Package org.geoserver.security.event

Examples of org.geoserver.security.event.UserGroupLoadedListener


        checkEmpty(service1);
        checkEmpty(service2);
       
        // prepare for syncing
       
        UserGroupLoadedListener listener = new UserGroupLoadedListener() {
           
            @Override
            public void usersAndGroupsChanged(UserGroupLoadedEvent event) {
                synchronized (this) {
                    this.notifyAll();
                }
            }
        };
           
        service2.registerUserGroupLoadedListener(listener);
       
        // modifiy store1
        store1.addGroup(group);
        store1.store();
        assertTrue(service1.getUserGroups().size()==1);
        assertTrue(service1.getGroupCount()==1);
       
     // increment lastmodified adding a second manually, the test is too fast
        xmlFile.setLastModified(xmlFile.lastModified()+2000)
       
        // wait for the listener to unlock when
        // service 2 triggers a load event
        synchronized (listener) {
            listener.wait();           
        }
       
        // here comes the magic !!!
        assertTrue(service2.getUserGroups().size()==1);
        assertTrue(service2.getGroupCount()==1);
View Full Code Here

TOP

Related Classes of org.geoserver.security.event.UserGroupLoadedListener

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.