Package org.rioproject.gnostic.service.test

Examples of org.rioproject.gnostic.service.test.TestService


    }

    @Test
    public void verifyThatInvocationsOnTestServiceAreDisallowedIfUtilizationIsBreached() {
        Assert.assertNotNull(testManager);
        TestService t = testManager.waitForService(TestService.class);
        Assert.assertNotNull(t);
        Throwable thrown = null;
        try {
            long waited = 0;
            long duration = 1000;
            while(t.getStatus().equals(TestService.Status.ALLOWED) && waited<=WAIT) {
                try {
                    Thread.sleep(duration);
                } catch (InterruptedException e) {
                    Thread.interrupted();
                }
                waited += duration;
            }
            Assert.assertTrue("Got "+t.getStatus().name(), t.getStatus().equals(TestService.Status.DISALLOWED));
        } catch (IOException e) {
            thrown = e;
            e.printStackTrace();
        }
        Assert.assertNull(thrown);
View Full Code Here


        } catch (Throwable e) {
            e.printStackTrace();
            thrown = e;
        }
        Assert.assertNull(thrown);
        TestService test = (TestService)testManager.waitForService("Test");
        Util.waitForRule(g, "CounterNotification");
       
        thrown = null;
        boolean written = false;
        for(int i=0; i<50; i++) {
            try {
                test.sendNotify();
                Util.sleep(1000);
                if(i>15 && !written) {
                    writeRule(25, 45, "src/test/resources/CounterNotification.drl");
                    written = true;
                }
View Full Code Here

        Assert.assertNotNull(testManager);
        File opstring = new File("src/test/opstring/artifactNotification2.groovy");
        Assert.assertTrue(opstring.exists());
        OperationalStringManager mgr = testManager.deploy(opstring);
        testManager.waitForDeployment(mgr);
        TestService test = (TestService)testManager.waitForService("Test");
        thrown = null;
        Gnostic g = (Gnostic)testManager.waitForService(Gnostic.class);
        Util.waitForRule(g, "CounterNotification");
        for(int i=0; i<15; i++) {
            try {
                test.sendNotify();
                Util.sleep(1000);
            } catch (Exception e) {
                e.printStackTrace();
                thrown = e;
            }
View Full Code Here

TOP

Related Classes of org.rioproject.gnostic.service.test.TestService

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.