У меня есть программа Maven, она прекрасно компилируется.У меня есть этот класс scala ./src/test/java/ResearchTest.scala
import org.junit.Test
class ResearchTest
{
@Test
def justAnExample(): Unit = {
System.out.println("This test method should be running SCALA")
}
}
Когда я запускаю mvn clean test, он не запускает никаких тестов, это вывод:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< poc:webIntTest11111 >-------------------------
[INFO] Building webIntTest11111 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from paypal-snapshots: http://nexus.paypal.com/nexus/content/repositories/snapshots/com/paypal/risk/ars/url-udf/0.0.1-SNAPSHOT/maven-metadata.xml
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ webIntTest11111 ---
[INFO] Deleting /Users/drimoch/IdeaProjects/webIntTest11111/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ webIntTest11111 ---
[WARNING] Using platform encoding (UTF-8 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) @ webIntTest11111 ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ webIntTest11111 ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ webIntTest11111 ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /Users/drimoch/IdeaProjects/webIntTest11111/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ webIntTest11111 ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.356 s
[INFO] Finished at: 2018-10-14T16:46:49+03:00
[INFO] ------------------------------------------------------------------------
У меня также есть этот класс Java ./src/test/java/Tests.java:
import org.junit.Test;
public class Tests {
@Test
public void justAnExample() {
System.out.println("This test method should be run JAVA");
}
}
Когда я сейчас запускаю mvn clean test, он запускает этот тест.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< poc:webIntTest11111 >-------------------------
[INFO] Building webIntTest11111 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from paypal-snapshots: http://nexus.paypal.com/nexus/content/repositories/snapshots/com/paypal/risk/ars/url-udf/0.0.1-SNAPSHOT/maven-metadata.xml
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ webIntTest11111 ---
[INFO] Deleting /Users/drimoch/IdeaProjects/webIntTest11111/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ webIntTest11111 ---
[WARNING] Using platform encoding (UTF-8 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) @ webIntTest11111 ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ webIntTest11111 ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ webIntTest11111 ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /Users/drimoch/IdeaProjects/webIntTest11111/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ webIntTest11111 ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running Tests
This test method should be run JAVA
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.054 s - in Tests
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.514 s
[INFO] Finished at: 2018-10-14T16:59:10+03:00
[INFO] ------------------------------------------------------------------------
Я хочу запустить тесты в Scala, что мне следует изменить?
также, это мой файл 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>poc</groupId>
<artifactId>webIntTest11111</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.paypal.risk.ars.bigdata.webintl</groupId>
<artifactId>webintl-services</artifactId>
<version>2.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.4.2</version>
</dependency>
<dependency>
<groupId>com.paypal.risk.ars.zonkey</groupId>
<artifactId>spark-utils</artifactId>
<type>test-jar</type>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>com.paypal.risk.ars.bigdata.webintl</groupId>
<artifactId>webintl-services</artifactId>
<version>2.5.0</version>
<type>test-jar</type>
</dependency>
</dependencies>
</project>