최근에 Android 계측 테스트를 사용하고 있습니다. 그래서 주요 응용 프로그램은Android maven 계측 테스트가 실패했습니다
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.onestopspot</groupId>
<artifactId>api_library</artifactId>
<version>5.0.0-SNAPSHOT</version>
<packaging>apk</packaging>
<name>One Stop Spot</name>
<dependencies>
<dependency>
<groupId>org.springframework.android</groupId>
<artifactId>spring-android-rest-template</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.8</version>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<sourceDirectory>src/main/java</sourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.4.0</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>16</platform>
</sdk>
</configuration>
</plugin>
</plugins>
</build>
</project>
pm.xml 파일
http://maven.apache.org/maven-v4_0_0.xsd "은 다음과 같은 구조를> 4.0.0을 가지고 다음과 같은 구조를 가지고 onestopspot 부모 1.0.0-SNAPSHOT com.onestopspot 계측 APK 원 스톱 샵 모어 계측 테스트
com.onestopspot.api에서 내 주요 프로젝트에 지금<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android-test</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.onestopspot</groupId>
<artifactId>api_library</artifactId>
<version>5.0.0-SNAPSHOT</version>
<scope>provided</scope>
<type>apk</type>
</dependency>
<dependency>
<groupId>com.onestopspot</groupId>
<artifactId>api_library</artifactId>
<version>5.0.0-SNAPSHOT</version>
<scope>provided</scope>
<type>jar</type>
</dependency>
</dependencies>
<profiles>
<profile>
<id>emma</id>
<dependencies>
<dependency>
<groupId>emma</groupId>
<artifactId>emma</artifactId>
<type>jar</type>
<scope>compile</scope>
<version>2.1.5320</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-1</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>project.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<test>
<coverage>true</coverage>
<createReport>true</createReport>
</test>
</configuration>
<extensions>true</extensions>
<!-- -->
<executions>
<execution>
<id>pull-coverage</id>
<phase>post-integration-test</phase>
<goals>
<goal>pull</goal>
</goals>
<configuration>
<pullSource>/data/data/com.onestopspot.api/files/coverage.ec</pullSource>
<pullDestination>${tested.project.dir}/target/emma/coverage.ec</pullDestination>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.sonatype.maven.plugin</groupId>
<artifactId>emma4it-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
<metadatas>${tested.project.dir}/target/emma/coverage.em,${tested.project.dir}/src/
</metadatas>
<instrumentations>${tested.project.dir}/target/emma/coverage.ec</instrumentations>
<reportDirectory>${tested.project.dir}/target/emma/</reportDirectory>
<baseDirectory>{tested.project.dir}/target/</baseDirectory>
<formats>xml,html</formats>
</configuration>
</plugin>
</plugins>
</reporting>
</profile>
</profiles>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<test>
<skip>false</skip>
<!--<instrumentationPackage>packageName</instrumentationPackage> -->
<!--<instrumentationRunner>className</instrumentationRunner> -->
<!--<debug>true|false</debug> -->
<!--<coverage>true|false</coverage> -->
<!--<logonly>true|false</logonly> avd -->
<!--<testsize>small|medium|large</testsize> -->
<testSize>small</testSize>
<createReport>true</createReport>
<!--<classes> -->
<!--<class>your.package.name.YourTestClass</class> -->
<!--</classes> -->
<!--<packages> -->
<!--<package>your.package.name</package> -->
<!--</packages> -->
</test>
</configuration>
</plugin>
</plugins>
</build>
, 내 안드로이드 응용 프로그램 클래스가 있습니다. onCreate 함수에는 응용 프로그램 클래스가 생성되었다는 간단한 log.d 메시지가 있습니다. 지금 내 테스트 프로젝트에서, 나는 지금 내가 MVN 깨끗한 말할 때
package com.onestopspot.api;
import junit.framework.Test;
import junit.framework.TestSuite;
import android.test.InstrumentationTestRunner;
import android.test.suitebuilder.TestSuiteBuilder;
public class AllTests extends TestSuite {
public static Test suite() {
return new TestSuiteBuilder(AllTests.class)
.includeAllPackagesUnderHere()
.build();
}
}
내가
[INFO] SH28HTV04654_HTC_HTCOneV : java.lang.RuntimeException: Exception during suite construction
at android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests.testSuiteConstructionFailed(TestSuiteBuilder.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:537)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1677)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.test.suitebuilder.TestMethod.instantiateTest(TestMethod.java:87)
at android.test.suitebuilder.TestMethod.createTest(TestMethod.java:73)
at android.test.suitebuilder.TestSuiteBuilder.addTest(TestSuiteBuilder.java:262)
at android.test.suitebuilder.TestSuiteBuilder.build(TestSuiteBuilder.java:184)
at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:371)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4456)
at android.app.ActivityThread.access$1300(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:4987)
at java.lang.reflect.Method.invokeNative(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoClassDefFoundError: com.onestopspot.api.MyApplication
at com.onestopspot.api.ApplicationTests.<init>(ApplicationTests.java:38)
... 18 more
내가 무슨 일을하고 있어요 다음과 같은 예외가 설치 한 다음 클래스를 가지고 com.onestopspot.api이 ? 나는 이틀 동안이 일을 해왔다. 내 프로젝트는 여기에있는 here과 거의 동일한 것으로 보이지만 작동하지 않습니다. 어떤 사람이 나를 도울 수 있다면 내 코드를 보낼 수 있습니까? 미리 감사드립니다.
03-16 19:05:11.068: I/TestRunner(9928): failed: testSuiteConstructionFailed(android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests)
03-16 19:05:11.068: I/TestRunner(9928): ----- begin exception -----
03-16 19:05:11.068: I/TestRunner(9928): java.lang.RuntimeException: Exception during suite construction
03-16 19:05:11.068: I/TestRunner(9928): at android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests.testSuiteConstructionFailed(TestSuiteBuilder.java:238)
03-16 19:05:11.068: I/TestRunner(9928): at java.lang.reflect.Method.invokeNative(Native Method)
03-16 19:05:11.068: I/TestRunner(9928): at java.lang.reflect.Method.invoke(Method.java:511)
03-16 19:05:11.068: I/TestRunner(9928): at junit.framework.TestCase.runTest(TestCase.java:154)
03-16 19:05:11.068: I/TestRunner(9928): at junit.framework.TestCase.runBare(TestCase.java:127)
03-16 19:05:11.068: I/TestRunner(9928): at junit.framework.TestResult$1.protect(TestResult.java:106)
03-16 19:05:11.068: I/TestRunner(9928): at junit.framework.TestResult.runProtected(TestResult.java:124)
03-16 19:05:11.068: I/TestRunner(9928): at junit.framework.TestResult.run(TestResult.java:109)
03-16 19:05:11.068: I/TestRunner(9928): at junit.framework.TestCase.run(TestCase.java:118)
03-16 19:05:11.068: I/TestRunner(9928): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
03-16 19:05:11.068: I/TestRunner(9928): at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
03-16 19:05:11.068: I/TestRunner(9928): at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:537)
03-16 19:05:11.068: I/TestRunner(9928): at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1677)
03-16 19:05:11.068: I/TestRunner(9928): Caused by: java.lang.reflect.InvocationTargetException
03-16 19:05:11.068: I/TestRunner(9928): at java.lang.reflect.Constructor.constructNative(Native Method)
03-16 19:05:11.068: I/TestRunner(9928): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
03-16 19:05:11.068: I/TestRunner(9928): at android.test.suitebuilder.TestMethod.instantiateTest(TestMethod.java:87)
03-16 19:05:11.068: I/TestRunner(9928): at android.test.suitebuilder.TestMethod.createTest(TestMethod.java:73)
03-16 19:05:11.068: I/TestRunner(9928): at android.test.suitebuilder.TestSuiteBuilder.addTest(TestSuiteBuilder.java:262)
03-16 19:05:11.068: I/TestRunner(9928): at android.test.suitebuilder.TestSuiteBuilder.build(TestSuiteBuilder.java:184)
03-16 19:05:11.068: I/TestRunner(9928): at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:371)
03-16 19:05:11.068: I/TestRunner(9928): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4456)
03-16 19:05:11.068: I/TestRunner(9928): at android.app.ActivityThread.access$1300(ActivityThread.java:139)
03-16 19:05:11.068: I/TestRunner(9928): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
03-16 19:05:11.068: I/TestRunner(9928): at android.os.Handler.dispatchMessage(Handler.java:99)
03-16 19:05:11.068: I/TestRunner(9928): at android.os.Looper.loop(Looper.java:156)
03-16 19:05:11.068: I/TestRunner(9928): at android.app.ActivityThread.main(ActivityThread.java:4987)
03-16 19:05:11.068: I/TestRunner(9928): at java.lang.reflect.Method.invokeNative(Native Method)
03-16 19:05:11.068: I/TestRunner(9928): at java.lang.reflect.Method.invoke(Method.java:511)
03-16 19:05:11.068: I/TestRunner(9928): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-16 19:05:11.068: I/TestRunner(9928): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-16 19:05:11.068: I/TestRunner(9928): at dalvik.system.NativeStart.main(Native Method)
03-16 19:05:11.068: I/TestRunner(9928): Caused by: java.lang.NoClassDefFoundError: **com.onestopspot.api.MyApplication**
03-16 19:05:11.068: I/TestRunner(9928): at com.onestopspot.api.APITest.<init>(APITest.java:38)
03-16 19:05:11.068: I/TestRunner(9928): ... 18 more
03-16 19:05:11.068: I/TestRunner(9928): ----- end exception -----
03-16 19:05:11.078: I/TestRunner(9928): finished: testSuiteConstructionFailed(android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests)
03-16 19:05:11.088: I/ActivityManager(1656): Force stopping package com.onestopspot.api uid=10161
com.onestopspot.api.MyApplication은 주 프로젝트의 응용 프로그램 클래스입니다. 내 계측 프로젝트에서 찾을 수없는 것 같습니다.
logcat을 (를) 찾고있는 동안 어떤 추가 정보를 제공하고 있습니까? –
번호. 내가 제공 한 바로 그 오류. 샘플 프로젝트를 보내 주시겠습니까? 그 아주 작은, 단지 2 개의 수업? – user1730789
프로젝트를 실행하기 위해 여기에 설정이나 장비가 없으므로 불행하게도 많은 것을하지는 않습니다. 프로젝트를 최소한으로 줄이려고 했습니까? –