maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Baptiste Mathus ...@batmat.net>
Subject Re: Error when using Maven for test project. I need a help...
Date Tue, 20 Aug 2013 12:50:10 GMT
Hi,
>From the output it seems more like you might actually have an issue with
your tests, not with maven.

Does this test also fail if you run mvn test from the command line at the
root of that project?

Cheers
Le 20 août 2013 12:04, "HoangVo" <thanhoang@gmail.com> a écrit :

> Hello,
> Im very new to Maven (im researching it)
> Im assigned to project that using maven.
> I got the message when use command: Maven Test in eclipse.
> Currently I don't know how to fix it :(
> Can anybody help me? I really don't know the root cause....
> I appreciate too much...
> I comment main code to find why the bug happens but I have no idea.
> The source code is very simple  (of course there are some heritances...)
>
> ------------------------------------------------------------------------------
> import com.validant.e3.controls.ExtWebDriver;
>
>
> public class TestBase {
>
>         protected ExtWebDriver driver;
>         protected UIMap uimap;
>
>         @BeforeSuite
>         public void beforeSuite(){
>                 System.out.println("Before Suite");
>                 driver = new ExtWebDriver();  // *<--- Error occurs when
> adding this
> sentence*
>
>         }
>
>         @AfterSuite
>         public void afterSuite() {
>                 System.out.println("After Suite");
>         }
>
>         @BeforeTest
>         public void beforeTest()
>     {
>                 System.out.println("Before Test");
>     }
>
>    @AfterTest
>    public void afterTest()
>    {
>            System.out.println("After test");
>    }
>
> }
>
> ------------------------------------------------------------------------------
> The error is:
> [INFO] Scanning for projects...
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building enigma3 1.0
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ e3
> ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] skip non existing resourceDirectory
> D:\WORK\Workspace\Selenium_E3\src\main\resources
> [INFO]
> [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ e3 ---
> [INFO] Nothing to compile - all classes are up to date
> [INFO]
> [INFO] --- maven-resources-plugin:2.4.3:testResources
> (default-testResources) @ e3 ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] skip non existing resourceDirectory
> D:\WORK\Workspace\Selenium_E3\src\test\resources
> [INFO]
> [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @
> e3 ---
> [INFO] Compiling 7 source files to
> D:\WORK\Workspace\Selenium_E3\target\test-classes
> [INFO]
> [INFO] --- maven-surefire-plugin:2.7.1:test (default-test) @ enigma3 ---
> [INFO] Surefire report directory:
> D:\WORK\Workspace\Selenium_E3\target\surefire-reports
>
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running TestSuite
> Before Suite
> Tests run: 6, Failures: 1, Errors: 0, Skipped: 5, Time elapsed: 0.441 sec
> <<< FAILURE!
>
> Results :
>
> Failed tests:
>   beforeSuite(com.validant.enigma3.samples.HoangTest)
>
> Tests run: 6, Failures: 1, Errors: 0, Skipped: 5
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 2.984s
> [INFO] Finished at: Tue Aug 20 16:19:47 ICT 2013
> [INFO] Final Memory: 15M/37M
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-surefire-plugin:2.7.1:test (default-test) on
> project E3: There are test failures.
> [ERROR]
> [ERROR] Please refer to
> D:\WORK\Workspace\Selenium_Enigma3\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
>
>
> -------------------------------------------------------------------------------------------------------------
>
>
> This is my 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>com.validant</groupId>
>   <artifactId>e3</artifactId>
>   <version>1.0</version>
>   <packaging>jar</packaging>
>   <name>e3</name>
>   <url>http://maven.apache.org</url>
>
>   <properties>
>     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>     <timestamp>${maven.build.timestamp}</timestamp>
>
> <maven.build.timestamp.format>yyyyMMdd-HHmm</maven.build.timestamp.format>
>     <ui.map.dir>ui.map</ui.map.dir>
>     <test.suite.dir>test.suites</test.suite.dir>
>     <test.report.dir>test.reports</test.report.dir>
>     <test.tool.dir>tools</test.tool.dir>
>   </properties>
>
>   <dependencies>
>         <dependency>
>                 <groupId>org.testng</groupId>
>                 <artifactId>testng</artifactId>
>                 <version>6.8.5</version>
>         </dependency>
>         <dependency>
>         <groupId>org.uncommons</groupId>
>         <artifactId>reportng</artifactId>
>         <version>1.1.2</version>
>         <exclusions>
>             <exclusion>
>                 <groupId>org.testng</groupId>
>                 <artifactId>testng</artifactId>
>             </exclusion>
>         </exclusions>
>     </dependency>
>     <dependency>
>             <groupId>com.google.inject</groupId>
>             <artifactId>guice</artifactId>
>             <version>3.0</version>
>         </dependency>
>         <dependency>
>                 <groupId>org.seleniumhq.selenium</groupId>
>                 <artifactId>selenium-java</artifactId>
>                 <version>2.33.0</version>
>         </dependency>
>         <dependency>
>                 <groupId>org.seleniumhq.selenium</groupId>
>                 <artifactId>selenium-server</artifactId>
>                 <version>2.33.0</version>
>         </dependency>
>         <dependency>
>           <groupId>org.apache.poi</groupId>
>           <artifactId>poi</artifactId>
>           <version>3.8</version>
>         </dependency>
>   </dependencies>
>
>   <build>
>         <plugins>
>                 <plugin>
>                         <groupId>org.apache.maven.plugins</groupId>
>
> <artifactId>maven-surefire-report-plugin</artifactId>
>                         <version>2.14.1</version>
>                         <configuration>
>
> <reportsDirectory>${test.report.dir}/${timestamp}</reportsDirectory>
>                                 <properties>
>                     <property>
>                         <name>usedefaultlisteners</name>
>                         <value>false</value>
>                     </property>
>                     <property>
>                         <name>listener</name>
>
>
> <value>com.validant.enigma3.reports.ScreenshotHTMLReporter,
> org.uncommons.reportng.JUnitXMLReporter</value>
>                     </property>
>                 </properties>
>
>                                 <systemPropertyVariables>
>
>
> <org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output>
>
>
>
>                                         <test.browser>Chrome</test.browser>
>
>
>
> <test.baseurl>http://docs.sencha.com/extjs/4.2.1/extjs-build/examples
> </test.baseurl>
>
>
>                                 <test.deftimeout>10</test.deftimeout>
>
>
>
> <ui.map.file>${ui.map.dir}/UIMap.xls</ui.map.file>
>
>
> <test.screenshot.dir>${test.report.dir}/${timestamp}</test.screenshot.dir>
>
>
>
>
> <webdriver.chrome.driver>${test.tool.dir}/chromedriver.exe</webdriver.chrome.driver>
>
>
> <webdriver.ie.driver>${test.tool.dir}/IEDriverServer.exe</webdriver.ie.driver>
>                         </systemPropertyVariables>
>
>                                 <suiteXmlFiles>
>
> <suiteXmlFile>${test.suite.dir}/HoangTest.xml</suiteXmlFile>
>                                 </suiteXmlFiles>
>
>
>                             <skip>true</skip>
>
>                         </configuration>
>
>                         <executions>
>                                 <execution>
>                                         <phase>test</phase>
>                                         <goals>
>                                                 <goal>report</goal>
>                                         </goals>
>                                 </execution>
>                         </executions>
>                  </plugin>
>
>         </plugins>
>
>   </build>
> </project>
>
>
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Error-when-using-Maven-for-test-project-I-need-a-help-tp5768218.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message