harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r726694 - in /harmony/enhanced/classlib/trunk/modules: awt/ awt/META-INF/ awt/src/main/java/common/org/apache/harmony/awt/www/ awt/src/main/java/common/org/apache/harmony/awt/www/content/ awt/src/main/java/common/org/apache/harmony/awt/www/...
Date Mon, 15 Dec 2008 13:47:11 GMT
Author: tellison
Date: Mon Dec 15 05:47:10 2008
New Revision: 726694

URL: http://svn.apache.org/viewvc?rev=726694&view=rev
Log:
Move URL image content handling from LUNI to AWT module.
Update manifests, tests and build script to reflect the change of packages.


Added:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/gif.java
  (with props)
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/jpeg.java
  (with props)
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/png.java
  (with props)
    harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/harmony/awt/tests/image/ImageLoadingTest.java
  (with props)
Removed:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/gif.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/jpeg.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/png.java
Modified:
    harmony/enhanced/classlib/trunk/modules/awt/META-INF/MANIFEST.MF
    harmony/enhanced/classlib/trunk/modules/awt/build.xml
    harmony/enhanced/classlib/trunk/modules/luni/META-INF/MANIFEST.MF
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLConnection.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/META-INF/MANIFEST.MF?rev=726694&r1=726693&r2=726694&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/META-INF/MANIFEST.MF Mon Dec 15 05:47:10 2008
@@ -38,7 +38,8 @@
  org.apache.harmony.luni.util,
  org.apache.harmony.misc,
  org.apache.harmony.misc.accessors,
- org.apache.harmony.x.print
+ org.apache.harmony.x.print,
+ tests.support.resource;hy_usage=test;resolution:=optional
 Export-Package: java.awt,
  java.awt.color,
  java.awt.datatransfer,
@@ -57,6 +58,7 @@
  org.apache.harmony.awt.gl,
  org.apache.harmony.awt.gl.image,
  org.apache.harmony.awt.gl.windows,
+ org.apache.harmony.awt.www.content.image,
  org.apache.harmony.awt.nativebridge,
  org.apache.harmony.awt.nativebridge.windows,
  org.apache.harmony.awt.text

Modified: harmony/enhanced/classlib/trunk/modules/awt/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/build.xml?rev=726694&r1=726693&r2=726694&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/build.xml Mon Dec 15 05:47:10 2008
@@ -340,6 +340,7 @@
                 </fileset>
             </bootclasspath>
             <classpath location="${basedir}/../../${junit.jar}" />
+            <classpath location="${hy.hdk}/build/test/support.jar" />
         </javac>
 
         <mkdir dir="${hy.awt.bin.test.classes}" />
@@ -364,6 +365,7 @@
                 </fileset>
             </bootclasspath>
             <classpath location="${basedir}/../../${junit.jar}" />
+            <classpath location="${hy.hdk}/build/test/support.jar" />
         </javac>
 
     </target>
@@ -430,7 +432,12 @@
             </assertions>
 
             <jvmarg line="${hy.test.vmargs}" />
-            <classpath location="${hy.awt.bin.test.classes}" />
+            <classpath>
+                <pathelement path="${hy.awt.bin.test.classes}" />
+                <fileset dir="${hy.hdk}/build/test/">
+                    <include name="*.jar" />
+                </fileset>
+            </classpath>
 
             <formatter type="xml" />
 

