Examples of UploadApplicationPayload


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

        converter.read(UploadApplicationPayload.class, mock(HttpInputMessage.class));
    }

    @Test
    public void shouldWrite() throws Exception {
        UploadApplicationPayload payload = mock(UploadApplicationPayload.class);
        given(payload.getInputStream()).willReturn(new ByteArrayInputStream(CONTENT));
        HttpOutputMessage outputMessage = mock(HttpOutputMessage.class);
        HttpHeaders headers = mock(HttpHeaders.class);
        given(outputMessage.getHeaders()).willReturn(headers);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        given(outputMessage.getBody()).willReturn(out);
View Full Code Here

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

            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);
            assertThat(payload.getArchive(), is(archive));
            assertThat(payload.getTotalUncompressedSize(), is(93));
            assertThat(bos.toByteArray().length, is(2451));
        } finally {
            zipFile.close();
        }
    }
View Full Code Here

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

      callback = UploadStatusCallback.NONE;
    }
    CloudResources knownRemoteResources = getKnownRemoteResources(archive);
    callback.onCheckResources();
    callback.onMatchedFileNames(knownRemoteResources.getFilenames());
    UploadApplicationPayload payload = new UploadApplicationPayload(archive, knownRemoteResources);
    callback.onProcessMatchedResources(payload.getTotalUncompressedSize());
    HttpEntity<?> entity = generatePartialResourceRequest(payload, knownRemoteResources);
    ResponseEntity<Map<String,Map<String,String>>> responseEntity =
                getRestTemplate().exchange(getUrl("/v2/apps/{guid}/bits?async=true"), HttpMethod.PUT, entity,
                                            new ParameterizedTypeReference<Map<String, Map<String,String>>>() {}, appId);
    processAsyncJob(responseEntity, callback);
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.