| File was renamed from sdk/tests/unit-tests-testng/src/com/sun/opends/sdk/ldap/GlobalTransportFactoryTestCase.java |
| | |
| | | import java.net.Socket; |
| | | import java.util.Random; |
| | | |
| | | import org.testng.annotations.Test; |
| | | |
| | | import org.glassfish.grizzly.TransportFactory; |
| | | import org.glassfish.grizzly.nio.transport.TCPNIOTransport; |
| | | import org.testng.annotations.Test; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Tests Global Transport Factory class. |
| | | * Tests LDAPDefaultTCPNIOTransport class. |
| | | */ |
| | | public class GlobalTransportFactoryTestCase extends LDAPTestCase |
| | | public class LDAPDefaultTCPNIOTransportTestCase extends LDAPTestCase |
| | | { |
| | | /** |
| | | * Tests the default transport. |
| | | * |
| | | * @throws Exception |
| | | * If an unexpected error occurred. |
| | | */ |
| | | @Test() |
| | | public void testGlobalTransport() throws Exception |
| | | public void testGetInstance() throws Exception |
| | | { |
| | | // Create a transport. |
| | | final TransportFactory instance = GlobalTransportFactory.getInstance(); |
| | | final TCPNIOTransport transport = instance.createTCPTransport(); |
| | | final TCPNIOTransport transport = LDAPDefaultTCPNIOTransport.getInstance(); |
| | | final Random r = new Random(); |
| | | int port = r.nextInt(10000); |
| | | if (port < 1000) |