2017-02-22 10 views
0

こんにちは、私はEclipse、Maven、Jenkinsにはとても新しいです。私はEclipseプロジェクトを持っています。次のコードで:EclipseでMavenを使ってテストしますが、Jenkinsから実行すると失敗します

package leantesting; 
import static org.junit.Assert.*; 

import org.junit.After; 
import org.junit.AfterClass; 
import org.junit.Before; 
import org.junit.BeforeClass; 
import org.junit.Test; 
import junit.framework.*; 

import com.hp.lft.sdk.*; 
import com.hp.lft.sdk.web.*; 
import com.hp.lft.sdk.web.Browser; 
import com.hp.lft.sdk.web.BrowserFactory; 
import com.hp.lft.sdk.web.BrowserType; 
import com.hp.lft.sdk.web.EditFieldDescription; 
import com.hp.lft.verifications.*; 


import unittesting.*; 

public class LeanFtTest extends UnitTestClassBase { 

    public LeanFtTest() { 
     //Change this constructor to private if you supply your own public constructor 
    } 

    @BeforeClass 
    public static void setUpBeforeClass() throws Exception { 
     instance = new LeanFtTest(); 
     globalSetup(LeanFtTest.class); 
    } 

    @AfterClass 
    public static void tearDownAfterClass() throws Exception { 
     globalTearDown(); 
    } 

    @Before 
    public void setUp() throws Exception { 
    } 

    @After 
    public void tearDown() throws Exception { 
    } 

    @Test 
    public void Chrome() throws GeneralLeanFtException { 
     Crossbrowser(BrowserType.CHROME); 

    } 

    @Test 
    public void Firefox() throws GeneralLeanFtException { 
     Crossbrowser(BrowserType.FIREFOX); 

    } 
    @Test 
    public void InternetExplorer() throws GeneralLeanFtException { 
     Crossbrowser(BrowserType.INTERNET_EXPLORER); 

    } 

    public void Crossbrowser(BrowserType pbrowser) throws GeneralLeanFtException { 

     Browser browser = BrowserFactory.launch(pbrowser); 

     browser.navigate("http://newtours.demoaut.com/"); 

     browser.describe(EditField.class, new EditFieldDescription.Builder() 
       .tagName("INPUT").name("userName").build()).setValue("Amir"); 
     browser.describe(EditField.class, new EditFieldDescription.Builder() 
       .type("password").tagName("INPUT").name("password").build()).setSecure("58a30b6a0708b8909633e81f"); 
     browser.describe(Image.class, new ImageDescription.Builder() 
       .alt("Sign-In").type(com.hp.lft.sdk.web.ImageType.BUTTON).tagName("INPUT").build()).click(); 


     browser.close(); 



     //AppModel myModel = new AppModel(browser); 

     //myModel.WelcomeMercuryToursPage().UserName().setValue("Amir"); 
     //myModel.WelcomeMercuryToursPage().Password().setValue("hpe"); 
     //myModel.WelcomeMercuryToursPage().Login().click(); 


    } 



} 

私のpom.xmlは、次のようになります。

<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>lean.testing</groupId> 
    <artifactId>leantesting</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>leantest</name> 
    <description>leantesting project</description> 
    <dependencies> 
     <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.12</version> 
     <scope>test</scope> 
     </dependency> 
     <dependency> 
     <groupId>com.hp.lft</groupId> 
     <artifactId>unittesting</artifactId> 
     <version>14.0.0</version> 
     <scope>test</scope> 
     </dependency> 
     <dependency> 
     <groupId>com.hp.lft</groupId> 
     <artifactId>sdk</artifactId> 
     <version>14.0.0</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
     <groupId>com.hp.lft</groupId> 
     <artifactId>report</artifactId> 
     <version>14.0.0</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
     <groupId>com.hp.lft</groupId> 
     <artifactId>reportbuilder</artifactId> 
     <version>14.0.0</version> 
     <scope>test</scope> 
     </dependency> 
    </dependencies> 
    <dependencyManagement> 
     <dependencies> 
      <dependency> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-plugin</artifactId> 
       <version>2.19.1</version> 
       <type>maven-plugin</type> 
       <scope>test</scope> 
      </dependency> 
      <dependency> 
       <groupId>org.apache.maven.surefire</groupId> 
       <artifactId>maven-surefire-common</artifactId> 
       <version>2.19.1</version> 
       <scope>test</scope> 
      </dependency> 
      <dependency> 
       <groupId>org.apache.maven.surefire</groupId> 
       <artifactId>surefire-api</artifactId> 
       <version>2.12.4</version> 
      </dependency> 
      <dependency> 
       <groupId>org.apache.maven.surefire</groupId> 
       <artifactId>surefire-booter</artifactId> 
       <version>2.12.4</version> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 
