本文整理汇总了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());
}
示例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());
}
示例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));
}
示例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);
}
示例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);
}
示例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());
}
示例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));
}