Search in sources :

Example 1 with RemoteArtifactManager

use of io.cdap.cdap.test.remote.RemoteArtifactManager in project cdap by caskdata.

the class IntegrationTestManager method addPluginArtifact.

@Override
public ArtifactManager addPluginArtifact(ArtifactId artifactId, ArtifactId parent, @Nullable Set<PluginClass> additionalPlugins, Class<?> pluginClass, Class<?>... pluginClasses) throws Exception {
    Set<ArtifactRange> parents = new HashSet<>();
    parents.add(new ArtifactRange(parent.getParent().getNamespace(), parent.getArtifact(), new ArtifactVersion(parent.getVersion()), true, new ArtifactVersion(parent.getVersion()), true));
    addPluginArtifact(artifactId, parents, additionalPlugins, pluginClass, pluginClasses);
    return new RemoteArtifactManager(clientConfig, restClient, artifactId);
}
Also used : ArtifactVersion(io.cdap.cdap.api.artifact.ArtifactVersion) RemoteArtifactManager(io.cdap.cdap.test.remote.RemoteArtifactManager) ArtifactRange(io.cdap.cdap.api.artifact.ArtifactRange) HashSet(java.util.HashSet)

Example 2 with RemoteArtifactManager

use of io.cdap.cdap.test.remote.RemoteArtifactManager in project cdap by caskdata.

the class IntegrationTestManager method addPluginArtifact.

@Override
public ArtifactManager addPluginArtifact(ArtifactId artifactId, ArtifactId parent, Class<?> pluginClass, Class<?>... pluginClasses) throws Exception {
    Set<ArtifactRange> parents = new HashSet<>();
    parents.add(new ArtifactRange(parent.getParent().getNamespace(), parent.getArtifact(), new ArtifactVersion(parent.getVersion()), true, new ArtifactVersion(parent.getVersion()), true));
    addPluginArtifact(artifactId, parents, pluginClass, pluginClasses);
    return new RemoteArtifactManager(clientConfig, restClient, artifactId);
}
Also used : ArtifactVersion(io.cdap.cdap.api.artifact.ArtifactVersion) RemoteArtifactManager(io.cdap.cdap.test.remote.RemoteArtifactManager) ArtifactRange(io.cdap.cdap.api.artifact.ArtifactRange) HashSet(java.util.HashSet)

Example 3 with RemoteArtifactManager

use of io.cdap.cdap.test.remote.RemoteArtifactManager in project cdap by caskdata.

the class IntegrationTestManager method addPluginArtifact.

@Override
public ArtifactManager addPluginArtifact(ArtifactId artifactId, Set<ArtifactRange> parents, @Nullable Set<PluginClass> additionalPlugins, Class<?> pluginClass, Class<?>... pluginClasses) throws Exception {
    Manifest manifest = createManifest(pluginClass, pluginClasses);
    final Location appJar = PluginJarHelper.createPluginJar(locationFactory, manifest, pluginClass, pluginClasses);
    artifactClient.add(Ids.namespace(artifactId.getNamespace()), artifactId.getArtifact(), appJar::getInputStream, artifactId.getVersion(), parents, additionalPlugins);
    appJar.delete();
    return new RemoteArtifactManager(clientConfig, restClient, artifactId);
}
Also used : RemoteArtifactManager(io.cdap.cdap.test.remote.RemoteArtifactManager) Manifest(java.util.jar.Manifest) Location(org.apache.twill.filesystem.Location)

Example 4 with RemoteArtifactManager

use of io.cdap.cdap.test.remote.RemoteArtifactManager in project cdap by cdapio.

the class IntegrationTestManager method addAppArtifact.

@Override
public ArtifactManager addAppArtifact(ArtifactId artifactId, Class<?> appClass, Manifest manifest, File... bundleEmbeddedJars) throws Exception {
    final Location appJar = AppJarHelper.createDeploymentJar(locationFactory, appClass, manifest, CLASS_ACCEPTOR, bundleEmbeddedJars);
    artifactClient.add(artifactId, null, appJar::getInputStream);
    appJar.delete();
    return new RemoteArtifactManager(clientConfig, restClient, artifactId);
}
Also used : RemoteArtifactManager(io.cdap.cdap.test.remote.RemoteArtifactManager) Location(org.apache.twill.filesystem.Location)

Example 5 with RemoteArtifactManager

use of io.cdap.cdap.test.remote.RemoteArtifactManager in project cdap by cdapio.

the class IntegrationTestManager method addPluginArtifact.

@Override
public ArtifactManager addPluginArtifact(ArtifactId artifactId, ArtifactId parent, @Nullable Set<PluginClass> additionalPlugins, Class<?> pluginClass, Class<?>... pluginClasses) throws Exception {
    Set<ArtifactRange> parents = new HashSet<>();
    parents.add(new ArtifactRange(parent.getParent().getNamespace(), parent.getArtifact(), new ArtifactVersion(parent.getVersion()), true, new ArtifactVersion(parent.getVersion()), true));
    addPluginArtifact(artifactId, parents, additionalPlugins, pluginClass, pluginClasses);
    return new RemoteArtifactManager(clientConfig, restClient, artifactId);
}
Also used : ArtifactVersion(io.cdap.cdap.api.artifact.ArtifactVersion) RemoteArtifactManager(io.cdap.cdap.test.remote.RemoteArtifactManager) ArtifactRange(io.cdap.cdap.api.artifact.ArtifactRange) HashSet(java.util.HashSet)

Aggregations

RemoteArtifactManager (io.cdap.cdap.test.remote.RemoteArtifactManager)12 Manifest (java.util.jar.Manifest)6 Location (org.apache.twill.filesystem.Location)6 ArtifactRange (io.cdap.cdap.api.artifact.ArtifactRange)4 ArtifactVersion (io.cdap.cdap.api.artifact.ArtifactVersion)4 HashSet (java.util.HashSet)4