use of co.cask.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);
}
use of co.cask.cdap.test.remote.RemoteArtifactManager in project cdap by caskdata.
the class IntegrationTestManager method addAppArtifact.
@Override
public ArtifactManager addAppArtifact(ArtifactId artifactId, Class<?> appClass, String... exportPackages) throws Exception {
Manifest manifest = new Manifest();
manifest.getMainAttributes().put(ManifestFields.EXPORT_PACKAGE, Joiner.on(',').join(exportPackages));
addAppArtifact(artifactId, appClass, manifest);
return new RemoteArtifactManager(clientConfig, restClient, artifactId);
}
use of co.cask.cdap.test.remote.RemoteArtifactManager in project cdap by caskdata.
the class IntegrationTestManager method addPluginArtifact.
@Override
public ArtifactManager addPluginArtifact(ArtifactId artifactId, Set<ArtifactRange> parents, Class<?> pluginClass, Class<?>... pluginClasses) throws Exception {
Manifest manifest = createManifest(pluginClass, pluginClasses);
final Location appJar = PluginJarHelper.createPluginJar(locationFactory, manifest, pluginClass, pluginClasses);
artifactClient.add(artifactId, parents, new InputSupplier<InputStream>() {
@Override
public InputStream getInput() throws IOException {
return appJar.getInputStream();
}
});
appJar.delete();
return new RemoteArtifactManager(clientConfig, restClient, artifactId);
}
use of co.cask.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(), new InputSupplier<InputStream>() {
@Override
public InputStream getInput() throws IOException {
return appJar.getInputStream();
}
}, artifactId.getVersion(), parents, additionalPlugins);
appJar.delete();
return new RemoteArtifactManager(clientConfig, restClient, artifactId);
}
use of co.cask.cdap.test.remote.RemoteArtifactManager in project cdap by caskdata.
the class IntegrationTestManager method addAppArtifact.
@Override
public ArtifactManager addAppArtifact(ArtifactId artifactId, Class<?> appClass, Manifest manifest) throws Exception {
final Location appJar = AppJarHelper.createDeploymentJar(locationFactory, appClass, manifest, CLASS_ACCEPTOR);
artifactClient.add(artifactId, null, new InputSupplier<InputStream>() {
@Override
public InputStream getInput() throws IOException {
return appJar.getInputStream();
}
});
appJar.delete();
return new RemoteArtifactManager(clientConfig, restClient, artifactId);
}
Aggregations