当前位置: 首页>>代码示例>>Java>>正文


Java DeploymentDescription.getArchive方法代码示例

本文整理汇总了Java中org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription.getArchive方法的典型用法代码示例。如果您正苦于以下问题:Java DeploymentDescription.getArchive方法的具体用法?Java DeploymentDescription.getArchive怎么用?Java DeploymentDescription.getArchive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription的用法示例。


在下文中一共展示了DeploymentDescription.getArchive方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generate

import org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription; //导入方法依赖的package包/类
public List<DeploymentDescription> generate(TestClass testClass) {
    List<DeploymentDescription> descriptions = delegate(testClass);

    boolean inCeContainer = isDeployedInCeContainer();

    List<DeploymentDescription> copy = new ArrayList<>();
    for (DeploymentDescription description : descriptions) {
        Archive<?> archive = description.getArchive();
        // only wrap in war, if it's in CE container
        if (inCeContainer && JavaArchive.class.isInstance(archive)) {
            JavaArchive jar = JavaArchive.class.cast(archive);
            copy.add(new DeploymentDescription(description.getName(), toWar(jar)));
        } else {
            copy.add(description);
        }
    }
    return copy;
}
 
开发者ID:jboss-openshift,项目名称:ce-arq,代码行数:19,代码来源:LegacyDeploymentScenarioGenerator.java

示例2: setTargetServerGroups

import org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription; //导入方法依赖的package包/类
public synchronized void setTargetServerGroups(@Observes BeforeDeploy event) {
    final String deploymentName = event.getDeployment().getName();
    if (serverGroupTargets.containsKey(deploymentName)) {
        final DeploymentDescription deploymentDescription = event.getDeployment();
        final Archive<?> delegate = deploymentDescription.getArchive();
        // Note that this breaks if anything else replaces this archive
        deploymentDescription.setTestableArchive(new ServerGroupArchive<>(delegate, Collections.unmodifiableSet(serverGroupTargets.get(deploymentName))));
    }
}
 
开发者ID:wildfly,项目名称:wildfly-arquillian,代码行数:10,代码来源:ServerGroupDeploymentObserver.java

示例3: testBundleGeneration

import org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription; //导入方法依赖的package包/类
@Test
public void testBundleGeneration() throws IOException {
	BndDeploymentScenarioGenerator bndDeploymentScenarioGenerator =
		new BndDeploymentScenarioGenerator() {

			@Override
			protected DeploymentScenarioGenerator
				getDefaultDeploymentScenarioGenerator() {

				return null;
			}

		};

	bndDeploymentScenarioGenerator.setBndFile(
		new File("target/test-classes/test.bnd"));

	List<DeploymentDescription> deploymentDescriptions =
		bndDeploymentScenarioGenerator.generate(new TestClass(ATest.class));

	assertEquals(1, deploymentDescriptions.size());

	DeploymentDescription deploymentDescription =
		deploymentDescriptions.get(0);

	Archive<?> archive = deploymentDescription.getArchive();

	Node object = archive.get("META-INF/MANIFEST.MF");

	assertNotNull("We must have a MANIFEST.MF", object);

	Manifest manifest = new Manifest(object.getAsset().openStream());

	Attributes mainAttributes = manifest.getMainAttributes();

	String importPackageValue = mainAttributes.getValue("Import-Package");

	assertFalse(
		"Package from the classes must not be imported",
		importPackageValue.contains(
			"com.liferay.arquillian.test.extras.a"));
	assertFalse(
		"Package from the classes must not be imported",
		importPackageValue.contains(
			"com.liferay.arquillian.test.extras.b"));

	assertTrue(
		"Should contain org.osgi.framework",
		importPackageValue.contains("org.osgi.framework"));

	assertNotNull(
		"Classes must be included",
		archive.get("com/liferay/arquillian/test/extras/a/A.class"));
	assertNotNull(
		"Classes must be included",
		archive.get("com/liferay/arquillian/test/extras/b/B.class"));
}
 
