Skip to content

Commit

Permalink
FORGE-2287: Improved test
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Mar 18, 2015
1 parent 2d36a7c commit af5a5bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class CommandScopedContext implements Context, UIContextListener
{
private final static String COMPONENT_MAP_NAME = CommandScopedContext.class.getName() + ".componentInstanceMap";
private final static String CREATIONAL_MAP_NAME = CommandScopedContext.class.getName() + ".creationalInstanceMap";
static final LinkedList<UIContext> CONTEXT_STACK = new LinkedList<UIContext>();
private static final LinkedList<UIContext> CONTEXT_STACK = new LinkedList<UIContext>();

@Override
public Class<? extends Annotation> getScope()
Expand Down Expand Up @@ -86,7 +86,7 @@ private void assertActive()
}
}

private UIContext getCurrentContext()
static UIContext getCurrentContext()
{
return CONTEXT_STACK.peek();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class UIContextHandler implements UIContextProvider
@Override
public UIContext getUIContext()
{
return CommandScopedContext.CONTEXT_STACK.peek();
return CommandScopedContext.getCurrentContext();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ public void testContextProvider() throws Exception
Assert.assertNotNull(contextProvider.getUIContext());
Assert.assertSame(contextProvider.getUIContext(), controller.getContext());
}
Assert.assertNull(contextProvider.getUIContext());
}
}

0 comments on commit af5a5bf

Please sign in to comment.