Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 30466 invoked from network); 15 Dec 2008 13:47:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Dec 2008 13:47:40 -0000 Received: (qmail 26619 invoked by uid 500); 15 Dec 2008 13:47:52 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 26520 invoked by uid 500); 15 Dec 2008 13:47:52 -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 26511 invoked by uid 99); 15 Dec 2008 13:47:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Dec 2008 05:47:52 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Dec 2008 13:47:32 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2D50223888A0; Mon, 15 Dec 2008 05:47:12 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@harmony.apache.org From: tellison@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081215134712.2D50223888A0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 @@ + @@ -364,6 +365,7 @@ + @@ -430,7 +432,12 @@ - + + + + + + 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() { 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[]) */