Package org.geoserver.platform.resource

Examples of org.geoserver.platform.resource.Resource.path()


            return resource(path, new ByteArrayInputStream(content.getBytes()));
        }

        public ResourcesBuilder resource(String path, InputStream content) {
            Resource r = mock(Resource.class);
            when(r.path()).thenReturn(path);
            when(r.name()).thenReturn(path.substring(path.lastIndexOf('/')+1));
            when(r.getType()).thenReturn(Type.RESOURCE);
            when(r.lastmodified()).thenReturn( System.currentTimeMillis() );
            when(r.in()).thenReturn(content);
            when(r.out()).thenReturn(new ByteArrayOutputStream());
View Full Code Here


            return this;
        }

        public ResourcesBuilder directory(final String path) {
            Resource r = mock(Resource.class);
            when(r.path()).thenReturn(path);
            when(r.name()).thenReturn(path.substring(path.lastIndexOf('/')+1));
            when(r.getType()).thenReturn(Type.DIRECTORY);
            when(r.dir()).then( new Answer<File>() {
                @Override
                public File answer(InvocationOnMock invocation) throws Throwable {
View Full Code Here

                else {
                    LOGGER.log(Level.SEVERE, "Had troubles converting file name to URL");
                }
            }
            else {
                LOGGER.info(definition.path() + " was not found, using the default set of " +
                        "coordinate operation overrides (normally empty)");
            }
        }
        return GeoserverOverridingWKTFactory.class.getResource(FILENAME);
       
View Full Code Here

   
    @Theory
    public void theoryHaveSamePath(String path) throws Exception {
        Resource res = getResource(path);
       
        String result = res.path();
       
        assertThat(result, is(equalTo(path)));
    }
   
    @Theory
View Full Code Here

   
    @Theory
    public void theoryHaveName(String path) throws Exception {
        Resource res = getResource(path);
       
        String result = res.path();
       
        assertThat(result, notNullValue());
    }
   
    @Theory
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.