appScope.setHandler(app);
// start
app.start(appScope);
// create our additional scopes
assertTrue(appScope.hasHandler());
IScope top = ScopeUtils.resolveScope(appScope, "/junit");
assertTrue(top.hasHandler());
IScope room = ScopeUtils.resolveScope(appScope, "/junit/room13");
if (room == null) {
assertTrue(top.createChildScope("room13"));
room = ScopeUtils.resolveScope(appScope, "/junit/room13");
assertNotNull(room);
}
assertTrue(room.hasHandler());
// get rooms
IScope room1 = ScopeUtils.resolveScope(appScope, "/junit/room13/subroomA");
if (room1 == null) {
assertTrue(room.createChildScope("subroomA"));
room1 = ScopeUtils.resolveScope(appScope, "/junit/room13/subroomA");
assertNotNull(room1);
}
Thread.sleep(10);
IScope room2 = ScopeUtils.resolveScope(appScope, "/junit/room13/subroomB");
if (room2 == null) {
assertTrue(room.createChildScope("subroomB"));
room2 = ScopeUtils.resolveScope(appScope, "/junit/room13/subroomB");
assertNotNull(room2);
}