0

我在 ubuntu 中使用 maven、java、sts eclipse 和 selenium ide、svn 和 web 驱动程序。我对这些技术很陌生。我需要知道如何使用 maven 通过终端测试我的项目(网站)。当我使用这个命令mvn clean test。测试和构建将成功..但测试未运行..我使用 selenium ide 记录它。我隐藏了那个sample.java并将它保存在我的项目中..

sampath@sampathkumar-Breeze:~/svn/colorspace_swift/trunk/colorspace-swift$ mvn clean test
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Colorspace Swift 1.0
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact easymock:easymock:jar:2.0 has been relocated to org.easymock:easymock:jar:2.0
[WARNING] The artifact jdbc:jdbc-stdext:jar:2.0 has been relocated to javax.sql:jdbc-stdext:jar:2.0
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ colorspace-swift ---
[INFO] Deleting /home/sampath/svn/colorspace_swift/trunk/colorspace-swift/target
[INFO] 
[INFO] --- maven-antrun-plugin:1.1:run (default) @ colorspace-swift ---
[INFO] Executing tasks
    [mxmlc] Loading configuration file /usr/local/flex_sdk_4.0/frameworks/flex-config.xml
    [mxmlc] /home/sampath/svn/colorspace_swift/trunk/colorspace-swift/src/main/webapp/flex/color_card/BreezeCC.swf is up-to-date and does not have to be rebuilt.
     [copy] Copying 29 files to /home/sampath/svn/colorspace_swift/trunk/colorspace-swift/target/classes/html_messages
     [copy] Copying 12 files to /home/sampath/svn/colorspace_swift/trunk/colorspace-swift/target/classes/help_files
[INFO] Executed tasks
[INFO] 
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ colorspace-swift ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 116 resources
[INFO] 
[INFO] --- maven-resources-plugin:2.3:copy-resources (copy-prod-resources) @ colorspace-swift ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 32 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ colorspace-swift ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 566 source files to /home/sampath/svn/colorspace_swift/trunk/colorspace-swift/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) @ colorspace-swift ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/sampath/svn/colorspace_swift/trunk/colorspace-swift/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ colorspace-swift ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ colorspace-swift ---
[INFO] No tests to run.
[INFO] Surefire report directory: /home/sampath/svn/colorspace_swift/trunk/colorspace-swift/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------

Results :

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

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.154s
[INFO] Finished at: Tue Nov 06 18:15:53 IST 2012
[INFO] Final Memory: 18M/165M
[INFO] ------------------------------------------------------------------------



no test run in project.. please help how to test in maven
4

1 回答 1

1

日志文件中的以下行表明您的测试源不在正确的目录中:

[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ colorspace-swift ---
[INFO] No sources to compile
[INFO] 

将所有测试源放入src/test/java. 然后它们将被建造并maven-surefire-plugin找到它们。

于 2012-11-06T12:53:17.917 回答