Package de.novanic.eventservice.client.event.domain

Examples of de.novanic.eventservice.client.event.domain.Domain


        } catch(EventServiceException e) {}
    }

    @Test
    public void testListen() throws Exception {
        final Domain theDomain = DomainFactory.getDomain("test_domain");
        final UserInfo theUserInfo = new UserInfo("test_user");

        ByteArrayOutputStream theByteArrayOutputStream = new ByteArrayOutputStream();

        StreamingServerConnector theStreamingServerConnector = createStreamingServerConnector(700, theByteArrayOutputStream);
View Full Code Here


        assertContainsScriptCycle(theOutput);
    }

    @Test
    public void testListen_2() throws Exception {
        final Domain theDomain = DomainFactory.getDomain("test_domain");
        final Domain theDomain_2 = DomainFactory.getDomain("test_domain_2");
        final UserInfo theUserInfo = new UserInfo("test_user");

        ByteArrayOutputStream theByteArrayOutputStream = new ByteArrayOutputStream();

        StreamingServerConnector theStreamingServerConnector = createStreamingServerConnector(700, theByteArrayOutputStream);
View Full Code Here

        }
    }

    @Test
    public void testListen_Error_2() throws Exception {
        final Domain theDomain = DomainFactory.getDomain("test_domain");
        final UserInfo theUserInfo = new UserInfo("test_user");

        StreamingServerConnector theStreamingServerConnector = createStreamingServerConnector(0, new DummyServletOutputStreamNotFlushable());

        TestLoggingHandler theTestLoggingHandler = new TestLoggingHandler();
View Full Code Here

        assertTrue(theOccurredException.getCause() instanceof IOException);
    }

    @Test
    public void testListen_Error_4() throws Exception {
        final Domain theDomain = DomainFactory.getDomain("test_domain");
        final UserInfo theUserInfo = new UserInfo("test_user");

        ByteArrayOutputStream theByteArrayOutputStream = new ByteArrayOutputStream();

        final EventServiceConfiguration theConfiguration = createConfiguration(0, 700, 90000);
View Full Code Here

        assertTrue(theOccurredException.getCause() instanceof SerializationException);
    }

    @Test
    public void testListen_Error_5() throws Exception {
        final Domain theDomain = DomainFactory.getDomain("test_domain");
        final UserInfo theUserInfo = new UserInfo("test_user");

        ByteArrayOutputStream theByteArrayOutputStream = new ByteArrayOutputStream();

        final EventServiceConfiguration theConfiguration = createConfiguration(0, 700, 90000);
View Full Code Here

     * Min. waiting has no effect for streaming, because the connection is always still opened for the max. waiting time.
     * @throws Exception exception
     */
    @Test
    public void testListen_Min_Waiting() throws Exception {
        final Domain theDomain = DomainFactory.getDomain("test_domain");
        final UserInfo theUserInfo = new UserInfo("test_user");

        ByteArrayOutputStream theByteArrayOutputStream = new ByteArrayOutputStream();

        StreamingServerConnector theStreamingServerConnector = createStreamingServerConnector(700, theByteArrayOutputStream);
View Full Code Here

     * Min. waiting has no effect for streaming, because the connection is always still opened for the max. waiting time.
     * @throws Exception exception
     */
    @Test
    public void testListen_Min_Waiting_2() throws Exception {
        final Domain theDomain = DomainFactory.getDomain("test_domain");
        final UserInfo theUserInfo = new UserInfo("test_user");

        ByteArrayOutputStream theByteArrayOutputStream = new ByteArrayOutputStream();

        StreamingServerConnector theStreamingServerConnector = createStreamingServerConnector(700, theByteArrayOutputStream);
View Full Code Here

@RunWith(JUnit4.class)
public class LongPollingServerConnectorTest extends ConnectionStrategyServerConnectorTest
{
    @Test
    public void testListen() throws Exception {
        final Domain theDomain = DomainFactory.getDomain("test_domain");
        final UserInfo theUserInfo = new UserInfo("test_user");

        ConnectionStrategyServerConnector theLongPollingListener = new LongPollingServerConnector(createConfiguration(0, 2000, 90000));

        ListenRunnable theListenRunnable = new ListenRunnable(theLongPollingListener, theUserInfo);
View Full Code Here

        assertTrue(theListenResult.getDuration() < 500);
    }

    @Test
    public void testListen_Min_Waiting() throws Exception {
        final Domain theDomain = DomainFactory.getDomain("test_domain");
        final UserInfo theUserInfo = new UserInfo("test_user");

        ConnectionStrategyServerConnector theLongPollingListener = new LongPollingServerConnector(createConfiguration(500, 2000, 90000));

        ListenRunnable theListenRunnable = new ListenRunnable(theLongPollingListener, theUserInfo);
View Full Code Here

        assertTrue(theListenResult.getDuration() > 400); //could be get a little bit lesser than the specified min. waiting time (sleep) caused by accuracies of the OS and JDK implementations.
    }

    @Test
    public void testListen_Min_Waiting_Interrupted() throws Exception {
        final Domain theDomain = DomainFactory.getDomain("test_domain");
        final UserInfo theUserInfo = new UserInfo("test_user");
        ConnectionStrategyServerConnector theLongPollingListener = new LongPollingServerConnector(createConfiguration(1000, 2000, 90000));

        ListenRunnable theListenRunnable = new ListenRunnable(theLongPollingListener, theUserInfo);
        Thread theListenThread = new Thread(theListenRunnable);
View Full Code Here

TOP

Related Classes of de.novanic.eventservice.client.event.domain.Domain

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.