hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1203149 - in /incubator/hama/trunk/examples: ./ src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/hama/ src/test/java/org/apache/hama/examples/
Date Thu, 17 Nov 2011 11:00:12 GMT
Author: tommaso
Date: Thu Nov 17 11:00:12 2011
New Revision: 1203149

URL: http://svn.apache.org/viewvc?rev=1203149&view=rev
Log:
[HAMA-447] - start adding tests to hama-examples

Added:
    incubator/hama/trunk/examples/src/test/
    incubator/hama/trunk/examples/src/test/java/
    incubator/hama/trunk/examples/src/test/java/org/
    incubator/hama/trunk/examples/src/test/java/org/apache/
    incubator/hama/trunk/examples/src/test/java/org/apache/hama/
    incubator/hama/trunk/examples/src/test/java/org/apache/hama/examples/
    incubator/hama/trunk/examples/src/test/java/org/apache/hama/examples/PiEstimatorTest.java
Modified:
    incubator/hama/trunk/examples/pom.xml

Modified: incubator/hama/trunk/examples/pom.xml
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/examples/pom.xml?rev=1203149&r1=1203148&r2=1203149&view=diff
==============================================================================
--- incubator/hama/trunk/examples/pom.xml (original)
+++ incubator/hama/trunk/examples/pom.xml Thu Nov 17 11:00:12 2011
@@ -45,16 +45,6 @@
   </dependencies>
   <build>
     <finalName>hama-examples-${project.version}</finalName>
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <artifactId>maven-surefire-plugin</artifactId>
-          <configuration>
-            <skipTests>true</skipTests>
-          </configuration>
-        </plugin>
-      </plugins>
-    </pluginManagement>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>

Added: incubator/hama/trunk/examples/src/test/java/org/apache/hama/examples/PiEstimatorTest.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/examples/src/test/java/org/apache/hama/examples/PiEstimatorTest.java?rev=1203149&view=auto
==============================================================================
--- incubator/hama/trunk/examples/src/test/java/org/apache/hama/examples/PiEstimatorTest.java
(added)
+++ incubator/hama/trunk/examples/src/test/java/org/apache/hama/examples/PiEstimatorTest.java
Thu Nov 17 11:00:12 2011
@@ -0,0 +1,30 @@
+package org.apache.hama.examples;
+
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
+
+/**
+ * @author tommaso
+ */
+public class PiEstimatorTest {
+  @Test
+  public void testCorrectPiExecution() {
+    try {
+      PiEstimator.main(new String[]{"10"});
+    } catch (Exception e) {
+      fail(e.getLocalizedMessage());
+    }
+  }
+
+  @Test
+  public void testPiExecutionWithEmptyArgs() {
+    try {
+      PiEstimator.main(new String[10]);
+      fail("PiEstimator should fail if the argument list has size 0");
+    } catch (Exception e) {
+      // everything ok
+    }
+  }
+
+}



Mime
View raw message