Example #1
0
 public void testGetAccessReturnsPushedAccess() throws Exception {
   InstanceStack iStack = new InstanceStack();
   iStack.setConfigAdapter(mci);
   Instance<?> ti1 = new TestInstance("path1");
   iStack.pushAccess(ti1);
   assertEquals(ti1, iStack.getAccess());
 }
Example #2
0
 public void testGetAccessReturnsInstanceWhenNoAccessStack() throws Exception {
   InstanceStack iStack = new InstanceStack();
   iStack.setConfigAdapter(mci);
   Instance<?> ti1 = new TestInstance("path1");
   iStack.pushInstance(ti1, ti1.getDescriptor());
   assertEquals(ti1, iStack.getAccess());
 }
Example #3
0
 public void testPushThenPopAccessSuccess() throws Exception {
   InstanceStack iStack = new InstanceStack();
   iStack.setConfigAdapter(mci);
   Instance<?> ti1 = new TestInstance("path1");
   Instance<?> ti2 = new TestInstance("path2");
   iStack.pushAccess(ti1);
   iStack.pushAccess(ti2);
   iStack.popAccess(ti2);
   iStack.popAccess(ti1);
   assertNull("Stack should return null after popping only instance", iStack.getAccess());
 }