я написал этот сценарий Gradle: https://gist.github.com/anonymous/ba7de8e301eef7be3f3cArquillian + Wildfly + Gradle Предупреждения
Когда я запускаю мой тест, Gradle предупреждает меня о некоторых зависимостей:
WARN: JBAS016006: Не удалось загрузить портативную расширение класс org.apache.deltaspike.core.impl.interceptor.GlobalInterceptorExtension java.lang.ClassNotFoundException: org.apache.deltaspike.core.impl.interceptor.GlobalInterceptorExtension
WARN: JBAS016006: не удалось загрузить портативный класс расширение org.jboss .weld.environment.se.WeldSEBeanR egistrant java.lang.ClassNotFoundException: org.jboss.weld.environment.se.WeldSEBeanRegistrant
WARN: JBAS016006: Не удалось загрузить портативный класс расширения org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension java.lang.ClassNotFoundException : org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension
WARN: JBAS016006: не удалось загрузить портативный класс расширение org.apache.deltaspike.core.impl.jmx.MBeanExtension java.lang.ClassNotFoundException: org.apache .deltaspike.core.impl.jmx.MBeanExtension
WARN: JBAS016006: Не удалось загрузить переносимый класс расширения org.apache.deltaspike.core.impl.config.ConfigurationExtension jav a.lang.ClassNotFoundException: org.apache.deltaspike.core.impl.config.ConfigurationExtension
WARN: JBAS016006: Не удалось загрузить портативный расширение класса org.apache.deltaspike.core.impl.exception.control.extension.ExceptionControlExtension java.lang.ClassNotFoundException: org.apache.deltaspike.core.impl.exception.control.extension.ExceptionControlExtension
WARN: JBAS016006: не удалось загрузить портативный расширение класса org.apache.deltaspike.core.impl.message.MessageBundleExtension java.lang.ClassNotFoundException: org.apache.deltaspike.core.impl.message.MessageBundleExtension
WARN: JBAS016006: Не удалось загрузить переносимый класс расширения o rg.apache.deltaspike.core.impl.exclude.extension.ExcludeExtension java.lang.ClassNotFoundException: org.apache.deltaspike.core.impl.exclude.extension.ExcludeExtension
WARN: JBAS016006: Не удалось загрузить портативный класс расширения org.apache.deltaspike.core.api.provider.BeanManagerProvider java.lang.ClassNotFoundException: org.apache.deltaspike.core.api.provider.BeanManagerProvider
Я не могу понять, что происходит не так.
Мой класс Тест:
package com.living.features.arquillian;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.hasProperty;
import static org.hamcrest.Matchers.hasSize;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import java.util.Arrays;
import javax.inject.Inject;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.gradle.archive.importer.embedded.EmbeddedGradleImporter;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.living.authz.oauth.persistence.repository.exceptions.RepositorySystemException;
import com.living.mock.ArquillianAlternative;
import com.living.mock.MockFactory;
import com.living.rest.dto.FollowUpActivityDTO;
import com.living.rest.dto.metainfos.values.MetaInfoValueDTO;
import com.living.rest.dto.metainfos.values.StringMetaInfoValue;
import com.living.rest.services.FollowUpActivityService;
import com.living.rest.services.ResourceService;
@RunWith(Arquillian.class)
public class ArquillianTest
{
@Inject protected FollowUpActivityService fuaService;
@Inject protected ResourceService resourceService;
@Deployment
public static WebArchive createDeployment()
{
System.getProperties().remove("javax.xml.parsers.SAXParserFactory");
EmbeddedGradleImporter importer = ShrinkWrap.create(EmbeddedGradleImporter.class);
WebArchive war = importer.forThisProjectDirectory().importBuildOutput().as(WebArchive.class);
war.addClass(ArquillianAlternative.class);
war.addClass(MockFactory.class);
JavaArchive[] libs = Maven.resolver().resolve("org.mockito:mockito-core:2.0.31-beta").withTransitivity().as(JavaArchive.class);
war.addAsLibraries(libs);
//System.out.println(war.toString(true));
return war;
}
@Test
public void categorize()
{
FollowUpActivityDTO receivedFuaDTO = new FollowUpActivityDTO();
receivedFuaDTO.setId("idFuaCategorize");
MetaInfoValueDTO receivedMetaInfoValue = new StringMetaInfoValue("key", "value");
try {
this.fuaService.createOrUpdate(receivedFuaDTO);
this.fuaService.categorize(Arrays.asList(receivedFuaDTO.getId()), Arrays.asList(receivedMetaInfoValue));
FollowUpActivityDTO categorizedFuaDto = this.fuaService.findOne(receivedFuaDTO.getId());
assertThat(categorizedFuaDto.getMetainfos(), hasSize(1));
assertThat(categorizedFuaDto.getMetainfos(), hasItems(
hasProperty("key", equalTo(receivedMetaInfoValue.getKey())),
hasProperty("value", equalTo(receivedMetaInfoValue.getValue()))
));
} catch (RepositorySystemException e) {
fail(e.getMessage());
}
}
}
Не могли бы вы экспортировать древовидную структуру войны, которую используете в качестве развертывания, пожалуйста? – LightGuard
Взгляните на [здесь] (https://gist.github.com/jeusdi/477f95e4659ce22d145b). Благодарю. – Jordi
Я вижу, что вы развертываете во встроенный контейнер, это тот же результат, если это удаленный или управляемый контейнер? – LightGuard