harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r984606 - in /harmony/enhanced/java/branches/java6: ./ classlib/ classlib/depends/libs/ classlib/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ drlvm/ jdktools/ jdktools/modules/jdktools/ jdktools/modules/jdkt...
Date Wed, 11 Aug 2010 22:11:01 GMT
Author: hindessm
Date: Wed Aug 11 22:11:00 2010
New Revision: 984606

URL: http://svn.apache.org/viewvc?rev=984606&view=rev
Log:
Merge change from /harmony/enhanced/java/trunk@984597:

  r984597 | hindessm | 2010-08-11 22:47:02 +0100 (Wed, 11 Aug 2010) | 3 lines
  
  Apply patch and zip from "[#HARMONY-6618] [jdktools] Additional Unit
  tests to increase the functional verification for javac".
  


Added:
    harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/test/resources/
      - copied from r984597, harmony/enhanced/java/trunk/jdktools/modules/jdktools/src/test/resources/
    harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/test/resources/Dependency.jar
      - copied unchanged from r984597, harmony/enhanced/java/trunk/jdktools/modules/jdktools/src/test/resources/Dependency.jar
    harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/test/resources/Sample.java
      - copied unchanged from r984597, harmony/enhanced/java/trunk/jdktools/modules/jdktools/src/test/resources/Sample.java
    harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/test/resources/Simple.java
      - copied unchanged from r984597, harmony/enhanced/java/trunk/jdktools/modules/jdktools/src/test/resources/Simple.java
Modified:
    harmony/enhanced/java/branches/java6/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/depends/libs/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DeflaterInputStreamTest.java
    harmony/enhanced/java/branches/java6/drlvm/   (props changed)
    harmony/enhanced/java/branches/java6/jdktools/   (props changed)
    harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/build.xml
    harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/test/java/org/apache/harmony/tests/tools/javac/MainTest.java

Propchange: harmony/enhanced/java/branches/java6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Aug 11 22:11:00 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/java/branches/mrh:935751-941490
-/harmony/enhanced/java/trunk:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577
+/harmony/enhanced/java/trunk:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597
 /harmony/enhanced/trunk:476395-929252
 /incubator/harmony/enhanced/trunk:292550-476394

Propchange: harmony/enhanced/java/branches/java6/classlib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Aug 11 22:11:00 2010
@@ -1,7 +1,7 @@
 /harmony/enhanced/classlib/trunk:713674-735919,765923-926091,926318-926838
 /harmony/enhanced/classlib/trunk/working_classlib:884014-884286
 /harmony/enhanced/java/branches/mrh/classlib:935751-941490
-/harmony/enhanced/java/trunk/classlib:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577
+/harmony/enhanced/java/trunk/classlib:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597
 /harmony/enhanced/trunk/classlib:476395-929252
 /harmony/enhanced/trunk/working_classlib:476396-920147
 /incubator/harmony/enhanced/trunk/classlib:292550-476394

Propchange: harmony/enhanced/java/branches/java6/classlib/depends/libs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Aug 11 22:11:00 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/classlib/trunk/depends/libs:544451-926091
-/harmony/enhanced/java/trunk/classlib/depends/libs:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577
+/harmony/enhanced/java/trunk/classlib/depends/libs:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597
 /harmony/enhanced/trunk/classlib/depends/libs:476395-929252
 /incubator/harmony/enhanced/trunk/classlib/depends/libs:292550-476394

Modified: harmony/enhanced/java/branches/java6/classlib/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DeflaterInputStreamTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DeflaterInputStreamTest.java?rev=984606&r1=984605&r2=984606&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DeflaterInputStreamTest.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/DeflaterInputStreamTest.java
Wed Aug 11 22:11:00 2010
@@ -20,6 +20,7 @@ package org.apache.harmony.archive.tests
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.zip.DataFormatException;
 import java.util.zip.Deflater;
 import java.util.zip.DeflaterInputStream;
 