</project> 

有効のpom.xml:Mavenのテストを使って日食から渡しているなぜ私は見当がつかない

<?xml version="1.0"?> 
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>lean.testing</groupId> 
    <artifactId>leantesting</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>leantest</name> 
    <description>leantesting project</description> 
    <dependencyManagement> 
    <dependencies> 
     <dependency> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-surefire-plugin</artifactId> 
     <version>2.19.1</version> 
     <type>maven-plugin</type> 
     <scope>test</scope> 
     </dependency> 
     <dependency> 
     <groupId>org.apache.maven.surefire</groupId> 
     <artifactId>maven-surefire-common</artifactId> 
     <version>2.19.1</version> 
     <scope>test</scope> 
     </dependency> 
     <dependency> 
     <groupId>org.apache.maven.surefire</groupId> 
     <artifactId>surefire-api</artifactId> 
     <version>2.12.4</version> 
     </dependency> 
     <dependency> 
     <groupId>org.apache.maven.surefire</groupId> 
     <artifactId>surefire-booter</artifactId> 
     <version>2.12.4</version> 
     </dependency> 
    </dependencies> 
    </dependencyManagement> 
    <dependencies> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.12</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.hp.lft</groupId> 
     <artifactId>unittesting</artifactId> 
     <version>14.0.0</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.hp.lft</groupId> 
     <artifactId>sdk</artifactId> 
     <version>14.0.0</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.hp.lft</groupId> 
     <artifactId>report</artifactId> 
     <version>14.0.0</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.hp.lft</groupId> 
     <artifactId>reportbuilder</artifactId> 
     <version>14.0.0</version> 
     <scope>test</scope> 
    </dependency> 
    </dependencies> 
    <repositories> 
    <repository> 
     <snapshots> 
     <enabled>false</enabled> 
     </snapshots> 
     <id>central</id> 
     <name>Central Repository</name> 
     <url>https://repo.maven.apache.org/maven2</url> 
    </repository> 
    </repositories> 
    <pluginRepositories> 
    <pluginRepository> 
     <releases> 
     <updatePolicy>never</updatePolicy> 
     </releases> 
     <snapshots> 
     <enabled>false</enabled> 
     </snapshots> 
     <id>central</id> 
     <name>Central Repository</name> 
     <url>https://repo.maven.apache.org/maven2</url> 
    </pluginRepository> 
    </pluginRepositories> 
    <build> 
    <sourceDirectory>C:\Users\khanami\workspace\leantesting\src\main\java</sourceDirectory> 
    <scriptSourceDirectory>C:\Users\khanami\workspace\leantesting\src\main\scripts</scriptSourceDirectory> 
    <testSourceDirectory>C:\Users\khanami\workspace\leantesting\src\test\java</testSourceDirectory> 
    <outputDirectory>C:\Users\khanami\workspace\leantesting\target\classes</outputDirectory> 
    <testOutputDirectory>C:\Users\khanami\workspace\leantesting\target\test-classes</testOutputDirectory> 
    <resources> 
     <resource> 
     <directory>C:\Users\khanami\workspace\leantesting\src\main\resources</directory> 
     </resource> 
    </resources> 
    <testResources> 
     <testResource> 
     <directory>C:\Users\khanami\workspace\leantesting\src\test\resources</directory> 
     </testResource> 
    </testResources> 
    <directory>C:\Users\khanami\workspace\leantesting\target</directory> 
    <finalName>leantesting-0.0.1-SNAPSHOT</finalName> 
    <pluginManagement> 
     <plugins> 
     <plugin> 
      <artifactId>maven-antrun-plugin</artifactId> 
      <version>1.3</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-assembly-plugin</artifactId> 
      <version>2.2-beta-5</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-dependency-plugin</artifactId> 
      <version>2.8</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-release-plugin</artifactId> 
      <version>2.3.2</version> 
     </plugin> 
     </plugins> 
    </pluginManagement> 
    <plugins> 
     <plugin> 
     <artifactId>maven-clean-plugin</artifactId> 
     <version>2.5</version> 
     <executions> 
      <execution> 
      <id>default-clean</id> 
      <phase>clean</phase> 
      <goals> 
       <goal>clean</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-resources-plugin</artifactId> 
     <version>2.6</version> 
     <executions> 
      <execution> 
      <id>default-testResources</id> 
      <phase>process-test-resources</phase> 
      <goals> 
       <goal>testResources</goal> 
      </goals> 
      </execution> 
      <execution> 
      <id>default-resources</id> 
      <phase>process-resources</phase> 
      <goals> 
       <goal>resources</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-jar-plugin</artifactId> 
     <version>2.4</version> 
     <executions> 
      <execution> 
      <id>default-jar</id> 
      <phase>package</phase> 
      <goals> 
       <goal>jar</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <version>3.1</version> 
     <executions> 
      <execution> 
      <id>default-compile</id> 
      <phase>compile</phase> 
      <goals> 
       <goal>compile</goal> 
      </goals> 
      </execution> 
      <execution> 
      <id>default-testCompile</id> 
      <phase>test-compile</phase> 
      <goals> 
       <goal>testCompile</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-surefire-plugin</artifactId> 
     <version>2.12.4</version> 
     <executions> 
      <execution> 
      <id>default-test</id> 
      <phase>test</phase> 
      <goals> 
       <goal>test</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-install-plugin</artifactId> 
     <version>2.4</version> 
     <executions> 
      <execution> 
      <id>default-install</id> 
      <phase>install</phase> 
      <goals> 
       <goal>install</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-deploy-plugin</artifactId> 
     <version>2.7</version> 
     <executions> 
      <execution> 
      <id>default-deploy</id> 
      <phase>deploy</phase> 
      <goals> 
       <goal>deploy</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-site-plugin</artifactId> 
     <version>3.3</version> 
     <executions> 
      <execution> 
      <id>default-site</id> 
      <phase>site</phase> 
      <goals> 
       <goal>site</goal> 
      </goals> 
      <configuration> 
       <outputDirectory>C:\Users\khanami\workspace\leantesting\target\site</outputDirectory> 
       <reportPlugins> 
       <reportPlugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-project-info-reports-plugin</artifactId> 
       </reportPlugin> 
       </reportPlugins> 
      </configuration> 
      </execution> 
      <execution> 
      <id>default-deploy</id> 
      <phase>site-deploy</phase> 
      <goals> 
       <goal>deploy</goal> 
      </goals> 
      <configuration> 
       <outputDirectory>C:\Users\khanami\workspace\leantesting\target\site</outputDirectory> 
       <reportPlugins> 
       <reportPlugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-project-info-reports-plugin</artifactId> 
       </reportPlugin> 
       </reportPlugins> 
      </configuration> 
      </execution> 
     </executions> 
     <configuration> 
      <outputDirectory>C:\Users\khanami\workspace\leantesting\target\site</outputDirectory> 
      <reportPlugins> 
      <reportPlugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-project-info-reports-plugin</artifactId> 
      </reportPlugin> 
      </reportPlugins> 
     </configuration> 
     </plugin> 
    </plugins> 
    </build> 
    <reporting> 
    <outputDirectory>C:\Users\khanami\workspace\leantesting\target\site</outputDirectory> 
    </reporting> 
