2013-07-26 2 views
1

는 JBoss에서의 작업 arquillian 얻기 위해 다음 튜토리얼을 따라하기 위해 노력 해왔다 JBoss에서의 작업하세요 FILE :오류 Arquillian는

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>org.arquillian.example</groupId> 
    <artifactId>arquillian-tutorial</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <name>container-test</name> 
    <url>http://maven.apache.org</url> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <!-- <version.arquillian_core>1.0.0.CR5</version.arquillian_core> <jboss.version>7.1.0.Beta1</jboss.version> 
      <junit.version>4.8.1</junit.version> --> 
     <slf4j.version>1.6.1</slf4j.version> 
    </properties> 

    <dependencyManagement> 
     <dependencies> 
      <dependency> 
       <groupId>org.jboss.arquillian</groupId> 
       <artifactId>arquillian-bom</artifactId> 
       <version>1.0.3.Final</version> 
       <scope>import</scope> 
       <type>pom</type> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 

    <profiles> 
     <profile> 
      <id>arquillian-jbossas-managed</id> 
      <activation> 
       <activeByDefault>true</activeByDefault> 
      </activation> 
      <dependencies> 
       <dependency> 
        <groupId>org.jboss.as</groupId> 
        <artifactId>jboss-as-arquillian-container-managed</artifactId> 
        <version>7.1.1.Final</version> 
        <scope>test</scope> 
       </dependency> 
       <dependency> 
        <groupId>org.jboss.arquillian.protocol</groupId> 
        <artifactId>arquillian-protocol-servlet</artifactId> 
        <scope>test</scope> 
       </dependency> 
       <dependency> 
        <groupId>org.jboss.spec</groupId> 
        <artifactId>jboss-javaee-6.0</artifactId> 
        <version>1.0.0.Final</version> 
        <type>pom</type> 
        <scope>provided</scope> 
       </dependency> 
      </dependencies> 
     </profile> 
    </profiles> 



    <build> 
     <plugins> 
      <plugin> 
       <artifactId>maven-dependency-plugin</artifactId> 
       <executions> 
        <execution> 
         <id>unpack</id> 
         <phase>process-test-classes</phase> 
         <goals> 
          <goal>unpack</goal> 
         </goals> 
         <configuration> 
          <artifactItems> 
           <artifactItem> 
            <groupId>org.jboss.as</groupId> 
            <artifactId>jboss-as-dist</artifactId> 
            <version>7.1.1.Final</version> 
            <type>zip</type> 
            <overWrite>false</overWrite> 
            <outputDirectory>target</outputDirectory> 
           </artifactItem> 
          </artifactItems> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 

    <dependencies> 


     <dependency> 
      <groupId>org.jboss.arquillian.container</groupId> 
      <artifactId>arquillian-weld-ee-embedded-1.1</artifactId> 
      <version>1.0.0.CR3</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.jboss.spec</groupId> 
      <artifactId>jboss-javaee-6.0</artifactId> 
      <version>1.0.0.Final</version> 
      <type>pom</type> 
      <scope>provided</scope> 
     </dependency> 

     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.8.1</version> 
     </dependency> 

     <dependency> 
      <groupId>org.jboss.arquillian.junit</groupId> 
      <artifactId>arquillian-junit-container</artifactId> 
      <scope>test</scope> 
     </dependency> 


     <dependency> 
      <groupId>org.jboss.shrinkwrap.resolver</groupId> 
      <artifactId>shrinkwrap-resolver-impl-maven</artifactId> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.jboss.weld</groupId> 
      <artifactId>weld-core</artifactId> 
      <version>1.1.5.Final</version> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-simple</artifactId> 
      <version>1.6.4</version> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.mockito</groupId> 
      <artifactId>mockito-all</artifactId> 
      <version>1.8.5</version> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.hamcrest</groupId> 
      <artifactId>hamcrest-integration</artifactId> 
      <version>1.2.1</version> 
     </dependency> 

     <dependency> 
      <groupId>net.avh4.util</groupId> 
      <artifactId>imagecomparison</artifactId> 
      <version>0.0.2</version> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>com.advancestores.storechannel</groupId> 
      <artifactId>epcfe-model</artifactId> 
      <version>0.0.1-SNAPSHOT</version> 
     </dependency> 

     <dependency> 
      <groupId>com.advancestores.storechannel</groupId> 
      <artifactId>epcfe-data</artifactId> 
      <version>0.0.1-SNAPSHOT</version> 
     </dependency> 

     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-api</artifactId> 
      <version>${slf4j.version}</version> 
     </dependency> 

     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-log4j12</artifactId> 
      <version>${slf4j.version}</version> 
     </dependency> 

     <dependency> 
      <groupId>commons-codec</groupId> 
      <artifactId>commons-codec</artifactId> 
      <version>1.4</version> 
     </dependency> 

     <dependency> 
      <groupId>commons-httpclient</groupId> 
      <artifactId>commons-httpclient</artifactId> 
      <version>20020423</version> 
     </dependency> 

     <dependency> 
      <groupId>com.sun.xml.bind</groupId> 
      <artifactId>jaxb-impl</artifactId> 
      <version>2.2</version> 
     </dependency> 


    </dependencies> 

