Package fr.imag.adele.apam.pax.test.grant.impl

Examples of fr.imag.adele.apam.pax.test.grant.impl.DayState


    }
    System.out.println();

    Assert.assertNotNull("DayState is not found in the composite", dayinst);
    ToolManager manager = (ToolManager) managerinst.getServiceObject();
    DayState state = (DayState) dayinst.getServiceObject();

    ThreadWrapper_grant thread = new ThreadWrapper_grant(worker1);

    System.out.println(">19h : afternoon !");

    state.setHour(19);
    thread = new ThreadWrapper_grant(worker1);
    thread.setDaemon(true);
    thread.start();

    apam.waitForIt(1000);
    Assert.assertFalse(
        "As the JackHammer is granted (afternoon), the worker resolution should be ok -> thread should be ended",
        thread.isAlive());

    System.out.println(">23h : night !");
    state.setHour(23);
    thread = new ThreadWrapper_grant(worker1);
    thread.setDaemon(true);
    thread.start();

    apam.waitForIt(1000);
View Full Code Here


    }
    System.out.println();

    Assert.assertNotNull("DayState is not found in the composite", dayinst);
    ToolManager manager = (ToolManager) managerinst.getServiceObject();
    DayState state = (DayState) dayinst.getServiceObject();

    ThreadWrapper_grant thread = new ThreadWrapper_grant(worker1);

    System.out.println(">Init : night !");
    thread.setDaemon(true);
    thread.start();

    apam.waitForIt(1000);
    manager.printTools();
    Assert.assertTrue(
        "As the JackHammer is not granted(night), the worker resolution should fails -> thread should be waiting",
        thread.isAlive());

    System.out.println(">9h : morning !");
    state.setHour(9);

    apam.waitForIt(1000);
    manager.printTools();
    Assert.assertFalse(
        "As the JackHammer is granted (morning), the worker resolution should be ok -> thread should be ended",
View Full Code Here

    }
    System.out.println();

    Assert.assertNotNull("DayState is not found in the composite", dayinst);
    ToolManager manager = (ToolManager) managerinst.getServiceObject();
    DayState state = (DayState) dayinst.getServiceObject();

    ThreadWrapper_grant thread = new ThreadWrapper_grant(worker1);

    System.out.println(">Init : night !");
    thread.setDaemon(true);
    thread.start();

    apam.waitForIt(1000);
    manager.printTools();
    Assert.assertTrue(
        "As the JackHammer is not granted(night), the worker resolution should fails -> thread should be waiting",
        thread.isAlive());

    System.out.println(">9h : morning !");
    state.setHour(9);

    apam.waitForIt(1000);
    manager.printTools();
    Assert.assertFalse(
        "As the JackHammer is granted (morning), the worker resolution should be ok, EVEN if instance is external -> thread should be ended",
View Full Code Here

    }
    System.out.println();

    Assert.assertNotNull("DayState is not found in the composite", dayinst);
    ToolManager manager = (ToolManager) managerinst.getServiceObject();
    DayState state = (DayState) dayinst.getServiceObject();

    ThreadWrapper_grant thread = new ThreadWrapper_grant(worker1);

    System.out.println(">Init : night !");
    thread.setDaemon(true);
    thread.start();

    apam.waitForIt(1000);
    manager.printTools();
    Assert.assertTrue(
        "As the JackHammer is not granted(night), the worker resolution should fails -> thread should be waiting",
        thread.isAlive());

    System.out.println(">9h : morning !");
    state.setHour(9);

    apam.waitForIt(1000);
    manager.printTools();
    Assert.assertFalse(
        "As the JackHammer is granted (morning), the worker resolution should be ok -> thread should be ended",
View Full Code Here

    }
    System.out.println();

    Assert.assertNotNull("DayState is not found in the composite", dayinst);
    ToolManager manager = (ToolManager) managerinst.getServiceObject();
    DayState state = (DayState) dayinst.getServiceObject();
    // manager.printTools();
    state.setHour(4);

    ThreadWrapper_grant thread = new ThreadWrapper_grant(worker1);

    System.out.println(">Init : night !");
    thread.setDaemon(true);
View Full Code Here

    }
    System.out.println();

    Assert.assertNotNull("DayState is not found in the composite", dayinst);
    ToolManager manager = (ToolManager) managerinst.getServiceObject();
    DayState state = (DayState) dayinst.getServiceObject();

    ThreadWrapper_grant thread = new ThreadWrapper_grant(worker1);

    System.out.println(">Init : night !");
    thread.setDaemon(true);
    thread.start();

    apam.waitForIt(1000);
    manager.printTools();
    Assert.assertTrue(
        "As the JackHammer is not granted(night), the worker resolution should fails -> thread should be waiting",
        thread.isAlive());

    System.out.println(">9h : morning !");
    state.setHour(9);

    apam.waitForIt(1000);
    manager.printTools();
    Assert.assertTrue(
        "The JackHammer is granted (morning) but the worker resolution should fail too (because wrong implementation working)  -> thread should be waiting",
View Full Code Here

    }
    System.out.println();

    Assert.assertNotNull("DayState is not found in the composite", dayinst);
    ToolManager manager = (ToolManager) managerinst.getServiceObject();
    DayState state = (DayState) dayinst.getServiceObject();
    manager.printTools();
    apam.waitForIt(500);
    ThreadWrapper_grant thread = new ThreadWrapper_grant(worker1);

    System.out.println(">19h : afternoon !");

    state.setHour(19);
    thread = new ThreadWrapper_grant(worker1);
    thread.setDaemon(true);
    thread.start();

    apam.waitForIt(500);
    Assert.assertFalse(
        "As the JackHammer is granted (afternoon), the worker resolution should be ok -> thread should be ended",
        thread.isAlive());

    System.out.println(">23h : night !");
    state.setHour(23);
    manager.printTools();
    apam.waitForIt(500);
    thread = new ThreadWrapper_grant(worker1);
    thread.setDaemon(true);
    thread.start();
View Full Code Here

TOP

Related Classes of fr.imag.adele.apam.pax.test.grant.impl.DayState

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.