</project> 

ログは次のようになります(日食)。

[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building leantest 0.0.1-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ leantesting --- 
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] Copying 0 resource 
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ leantesting --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ leantesting --- 
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] Copying 0 resource 
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ leantesting --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ leantesting --- 
[INFO] Surefire report directory: C:\Users\khanami\workspace\leantesting\target\surefire-reports 

------------------------------------------------------- 
T E S T S 
------------------------------------------------------- 
Running leantesting.LeanFtTest 
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 31.443 sec 
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook 
Picked up _JAVA_OPTIONS: -Xbootclasspath/a:"C:\Program Files (x86)\HP\Unified Functional Testing\bin\java_shared\classes\jasmine.jar" 

Results : 

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

[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD SUCCESS 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 33.583 s 
[INFO] Finished at: 2017-02-22T09:02:23+01:00 
[INFO] Final Memory: 11M/368M 
[INFO] ------------------------------------------------------------------------ 
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook 
Picked up _JAVA_OPTIONS: -Xbootclasspath/a:"C:\Program Files (x86)\HP\Unified Functional Testing\bin\java_shared\classes\jasmine.jar" 

Jenkinsでは、次のようになります。

Building in workspace C:\Program Files (x86)\Jenkins\workspace\Maven-LeanFT-TestCompile-eclipse 
Parsing POMs 
Established TCP socket on 64573 
[leantesting] $ "C:\Program Files\Java\jdk1.8.0_121\/bin/java" -Xms256m -Xmx512m -cp "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-agent-1.8.1.jar;C:\Program Files\Apache Software\apache-maven-3.3.9\boot\plexus-classworlds-2.5.2.jar;C:\Program Files\Apache Software\apache-maven-3.3.9/conf/logging" jenkins.maven3.agent.Maven33Main "C:\Program Files\Apache Software\apache-maven-3.3.9" "C:\Program Files (x86)\Jenkins\war\WEB-INF\lib\remoting-3.4.1.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-interceptor-1.8.1.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.8.1.jar" 64573 
<===[JENKINS REMOTING CAPACITY]===>channel started 
Executing Maven: -B -f C:\Users\khanami\workspace\leantesting\pom.xml -Dmaven.repo.local=C:\Program Files (x86)\Jenkins\workspace\Maven-LeanFT-TestCompile-eclipse\.repository install 
[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building leantest 0.0.1-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ leantesting --- 
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] Copying 0 resource 
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ leantesting --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ leantesting --- 
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] Copying 0 resource 
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ leantesting --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ leantesting --- 
[INFO] Surefire report directory: C:\Users\khanami\workspace\leantesting\target\surefire-reports 