开发者ID:liferay-labs,项目名称:arquillian-liferay,代码行数:58,代码来源:BndDeploymentScenarioGeneratorTest.java

示例4: testBundleGenerationWithCommonBnd

import org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription; //导入方法依赖的package包/类
@Test
public void testBundleGenerationWithCommonBnd() throws IOException {
	BndDeploymentScenarioGenerator bndDeploymentScenarioGenerator =
		new BndDeploymentScenarioGenerator() {

			@Override
			protected DeploymentScenarioGenerator
				getDefaultDeploymentScenarioGenerator() {

				return null;
			}

		};

	bndDeploymentScenarioGenerator.setBndFile(
		new File("target/test-classes/test.bnd"));

	File commonBndFile = new File("target/test-classes/common.bnd");

	bndDeploymentScenarioGenerator.setCommonBndFile(commonBndFile);

	List<DeploymentDescription> deploymentDescriptions =
		bndDeploymentScenarioGenerator.generate(new TestClass(ATest.class));

	assertEquals(1, deploymentDescriptions.size());

	DeploymentDescription deploymentDescription =
		deploymentDescriptions.get(0);

	Archive<?> archive = deploymentDescription.getArchive();

	Node object = archive.get("META-INF/MANIFEST.MF");

	assertNotNull("We must have a MANIFEST.MF", object);

	Manifest manifest = new Manifest(object.getAsset().openStream());

	Attributes mainAttributes = manifest.getMainAttributes();

	String importPackageValue = mainAttributes.getValue("Import-Package");

	assertFalse(
		"Package from the classes must not be imported",
		importPackageValue.contains(
			"com.liferay.arquillian.test.extras.a"));
	assertFalse(
		"Package from the classes must not be imported",
		importPackageValue.contains(
			"com.liferay.arquillian.test.extras.b"));

	String fooProperty = mainAttributes.getValue("Foo-Property");

	assertEquals("test", fooProperty);

	String fooBadProperty = mainAttributes.getValue("Foo-Bad-Property");

	assertEquals("${a.non.existant.property}", fooBadProperty);

	assertNotNull(
		"Classes must be included",
		archive.get("com/liferay/arquillian/test/extras/a/A.class"));
	assertNotNull(
		"Classes must be included",
		archive.get("com/liferay/arquillian/test/extras/b/B.class"));
}
 
开发者ID:liferay-labs,项目名称:arquillian-liferay,代码行数:66,代码来源:BndDeploymentScenarioGeneratorTest.java

示例5: testBundleGenerationWithCommonBndFromSystemProperty

import org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription; //导入方法依赖的package包/类
@Test
public void testBundleGenerationWithCommonBndFromSystemProperty()
	throws IOException {

	System.setProperty("sdk.dir", "target/test-classes");

	BndDeploymentScenarioGenerator bndDeploymentScenarioGenerator =
		new BndDeploymentScenarioGenerator() {

			@Override
			protected DeploymentScenarioGenerator
				getDefaultDeploymentScenarioGenerator() {

				return null;
			}

		};

	bndDeploymentScenarioGenerator.setBndFile(
		new File("target/test-classes/test.bnd"));

	List<DeploymentDescription> deploymentDescriptions =
		bndDeploymentScenarioGenerator.generate(new TestClass(ATest.class));

	assertEquals(1, deploymentDescriptions.size());

	DeploymentDescription deploymentDescription =
		deploymentDescriptions.get(0);

	Archive<?> archive = deploymentDescription.getArchive();

	Node object = archive.get("META-INF/MANIFEST.MF");

	assertNotNull("We must have a MANIFEST.MF", object);

	Manifest manifest = new Manifest(object.getAsset().openStream());

	Attributes mainAttributes = manifest.getMainAttributes();

	String importPackageValue = mainAttributes.getValue("Import-Package");

	assertFalse(
		"Package from the classes must not be imported",
		importPackageValue.contains(
			"com.liferay.arquillian.test.extras.a"));
	assertFalse(
		"Package from the classes must not be imported",
		importPackageValue.contains(
			"com.liferay.arquillian.test.extras.b"));

	String fooProperty = mainAttributes.getValue("Foo-Property");

	assertEquals("test", fooProperty);

	String fooBadProperty = mainAttributes.getValue("Foo-Bad-Property");

	assertEquals("${a.non.existant.property}", fooBadProperty);

	assertNotNull(
		"Classes must be included",
		archive.get("com/liferay/arquillian/test/extras/a/A.class"));
	assertNotNull(
		"Classes must be included",
		archive.get("com/liferay/arquillian/test/extras/b/B.class"));
}
 