</project> 

ARQUILLIAN.XML :

<arquillian xmlns="http://jboss.org/schema/arquillian" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation=" 
     http://jboss.org/schema/arquillian 
     http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> 
    <container qualifier="jbossas-managed" default="true"> 
     <configuration> 
      <property name="jbossHome">C:\appservers\jboss-eap-6.1\jboss-eap-6.1</property> 
     </configuration> 
    </container> 
</arquillian> 

편집 FULL 스택 트레이스 :

------------------------------------------------------- 
T E S T S 
------------------------------------------------------- 
Running org.arquillian.example.GreeterTest 
log4j:WARN No appenders could be found for logger (org.jboss.logging). 
log4j:WARN Please initialize the log4j system properly. 
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.323 sec <<< FAILURE! 

Results : 

Tests in error: 
    org.arquillian.example.GreeterTest: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor 

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 

[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 3.866s 
[INFO] Finished at: Mon Jul 29 09:12:13 EDT 2013 
[INFO] Final Memory: 12M/30M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test (default-test) on project arquillian-tutorial: There are test failures. 
[ERROR] 
[ERROR] Please refer to C:\Users\james.land\arquillian-tutorial\target\surefire-reports for the individual test results. 
[ERROR] -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException 
+0

내가 더 많은 정보는 있다고 생각 오류에 대해 게시 할 수 있습니다. 전체 스택 추적으로 질문을 업데이트하십시오. –

답변

0

당신의 IDE에서 당신 활성 제이 보스 관련 프로필습니까? pom.xml에서 프로파일을 언급 한 후에는 here과 같이 프로젝트 속성에서 프로파일을 활성화해야합니다.

설정 활성 메이븐 프로파일 : 수동 구성

다음 단계에 따라 수동으로 활성화 된 프로파일을 설정하려면

Right click on the project(your project)and select Properties 

    Select the Maven properties tab 

    Enter the profile id in the Active Maven Profiles field(e.g., arquillian-weld-ee-embedded) 

    Click the OK button and accept the project changes 
0
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>org.arquillian.example </groupId> 
    <artifactId>arquillian-tutorial</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 

    <url>http://arquillian.org</url> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 

    <build> 
     <plugins> 
      <plugin> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>2.3.2</version> 
       <configuration> 
        <source>1.6</source> 
        <target>1.6</target> 
       </configuration> 
      </plugin> 

      <plugin> 
    <artifactId>maven-surefire-plugin</artifactId> 
    <version>2.12</version> 
</plugin> 
     </plugins> 
    </build> 
    <dependencies> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.8.1</version> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
     <groupId>org.jboss.spec</groupId> 
     <artifactId>jboss-javaee-6.0</artifactId> 
     <version>1.0.0.Final</version> 
     <type>pom</type> 
     <scope>provided</scope> 
    </dependency> 

    <dependency> 
    <groupId>org.jboss.arquillian.junit</groupId> 
    <artifactId>arquillian-junit-container</artifactId> 
    <scope>test</scope> 
</dependency> 

    <dependency> 
    <groupId>org.jboss.arquillian.container</groupId> 
    <artifactId>arquillian-weld-ee-embedded-1.1</artifactId> 
    <version>1.0.0.CR3</version> 
    <scope>test</scope> 
</dependency> 
<dependency> 
    <groupId>org.jboss.weld</groupId> 
    <artifactId>weld-core</artifactId> 
    <version>1.1.5.Final</version> 
    <scope>test</scope> 
</dependency> 
<dependency> 
    <groupId>org.slf4j</groupId> 
    <artifactId>slf4j-simple</artifactId> 
    <version>1.6.4</version> 
    <scope>test</scope> 
</dependency> 

<dependency> 
<groupId>org.jboss.shrinkwrap.resolver</groupId> 
<artifactId>shrinkwrap-resolver-impl-maven</artifactId> 
<scope>test</scope> 
</dependency> 

<dependency> 
    <groupId>org.jboss.arquillian.extension</groupId> 
    <artifactId>arquillian-persistence-impl</artifactId> 
    <version>1.0.0.Alpha6</version> 
</dependency> 


    </dependencies> 
    <dependencyManagement> 
    <dependencies> 
     <dependency> 
      <groupId>org.jboss.arquillian</groupId> 
      <artifactId>arquillian-bom</artifactId> 
      <version>1.1.1.Final</version> 
      <scope>import</scope> 
      <type>pom</type> 
     </dependency> 
    </dependencies> 
</dependencyManagement> 

</project> 

**Don’t add unnecessary dependencies to the maven might cause version mismatch error. 
This pom is sufficient enough to run Arquillian.** 
+0

대답을 설명 해주십시오. – Litmus

+0

1) 테스트를 건너 뛰고 프로그램을 실행하거나 IDE에 m2e 플러그인을 추가하십시오. 2) 필요한 의존성 만 사용하십시오. –