------------------------------------------------------- 
T E S T S 
------------------------------------------------------- 
Running leantesting.LeanFtTest 
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.301 sec <<< FAILURE! 
leantesting.LeanFtTest Time elapsed: 0.3 sec <<< ERROR! 
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 
    at java.util.ArrayList.rangeCheck(ArrayList.java:653) 
    at java.util.ArrayList.get(ArrayList.java:429) 
    at com.hp.lft.common.WindowsOSHelper.getCurrentSessionId(WindowsOSHelper.java:243) 
    at com.hp.lft.common.OSHelperBase.getProcessesByName(OSHelperBase.java:12) 
    at com.hp.lft.common.OSHelperBase.getRuntimeProcesses(OSHelperBase.java:17) 
    at com.hp.lft.sdk.internal.ServerLauncher.launchIfNeeded(ServerLauncher.java:30) 
    at com.hp.lft.unittesting.UnitTestBase.initSDK(UnitTestBase.java:184) 
    at com.hp.lft.unittesting.UnitTestBase.init(UnitTestBase.java:176) 
    at com.hp.lft.unittesting.UnitTestBase.classSetup(UnitTestBase.java:50) 
    at unittesting.UnitTestClassBase.globalSetup(UnitTestClassBase.java:19) 
    at leantesting.LeanFtTest.setUpBeforeClass(LeanFtTest.java:33) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) 
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) 
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) 
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) 
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) 
    at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55) 
    at org.junit.rules.RunRules.evaluate(RunRules.java:20) 
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363) 
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) 
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) 
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) 
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) 
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) 
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) 
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) 

