Package org.cloudfoundry.client.lib.domain

Examples of org.cloudfoundry.client.lib.domain.CloudResources.asList()


    public void shouldPackOnlyMissingResources() throws Exception {
        ZipFile zipFile = new ZipFile(SampleProjects.springTravel());
        try {
            ApplicationArchive archive = new ZipApplicationArchive(zipFile);
            CloudResources allResources = new CloudResources(archive);
            List<CloudResource> resources = new ArrayList<CloudResource>(allResources.asList());
            resources.remove(0);
            CloudResources knownRemoteResources = new CloudResources(resources);
            UploadApplicationPayload payload = new UploadApplicationPayload(archive, knownRemoteResources);
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            FileCopyUtils.copy(payload.getInputStream(), bos);
View Full Code Here


    }

    @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

    @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

    public void shouldGetFromArchive() throws Exception {
        ZipFile zipFile = new ZipFile(SampleProjects.springTravel());
        try {
            ApplicationArchive archive = new ZipApplicationArchive(zipFile);
            CloudResources o = new CloudResources(archive);
            List<CloudResource> l = o.asList();
            assertThat(l.size(), is(96));
            assertThat(l.get(0).getFilename(), is("index.html"));
        } finally {
            zipFile.close();
        }
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.