Added: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/gif.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/gif.java?rev=726694&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/gif.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/gif.java
Mon Dec 15 05:47:10 2008
@@ -0,0 +1,33 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.harmony.awt.www.content.image;
+
+import java.io.IOException;
+import java.net.ContentHandler;
+import java.net.URLConnection;
+
+import org.apache.harmony.awt.gl.image.URLDecodingImageSource;
+
+/**
+ * image/gif content handler.
+ */
+public class gif extends ContentHandler {
+    public Object getContent(URLConnection conn) throws IOException {
+        return new URLDecodingImageSource(conn.getURL());
+    }
+}

Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/gif.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/jpeg.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/jpeg.java?rev=726694&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/jpeg.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/jpeg.java
Mon Dec 15 05:47:10 2008
@@ -0,0 +1,33 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.harmony.awt.www.content.image;
+
+import java.io.IOException;
+import java.net.ContentHandler;
+import java.net.URLConnection;
+
+import org.apache.harmony.awt.gl.image.URLDecodingImageSource;
+
+/**
+ * image/jpeg content handler.
+ */
+public class jpeg extends ContentHandler {
+    public Object getContent(URLConnection conn) throws IOException {
+        return new URLDecodingImageSource(conn.getURL());
+    }
+}

Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/jpeg.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/png.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/png.java?rev=726694&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/png.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/png.java
Mon Dec 15 05:47:10 2008
@@ -0,0 +1,33 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.harmony.awt.www.content.image;
+
+import java.io.IOException;
+import java.net.ContentHandler;
+import java.net.URLConnection;
+
+import org.apache.harmony.awt.gl.image.URLDecodingImageSource;
+
+/**
+ * image/png content handler.
+ */
+public class png extends ContentHandler {
+    public Object getContent(URLConnection conn) throws IOException {
+        return new URLDecodingImageSource(conn.getURL());
+    }
+}

Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/www/content/image/png.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/harmony/awt/tests/image/ImageLoadingTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/harmony/awt/tests/image/ImageLoadingTest.java?rev=726694&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/harmony/awt/tests/image/ImageLoadingTest.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/harmony/awt/tests/image/ImageLoadingTest.java
Mon Dec 15 05:47:10 2008
@@ -0,0 +1,49 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.harmony.awt.tests.image;
+
+import java.awt.image.ImageProducer;
+import java.io.IOException;
+import java.net.URL;
+
+import junit.framework.TestCase;
+import tests.support.resource.Support_Resources;
+
+public class ImageLoadingTest extends TestCase {
+
+    // Regression test for HARMONY-1718
+    public void test_getContent1718() throws IOException {
+        URL url;
+
+        url = Support_Resources.class
+                .getResource(Support_Resources.RESOURCE_PACKAGE + "Harmony.GIF");
+        System.out.println(url);
+        System.out.println(url.getContent());
+        assertTrue("Returned object doesn't implement ImageProducer interface",
+                url.getContent() instanceof ImageProducer);
+
+        url = Support_Resources.class
+                .getResource(Support_Resources.RESOURCE_PACKAGE + "Harmony.jpg");
+        assertTrue("Returned object doesn't implement ImageProducer interface",
+                url.getContent() instanceof ImageProducer);
+
+        url = Support_Resources.class
+                .getResource(Support_Resources.RESOURCE_PACKAGE + "Harmony.png");
+        assertTrue("Returned object doesn't implement ImageProducer interface",
+                url.getContent() instanceof ImageProducer);
+    }
+}

Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/org/apache/harmony/awt/tests/image/ImageLoadingTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/classlib/trunk/modules/luni/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/META-INF/MANIFEST.MF?rev=726694&r1=726693&r2=726694&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/META-INF/MANIFEST.MF Mon Dec 15 05:47:10
2008
@@ -13,7 +13,6 @@
 Eclipse-JREBundle: true
 Eclipse-ExtensibleAPI: true
 Import-Package: com.ibm.icu.lang,
- java.awt,
  java.lang.annotation,
  java.math,
  java.nio,
@@ -29,7 +28,7 @@
  javax.net;resolution:=optional,
  javax.net.ssl,
  javax.xml.parsers,
- org.apache.harmony.awt.gl.image,
+ org.apache.harmony.awt.www.content.image;resolution:=optional,
  org.apache.harmony.misc.accessors,
  org.apache.harmony.nio,
  org.apache.harmony.testframework.serialization;hy_usage=test;resolution:=optional,

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLConnection.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLConnection.java?rev=726694&r1=726693&r2=726694&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLConnection.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLConnection.java
Mon Dec 15 05:47:10 2008
@@ -246,7 +246,8 @@
                     .doPrivileged(new PrivilegedAction<Object>() {
                         public Object run() {
                             try {
-                                String className = "org.apache.harmony.luni.internal.net.www.content."
//$NON-NLS-1$
+                                // Try looking up AWT image content handlers
+                                String className = "org.apache.harmony.awt.www.content."
//$NON-NLS-1$
                                         + typeString;
                                 return Class.forName(className).newInstance();
                             } catch (ClassNotFoundException e) {

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java?rev=726694&r1=726693&r2=726694&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/URLTest.java
Mon Dec 15 05:47:10 2008
@@ -17,7 +17,6 @@
 
 package org.apache.harmony.luni.tests.java.net;
 
-import java.awt.image.ImageProducer;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -747,26 +746,6 @@
         }
     }
 
-    // Regression test for HARMONY-1718
-    public void test_getContent1718() throws IOException {
-        URL url;
-
-        url = Support_Resources.class
-                .getResource(Support_Resources.RESOURCE_PACKAGE + "Harmony.GIF");
-        assertTrue("Returned object doesn't implement ImageProducer interface",
-                url.getContent() instanceof ImageProducer);
-
-        url = Support_Resources.class
-                .getResource(Support_Resources.RESOURCE_PACKAGE + "Harmony.jpg");
-        assertTrue("Returned object doesn't implement ImageProducer interface",
-                url.getContent() instanceof ImageProducer);
-
-        url = Support_Resources.class
-                .getResource(Support_Resources.RESOURCE_PACKAGE + "Harmony.png");
-        assertTrue("Returned object doesn't implement ImageProducer interface",
-                url.getContent() instanceof ImageProducer);
-    }
-
     /**
      * @tests java.net.URL#getContent(class[])
      */



Mime
View raw message