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


Java EnterpriseArchive.delete方法代码示例

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


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

示例1: selectTestableWAR

import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@EnhanceDeployment
   public static void selectTestableWAR(EnterpriseArchive enterpriseArchive)
    throws Exception {
WebArchive testableWar = enterpriseArchive.getAsType(WebArchive.class,
	"server.socket.impl.war");
enterpriseArchive.delete("server.socket.impl.war");
enterpriseArchive.addAsModule(Testable.archiveToTest(testableWar));
   }
 
开发者ID:PureSolTechnologies,项目名称:Purifinity,代码行数:9,代码来源:AbstractPurifinityServerWebsocketClientTest.java

示例2: selectTestableWAR

import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@EnhanceDeployment
   public static void selectTestableWAR(EnterpriseArchive enterpriseArchive)
    throws Exception {
WebArchive testableWar = enterpriseArchive.getAsType(WebArchive.class,
	"server.rest.impl.war");
enterpriseArchive.delete("server.rest.impl.war");
enterpriseArchive.addAsModule(Testable.archiveToTest(testableWar));
   }
 
开发者ID:PureSolTechnologies,项目名称:Purifinity,代码行数:9,代码来源:AbstractPurifinityServerRestClientTest.java

示例3: removeNotNeededWARFiles

import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@EnhanceDeployment
   public static void removeNotNeededWARFiles(
    EnterpriseArchive enterpriseArchive) throws Exception {
WebArchive testableWar = enterpriseArchive.getAsType(WebArchive.class,
	"server.rest.impl.war");
enterpriseArchive.delete("server.rest.impl.war");
enterpriseArchive.addAsModule(Testable.archiveToTest(testableWar));
   }
 
开发者ID:PureSolTechnologies,项目名称:Purifinity,代码行数:9,代码来源:AbstractPurifinityServerRestClientTest.java

示例4: selectTestableWAR

import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@EnhanceDeployment
   public static void selectTestableWAR(EnterpriseArchive enterpriseArchive)
    throws Exception {
WebArchive testableWar = enterpriseArchive.getAsType(WebArchive.class,
	"server.ui.war");
enterpriseArchive.delete("server.ui.war");
enterpriseArchive.addAsModule(Testable.archiveToTest(testableWar));
   }
 
开发者ID:PureSolTechnologies,项目名称:Purifinity,代码行数:9,代码来源:AbstractPurifinityServerUIClientTest.java

示例5: removeWAR

import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
protected static void removeWAR(EnterpriseArchive archive, String warName)
    throws Exception {
// Delete war file
archive.delete("/" + warName);
// now we remove the module entry in application.xml
Node node = archive.get(APPLICATION_XML_PATH);
DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance()
	.newDocumentBuilder();
try (InputStream stream = node.getAsset().openStream()) {
    Document document = documentBuilder.parse(stream);
    NodeList elements = document.getElementsByTagName("web-uri");
    for (int index = 0; index < elements.getLength(); index++) {
	org.w3c.dom.Node item = elements.item(index);
	if (item.getTextContent().equals(warName)) {
	    org.w3c.dom.Node webNode = item.getParentNode();
	    org.w3c.dom.Node moduleNode = webNode.getParentNode();
	    moduleNode.getParentNode().removeChild(moduleNode);
	}
    }
    document.normalize();
    archive.delete(APPLICATION_XML_PATH);

    Transformer transformer = TransformerFactory.newInstance()
	    .newTransformer();
    try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
	transformer.transform(new DOMSource(document),
		new StreamResult(byteArrayOutputStream));
	archive.add(
		new ByteArrayAsset(byteArrayOutputStream.toByteArray()),
		APPLICATION_XML_PATH);
    }
}
   }
 
开发者ID:PureSolTechnologies,项目名称:Purifinity,代码行数:34,代码来源:AbstractArquillianTest.java

示例6: setJBossDeploymentStructureXml

import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
/**
 * This method sets a new JBoss deployment structure for an enterprise
 * archive.
 * 
 * @param enterpriseArchive
 *            is the {@link EnterpriseArchive} to be edited.
 * @param jbossDeploymentStructure
 *            is the content of the new deployment structure.
 * @throws IOException
 *             No application.xml found
 */
