Package org.japura.controller

Examples of org.japura.controller.Context


    ControllerStatus newStatus = ControllerStatus.UNREGISTERING;
    controller.setControllerStatus(newStatus);

    Group group = controller.getGroup();
    group.fireListeners(controller, newStatus);
    Context context = controller.getContext();
    context.fireListeners(controller, newStatus);
    fireListeners(controller, newStatus);
  }

  // cancel all tasks
  if (cancelGroupTaskExecution) {
    for (Controller controller : freeList) {
    controller.getGroup().cancelTasks();
    }
  }

  // unregister all
  for (Controller controller : freeList) {
    Application.getMessageManager().unregister(controller);

    Group group = controller.getGroup();
    group.unregister(controller);
    if (group.count() == 0) {
    group.shutdown();
    }

    Context context = controller.getContext();
    context.unregister(controller);

    Controller parentController = controller.getParent();
    if (parentController != null) {
    controller.unregisterParent();
    parentController.unregisterChild(controller);
View Full Code Here


  }

  @Test
  public void test5() {
  thrown.expect(ControllerException.class);
  Context context = new Context("TEST2");
  Application.getControllerManager().buildController(ControllerC.class,
    context);
  }
View Full Code Here

    context);
  }

  @Test
  public void test6() {
  Context mainContext = Context.getMainContext();
  Application.getControllerManager().buildController(ControllerA.class,
    mainContext);
  Assert.assertEquals(1, Application.getControllerManager()
    .getContextsCount());
  }
View Full Code Here

    .getContextsCount());
  }

  @Test
  public void test7() {
  Context context = new Context("TEST");
  Application.getControllerManager().buildController(ControllerC.class,
    context);
  Assert.assertEquals(1, Application.getControllerManager()
    .getContextsCount());
  }
View Full Code Here

  public ExpectedException thrown = ExpectedException.none();

  @Test
  public void test1() {
  thrown.expect(IllegalArgumentException.class);
  new Context(null);
  }
View Full Code Here

  }

  @Test
  public void test2() {
  thrown.expect(IllegalArgumentException.class);
  new Context("");
  }
View Full Code Here

  }

  @Test
  public void test3() {
  thrown.expect(IllegalArgumentException.class);
  new Context(" ");
  }
View Full Code Here

  }

  @Test
  public void test4() {
  thrown.expect(IllegalArgumentException.class);
  new Context(Context.MAIN_CONTEXT);
  }
View Full Code Here

  new Context(Context.MAIN_CONTEXT);
  }

  @Test
  public void test5() {
  Context context = new Context("TEST");
  Assert.assertEquals("TEST", context.getName());
  }
View Full Code Here

  Assert.assertEquals("TEST", context.getName());
  }

  @Test
  public void test6() {
  Context context = new Context("TEST");
  Assert.assertNotNull(context.getId());
  }
View Full Code Here

TOP

Related Classes of org.japura.controller.Context

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.