开发者ID:liferay-labs,项目名称:arquillian-liferay,代码行数:66,代码来源:BndDeploymentScenarioGeneratorTest.java

示例6: testBundleGeneration

import org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription; //导入方法依赖的package包/类
@Test
public void testBundleGeneration() throws IOException {
	BndDeploymentScenarioGenerator bndDeploymentScenarioGenerator =
		new BndDeploymentScenarioGenerator() {

			@Override
			protected DeploymentScenarioGenerator
				getDefaultDeploymentScenarioGenerator() {

				return null;
		}
	};

	bndDeploymentScenarioGenerator.setBndFile(
		new File("target/test-classes/test.bnd"));

	List<DeploymentDescription> deploymentDescriptions =
		bndDeploymentScenarioGenerator.generate(new TestClass(ATest.class));

	assertEquals(1, deploymentDescriptions.size());

	DeploymentDescription deploymentDescription =
		deploymentDescriptions.get(0);

	Archive<?> archive = deploymentDescription.getArchive();

	Node object = archive.get("META-INF/MANIFEST.MF");

	assertNotNull("We must have a MANIFEST.MF", object);

	Manifest manifest = new Manifest(object.getAsset().openStream());

	Attributes mainAttributes = manifest.getMainAttributes();

	String importPackageValue = mainAttributes.getValue("Import-Package");

	assertFalse(
		"Package from the classes must not be imported",
		importPackageValue.contains(
			"org.arquillian.liferay.test.extras.a"));
	assertFalse(
		"Package from the classes must not be imported",
		importPackageValue.contains(
			"org.arquillian.liferay.test.extras.b"));

	assertTrue(
		"Should contain org.osgi.framework",
		importPackageValue.contains("org.osgi.framework"));

	assertNotNull(
		"Classes must be included",
		archive.get("org/arquillian/liferay/test/extras/a/A.class"));
	assertNotNull(
		"Classes must be included",
		archive.get("org/arquillian/liferay/test/extras/b/B.class"));
}
 
开发者ID:arquillian,项目名称:arquillian-extension-liferay,代码行数:57,代码来源:BndDeploymentScenarioGeneratorTest.java

示例7: testBundleGenerationWithCommonBnd

import org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription; //导入方法依赖的package包/类
@Test
public void testBundleGenerationWithCommonBnd() throws IOException {
	BndDeploymentScenarioGenerator bndDeploymentScenarioGenerator =
		new BndDeploymentScenarioGenerator() {

		@Override
		protected DeploymentScenarioGenerator
			getDefaultDeploymentScenarioGenerator() {

			return null;
		}
	};

	bndDeploymentScenarioGenerator.setBndFile(
		new File("target/test-classes/test.bnd"));

	File commonBndFile = new File("target/test-classes/common.bnd");

	bndDeploymentScenarioGenerator.setCommonBndFile(commonBndFile);

	List<DeploymentDescription> deploymentDescriptions =
		bndDeploymentScenarioGenerator.generate(new TestClass(ATest.class));

	assertEquals(1, deploymentDescriptions.size());

	DeploymentDescription deploymentDescription =
		deploymentDescriptions.get(0);

	Archive<?> archive = deploymentDescription.getArchive();

	Node object = archive.get("META-INF/MANIFEST.MF");

	assertNotNull("We must have a MANIFEST.MF", object);

	Manifest manifest = new Manifest(object.getAsset().openStream());

	Attributes mainAttributes = manifest.getMainAttributes();

	String importPackageValue = mainAttributes.getValue("Import-Package");

	assertFalse(
		"Package from the classes must not be imported",
		importPackageValue.contains(
			"org.arquillian.liferay.test.extras.a"));
	assertFalse(
		"Package from the classes must not be imported",
		importPackageValue.contains(
			"org.arquillian.liferay.test.extras.b"));

	String fooProperty = mainAttributes.getValue("Foo-Property");

	assertEquals("test", fooProperty);

	String fooBadProperty = mainAttributes.getValue("Foo-Bad-Property");

	assertEquals("${a.non.existant.property}", fooBadProperty);

	assertNotNull(
		"Classes must be included",
		archive.get("org/arquillian/liferay/test/extras/a/A.class"));
	assertNotNull(
		"Classes must be included",
		archive.get("org/arquillian/liferay/test/extras/b/B.class"));
}
 
