2013-01-09 1 views
0

매우 간단한 Pax 시험을하고 있습니다.OSGI Pax 시험은 maven에서 실행되지만 IDE에서는 실행되지 않음

maven "mvn verify"로 실행하는 동안 성공합니다. 내 IDE에서 실행하는 동안 다음 오류가 발생합니다.

항아리가 누락되었거나 버그 인 사람은 누구입니까?

감사합니다, 여기에

java.lang.Exception: No tests found matching Method checkBundles(test.TestPaxExam) from [email protected] 
at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:37) 
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:43) 
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195) 
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) 

내 테스트 클래스입니다 : 여기

package test; 

import static org.junit.Assert.*; 
import static org.ops4j.pax.exam.CoreOptions.*; 

import org.junit.Test; 
import org.junit.runner.RunWith; 
import org.ops4j.pax.exam.Option; 
import org.ops4j.pax.exam.junit.Configuration; 
import org.ops4j.pax.exam.junit.JUnit4TestRunner; 
import org.osgi.framework.BundleContext; 

import javax.inject.Inject; 

@RunWith(JUnit4TestRunner.class) 
public class TestPaxExam { 

@Inject 
public BundleContext bc; 

@Configuration 
public Option[] config() { 

    return options(
      junitBundles() 
    ); 
} 

@Test 
public void checkBundles() { 
    assertNotNull(bc); 
} 
} 

그리고 내 pom.xml 파일입니다 :에

<?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>TestPaxExam</groupId> 
<artifactId>TestPaxExam</artifactId> 
<version>1.0</version> 

<properties> 
    <exam.version>2.5.0</exam.version> 
    <url.version>1.4.0</url.version> 
</properties> 

<dependencies> 

    <dependency> 
     <groupId>org.ops4j.pax.exam</groupId> 
     <artifactId>pax-exam-container-native</artifactId> 
     <version>${exam.version}</version> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>org.ops4j.pax.exam</groupId> 
     <artifactId>pax-exam-junit4</artifactId> 
     <version>${exam.version}</version> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>org.ops4j.pax.exam</groupId> 
     <artifactId>pax-exam-link-mvn</artifactId> 
     <version>${exam.version}</version> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>org.ops4j.pax.url</groupId> 
     <artifactId>pax-url-aether</artifactId> 
     <version>${url.version}</version> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.felix</groupId> 
     <artifactId>org.apache.felix.framework</artifactId> 
     <version>3.2.2</version> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>ch.qos.logback</groupId> 
     <artifactId>logback-core</artifactId> 
     <version>0.9.20</version> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>ch.qos.logback</groupId> 
     <artifactId>logback-classic</artifactId> 
     <version>0.9.20</version> 
     <scope>test</scope> 
    </dependency> 


<build> 
    <plugins> 
     <plugin> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <configuration> 
       <source>1.7</source> 
       <target>1.7</target> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 

</dependencies> 

</project> 
+0

IntelliJ 및 PaxExam에 여전히 문제가 있습니까? – kevcodez

답변

0

내가 의심스러운 아무것도 표시되지 않는 당신의 테스트 또는 귀하의 POM. IntelliJ 문제처럼 보입니다. checkBundles(test.TestPaxExam)이라는 서명이있는 메소드는 테스트 클래스에 존재하지 않으므로 JUnit은 불평 할 권리가 있습니다.

+0

우분투를 사용하여 새 컴퓨터에서이 동일한 테스트 프로젝트를 시도했지만 pom.xml에 섹션을 추가하지 않으면 컴파일 할 수 없습니다 (이미 첫 번째 게시물에서 업데이트 됨). 여전히 같은 문제입니다. – lleclerc