Package org.geoserver.catalog

Examples of org.geoserver.catalog.StyleInfo


   
    @Test
    public void testRemoveStyle() throws Exception {
        testAddStyle();
       
        StyleInfo st = dao.getStyleByName("blue");
        dao.remove(st);
       
        assertNull(dao.getStyleByName("blue"));
    }
View Full Code Here


        testAddFeatureType();
        testAddStyle();
       
        NamespaceInfo ns = dao.getNamespaceByPrefix("acme");
        FeatureTypeInfo ft = dao.getResourceByName(ns, "anvil", FeatureTypeInfo.class);
        StyleInfo s = dao.getStyleByName("blue");
       
        LayerInfo l = dao.getCatalog().getFactory().createLayer();
        l.setPath("/anvil");
        l.setResource(ft);
        l.setDefaultStyle(s);
View Full Code Here

       
        NamespaceInfo ns = dao.getNamespaceByPrefix("acme");
        FeatureTypeInfo ft = dao.getResourceByName(ns, "anvil", FeatureTypeInfo.class);
        assertEquals(1, dao.getLayers(ft).size());
       
        StyleInfo s1 = dao.getStyleByName("blue");
        assertEquals(1, dao.getLayers(s1).size());
       
        //TODO: we need to ge tthe following test to pass
//        StyleInfo s2 = dao.getCatalog().getFactory().createStyle();
//        s2.setName("red");
View Full Code Here

        assertTrue( catalog.getStyles().isEmpty() );
       
        addStyle();
        assertEquals( 1, catalog.getStyles().size() );
       
        StyleInfo s2 = catalog.getFactory().createStyle();
        try {
            catalog.add( s2 );
            fail( "adding without name should throw exception");
        }
        catch( Exception e ) {}
       
        s2.setName( "s2Name");
        try {
            catalog.add( s2 );
            fail( "adding without fileName should throw exception");
        }
        catch( Exception e ) {}
       
        s2.setFilename( "s2Filename");
        try {
            catalog.getStyles().add( s2 );
            fail( "adding directly should throw exception");
        }
        catch( Exception e ) {}
View Full Code Here

    }
   
    public void testGetStyleById() {
        addStyle();
       
        StyleInfo s2 = catalog.getStyle( s.getId() );
        assertNotNull( s2 );
        assertNotSame(s,s2);
        assertEquals(s,s2);
    }
View Full Code Here

    }
   
    public void testGetStyleByName() {
        addStyle();
       
        StyleInfo s2 = catalog.getStyleByName( s.getName() );
        assertNotNull( s2 );
        assertNotSame(s,s2);
        assertEquals(s,s2);
    }
View Full Code Here

    }
   
    public void testModifyStyle() {
        addStyle();
       
        StyleInfo s2 = catalog.getStyleByName( s.getName() );
        s2.setName( null );
        s2.setFilename( null );
       
        StyleInfo s3 = catalog.getStyleByName( s.getName() );
        assertEquals( s, s3 );
       
        try {
            catalog.save(s2);
            fail("setting name to null should fail");
View Full Code Here

        assertTrue( l.added.isEmpty() );
        catalog.add( s );
        assertEquals( 1, l.added.size() );
        assertEquals( s, l.added.get(0).getSource() );
       
        StyleInfo s2 = catalog.getStyleByName(s.getName());
        s2.setFilename( "changed");
       
        assertTrue( l.modified.isEmpty() );
        catalog.save( s2 );
        assertEquals( 1, l.modified.size() );
        assertEquals( s2, l.modified.get(0).getSource() );
View Full Code Here

    }
   
    public void testProxyListBehaviour() throws Exception {
        catalog.add( s );
       
        StyleInfo s2 = catalog.getFactory().createStyle();
        s2.setName( "a" + s.getName() );
        s2.setFilename( "a.sld");
        catalog.add( s2 );
       
        List<StyleInfo> styles = catalog.getStyles();
        assertEquals( 2 , styles.size() );
       
View Full Code Here

        tester.assertRenderedPage(FormTestPage.class);
        tester.assertComponent("form", Form.class);
        tester.assertComponent("form:panel:styles:defaultStyle", DropDownChoice.class);
       
        // check selecting something else works
        StyleInfo target = ((List<StyleInfo>) new StylesModel().getObject()).get(0);
        FormTester ft = tester.newFormTester("form");
        ft.select("panel:styles:defaultStyle", 0);
        ft.submit();
        tester.assertModelValue("form:panel:styles:defaultStyle", target);
    }
View Full Code Here

TOP

Related Classes of org.geoserver.catalog.StyleInfo

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.