Package org.jtestserver.common.protocol.udp

Examples of org.jtestserver.common.protocol.udp.UDPProtocol


        Server<?, ?> s = null;
        //TODO use config for min and max port
        for (int port = config.getPort(); port < (config.getPort() + 10); port++) {
            try {
                LOGGER.finer("trying port " + port);
                s = new UDPProtocol().createServer(port);
                if (s != null) {
                    LOGGER.finer("succeed !");
                    break;
                }
            } catch (ProtocolException pe) {
View Full Code Here


   
    private static TestDriver createUDPTestDriver() throws ProtocolException, IOException {        
        Config config = new ConfigReader().read(ConfigurationUtils.getConfigurationFile());
        InetAddress serverAddress = InetAddress.getByName(config.getServerName());
        int serverPort = config.getServerPort();       
        Protocol<?> protocol = new UDPProtocol(); //TODO create protocol from a config parameter
       
        Client<?, ?> client = protocol.createClient(serverAddress, serverPort);
        client.setTimeout(config.getClientTimeout());
       
        return new TestDriver(config, client);
    }
View Full Code Here

@RunWith(Parameterized.class)
public class TestProtocol {
    @Parameters
    public static List<Object[]> getProtocols() throws ProtocolException {
        return Arrays.asList(new Object[][] {{new UDPProtocol()}});
    }
View Full Code Here

        assertNotNull(result);
    }
   
    @Test
    public void testRunMauveThroughClient() throws ProtocolException, TimeoutException, IOException {
        Protocol<?> protocol = new UDPProtocol();
        int port = Config.read().getPort();
        Client<?, ?> client = null;
        TestServer server = null;
       
        try {           
            server = new TestServer();
            final TestServer s = server;
            new Thread() {
                public void run() {
                    s.start();
                }
            } .start();

            client = protocol.createClient(InetAddress.getLocalHost(), port);
            TestClient testClient = new DefaultTestClient(client);
           
            RunResult result = testClient.runMauveTest(MAUVE_TEST);
            assertNotNull(result);
        } finally {
View Full Code Here

TOP

Related Classes of org.jtestserver.common.protocol.udp.UDPProtocol

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.