use of jodd.petite.scope.SessionScope in project jodd by oblac.
the class ScopeTest method testScopeAccept.
@Test
public void testScopeAccept() {
final PetiteContainer pc = new PetiteContainer();
SingletonScope singletonScope = pc.resolveScope(SingletonScope.class);
ProtoScope protoScope = pc.resolveScope(ProtoScope.class);
SessionScope sessionScope = pc.resolveScope(SessionScope.class);
RequestScope requestScope = pc.resolveScope(RequestScope.class);
assertTrue(singletonScope.accept(singletonScope));
assertTrue(singletonScope.accept(protoScope));
assertFalse(singletonScope.accept(sessionScope));
assertFalse(singletonScope.accept(requestScope));
assertTrue(protoScope.accept(singletonScope));
assertTrue(protoScope.accept(protoScope));
assertTrue(protoScope.accept(sessionScope));
assertTrue(protoScope.accept(requestScope));
assertTrue(sessionScope.accept(singletonScope));
assertTrue(sessionScope.accept(protoScope));
assertTrue(sessionScope.accept(sessionScope));
assertFalse(sessionScope.accept(requestScope));
assertTrue(requestScope.accept(singletonScope));
assertTrue(requestScope.accept(protoScope));
assertTrue(requestScope.accept(sessionScope));
assertTrue(requestScope.accept(requestScope));
}
Aggregations