Search in sources :

Example 1 with EntityExistenceVerifier

use of io.cdap.cdap.common.entity.EntityExistenceVerifier in project cdap by caskdata.

the class EntityExistenceTest method setup.

@BeforeClass
public static void setup() throws Exception {
    CConfiguration cConf = CConfiguration.create();
    cConf.set(Constants.INSTANCE_NAME, EXISTS);
    Injector injector = AppFabricTestHelper.getInjector(cConf);
    NamespaceStore nsStore = injector.getInstance(NamespaceStore.class);
    ArtifactRepository artifactRepository = injector.getInstance(ArtifactRepository.class);
    cConf = injector.getInstance(CConfiguration.class);
    nsStore.create(new NamespaceMeta.Builder().setName(EXISTS).build());
    existenceVerifier = injector.getInstance(Key.get(new TypeLiteral<EntityExistenceVerifier<EntityId>>() {
    }));
    LocalLocationFactory lf = new LocalLocationFactory(TEMPORARY_FOLDER.newFolder());
    File artifactFile = new File(AppJarHelper.createDeploymentJar(lf, AllProgramsApp.class).toURI());
    artifactRepository.addArtifact(Id.Artifact.fromEntityId(ARTIFACT), artifactFile);
    AppFabricTestHelper.deployApplication(Id.Namespace.fromEntityId(NAMESPACE), AllProgramsApp.class, null, cConf);
}
Also used : EntityExistenceVerifier(io.cdap.cdap.common.entity.EntityExistenceVerifier) Injector(com.google.inject.Injector) NamespaceMeta(io.cdap.cdap.proto.NamespaceMeta) NamespaceStore(io.cdap.cdap.store.NamespaceStore) ArtifactRepository(io.cdap.cdap.internal.app.runtime.artifact.ArtifactRepository) CConfiguration(io.cdap.cdap.common.conf.CConfiguration) LocalLocationFactory(org.apache.twill.filesystem.LocalLocationFactory) File(java.io.File) BeforeClass(org.junit.BeforeClass)

Example 2 with EntityExistenceVerifier

use of io.cdap.cdap.common.entity.EntityExistenceVerifier in project cdap by cdapio.

the class EntityExistenceTest method setup.

@BeforeClass
public static void setup() throws Exception {
    CConfiguration cConf = CConfiguration.create();
    cConf.set(Constants.INSTANCE_NAME, EXISTS);
    Injector injector = AppFabricTestHelper.getInjector(cConf);
    NamespaceStore nsStore = injector.getInstance(NamespaceStore.class);
    ArtifactRepository artifactRepository = injector.getInstance(ArtifactRepository.class);
    cConf = injector.getInstance(CConfiguration.class);
    nsStore.create(new NamespaceMeta.Builder().setName(EXISTS).build());
    existenceVerifier = injector.getInstance(Key.get(new TypeLiteral<EntityExistenceVerifier<EntityId>>() {
    }));
    LocalLocationFactory lf = new LocalLocationFactory(TEMPORARY_FOLDER.newFolder());
    File artifactFile = new File(AppJarHelper.createDeploymentJar(lf, AllProgramsApp.class).toURI());
    artifactRepository.addArtifact(Id.Artifact.fromEntityId(ARTIFACT), artifactFile);
    AppFabricTestHelper.deployApplication(Id.Namespace.fromEntityId(NAMESPACE), AllProgramsApp.class, null, cConf);
}
Also used : EntityExistenceVerifier(io.cdap.cdap.common.entity.EntityExistenceVerifier) Injector(com.google.inject.Injector) NamespaceMeta(io.cdap.cdap.proto.NamespaceMeta) NamespaceStore(io.cdap.cdap.store.NamespaceStore) ArtifactRepository(io.cdap.cdap.internal.app.runtime.artifact.ArtifactRepository) CConfiguration(io.cdap.cdap.common.conf.CConfiguration) LocalLocationFactory(org.apache.twill.filesystem.LocalLocationFactory) File(java.io.File) BeforeClass(org.junit.BeforeClass)

Aggregations

Injector (com.google.inject.Injector)2 CConfiguration (io.cdap.cdap.common.conf.CConfiguration)2 EntityExistenceVerifier (io.cdap.cdap.common.entity.EntityExistenceVerifier)2 ArtifactRepository (io.cdap.cdap.internal.app.runtime.artifact.ArtifactRepository)2 NamespaceMeta (io.cdap.cdap.proto.NamespaceMeta)2 NamespaceStore (io.cdap.cdap.store.NamespaceStore)2 File (java.io.File)2 LocalLocationFactory (org.apache.twill.filesystem.LocalLocationFactory)2 BeforeClass (org.junit.BeforeClass)2