當前位置: 首頁>>代碼示例>>Java>>正文


Java AddonRepositoryImpl.forDirectory方法代碼示例

本文整理匯總了Java中org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl.forDirectory方法的典型用法代碼示例。如果您正苦於以下問題:Java AddonRepositoryImpl.forDirectory方法的具體用法?Java AddonRepositoryImpl.forDirectory怎麽用?Java AddonRepositoryImpl.forDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl的用法示例。


在下文中一共展示了AddonRepositoryImpl.forDirectory方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testDeployAddonEntryNoDependencies

import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //導入方法依賴的package包/類
@Test
public void testDeployAddonEntryNoDependencies() throws Exception
{
   File temp = File.createTempFile("addonDir", "test");
   temp.deleteOnExit();
   MutableAddonRepository repository = AddonRepositoryImpl.forDirectory(new FurnaceImpl(), temp);

   AddonId addon = AddonId.from("1", "2");
   ArrayList<File> resourceJars = new ArrayList<File>();
   File tempJar = File.createTempFile("addon" + addon.getName(), ".jar");
   tempJar.createNewFile();
   resourceJars.add(tempJar);

   Assert.assertFalse(repository.isDeployed(addon));
   repository.deploy(addon, new ArrayList<AddonDependencyEntry>(), resourceJars);
   Assert.assertTrue(repository.isDeployed(addon));

   Assert.assertFalse(repository.isEnabled(addon));
   repository.enable(addon);
   Assert.assertTrue(repository.isEnabled(addon));

   Assert.assertEquals(0, repository.getAddonDependencies(addon).size());
}
 
開發者ID:koentsje,項目名稱:forge-furnace,代碼行數:24,代碼來源:AddonRepositoryImplTest.java

示例2: testDeployAddonEntryNoDependenciesOrResources

import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //導入方法依賴的package包/類
@Test
public void testDeployAddonEntryNoDependenciesOrResources() throws Exception
{
   File temp = File.createTempFile("addonDir", "test");
   temp.deleteOnExit();
   MutableAddonRepository repository = AddonRepositoryImpl.forDirectory(new FurnaceImpl(), temp);

   AddonId addon = AddonId.from("1", "2");

   Assert.assertFalse(repository.isDeployed(addon));
   repository.deploy(addon, new ArrayList<AddonDependencyEntry>(), new ArrayList<File>());
   Assert.assertTrue(repository.isDeployed(addon));

   Assert.assertFalse(repository.isEnabled(addon));
   repository.enable(addon);
   Assert.assertTrue(repository.isEnabled(addon));

   Assert.assertEquals(0, repository.getAddonDependencies(addon).size());
}
 
開發者ID:koentsje,項目名稱:forge-furnace,代碼行數:20,代碼來源:AddonRepositoryImplTest.java

示例3: testDeployAddonEntryMultipleDependencies

import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //導入方法依賴的package包/類
@Test
public void testDeployAddonEntryMultipleDependencies() throws Exception
{
   File temp = File.createTempFile("addonDir", "test");
   temp.deleteOnExit();
   MutableAddonRepository repository = AddonRepositoryImpl.forDirectory(new FurnaceImpl(), temp);

   AddonId addon = AddonId.from("1", "2");
   AddonDependencyEntry dependency0 = AddonDependencyEntry.create("nm1", "ver", true, false);
   AddonDependencyEntry dependency1 = AddonDependencyEntry.create("nm2", "ver");

   repository.deploy(addon, Arrays.asList(dependency0, dependency1), new ArrayList<File>());

   Assert.assertEquals(2, repository.getAddonDependencies(addon).size());
   Assert.assertTrue(repository.getAddonDependencies(addon).contains(dependency0));
   Assert.assertTrue(repository.getAddonDependencies(addon).contains(dependency1));
}
 
開發者ID:koentsje,項目名稱:forge-furnace,代碼行數:18,代碼來源:AddonRepositoryImplTest.java

示例4: addRepository

import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //導入方法依賴的package包/類
@Override
public AddonRepository addRepository(AddonRepositoryMode mode, File directory)
{
   Assert.notNull(mode, "Addon repository mode must not be null.");
   Assert.notNull(directory, "Addon repository directory must not be null.");

   AddonRepository repository = AddonRepositoryImpl.forDirectory(this, directory);

   if (mode.isImmutable())
      repository = new ImmutableAddonRepository(repository);
   return addRepository(repository);
}
 
開發者ID:forge,項目名稱:furnace,代碼行數:13,代碼來源:FurnaceImpl.java

示例5: addRepository

import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //導入方法依賴的package包/類
@Override
public AddonRepository addRepository(AddonRepositoryMode mode, File directory)
{
   Assert.notNull(mode, "Addon repository mode must not be null.");
   Assert.notNull(directory, "Addon repository directory must not be null.");

   AddonRepository repository = AddonRepositoryImpl.forDirectory(this, directory);

   if (mode.isImmutable())
      repository = new ImmutableAddonRepository(repository);

   try
   {
      if (watcher != null)
      {
         if ((directory.exists() && directory.isDirectory()) || directory.mkdirs())
         {
            directory.toPath().register(watcher,
                     StandardWatchEventKinds.ENTRY_MODIFY,
                     StandardWatchEventKinds.ENTRY_CREATE,
                     StandardWatchEventKinds.ENTRY_DELETE,
                     StandardWatchEventKinds.OVERFLOW);
            logger.log(Level.INFO, "Monitoring repository [" + directory.toString() + "] for file changes.");
         }
         else
         {
            logger.log(Level.WARNING, "Cannot monitor repository [" + directory
                     + "] for changes because it is not a directory.");
         }
      }
   }
   catch (IOException e)
   {
      logger.log(Level.WARNING, "Could not monitor repository [" + directory.toString() + "] for file changes.", e);
   }

   return addRepository(repository);
}
 
開發者ID:koentsje,項目名稱:forge-furnace,代碼行數:39,代碼來源:FurnaceImpl.java

示例6: testAddonDirNaming

import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //導入方法依賴的package包/類
@Test
public void testAddonDirNaming() throws Exception
{
   File temp = File.createTempFile("addonDir", "test");
   temp.deleteOnExit();
   MutableAddonRepository repository = AddonRepositoryImpl.forDirectory(new FurnaceImpl(), temp);

   File dir = repository.getAddonBaseDir(AddonId.from("123#$%456", "[email protected]#789*-0"));
   Assert.assertEquals("123-456-789-0", dir.getName());
}
 
開發者ID:koentsje,項目名稱:forge-furnace,代碼行數:11,代碼來源:AddonRepositoryImplTest.java

示例7: testDeployAddonEntrySingleDependency

import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //導入方法依賴的package包/類
@Test
public void testDeployAddonEntrySingleDependency() throws Exception
{
   File temp = File.createTempFile("addonDir", "test");
   temp.deleteOnExit();
   MutableAddonRepository repository = AddonRepositoryImpl.forDirectory(new FurnaceImpl(), temp);

   AddonId addon = AddonId.from("1", "2");
   AddonDependencyEntry dependency = AddonDependencyEntry.create("nm", "ver", false, true);
   repository.deploy(addon, Arrays.asList(dependency), new ArrayList<File>());

   Assert.assertEquals(1, repository.getAddonDependencies(addon).size());
   Assert.assertTrue(repository.getAddonDependencies(addon).contains(dependency));
}
 
開發者ID:koentsje,項目名稱:forge-furnace,代碼行數:15,代碼來源:AddonRepositoryImplTest.java


注:本文中的org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl.forDirectory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。