@SuppressWarnings("unchecked") @Test public void testRetrieve() throws ApiException, InterruptedException, IOException { final UnpackagedComponents unpackagedComponents = new UnpackagedComponents(null, null, null, null, new ArrayList<ProfileObjectPermissions>(), null, new ArrayList<UnpackagedComponent>(), "1234"); final RetrieveRequest req = new RetrieveRequest(ApiVersion.API_VERSION_DOUBLE, new ArrayList<String>(), new ArrayList<String>(), unpackagedComponents); final AsyncResult asyncResult = mdconn.retrieve(req); final WaitForAsyncResult waitResult = mdconn.waitForAsyncResults(Arrays.asList(asyncResult), 20000); assertTrue(!waitResult.getComplete().isEmpty()); final RetrieveResult result = mdconn.getRetrieveResult(asyncResult.getId()); assertTrue(result.getRetrieveMessages().isEmpty()); Map<String, byte[]> expected = (Map<String, byte[]>) TestFixtureUtils .loadFixtures("/sObjectFixtures/MetadataConnectionTests/retrieve.xml"); Map<String, String> expectedHex = new HashMap<String, String>(); for (Map.Entry<String, byte[]> stringEntry : expected.entrySet()) { expectedHex.put(stringEntry.getKey(), Base64.encodeBase64String(stringEntry.getValue())); } Map<String, String> actualHex = new HashMap<String, String>(); for (Map.Entry<String, byte[]> stringEntry : result.getZipFileEntryBytes().entrySet()) { actualHex.put(stringEntry.getKey(), Base64.encodeBase64String(stringEntry.getValue())); } assertEquals(expectedHex, actualHex); }
@Override @Nonnull public synchronized AsyncResult retrieve(@Nonnull RetrieveRequest retrieveRequest) throws ApiException { return new AsyncResult(new RetrieveOp().execute(retrieveRequest.getStub())); }
MetadataConnectionImpl extends AbstractSalesforceConnection implements MetadataConnection { @Override @Nonnull public synchronized AsyncResult retrieve(@Nonnull RetrieveRequest retrieveRequest) throws ApiException { return new AsyncResult(new RetrieveOp().execute(retrieveRequest.getStub())); } }
MetadataConnectionImpl extends AbstractSalesforceConnection implements MetadataConnection { @Override @Nonnull public synchronized AsyncResult retrieve(@Nonnull RetrieveRequest retrieveRequest) throws ApiException { return new AsyncResult(new RetrieveOp().execute(retrieveRequest.getStub())); } MetadataConnectionImpl(@Nonnull CallSemaphore semaphore, @Nonnull ConnectionBundleImpl bundle,
            MetricRegistry metricRegistry); }
MetadataConnectionImpl extends AbstractSalesforceConnection implements MetadataConnection { @Override @Nonnull public synchronized AsyncResult retrieve(@Nonnull RetrieveRequest retrieveRequest) throws ApiException { return new AsyncResult(new RetrieveOp().execute(retrieveRequest.getStub())); } MetadataConnectionImpl(@Nonnull CallSemaphore semaphore, @Nonnull ConnectionBundleImpl bundle,
            MetricRegistry metricRegistry); @Override @Nonnull WaitForAsyncResult waitForAsyncResults(@Nonnull List<AsyncResult> results, long maxMillisToWait); @Override @Nonnull synchronized List<AsyncResult> checkStatus(@Nonnull List<Id> idsToCheck); @Override @Nonnull synchronized List<AsyncResult> create(@Nonnull List<Metadata> metadataList); @Override @Nonnull synchronized List<AsyncResult> delete(@Nonnull List<Metadata> metadataList); @Override @Nonnull synchronized List<AsyncResult> update(@Nonnull List<UpdateMetadata> metadataList); @Override @Nonnull synchronized List<FileProperties> listMetadata(@Nonnull List<ListMetadataQuery> queries); @Override @Nonnull synchronized AsyncResult retrieve(@Nonnull RetrieveRequest retrieveRequest); @Override @Nonnull synchronized RetrieveResult getRetrieveResult(@Nonnull Id id); @Override @Nonnull synchronized DescribeMetadataResult describeMetadata(); @Override @Nonnull synchronized DescribeMetadataResult describeMetadata(double apiVersion); }
MetadataConnectionImpl extends AbstractSalesforceConnection implements MetadataConnection { @Override @Nonnull public synchronized AsyncResult retrieve(@Nonnull RetrieveRequest retrieveRequest) throws ApiException { return new AsyncResult(new RetrieveOp().execute(retrieveRequest.getStub())); } MetadataConnectionImpl(@Nonnull CallSemaphore semaphore, @Nonnull ConnectionBundleImpl bundle,
            MetricRegistry metricRegistry); @Override @Nonnull WaitForAsyncResult waitForAsyncResults(@Nonnull List<AsyncResult> results, long maxMillisToWait); @Override @Nonnull synchronized List<AsyncResult> checkStatus(@Nonnull List<Id> idsToCheck); @Override @Nonnull synchronized List<AsyncResult> create(@Nonnull List<Metadata> metadataList); @Override @Nonnull synchronized List<AsyncResult> delete(@Nonnull List<Metadata> metadataList); @Override @Nonnull synchronized List<AsyncResult> update(@Nonnull List<UpdateMetadata> metadataList); @Override @Nonnull synchronized List<FileProperties> listMetadata(@Nonnull List<ListMetadataQuery> queries); @Override @Nonnull synchronized AsyncResult retrieve(@Nonnull RetrieveRequest retrieveRequest); @Override @Nonnull synchronized RetrieveResult getRetrieveResult(@Nonnull Id id); @Override @Nonnull synchronized DescribeMetadataResult describeMetadata(); @Override @Nonnull synchronized DescribeMetadataResult describeMetadata(double apiVersion);  }