Skip to content

Commit

Permalink
Merge pull request #14776 from cdapio/cp_itn_fixes
Browse files Browse the repository at this point in the history
[CDAP-20117] Cp itn fixes
  • Loading branch information
iam-divya authored Nov 29, 2022
2 parents f91f4ef + 04592d0 commit 8393a04
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import io.cdap.cdap.api.app.Application;
import io.cdap.cdap.api.artifact.ArtifactScope;
import io.cdap.cdap.api.artifact.ArtifactSummary;
import io.cdap.cdap.api.security.AccessException;
import io.cdap.cdap.cli.util.InstanceURIParser;
import io.cdap.cdap.client.ApplicationClient;
import io.cdap.cdap.client.ArtifactClient;
Expand All @@ -40,6 +39,7 @@
import io.cdap.cdap.client.config.ConnectionConfig;
import io.cdap.cdap.client.util.RESTClient;
import io.cdap.cdap.common.ApplicationNotFoundException;
import io.cdap.cdap.common.DatasetNotFoundException;
import io.cdap.cdap.common.conf.CConfiguration;
import io.cdap.cdap.common.conf.Constants;
import io.cdap.cdap.data2.datafabric.DefaultDatasetNamespace;
Expand Down Expand Up @@ -366,21 +366,24 @@ protected DatasetClient getDatasetClient() {

protected ApplicationManager deployApplication(NamespaceId namespace,
Class<? extends Application> applicationClz,
File...bundleEmbeddedJars) throws IOException, AccessException {
File...bundleEmbeddedJars) throws Exception {
checkSystemServices();
return getTestManager().deployApplication(namespace, applicationClz, bundleEmbeddedJars);
}

protected ApplicationManager deployApplication(Class<? extends Application> applicationClz)
throws IOException, AccessException {
throws Exception {
return deployApplication(getConfiguredNamespace(), applicationClz);
}


protected ApplicationManager deployApplication(ApplicationId appId, AppRequest appRequest) throws Exception {
checkSystemServices();
return getTestManager().deployApplication(appId, appRequest);
}

protected ArtifactManager addAppArtifact(ArtifactId artifactId, Class<?> appClass) throws Exception {
checkSystemServices();
return getTestManager().addAppArtifact(artifactId, appClass);
}

Expand All @@ -407,7 +410,11 @@ private void doClear(NamespaceId namespace, boolean deleteNamespace) throws Exce
}
// delete all dataset instances
for (DatasetSpecificationSummary datasetSpecSummary : getDatasetClient().list(namespace)) {
getDatasetClient().delete(namespace.dataset(datasetSpecSummary.getName()));
try {
getDatasetClient().delete(namespace.dataset(datasetSpecSummary.getName()));
} catch (DatasetNotFoundException e) {
// No action needed.
}
}
ArtifactClient artifactClient = new ArtifactClient(getClientConfig(), getRestClient());
for (ArtifactSummary artifactSummary : artifactClient.list(namespace, ArtifactScope.USER)) {
Expand Down

0 comments on commit 8393a04

Please sign in to comment.