@Test public void testModifyLogging() { LoggingInfo logging = geoServer.getLogging(); logging.setLevel("VERBOSE_LOGGING.properties"); geoServer.save(logging); assertEquals(logging, geoServer.getLogging()); } }
@Test public void testGlobalEvents() throws Exception { TestListener tl = new TestListener(); geoServer.addListener(tl); GeoServerInfo global = geoServer.getFactory().createGlobal(); geoServer.setGlobal(global); global = geoServer.getGlobal(); global.setAdminPassword("foo"); global.setOnlineResource("bar"); assertEquals(0, tl.gPropertyNames.size()); geoServer.save(global); assertEquals(2, tl.gPropertyNames.size()); assertTrue(tl.gPropertyNames.contains("adminPassword")); assertTrue(tl.gPropertyNames.contains("onlineResource")); }
@Test public void testModifyGlobal() throws Exception { GeoServerInfo global = geoServer.getFactory().createGlobal(); geoServer.setGlobal(global); GeoServerInfo g1 = geoServer.getGlobal(); g1.setAdminPassword("newAdminPassword"); GeoServerInfo g2 = geoServer.getGlobal(); assertNull(g2.getAdminPassword()); geoServer.save(g1); g2 = geoServer.getGlobal(); assertEquals("newAdminPassword", g2.getAdminPassword()); }
@Test public void testModifyService() throws Exception { ServiceInfo service = geoServer.getFactory().createService(); ((ServiceInfoImpl) service).setId("id"); service.setName("foo"); service.setTitle("bar"); geoServer.add(service); ServiceInfo s1 = geoServer.getServiceByName("foo", ServiceInfo.class); s1.setTitle("changed"); ServiceInfo s2 = geoServer.getServiceByName("foo", ServiceInfo.class); assertEquals("bar", s2.getTitle()); geoServer.save(s1); s2 = geoServer.getServiceByName("foo", ServiceInfo.class); assertEquals("changed", s2.getTitle()); }