@@ -305,6 +306,13 @@ public class DeflaterInputStreamTest ext
     }
 
     /**
+     * @tests DataFormatException#DataFormatException()
+     */
+    public void testDataFormatException() {
+        new DataFormatException();
+    }
+    
+    /**
      * @tests DeflaterInputStream#DeflaterInputStream(InputStream,Deflater)
      */
     public void testDeflaterInputStreamInputStreamDeflater() {

Propchange: harmony/enhanced/java/branches/java6/drlvm/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Aug 11 22:11:00 2010
@@ -1,5 +1,5 @@
 /harmony/enhanced/java/branches/mrh/drlvm:935751-941490
-/harmony/enhanced/java/trunk/drlvm:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577
+/harmony/enhanced/java/trunk/drlvm:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597
 /harmony/enhanced/trunk/drlvm:476395-929252
 /harmony/enhanced/trunk/working_vm:476396-920147
 /incubator/harmony/enhanced/trunk/drlvm:292550-476394

Propchange: harmony/enhanced/java/branches/java6/jdktools/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Aug 11 22:11:00 2010
@@ -1,4 +1,4 @@
-/harmony/enhanced/java/trunk/jdktools:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577
+/harmony/enhanced/java/trunk/jdktools:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597
 /harmony/enhanced/jdktools/trunk:630107-925933
 /harmony/enhanced/trunk/jdktools:476395-929252
 /harmony/enhanced/trunk/working_jdktools:476396-920147

Modified: harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/build.xml?rev=984606&r1=984605&r2=984606&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/build.xml (original)
+++ harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/build.xml Wed Aug 11 22:11:00
2010
@@ -169,6 +169,11 @@
         <mkdir dir="${tests.hdk.dir}" />
 
         <copy file="make/run-test.xml" tofile="${tests.hdk.dir}/build.xml" />
+        
+        <copy todir= "${tests.hdk.dir}/resources">
+           <fileset dir = "src/test/resources" />
+        </copy>
+       
 
         <hy.jar.bin destfile="${tests.hdk.dir}/${hy.module}_tests.jar">
             <fileset dir="bin/test" />

Modified: harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/test/java/org/apache/harmony/tests/tools/javac/MainTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/test/java/org/apache/harmony/tests/tools/javac/MainTest.java?rev=984606&r1=984605&r2=984606&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/test/java/org/apache/harmony/tests/tools/javac/MainTest.java
(original)
+++ harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/test/java/org/apache/harmony/tests/tools/javac/MainTest.java
Wed Aug 11 22:11:00 2010
@@ -17,22 +17,82 @@
 
 package org.apache.harmony.tests.tools.javac;
 
-import junit.framework.TestCase;
+import java.io.File;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 
-import com.sun.tools.javac.Main;
+import junit.framework.TestCase;
 
-public class MainTest extends TestCase {
+import com.sun.tools.javac.Main;
 
-    public void test_main() throws Exception {
-        StringWriter out = new StringWriter();
-        String testStr = "no_this_test.java";
-        Main.compile(new String[]{testStr}, new PrintWriter(out));
-        assertTrue("The output should have " + testStr, out.toString().contains(testStr));
+public class MainTest extends TestCase {	
+	
+	private static final String RESOURCES = "resources/";
+	
+	/**
+	 * Method that takes in a non-existent file and checks the output for the appropriate Error
message
+	 * 
+	 */
+    public void test_nonExists()  {
+        final StringWriter out = new StringWriter();
+        final String testStr = "no_this_test.java";
+        final int rc = Main.compile(new String[]{testStr}, new PrintWriter(out));       

+        assertTrue("The output should have " + testStr, out.toString().contains("missing")
&& rc == 1);
     }
-
-	public void test_nothing() {
-		// bogus test
-	}
+    
+    /**
+     * Method that takes a valid (A pgm without any errors) file and tests for the proper
return code
+     */
+    public void test_exists()
+    {
+    	final StringWriter out = new StringWriter();
+    	final StringWriter err = new StringWriter();
+        	
+    	final String srcFile =  RESOURCES + "Simple.java";
+    	final File f = new File(srcFile);
+    	final String testStr =  f.getAbsolutePath();
+        	
+        final int rc = Main.compile(new String[]{testStr}, new PrintWriter(out), new PrintWriter(err));
       
+        assertTrue("The program " + testStr + " should cleanly compile", err.toString().trim().equals("")
&& rc == 0 );
+    }
+	
+    /**
+     * Method that takes a valid (A program without any errors) file but with unresolved
dependencies and tests for the proper return code     
+     */
+    public void test_existsWithUnresolvedDep()
+    {
+    	final StringWriter out = new StringWriter();
+    	final StringWriter err = new StringWriter();
+        
+    	final String srcFile =  RESOURCES + "Sample.java";
+    	final File f = new File(srcFile);
+    	final String testStr =  f.getAbsolutePath();
+    	
+    	final int rc = Main.compile(new String[]{testStr}, new PrintWriter(out), new PrintWriter(err));
      
+        assertTrue("The program " + testStr + " shouldn't compile due to unresolved dependencies",
err.toString().contains("ERROR") && (rc == 1) );
+    }
+    
+    /**
+     * Method that takes a valid (A program without any errors) file  with Resolved dependencies
and tests for the proper return code    
+     */
+    public void test_existsWithResolvedDep()
+    {
+    	final StringWriter out = new StringWriter();
+    	final StringWriter err = new StringWriter();
+    	
+    	final String srcFile =  RESOURCES + "Sample.java";
+    	final File f = new File(srcFile);
+    	final String testStr =  f.getAbsolutePath();
+        
+        final String option1 =  "-classpath" ;
+        
+        final String jarFile =  RESOURCES + "Dependency.jar";
+    	final File f1 = new File(jarFile);
+    	final String option2 =  f1.getAbsolutePath();
+    	
+        final int rc = Main.compile(new String[]{testStr, option1, option2}, new PrintWriter(out),
new PrintWriter(err));        
+        assertTrue("The program " + testStr + " should compile as dependency " +  option2
+ " is resolved", ! err.toString().contains("ERROR") && (rc == 0) );
+    }  
+	
+	
 }



Mime
View raw message