You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ay...@apache.org on 2007/06/04 11:07:25 UTC
svn commit: r544096 - in /harmony/enhanced/classlib/trunk:
modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/
modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/
modules/luni/src/test/java/tests/...
Author: ayza
Date: Mon Jun 4 02:07:19 2007
New Revision: 544096
URL: http://svn.apache.org/viewvc?view=rev&rev=544096
Log:
Applying patch and test for HARMONY-1718 ([classlib][luni] Junit AWTRunner there is no JU icon on the window title)
Added:
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/gif.java (with props)
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/jpeg.java (with props)
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/png.java (with props)
harmony/enhanced/classlib/trunk/support/src/test/java/tests/resources/Harmony.jpg (with props)
harmony/enhanced/classlib/trunk/support/src/test/java/tests/resources/Harmony.png (with props)
Modified:
harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URLTest.java
Added: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/gif.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/gif.java?view=auto&rev=544096
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/gif.java (added)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/gif.java Mon Jun 4 02:07:19 2007
@@ -0,0 +1,32 @@
+/*
+ * 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.luni.internal.net.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/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/gif.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/jpeg.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/jpeg.java?view=auto&rev=544096
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/jpeg.java (added)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/jpeg.java Mon Jun 4 02:07:19 2007
@@ -0,0 +1,32 @@
+/*
+ * 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.luni.internal.net.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/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/jpeg.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/png.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/png.java?view=auto&rev=544096
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/png.java (added)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/png.java Mon Jun 4 02:07:19 2007
@@ -0,0 +1,32 @@
+/*
+ * 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.luni.internal.net.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/luni/src/main/java/org/apache/harmony/luni/internal/net/www/content/image/png.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URLTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URLTest.java?view=diff&rev=544096&r1=544095&r2=544096
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URLTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URLTest.java Mon Jun 4 02:07:19 2007
@@ -36,6 +36,7 @@
import java.security.Permission;
import java.util.ArrayList;
import java.util.List;
+import java.awt.image.ImageProducer;
import tests.support.Support_Configuration;
import tests.support.Support_Jetty;
@@ -856,6 +857,26 @@
// Support_Resources.deleteTempFolder(resources);
}
}
+
+ // 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[])
Added: harmony/enhanced/classlib/trunk/support/src/test/java/tests/resources/Harmony.jpg
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/support/src/test/java/tests/resources/Harmony.jpg?view=auto&rev=544096
==============================================================================
Binary file - no diff available.
Propchange: harmony/enhanced/classlib/trunk/support/src/test/java/tests/resources/Harmony.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: harmony/enhanced/classlib/trunk/support/src/test/java/tests/resources/Harmony.png
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/support/src/test/java/tests/resources/Harmony.png?view=auto&rev=544096
==============================================================================
Binary file - no diff available.
Propchange: harmony/enhanced/classlib/trunk/support/src/test/java/tests/resources/Harmony.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream