Browse Source

[livy] Setup maven for running tests

Erick Tryzelaar 10 năm trước cách đây
mục cha
commit
7782f7b7dc

+ 7 - 0
apps/spark/java/livy-core/pom.xml

@@ -27,6 +27,13 @@
             <version>${logback.version}</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-server</artifactId>
+            <version>${jetty.version}</version>
+            <scope>container</scope>
+        </dependency>
+
         <dependency>
             <groupId>org.eclipse.jetty</groupId>
             <artifactId>jetty-webapp</artifactId>

+ 36 - 2
apps/spark/java/livy-repl/pom.xml

@@ -42,14 +42,19 @@
             <groupId>org.scalatra</groupId>
             <artifactId>scalatra_2.10</artifactId>
             <version>${scalatra.version}</version>
-            <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>org.scalatra</groupId>
             <artifactId>scalatra-json_2.10</artifactId>
             <version>${scalatra.version}</version>
-            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.scalatra</groupId>
+            <artifactId>scalatra-scalatest_2.10</artifactId>
+            <version>${scalatra.version}</version>
+            <scope>test</scope>
         </dependency>
 
         <dependency>
@@ -133,6 +138,35 @@
                 </configuration>
             </plugin>
 
+            <!-- disable surefire -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.7</version>
+                <configuration>
+                    <skipTests>true</skipTests>
+                </configuration>
+            </plugin>
+            <!-- enable scalatest -->
+            <plugin>
+                <groupId>org.scalatest</groupId>
+                <artifactId>scalatest-maven-plugin</artifactId>
+                <version>1.0</version>
+                <configuration>
+                    <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
+                    <junitxml>.</junitxml>
+                    <filereports>WDF TestSuite.txt</filereports>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>test</id>
+                        <goals>
+                            <goal>test</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
         </plugins>
     </build>
 

+ 17 - 0
apps/spark/java/livy-repl/src/test/scala/com/cloudera/hue/livy/repl/python/PythonSessionSpec.scala

@@ -0,0 +1,17 @@
+package com.cloudera.hue.livy.repl.python
+
+import com.cloudera.hue.livy.repl.WebApp
+import org.scalatest.FunSuite
+import org.scalatra.test.scalatest._
+
+class PythonSessionSpec extends ScalatraSuite with FunSuite {
+
+  addServlet(new WebApp(PythonSession.createPython()), "/*")
+
+  test("it works") {
+    get("/") {
+      status should equal (200)
+    }
+  }
+
+}

+ 29 - 0
apps/spark/java/pom.xml

@@ -171,6 +171,35 @@
                     <artifactId>maven-bundle-plugin</artifactId>
                     <version>2.4.0</version>
                 </plugin>
+
+                <!-- disable surefire -->
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-surefire-plugin</artifactId>
+                    <version>2.7</version>
+                    <configuration>
+                        <skipTests>true</skipTests>
+                    </configuration>
+                </plugin>
+                <!-- enable scalatest -->
+                <plugin>
+                    <groupId>org.scalatest</groupId>
+                    <artifactId>scalatest-maven-plugin</artifactId>
+                    <version>1.0</version>
+                    <configuration>
+                        <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
+                        <junitxml>.</junitxml>
+                        <filereports>WDF TestSuite.txt</filereports>
+                    </configuration>
+                    <executions>
+                        <execution>
+                            <id>test</id>
+                            <goals>
+                                <goal>test</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
             </plugins>
         </pluginManagement>