nsStore.create(metadata); try { UserGroupInformation ugi;
@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); }
nsStore.create(metadata); try { UserGroupInformation ugi;
.setRootDirectory(TEMP_FOLDER.getRoot().toString() + "/" + customSpace.getNamespace()).build(); namespaceStore.create(customSpaceMeta); try { storageProviderNamespaceAdmin.create(customSpaceMeta);
@Test public void test() throws Exception { NamespaceId myspace = new NamespaceId("myspace"); NamespaceMeta myspaceMeta = new NamespaceMeta.Builder().setName(myspace.getNamespace()).build(); // the create/delete will look up meta so store that too namespaceStore.create(myspaceMeta); storageProviderNamespaceAdmin.create(myspaceMeta); Location namespaceLocation = namespacePathLocator.get(myspace); Assert.assertTrue(namespaceLocation.exists()); storageProviderNamespaceAdmin.delete(myspace); Assert.assertFalse(namespaceLocation.exists()); }