Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 51998 invoked from network); 2 Feb 2007 15:10:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Feb 2007 15:10:05 -0000 Received: (qmail 84176 invoked by uid 500); 2 Feb 2007 15:10:11 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 84153 invoked by uid 500); 2 Feb 2007 15:10:11 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 84119 invoked by uid 99); 2 Feb 2007 15:10:10 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Feb 2007 07:10:10 -0800 Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Feb 2007 07:10:03 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 7F3A91A981D; Fri, 2 Feb 2007 07:09:43 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r502621 - in /harmony/enhanced/classlib/trunk/modules/pack200: .classpath README.txt src/test/java/org/apache/harmony/pack200/tests/ClassVersionTest.java Date: Fri, 02 Feb 2007 15:09:43 -0000 To: commits@harmony.apache.org From: ayza@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070202150943.7F3A91A981D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ayza Date: Fri Feb 2 07:09:41 2007 New Revision: 502621 URL: http://svn.apache.org/viewvc?view=rev&rev=502621 Log: Applying another patch for HARMONY-2957 ([classlib][pack200] Update pack200 project layout and ensure 1.4 compatibility) Added: harmony/enhanced/classlib/trunk/modules/pack200/README.txt (with props) Modified: harmony/enhanced/classlib/trunk/modules/pack200/.classpath harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ClassVersionTest.java Modified: harmony/enhanced/classlib/trunk/modules/pack200/.classpath URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/.classpath?view=diff&rev=502621&r1=502620&r2=502621 ============================================================================== --- harmony/enhanced/classlib/trunk/modules/pack200/.classpath (original) +++ harmony/enhanced/classlib/trunk/modules/pack200/.classpath Fri Feb 2 07:09:41 2007 @@ -6,6 +6,5 @@ - Added: harmony/enhanced/classlib/trunk/modules/pack200/README.txt URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/README.txt?view=auto&rev=502621 ============================================================================== --- harmony/enhanced/classlib/trunk/modules/pack200/README.txt (added) +++ harmony/enhanced/classlib/trunk/modules/pack200/README.txt Fri Feb 2 07:09:41 2007 @@ -0,0 +1,5 @@ +The java5 source directory are files that need to be compiled under Java 5. +Currently, they're not visible in the Eclipse project. +At build time, the contents of the src/main/java5 project are be added to the +build (with a 1.5 target) and the src/main/java should be compiled with a +1.4 target. Propchange: harmony/enhanced/classlib/trunk/modules/pack200/README.txt ------------------------------------------------------------------------------ svn:eol-style = native Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ClassVersionTest.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ClassVersionTest.java?view=diff&rev=502621&r1=502620&r2=502621 ============================================================================== --- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ClassVersionTest.java (original) +++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ClassVersionTest.java Fri Feb 2 07:09:41 2007 @@ -25,38 +25,42 @@ import org.apache.harmony.pack200.Segment; public class ClassVersionTest extends TestCase { + private static final int JAVA_15 = 49; + public void testCorrectVersionOfSegment() throws IOException { - InputStream in = Segment.class.getResourceAsStream( - "/org/apache/harmony/pack200/Segment.class"); + InputStream in = Segment.class + .getResourceAsStream("/org/apache/harmony/pack200/Segment.class"); DataInputStream din = new DataInputStream(in); - assertEquals(0xCAFEBABE,din.readInt()); + assertEquals(0xCAFEBABE, din.readInt()); din.readShort(); // MINOR -- don't care - assertTrue("Class file has been compiled with Java 1.5 compatibility" + - " instead of 1.4 or lower",din.readShort() < 49); // 49 = Java 1.5 + assertTrue("Class file has been compiled with Java 1.5 compatibility" + + " instead of 1.4 or lower", din.readShort() < JAVA_15); } - public void testCorrectVersionOfTest() throws IOException { - InputStream in = Segment.class.getResourceAsStream( - "/org/apache/harmony/pack200/tests/ClassVersionTest.class"); + public void testCorrectVersionOfTest() throws IOException { + InputStream in = Segment.class + .getResourceAsStream("/org/apache/harmony/pack200/tests/ClassVersionTest.class"); DataInputStream din = new DataInputStream(in); - assertEquals(0xCAFEBABE,din.readInt()); + assertEquals(0xCAFEBABE, din.readInt()); din.readShort(); // MINOR -- don't care - assertTrue("Class file has been compiled with Java 1.5 compatibility" + - " instead of 1.4 or lower",din.readShort() < 49); // 49 = Java 1.5 + assertTrue("Class file has been compiled with Java 1.5 compatibility" + + " instead of 1.4 or lower", din.readShort() < JAVA_15); } - public void testCorrectVersionOfAdapter() throws IOException { + public void testCorrectVersionOfAdapter() throws IOException { // tests that both the file is on the classpath and that it's been - // compiled correctly, but without actually loading the class - InputStream in = Segment.class.getResourceAsStream( - "/org/apache/harmony/pack200/Pack200Adapter.class"); - DataInputStream din = new DataInputStream(in); + // compiled correctly, but without actually loading the class + InputStream in = Segment.class + .getResourceAsStream("/org/apache/harmony/pack200/Pack200Adapter.class"); + if (in != null) { // If running in Eclipse and Java5 stuff not built/available + DataInputStream din = new DataInputStream(in); - assertEquals(0xCAFEBABE,din.readInt()); - din.readShort(); // MINOR -- don't care - assertTrue("Class file needs 1.5 compatibility", - din.readShort() >= 49); // 49 = Java 1.5 + assertEquals(0xCAFEBABE, din.readInt()); + din.readShort(); // MINOR -- don't care + assertTrue("Class file needs 1.5 compatibility", + din.readShort() >= JAVA_15); + } } }