public static void setJBossDeploymentStructureXml(
		EnterpriseArchive enterpriseArchive, String jbossDeploymentStructure)
		throws IOException {
	File tempFile = File.createTempFile(
			JBOSS_DEPLOYMENT_STRUCTURE_XML_FILE_NAME, ".temp");
	tempFile.deleteOnExit();
	IOUtils.write(jbossDeploymentStructure, new FileOutputStream(tempFile));
	// delete the old descriptor
	enterpriseArchive.delete(JBOSS_DEPLOYMENT_STRUCTURE_XML_PATH);
	// set the new descriptor
	enterpriseArchive.addAsManifestResource(tempFile,
			JBOSS_DEPLOYMENT_STRUCTURE_XML_FILE_NAME);
}
 
开发者ID:PureSolTechnologies,项目名称:Purifinity,代码行数:25,代码来源:EnterpriseArchiveUtils.java

示例7: setApplicationXml

import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
/**
 * This method sets a new application.xml for the provided enterprise
 * archive.
 * 
 * @param enterpriseArchive
 *            is the {@link EnterpriseArchive} to be edited.
 * @param applicationXML
 *            is the content of the application.xml as {@link String}.
 * @throws IOException
 *             is thrown if the new application.xml was not set.
 */
public static void setApplicationXml(EnterpriseArchive enterpriseArchive,
		String applicationXML) throws IOException {
	File tempApplicationXmlFile = File.createTempFile(
			APPLICATION_XML_FILE_NAME, ".temp");
	tempApplicationXmlFile.deleteOnExit();
	IOUtils.write(applicationXML, new FileOutputStream(
			tempApplicationXmlFile));

	// delete old application.xml
	enterpriseArchive.delete(APPLICATION_XML_PATH);

	// set the new application.xml
	enterpriseArchive.setApplicationXML(tempApplicationXmlFile);
}
 
开发者ID:PureSolTechnologies,项目名称:Purifinity,代码行数:26,代码来源:EnterpriseArchiveUtils.java

示例8: generateAutogeneratedDeployment

import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@Deployment(name = "autogenerated", order = 2)
@TargetsContainer("app")
public static Archive<?> generateAutogeneratedDeployment() {
    EnterpriseArchive ear = EarGenericBuilder.getModuleDeployment(ModuleType.EJB);
    ear.delete("lib/glassfish-embedded-all-3.1.2.2.jar");
    return ear;
}
 
开发者ID:ingwarsw,项目名称:arquillian-suite-extension,代码行数:8,代码来源:Deployments.java

示例9: generateAutogeneratedWebDeployment

import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@Deployment(name = "autogenerated_web", order = 1)
@TargetsContainer("app")
public static Archive<?> generateAutogeneratedWebDeployment() {
    EnterpriseArchive ear = EarGenericBuilder.getModuleDeployment(ModuleType.WAR, "test-war-module");
    ear.delete("lib/glassfish-embedded-all-3.1.2.2.jar");
    return ear;
}
 
开发者ID:ingwarsw,项目名称:arquillian-suite-extension,代码行数:8,代码来源:Deployments.java

示例10: removeModule

import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
/**
 * This modules removes a module from an enterprise archive.
 * 
 * @param enterpriseArchive
 *            is the {@link EnterpriseArchive} to be searched for a module
 *            to be removed.
 * @param moduleName
 *            is the name of the module to be removed.
 * @throws Exception
 *             is thrown if the modules could not be removed.
 */
public static void removeModule(EnterpriseArchive enterpriseArchive,
		String moduleName) throws Exception {
	enterpriseArchive.delete("/" + moduleName);
	removeModuleFromApplicationXml(enterpriseArchive, moduleName);
	removeModuleFromJBossDeploymentStructureXml(enterpriseArchive,
			moduleName);
}
 
开发者ID:PureSolTechnologies,项目名称:Purifinity,代码行数:19,代码来源:EnterpriseArchiveUtils.java


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