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


Java WebArchive.addPackage方法代碼示例

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


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

示例1: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "component-test.war");
	war.addPackage(MyComponent.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web.xml")), "web.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:9,代碼來源:ComponentTestCase.java

示例2: getDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static Archive<?> getDeployment() {
    WebArchive war = ShrinkWrap.create(WebArchive.class);
    war.addPackage(EntityToModelMapper.class.getPackage());
    war.addClasses(GaeSearchRepository.class, SearchData.class, SearchConfiguration.class);
    war.addAsWebInfResource("appengine-web.xml");
    war.addAsResource("datastore-indexes.xml");

    PomEquippedResolveStage pom = Maven.resolver().loadPomFromFile("pom.xml");
    war.addAsLibraries(pom.resolve("com.google.appengine:appengine-api-1.0-sdk").withTransitivity().as(File.class));
    war.addAsLibraries(pom.resolve("me.snowdrop.data:spring-data-snowdrop-core").withTransitivity().as(File.class));

    return war;
}
 
開發者ID:snowdrop,項目名稱:spring-data-snowdrop,代碼行數:15,代碼來源:SearchTest.java

示例3: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "news-test.war");
	war.addPackage(Param.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebResource(new FileAsset(new File("src/test/resources/index.html")), "index.html");
	war.addAsWebResource(new FileAsset(new File("src/test/resources/form.html")), "form.html");
	war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web.xml")), "web.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:11,代碼來源:NewsTestCase.java

示例4: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "rest-test.war");
	war.addPackage(Calculator.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:8,代碼來源:RestTestCase.java

示例5: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "checkpointjob-test.war");
	war.addPackage(PayrollCheckpoint.class.getPackage());
	war.addPackage(SkippedException.class.getPackage());
	war.addPackage(PayrollListener.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebInfResource(new FileAsset(new File("src/main/resources/META-INF/batch-jobs/" + JOB_NAME + ".xml")),
			"classes/META-INF/batch-jobs/" + JOB_NAME + ".xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:12,代碼來源:CheckpointJobTestCase.java

示例6: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "simplejob-test.war");
	war.addPackage(Payroll.class.getPackage());
	war.addPackage(PayrollItemProcessor.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebInfResource(
			new FileAsset(new File("src/main/resources/META-INF/batch-jobs/" + JOB_NAME + ".xml")),
			"classes/META-INF/batch-jobs/" + JOB_NAME + ".xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:12,代碼來源:SimpleJobTestCase.java

示例7: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "mailjob-test.war");
	File[] files = resolver().loadPomFromFile("pom.xml").importRuntimeDependencies()
			.resolve("org.subethamail:subethasmtp:3.1.7").withTransitivity().asFile();
	war.addPackage(MailBatchlet.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebInfResource(new FileAsset(new File("src/main/resources/META-INF/batch-jobs/" + JOB_NAME + ".xml")),
			"classes/META-INF/batch-jobs/" + JOB_NAME + ".xml");
	war.addAsLibraries(files);
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:13,代碼來源:MailJobTestCase.java

示例8: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "asynch-rest-test.war");
	war.addPackage(AsyncResource.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web.xml")), "web.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:9,代碼來源:ReceiveMessagesTestCase.java

示例9: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "asynchronous-test.war");
	war.addPackage(AsynchronousServlet.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web.xml")), "web.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:9,代碼來源:AsynchronousTestCase.java

示例10: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "protocolhandler-test.war");
	war.addPackage(UpgradeServlet.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web.xml")), "web.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:9,代碼來源:ProtocolHandlerTestCase.java

示例11: deploy

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment(testable = false)
public static WebArchive deploy() throws URISyntaxException {
	final WebArchive war = create(WebArchive.class, "fileupload-test.war");
	war.addPackage(FileUploadServlet.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebResource(new FileAsset(new File("src/main/webapp/view/fileupload.jsp")), "view/fileupload.jsp");
	war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web.xml")), "web.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:10,代碼來源:FileUploadTestCase.java

示例12: createDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
private static Archive<?> createDeployment() {
	WebArchive war = create(WebArchive.class, "singleton.war");
	war.addPackage(HAService.class.getPackage());
	war.setManifest(new StringAsset("Manifest-Version: 1.0\nDependencies: org.jboss.as.server\n"));
	war.addAsManifestResource(createPermissionsXmlAsset(new RuntimePermission("getClassLoader"), // See
																									// org.jboss.as.server.deployment.service.ServiceActivatorProcessor#deploy()
			new ServerPermission("useServiceRegistry"), // See
														// org.jboss.as.server.deployment.service.SecuredServiceRegistry
			new ServerPermission("getCurrentServiceContainer")), "permissions.xml");
	war.addAsServiceProvider(ServiceActivator.class, HAServiceActivator.class);
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:13,代碼來源:SingletonServiceTestCase.java

示例13: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "nonblocking-test.war");
	war.addPackage(ReadingServlet.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebResource(new FileAsset(new File("src/main/webapp/view/nonblocking.jsp")), "view/nonblocking.jsp");
	war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web.xml")), "web.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:10,代碼來源:NonBlockingTestCase.java

示例14: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "errormappings-test.war");
	war.addPackage(ErrorMappingServlet.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebResource(new FileAsset(new File("src/main/webapp/view/errormapping.jsp")), "view/errormapping.jsp");
	war.addAsWebResource(new FileAsset(new File("src/main/webapp/view/error-404.jsp")), "view/error-404.jsp");
	war.addAsWebResource(new FileAsset(new File("src/main/webapp/view/error-exception.jsp")),
			"view/error-exception.jsp");
	war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web-errormapping.xml")), "web.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:13,代碼來源:ErrorMappingTestCase.java

示例15: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "eventlistener-test.war");
	war.addPackage(EventListenerServlet.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web.xml")), "web.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:9,代碼來源:EventListenerTestCase.java


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