leantesting.LeanFtTest Time elapsed: 0.301 sec <<< ERROR! 
java.lang.NullPointerException 
    at com.hp.lft.report.DefaultReporter.closeAllReportLevels(DefaultReporter.java:177) 
    at com.hp.lft.unittesting.UnitTestBase.closeReportLevels(UnitTestBase.java:172) 
    at com.hp.lft.unittesting.UnitTestBase.classTearDown(UnitTestBase.java:65) 
    at unittesting.UnitTestClassBase.globalTearDown(UnitTestClassBase.java:33) 
    at leantesting.LeanFtTest.tearDownAfterClass(LeanFtTest.java:38) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) 
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) 
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) 
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33) 
    at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55) 
    at org.junit.rules.RunRules.evaluate(RunRules.java:20) 
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363) 
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) 
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) 
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) 
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) 
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) 
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) 
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) 

Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook 
Picked up _JAVA_OPTIONS: -Xbootclasspath/a:"C:\Program Files (x86)\HP\Unified Functional Testing\bin\java_shared\classes\jasmine.jar" 

Results : 

Tests in error: 
    leantesting.LeanFtTest: Index: 0, Size: 0 
    leantesting.LeanFtTest 

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

[ERROR] There are test failures. 

Please refer to C:\Users\khanami\workspace\leantesting\target\surefire-reports for the individual test results. 
[JENKINS] Recording test results 
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ leantesting --- 
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ leantesting --- 
[INFO] Installing C:\Users\khanami\workspace\leantesting\target\leantesting-0.0.1-SNAPSHOT.jar to C:\Program Files (x86)\Jenkins\workspace\Maven-LeanFT-TestCompile-eclipse\.repository\lean\testing\leantesting\0.0.1-SNAPSHOT\leantesting-0.0.1-SNAPSHOT.jar 
[INFO] Installing C:\Users\khanami\workspace\leantesting\pom.xml to C:\Program Files (x86)\Jenkins\workspace\Maven-LeanFT-TestCompile-eclipse\.repository\lean\testing\leantesting\0.0.1-SNAPSHOT\leantesting-0.0.1-SNAPSHOT.pom 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD SUCCESS 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 4.417 s 
[INFO] Finished at: 2017-02-22T09:15:42+01:00 
[INFO] Final Memory: 16M/325M 
[INFO] ------------------------------------------------------------------------ 
Waiting for Jenkins to finish collecting data 
[JENKINS] Archiving C:\Users\khanami\workspace\leantesting\pom.xml to lean.testing/leantesting/0.0.1-SNAPSHOT/leantesting-0.0.1-SNAPSHOT.pom 
[JENKINS] Archiving C:\Users\khanami\workspace\leantesting\target\leantesting-0.0.1-SNAPSHOT.jar to lean.testing/leantesting/0.0.1-SNAPSHOT/leantesting-0.0.1-SNAPSHOT.jar 
channel stopped 
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook 
Picked up _JAVA_OPTIONS: -Xbootclasspath/a:"C:\Program Files (x86)\HP\Unified Functional Testing\bin\java_shared\classes\jasmine.jar" 
Finished: UNSTABLE 

助けてください:

乾杯、 アミール

+0

Jenkinsのenvとlocalが同じであることを確認できますか。 javaバージョン? mvnバージョン? settings.xmlファイル? –

+0

jenkinsがローカルマシンで実行されています。それは奇妙なことだ。 Mavenテストを使ってeclipseでテストをパスします。 mavenテストを使用するジェンキンでは失敗します。 settings.xmlは何を意味していますか。 –

+0

デバッグadd -Xでmvnを実行すると、さらに詳しい情報が得られます。 質問が失敗した理由は何ですか? –

答えて

0

解決しよう! Windows下のJenkinsサービスがシステムローカルアカウントで実行されていました。私は私のuserprofileの下で実行するように変更しました。

関連する問題