本文整理汇总了Java中org.jboss.arquillian.container.spi.event.container.BeforeDeploy类的典型用法代码示例。如果您正苦于以下问题:Java BeforeDeploy类的具体用法?Java BeforeDeploy怎么用?Java BeforeDeploy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BeforeDeploy类属于org.jboss.arquillian.container.spi.event.container包,在下文中一共展示了BeforeDeploy类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: handleBeforeDeployment
import org.jboss.arquillian.container.spi.event.container.BeforeDeploy; //导入依赖的package包/类
/**
* Executed before deployments to lazily execute the {@link ServerSetupTask#setup(ManagementClient, String) ServerSetupTask}.
* <p>
* This is lazily loaded for manual mode tests. The server may not have been started at the
* {@link org.jboss.arquillian.test.spi.event.suite.BeforeClass BeforeClass} event.
* </p>
*
* @param event the lifecycle event
* @param container the container the event is being invoked on
*
* @throws Throwable if an error occurs processing the event
*/
public synchronized void handleBeforeDeployment(@Observes BeforeDeploy event, Container container) throws Throwable {
final String containerName = container.getName();
if (setupTasks.containsKey(containerName)) {
setupTasks.get(containerName).deployments.add(event.getDeployment());
return;
}
final ClassContext classContext = classContextInstance.get();
if (classContext == null) {
return;
}
final Class<?> currentClass = classContext.getActiveId();
ServerSetup setup = currentClass.getAnnotation(ServerSetup.class);
if (setup == null) {
return;
}
final ManagementClient client = managementClient.get();
final ServerSetupTaskHolder holder = new ServerSetupTaskHolder(client);
holder.deployments.add(event.getDeployment());
setupTasks.put(containerName, holder);
holder.setup(setup, containerName);
}
开发者ID:wildfly,项目名称:wildfly-arquillian,代码行数:38,代码来源:ServerSetupObserver.java
示例2: reportDeployment
import org.jboss.arquillian.container.spi.event.container.BeforeDeploy; //导入依赖的package包/类
public void reportDeployment(@Observes BeforeDeploy event) {
DeploymentDescription description = event.getDeployment();
// String targetContainer = description.getTarget().getName();
Reporter
.createReport(DEPLOYMENT_IN_TEST_CLASS_REPORT)
.addKeyValueEntry(DEPLOYMENT_IN_TEST_CLASS_NAME, description.getName())
.addKeyValueEntry(ARCHIVE_NAME_OF_DEPLOYMENT, description.getArchive().getName())
.addKeyValueEntry(ORDER_OF_DEPLOYMENT, description.getOrder())
.addKeyValueEntry(PROTOCOL_USED_FOR_DEPLOYMENT, description.getProtocol().getName())
.inSection(new TestClassConfigurationDeploymentSection(description.getName()))
.fire(sectionEvent);
// todo add info into container report - optimally keep oll deployments in a table - to do so we need to have functionality of merging tables. Or is there any better way?
}
开发者ID:arquillian,项目名称:arquillian-reporter,代码行数:16,代码来源:ArquillianCoreReporterLifecycleManager.java
示例3: executeAfterUnDeploy
import org.jboss.arquillian.container.spi.event.container.BeforeDeploy; //导入依赖的package包/类
public void executeAfterUnDeploy(@Observes BeforeDeploy event, TestClass testClass) {
try {
testClass.getMethod(com.cortez.wildfly.security.arquillian.BeforeDeploy.class).invoke(null);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
开发者ID:radcortez,项目名称:wildfly-custom-login-module,代码行数:8,代码来源:DeployExtension.java
示例4: observeBeforeDeploy
import org.jboss.arquillian.container.spi.event.container.BeforeDeploy; //导入依赖的package包/类
public void observeBeforeDeploy(@Observes BeforeDeploy event) {
DeploymentReport deploymentReport = new DeploymentReport();
DeploymentDescription description = event.getDeployment();
deploymentReport.setArchiveName(description.getArchive().getName());
deploymentReport.setName(description.getName());
int order = description.getOrder();
if (order > 0) {
deploymentReport.setOrder(order);
}
String protocol = description.getProtocol().getName();
if (!protocol.equals("_DEFAULT_")) {
deploymentReport.setProtocol(protocol);
} else {
deploymentReport.setProtocol("_DEFAULT_");
}
deploymentReport.setTarget(description.getTarget().getName());
boolean reported = false;
for (ContainerReport containerReport : reporter.get().getLastTestSuiteReport().getContainerReports()) {
if (containerReport.getQualifier().equals(deploymentReport.getTarget())) {
containerReport.getDeploymentReports().add(deploymentReport);
reported = true;
break;
}
}
if (!reported) {
if (reporter.get().getLastTestSuiteReport().getContainerReports().size() == 1) {
reporter.get().getLastTestSuiteReport().getContainerReports().get(0).getDeploymentReports().add(deploymentReport);
}
}
}
开发者ID:arquillian,项目名称:arquillian-recorder,代码行数:40,代码来源:ReporterLifecycleObserver.java
示例5: doServiceDeploy
import org.jboss.arquillian.container.spi.event.container.BeforeDeploy; //导入依赖的package包/类
public synchronized void doServiceDeploy(@Observes BeforeDeploy event, Container container, ServiceArchiveHolder archiveHolder) {
// already deployed?
if (serviceArchiveDeployed.contains(container.getName())) {
archiveHolder.deploymentExistsAndRemove(event.getDeployment().getName()); // cleanup
return;
}
// only deploy the service if the deployment has been enriched by the jmx-as7 protocol
if (archiveHolder.deploymentExistsAndRemove(event.getDeployment().getName())) {
JavaArchive serviceArchive = (JavaArchive) archiveHolder.getArchive();
try {
log.infof("Deploy arquillian service: %s", serviceArchive);
final Map<String, String> props = container.getContainerConfiguration().getContainerProperties();
//MASSIVE HACK
//write the management connection props to the archive, so we can access them from the server
final ByteArrayOutputStream bytes = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(bytes);
out.writeObject(props.get("managementPort"));
out.writeObject(NetworkUtils.formatPossibleIpv6Address(props.get("managementAddress")));
out.writeObject(NetworkUtils.formatPossibleIpv6Address(props.get("managementProtocol")));
out.writeObject(props.get("authenticationConfig"));
out.close();
serviceArchive.addAsManifestResource(new ByteArrayAsset(bytes.toByteArray()), "org.jboss.as.managementConnectionProps");
DeployableContainer<?> deployableContainer = container.getDeployableContainer();
deployableContainer.deploy(serviceArchive);
serviceArchiveDeployed.add(container.getName());
} catch (Throwable th) {
log.error("Cannot deploy arquillian service", th);
}
}
}
开发者ID:wildfly,项目名称:wildfly-arquillian,代码行数:33,代码来源:ArquillianServiceDeployer.java
示例6: setTargetServerGroups
import org.jboss.arquillian.container.spi.event.container.BeforeDeploy; //导入依赖的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
示例7: handleBeforeDeploy
import org.jboss.arquillian.container.spi.event.container.BeforeDeploy; //导入依赖的package包/类
public void handleBeforeDeploy(@Observes BeforeDeploy event, Container container) throws Throwable {
List<ManagedSetupTask> setupTasks = getSetupTasks();
if (!setupTasks.isEmpty()) {
ClassContext classContext = classContextInstance.get();
ObjectStore suiteStore = suiteContextInstance.get().getObjectStore();
ObjectStore classStore = classContext.getObjectStore();
MBeanServerConnection server = mbeanServerInstance.get();
Map<String, String> props = container.getContainerConfiguration().getContainerProperties();
ManagedSetupContext context = new ManagedSetupContext(suiteStore, classStore, server, props);
for (ManagedSetupTask task : setupTasks) {
task.beforeDeploy(context);
}
}
}
开发者ID:tdiesler,项目名称:gravia,代码行数:15,代码来源:ManagedContainerSetupObserver.java
示例8: beforeDeploy
import org.jboss.arquillian.container.spi.event.container.BeforeDeploy; //导入依赖的package包/类
public void beforeDeploy(@Observes final BeforeDeploy event) throws IOException {
log.log(Level.INFO, "Deleting searchisko data dir before deployment.");
DeploymentHelpers.removeSearchiskoDataDir();
}
开发者ID:searchisko,项目名称:searchisko,代码行数:5,代码来源:SearchiskoWarmupExecutor.java
示例9: executeBeforeDeploy
import org.jboss.arquillian.container.spi.event.container.BeforeDeploy; //导入依赖的package包/类
/**
* Execution method delegating the annotated method for "BeforeDeploy"
*
* @param event
* The observed event
* @param testClass
* The testclass with the annotation
*/
public final void executeBeforeDeploy(@Observes BeforeDeploy event,
TestClass testClass) {
execute(testClass.getMethods(BeforeDeployment.class));
}
开发者ID:PureSolTechnologies,项目名称:Purifinity,代码行数:13,代码来源:ArquillianLifecycle.java
注:本文中的org.jboss.arquillian.container.spi.event.container.BeforeDeploy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论