本文整理汇总了Java中org.jboss.arquillian.core.spi.EventContext.proceed方法的典型用法代码示例。如果您正苦于以下问题:Java EventContext.proceed方法的具体用法?Java EventContext.proceed怎么用?Java EventContext.proceed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.arquillian.core.spi.EventContext
的用法示例。
在下文中一共展示了EventContext.proceed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testPact
import org.jboss.arquillian.core.spi.EventContext; //导入方法依赖的package包/类
public void testPact(@Observes EventContext<Test> testEventContext) throws Throwable {
final Test event = testEventContext.getEvent();
final TestClass testClass = event.getTestClass();
final PactVerification pactVerification = event.getTestMethod().getAnnotation(PactVerification.class);
if (pactVerification == null) {
logger.log(Level.INFO,
String.format(
"Method %s is not annotated with %s annotation and it is going to be executed as normal junit test.",
event.getTestMethod().getName(), PactVerification.class.getName()));
testEventContext.proceed();
return;
}
executeConsumerTest(testEventContext, testClass, pactVerification);
}
示例2: testPact
import org.jboss.arquillian.core.spi.EventContext; //导入方法依赖的package包/类
public void testPact(@Observes(precedence = -50) EventContext<Test> testEventContext, Deployment deployment)
throws Throwable {
final Test event = testEventContext.getEvent();
final TestClass testClass = event.getTestClass();
// We need to check this because in case of embedded containers this class is executed too
if (RunModeUtils.isRunAsClient(deployment, testClass, event.getTestMethod())) {
final PactVerification pactVerification = event.getTestMethod().getAnnotation(PactVerification.class);
if (pactVerification == null) {
logger.log(Level.INFO,
String.format(
"Method %s is not annotated with %s annotation and it is going to be executed as normal junit test.",
event.getTestMethod().getName(), PactVerification.class.getName()));
testEventContext.proceed();
return;
}
executeConsumerTest(testEventContext, testClass, pactVerification);
} else {
// We are in container and this class is executed in client side so we should only pass the execution and incontainer class will do the job
testEventContext.proceed();
}
}
示例3: testPact
import org.jboss.arquillian.core.spi.EventContext; //导入方法依赖的package包/类
public void testPact(@Observes(precedence = -50) EventContext<Test> testEventContext) throws Throwable {
final Test event = testEventContext.getEvent();
final TestClass testClass = event.getTestClass();
final PactVerification pactVerification = event.getTestMethod().getAnnotation(PactVerification.class);
if (pactVerification == null) {
logger.log(Level.INFO,
String.format(
"Method %s is not annotated with %s annotation and it is going to be executed as normal junit test.",
event.getTestMethod().getName(), PactVerification.class.getName()));
testEventContext.proceed();
return;
}
final ConsumerProviderPair consumerProviderPair =
executeConsumerTest(testEventContext, testClass, pactVerification);
// Send results back to client
final String filename = getFilename(consumerProviderPair);
final byte[] content = loadPact(filename);
getCommandService().execute(new PactFilesCommand(filename, content));
}
示例4: start
import org.jboss.arquillian.core.spi.EventContext; //导入方法依赖的package包/类
public void start(@Observes final EventContext<ManagerStarted> starting) {
starting.proceed();
final ArquillianDescriptor descriptor = getDescriptorInstance();
Thread adocThread = new Thread(new Runnable() {
@Override
public void run() {
try {
long initialTime = System.currentTimeMillis();
initAsciidoctor(descriptor);
getLogger().info(String.format("Asciidoctor successfully initialized in %s milliseconds", System.currentTimeMillis() - initialTime));
}catch (Exception e){
getLogger().log(Level.SEVERE, "Could not initilize Asciidoctor instance", e);
}
}
}, "arquillian-asciidoctor-thread");
adocThread.setDaemon(true);
adocThread.start();
}
示例5: x
import org.jboss.arquillian.core.spi.EventContext; //导入方法依赖的package包/类
public void x(@Observes(precedence = -1) EventContext<Test> context) {
final MailTest mailTest = ExtractSetupUtil.extractMailTestFromTestMethod(context.getEvent());
if (mailTest != null) {
if (mailTest.clearAllMails()) {
mailTestEvent.fire(MailTestEvent.DeleteAllMails);
}
}
context.proceed();
if (mailTest != null && mailTest.verifyResult()) {
try {
final MimeMessage[] messages = greenMailProxy.get().getReceivedMessages();
final FilterChain chain = new FilterChain();
final List<MimeMessage> messagesFiltered = chain.filter(mailTest, messages);
if (mailTest.expectedMessageCount() != messagesFiltered.size()) {
throw new MailTestAssertionError(String.format("Expected mail message count %d but was %d",
mailTest.expectedMessageCount(), messagesFiltered.size()));
}
} catch (MessagingException ex) {
throw new RuntimeException(ex.getMessage(), ex);
}
}
}
示例6: execute
import org.jboss.arquillian.core.spi.EventContext; //导入方法依赖的package包/类
public void execute(@Observes EventContext<Test> context) {
Test event = context.getEvent();
Method testMethod = event.getTestMethod();
WithinNamespace ns = testMethod.getAnnotation(WithinNamespace.class);
if (ns == null) {
ns = event.getTestClass().getAnnotation(WithinNamespace.class);
if (ns == null) {
Class<?> testClass = event.getTestClass().getJavaClass();
ns = testClass.getPackage().getAnnotation(WithinNamespace.class);
}
}
if (ns != null) {
runWithinNamespaces(context, ns.value());
} else {
context.proceed();
}
}
示例7: runWithinNamespaces
import org.jboss.arquillian.core.spi.EventContext; //导入方法依赖的package包/类
private void runWithinNamespaces(EventContext<Test> context, String[] namespaces) {
final List<FailedNamespaceException> exceptions = new ArrayList<>();
final String original = NamespaceManager.get();
try {
for (String namespace : namespaces) {
try {
NamespaceManager.set(namespace);
context.proceed();
} catch (Exception e) {
exceptions.add(new FailedNamespaceException(e, namespace));
}
}
} finally {
NamespaceManager.set(original);
}
if (exceptions.size() > 1) {
throw new MultipleExceptions(exceptions);
} else if (exceptions.size() == 1) {
throw exceptions.get(0);
}
}
示例8: release
import org.jboss.arquillian.core.spi.EventContext; //导入方法依赖的package包/类
public void release(@Observes final EventContext<BeforeUnDeploy> event) {
if (!SystemInstance.isInitialized()) {
event.proceed();
return;
}
try {
event.proceed();
} finally {
final BeanContext bc = beanContext();
if (bc != null) { // can be null if deployment exception
final CreationalContext<?> cc = bc.get(CreationalContext.class);
if (cc != null) {
cc.release();
}
}
}
}
示例9: executePacts
import org.jboss.arquillian.core.spi.EventContext; //导入方法依赖的package包/类
public void executePacts(@Observes EventContext<Test> test) {
final Pacts pacts = pactsInstance.get();
if (pacts == null) {
test.proceed();
return;
}
TestClass testClass = test.getEvent().getTestClass();
final List<Throwable> errors = new ArrayList<>();
validateState(testClass, errors);
validateTargetRequestFilters(testClass, errors);
validateTestTarget(testClass, errors);
Field interactionField =
validateAndGetResourceField(testClass, RequestResponseInteraction.class, CurrentInteraction.class, errors);
Field consumerField = validateAndGetResourceField(testClass, Consumer.class, CurrentConsumer.class, errors);
if (errors.size() != 0) {
String errorMessage = errors.stream()
.map(Throwable::getMessage)
.collect(Collectors.joining(" * "));
throw new IllegalArgumentException(errorMessage);
}
executePacts(test, pacts, interactionField, consumerField);
}
示例10: stop
import org.jboss.arquillian.core.spi.EventContext; //导入方法依赖的package包/类
public void stop(@Observes final EventContext<ManagerStopping> ending) {
final ArquillianDescriptor descriptor = getDescriptorInstance();
try {
ending.proceed();
} finally {
renderAll(descriptor);
}
}
示例11: execute
import org.jboss.arquillian.core.spi.EventContext; //导入方法依赖的package包/类
public void execute(@Observes(precedence = Integer.MAX_VALUE)
EventContext<BeforeSuite> event) throws InvalidSyntaxException {
Bundle bundle = FrameworkUtil.getBundle(getClass());
BundleContext bundleContext = bundle.getBundleContext();
Filter filter = FrameworkUtil.createFilter(
"(&(objectClass=org.springframework.context.ApplicationContext)" +
"(org.springframework.context.service.name=" +
bundle.getSymbolicName() + "))");
ServiceTracker<ApplicationContext, ApplicationContext> serviceTracker =
new ServiceTracker<>(bundleContext, filter, null);
serviceTracker.open();
try {
serviceTracker.waitForService(30 * 1000L);
}
catch (InterruptedException ie) {
throw new RuntimeException(ie);
}
serviceTracker.close();
event.proceed();
}
示例12: execute
import org.jboss.arquillian.core.spi.EventContext; //导入方法依赖的package包/类
private void execute(EventContext<? extends ExecutionEvent> context, String phase) {
if (shouldPerformExecution(context.getEvent())) {
context.proceed();
} else {
log.info("Ignore test [" + phase + "]: " + toFqn(context.getEvent()));
testResultProducer.set(TestResult.skipped());
}
}
示例13: execute
import org.jboss.arquillian.core.spi.EventContext; //导入方法依赖的package包/类
public void execute(@Observes(precedence = Integer.MAX_VALUE)
EventContext<BeforeSuite> event) throws InvalidSyntaxException {
Bundle bundle = FrameworkUtil.getBundle(getClass());
BundleContext bundleContext = bundle.getBundleContext();
Filter filter = FrameworkUtil.createFilter(
"(&(objectClass=org.springframework.context.ApplicationContext)" +
"(org.springframework.context.service.name=" +
bundleContext.getBundle().getSymbolicName() + "))");
ServiceTracker<ApplicationContext, ApplicationContext> serviceTracker =
new ServiceTracker<>(bundleContext, filter, null);
serviceTracker.open();
try {
serviceTracker.waitForService(30 * 1000L);
}
catch (InterruptedException e) {
throw new RuntimeException(e);
}
serviceTracker.close();
event.proceed();
}
示例14: blockDeployManagedDeploymentsWhenNeeded
import org.jboss.arquillian.core.spi.EventContext; //导入方法依赖的package包/类
/**
* Method ignoring DeployManagedDeployments events if already deployed.
*
* @param eventContext Event to check
*/
public void blockDeployManagedDeploymentsWhenNeeded(@Observes EventContext<DeployManagedDeployments> eventContext) {
if (deployDeployments) {
deployDeployments = false;
debug("NOT Blocking DeployManagedDeployments event {0}", eventContext.getEvent().toString());
eventContext.proceed();
} else {
// Do nothing with event.
debug("Blocking DeployManagedDeployments event {0}", eventContext.getEvent().toString());
}
}
示例15: blockGenerateDeploymentWhenNeeded
import org.jboss.arquillian.core.spi.EventContext; //导入方法依赖的package包/类
/**
* Method ignoring GenerateDeployment events if deployment is already done.
*
* @param eventContext Event to check
*/
public void blockGenerateDeploymentWhenNeeded(@Observes EventContext<GenerateDeployment> eventContext) {
if (suiteDeploymentGenerated) {
// Do nothing with event.
debug("Blocking GenerateDeployment event {0}", eventContext.getEvent().toString());
} else {
suiteDeploymentGenerated = true;
debug("NOT Blocking GenerateDeployment event {0}", eventContext.getEvent().toString());
eventContext.proceed();
}
}