开发者ID:arquillian,项目名称:arquillian-extension-liferay,代码行数:65,代码来源:BndDeploymentScenarioGeneratorTest.java

示例8: testBundleGenerationWithCommonBndFromSystemProperty

import org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription; //导入方法依赖的package包/类
@Test
public void testBundleGenerationWithCommonBndFromSystemProperty()
	throws IOException {

	System.setProperty("sdk.dir", "target/test-classes");

	BndDeploymentScenarioGenerator bndDeploymentScenarioGenerator =
		new BndDeploymentScenarioGenerator() {

		@Override
		protected DeploymentScenarioGenerator
			getDefaultDeploymentScenarioGenerator() {

			return null;
		}
	};

	bndDeploymentScenarioGenerator.setBndFile(
		new File("target/test-classes/test.bnd"));

	List<DeploymentDescription> deploymentDescriptions =
		bndDeploymentScenarioGenerator.generate(new TestClass(ATest.class));

	assertEquals(1, deploymentDescriptions.size());

	DeploymentDescription deploymentDescription =
		deploymentDescriptions.get(0);

	Archive<?> archive = deploymentDescription.getArchive();

	Node object = archive.get("META-INF/MANIFEST.MF");

	assertNotNull("We must have a MANIFEST.MF", object);

	Manifest manifest = new Manifest(object.getAsset().openStream());

	Attributes mainAttributes = manifest.getMainAttributes();

	String importPackageValue = mainAttributes.getValue("Import-Package");

	assertFalse(
		"Package from the classes must not be imported",
		importPackageValue.contains(
			"org.arquillian.liferay.test.extras.a"));
	assertFalse(
		"Package from the classes must not be imported",
		importPackageValue.contains(
			"org.arquillian.liferay.test.extras.b"));

	String fooProperty = mainAttributes.getValue("Foo-Property");

	assertEquals("test", fooProperty);

	String fooBadProperty = mainAttributes.getValue("Foo-Bad-Property");

	assertEquals("${a.non.existant.property}", fooBadProperty);

	assertNotNull(
		"Classes must be included",
		archive.get("org/arquillian/liferay/test/extras/a/A.class"));
	assertNotNull(
		"Classes must be included",
		archive.get("org/arquillian/liferay/test/extras/b/B.class"));
}
 
开发者ID:arquillian,项目名称:arquillian-extension-liferay,代码行数:65,代码来源:BndDeploymentScenarioGeneratorTest.java

示例9: isTestable

import org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription; //导入方法依赖的package包/类
protected boolean isTestable(final Archive<?> archive, final DeploymentDescription deploymentDescription) {
    return deploymentDescription != null
            && deploymentDescription.isArchiveDeployment()
            && (deploymentDescription.getArchive() == archive || deploymentDescription.getTestableArchive() == archive)
            && deploymentDescription.testable();
}
 
开发者ID:apache,项目名称:tomee,代码行数:7,代码来源:TomEEContainer.java


注:本文中的org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription.getArchive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。