Package org.geoserver.config

Examples of org.geoserver.config.GeoServerInfo


    }

    @Override
    protected void oneTimeSetUp() throws Exception {
        super.oneTimeSetUp();
        GeoServerInfo global = getGeoServer().getGlobal();
        global.setProxyBaseUrl("src/test/resources/geoserver");
        getGeoServer().save(global);
    }
View Full Code Here


            }

            metas.add(meta);
        }

        GeoServerInfo global = wfs.getGeoServer().getGlobal();
        Encoder encoder = new Encoder(configuration, configuration.schema());
        encoder.setEncoding(Charset.forName( global.getCharset() ));

        // declare wfs schema location
        BaseRequestType gft = (BaseRequestType) getFeature.getParameters()[0];

        encoder.setSchemaLocation(org.geoserver.wfsv.xml.v1_1_0.WFSV.NAMESPACE,
View Full Code Here

    /**
     * Do the links in getcaps respect the proxy base url?
     */
    public void testProxyBaseUrl() throws Exception {
        final String proxyBaseUrl = "http://localhost/proxy";
        GeoServerInfo gs = getGeoServer().getGlobal();
        gs.setProxyBaseUrl(proxyBaseUrl);
        getGeoServer().save(gs);

        Document dom = getAsDOM("wms?request=GetCapabilities");
        print(dom);

View Full Code Here

        if (obj == null)
            return "other is null";
        if (!(obj instanceof GeoServerInfo)) {
            return "bad class";
        }
        final GeoServerInfo other = (GeoServerInfo) obj;
        String err;
        err = getDiff("pw", adminPassword, other.getAdminPassword());
        if (err != null)
            return err;
        err = getDiff("admin", adminUsername, other.getAdminUsername());
        if (err != null)
            return err;
        err = getDiff("charset", charset, other.getCharset());
        if (err != null)
            return err;

        if (!contact.equals(other.getContact()))
            return "contactInfo::";

        err = getDiff("id", id, other.getId());
        if (err != null)
            return err;
        // err = getDiff("loglev", loggingLevel, other.getLoggingLevel());
        // if(err != null)
        // return err;
        // err = getDiff("logloc", loggingLocation, other.getLoggingLocation());
        // if(err != null)
        // return err;
        // err = getDiff("maxfeat", ""+maxFeatures, ""+other.getMaxFeatures());
        // if(err != null)
        // return err;
        err = getDiff("numdec", "" + numDecimals, "" + other.getNumDecimals());
        if (err != null)
            return err;
        err = getDiff("olres", onlineResource, other.getOnlineResource());
        if (err != null)
            return err;
        err = getDiff("proxybu", proxyBaseUrl, other.getProxyBaseUrl());
        if (err != null)
            return err;
        err = getDiff("schemabu", schemaBaseUrl, other.getSchemaBaseUrl());
        if (err != null)
            return err;
        // err = getDiff("stdout", ""+stdOutLogging, ""+other.isStdOutLogging());
        // if(err != null)
        // return err;
        err = getDiff("title", title, other.getTitle());
        if (err != null)
            return err;
        err = getDiff("updateSeq", "" + updateSequence, "" + other.getUpdateSequence());
        if (err != null)
            return err;
        err = getDiff("verb", "" + verbose, "" + other.isVerbose());
        if (err != null)
            return err;
        err = getDiff("verbex", "" + verboseExceptions, "" + other.isVerboseExceptions());

        return err;
    }
View Full Code Here

        entityManager.flush();// TODO useless??
        return entityManager.find(GeoServerInfoImplHb.class, entity.getId());// TODO useless??
    }

    public GeoServerInfo update(GeoServerInfo entity) {
        GeoServerInfo ret = entityManager.merge(entity);
        entityManager.flush();
        entityManager.refresh(ret);
        return ret;
    }
View Full Code Here

        }
    }

    public void testGeoServer() {

        GeoServerInfo info = geoServer.getFactory().createGlobal();
        info.setTitle("title");
        geoServer.setGlobal(info);
        assertEquals("Lost title attribute when persisting", "title", info.getTitle());

        GeoServerInfo reloaded = geoServer.getGlobal();
        assertEquals("Lost title attribute when reloading", "title", reloaded.getTitle());

        endTransaction();

        startNewTransaction();

        GeoServerInfo info2 = geoServer.getGlobal();
        assertFalse(info == info2);

        // info = info2;
        assertEquals("Lost title attribute inter transactions", "title", info2.getTitle());

    }
View Full Code Here

        assertEquals("Lost title attribute inter transactions", "title", info2.getTitle());

    }

    public void testServices() {
        GeoServerInfo config = geoServer.getFactory().createGlobal();
        geoServer.setGlobal(config);

        removeServices();

        ServiceInfo info = geoServer.getFactory().createService();
View Full Code Here

        assertEquals("bar", info.getName());
        assertNotNull(info.getGeoServer());
    }

    public void testGlobal() throws Exception {
        GeoServerInfo global1 = geoServer.getFactory().createGlobal();
        global1.setTitle("test global "
                + DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.FULL).format(
                        new Date()));

        geoServer.setGlobal(global1);

        endTransaction();
        startNewTransaction();

        assertEquals(global1, geoServer.getGlobal());

        endTransaction();
        startNewTransaction();

        GeoServerInfo global2 = geoServer.getFactory().createGlobal();
        global2.setTitle("subst'ed global "
                + DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.FULL).format(
                        new Date()));

        global2.setAdminPassword("secret");
        ContactInfo contactInfo = geoServer.getFactory().createContact();
        contactInfo.setAddress("the address");
        contactInfo.setAddressCity("the city");
        global2.setContact(contactInfo);
        geoServer.setGlobal(global2);

        endTransaction();
        startNewTransaction();

        GeoServerInfo globalZ = geoServer.getGlobal();

        String globalDebugDiff = ((GeoServerInfoImplHb) global2).getFirstDiff(globalZ);
        if (globalDebugDiff != null)
            Logging.getLogger(this.getClass()).severe("Globals do not match: " + globalDebugDiff);

        assertEquals(global2, globalZ);

        ContactInfo contactInfoZ = globalZ.getContact();
        assertEquals("Contacts differ", global2.getContact(), contactInfoZ);
        // assertEquals(global2, globalZ);
    }
View Full Code Here

        assertEquals("Contacts differ", global2.getContact(), contactInfoZ);
        // assertEquals(global2, globalZ);
    }

    public void testModifyGlobal() throws Exception {
        GeoServerInfo global = geoServer.getFactory().createGlobal();
        geoServer.setGlobal(global);

        GeoServerInfo g1 = geoServer.getGlobal();
        assertNull(g1.getAdminPassword());

        g1.setAdminPassword("newAdminPassword");
        geoServer.save(g1);

        GeoServerInfo g2 = geoServer.getGlobal();
        assertEquals("newAdminPassword", g2.getAdminPassword());
    }
View Full Code Here

     */
    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.setMaxFeatures(100);
        global.setOnlineResource("bar");

        assertEquals(0, tl.gPropertyNames.size());
        geoServer.save(global);

        assertEquals(3, tl.gPropertyNames.size());
View Full Code Here

TOP

Related Classes of org.geoserver.config.GeoServerInfo

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.