2016-02-08 75 views
0

我寫這個劇本的gradle:https://gist.github.com/anonymous/ba7de8e301eef7be3f3c的Arquillian + Wildfly +搖籃警告

當我運行我的測試,gradle這個警告我的一些相關性:

警告:JBAS016006:無法加載移植的擴展類org.apache.deltaspike.core.impl.interceptor.GlobalInterceptorExtension拋出java.lang.ClassNotFoundException:org.apache.deltaspike.core.impl.interceptor.GlobalInterceptorExtension

警告:JBAS016006:無法加載移植的擴展類org.jboss .weld.environment.se.WeldSEBeanR egistrant拋出java.lang.ClassNotFoundException:org.jboss.weld.environment.se.WeldSEBeanRegistrant

警告:JBAS016006:無法加載移植的擴展類org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension拋出java.lang.ClassNotFoundException :org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension

警告:JBAS016006:無法加載移植的擴展類org.apache.deltaspike.core.impl.jmx.MBeanExtension拋出java.lang.ClassNotFoundException:org.apache .deltaspike.core.impl.jmx.MBeanExtension

警告:JBAS016006:無法加載可移植擴展類org.apache.deltaspike.core.impl.config.ConfigurationExtension jav a.lang.ClassNotFoundException:org.apache.deltaspike.core.impl.config.ConfigurationExtension

警告:JBAS016006:無法加載移植的擴展類org.apache.deltaspike.core.impl.exception.control.extension.ExceptionControlExtension拋出java.lang.ClassNotFoundException:org.apache.deltaspike.core.impl.exception.control.extension.ExceptionControlExtension

警告: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

警告: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()); 
     } 
    } 
} 
+0

您能導出您用作部署的戰爭的樹視圖嗎? – LightGuard

+0

看看[這裏](https://gist.github.com/jeusdi/477f95e4659ce22d145b)。謝謝。 – Jordi

+0

我看到您正在部署到嵌入式容器,如果它是遠程或受控容器,結果是否相同? – LightGuard

回答