Examples of CloudResource


Examples of org.cloudfoundry.client.lib.domain.CloudResource

    private ObjectMapper mapper = new ObjectMapper();

    @Test
    public void shouldSerialize() throws Exception {
        CloudResource r = new CloudResource("index.html", 93L, SHA);
        CloudResources o = new CloudResources(Collections.singleton(r));
        String s = mapper.writeValueAsString(o);
        assertThat(s, is(equalTo(JSON)));
    }
View Full Code Here

Examples of org.cloudfoundry.client.lib.domain.CloudResource

    @Test
    public void shouldDeserialize() throws JsonParseException, JsonMappingException, IOException {
        CloudResources o = mapper.readValue(JSON, CloudResources.class);
        List<CloudResource> l = o.asList();
        assertThat(l.size(), is(1));
        CloudResource r = l.get(0);
        assertThat(r.getFilename(), is("index.html"));
        assertThat(r.getSha1(), is(SHA));
        assertThat(r.getSize(), is(93L));
    }
View Full Code Here

Examples of org.cloudfoundry.client.lib.domain.CloudResource

        assertThat(r.getSize(), is(93L));
    }

    @Test
    public void shouldCreateFromIterator() throws Exception {
        Iterator<? extends CloudResource> i = Collections.singleton(new CloudResource("index.html", 93L, SHA)).iterator();
        CloudResources o = new CloudResources(i);
        List<CloudResource> l = o.asList();
        assertThat(l.size(), is(1));
        CloudResource r = l.get(0);
        assertThat(r.getFilename(), is("index.html"));
        assertThat(r.getSha1(), is(SHA));
        assertThat(r.getSize(), is(93L));
    }
View Full Code Here

Examples of org.cloudfoundry.client.lib.domain.CloudResource

    }

    @Test
    public void shouldGetFilenames() throws Exception {
        List<CloudResource> resources = new ArrayList<CloudResource>();
        resources.add(new CloudResource("1", 93L, SHA));
        resources.add(new CloudResource("2", 93L, SHA));
        CloudResources o = new CloudResources(resources);
        Set<String> expected = new HashSet<String>(Arrays.asList("1", "2"));
        assertThat(o.getFilenames(), is(expected));
    }
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.