harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apavle...@apache.org
Subject svn commit: r620101 - in /harmony/enhanced/classlib/trunk/modules/awt/src/test: api/java/common/ api/java/unix/ api/java/windows/ impl/ impl/boot/ impl/boot/java/awt/ impl/boot/java/awt/geom/ impl/boot/org/apache/harmony/awt/gl/ impl/boot/org/apache/ha...
Date Sat, 09 Feb 2008 11:05:40 GMT
Author: apavlenko
Date: Sat Feb  9 03:05:37 2008
New Revision: 620101

URL: http://svn.apache.org/viewvc?rev=620101&view=rev
Log:
Applied patches from HARMONY-5451: [classlib][awt] reordering awt tests according to the testing
convention

Added:
    harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/
    harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/
      - copied from r619507, harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/
    harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/org/apache/harmony/awt/tests/image/
    harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/org/apache/harmony/awt/tests/image/BufferedImageTest.java
  (with props)
    harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/unix/
      - copied from r619507, harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/unix/
    harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/windows/
      - copied from r619507, harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/
Removed:
    harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/
    harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/unix/
    harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/
    harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/org/apache/harmony/awt/gl/image/ImageDecoderTest.java
    harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/org/apache/harmony/awt/tests/gl/image/ImageDecoderTest.java
Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/java/awt/BasicStrokeTest.java
    harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/java/awt/SerializeTestCase.java
    harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/java/awt/geom/ShapeTestCase.java
    harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/org/apache/harmony/awt/gl/MultiRectAreaTestCase.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/java/awt/BasicStrokeTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/java/awt/BasicStrokeTest.java?rev=620101&r1=619507&r2=620101&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/java/awt/BasicStrokeTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/java/awt/BasicStrokeTest.java
Sat Feb  9 03:05:37 2008
@@ -45,7 +45,7 @@
     public BasicStrokeTest(String name) {
         super(name);
         
-        String classPath = "shapes/" + Tools.getClasstPath(this.getClass());
+        String classPath = "../resources/shapes/" + Tools.getClasstPath(this.getClass());
         URL url = ClassLoader.getSystemClassLoader().getResource(classPath);
 
         assertNotNull("Path not found " + classPath, url);

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/java/awt/SerializeTestCase.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/java/awt/SerializeTestCase.java?rev=620101&r1=619507&r2=620101&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/java/awt/SerializeTestCase.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/java/awt/SerializeTestCase.java
Sat Feb  9 03:05:37 2008
@@ -35,7 +35,7 @@
     public SerializeTestCase(String name) {
         super(name);
         if (SERIALIZATION_TEST) {
-            String classPath = "serialization/" + Tools.getClasstPath(this.getClass());
+            String classPath = "../resources/serialization/" + Tools.getClasstPath(this.getClass());
             URL url = ClassLoader.getSystemClassLoader().getResource(classPath);
             assertNotNull("Path not found " + classPath, url);
             serializePath = url.getPath();

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/java/awt/geom/ShapeTestCase.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/java/awt/geom/ShapeTestCase.java?rev=620101&r1=619507&r2=620101&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/java/awt/geom/ShapeTestCase.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/java/awt/geom/ShapeTestCase.java
Sat Feb  9 03:05:37 2008
@@ -490,7 +490,7 @@
     
     public ShapeTestCase(String name) {
         super(name);
-        String classPath = "shapes/" + Tools.getClasstPath(this.getClass());
+        String classPath = "../resources/shapes/" + Tools.getClasstPath(this.getClass());
         URL url = ClassLoader.getSystemClassLoader().getResource(classPath);
         assertNotNull("Path not found " + classPath, url);
         shapePath = url.getPath();

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/org/apache/harmony/awt/gl/MultiRectAreaTestCase.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/org/apache/harmony/awt/gl/MultiRectAreaTestCase.java?rev=620101&r1=619507&r2=620101&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/org/apache/harmony/awt/gl/MultiRectAreaTestCase.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/org/apache/harmony/awt/gl/MultiRectAreaTestCase.java
Sat Feb  9 03:05:37 2008
@@ -41,7 +41,7 @@
     public MultiRectAreaTestCase(String name) {
         super(name);
        
-        String classPath = "shapes/" + Tools.getClasstPath(this.getClass());
+        String classPath = "../resources/shapes/" + Tools.getClasstPath(this.getClass());
         URL url = ClassLoader.getSystemClassLoader().getResource(classPath);
 
         assertNotNull("Path not found " + classPath, url);

Added: harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/org/apache/harmony/awt/tests/image/BufferedImageTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/org/apache/harmony/awt/tests/image/BufferedImageTest.java?rev=620101&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/org/apache/harmony/awt/tests/image/BufferedImageTest.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/org/apache/harmony/awt/tests/image/BufferedImageTest.java
Sat Feb  9 03:05:37 2008
@@ -0,0 +1,82 @@
+/*
+ *  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.Frame;
+import java.awt.Image;
+import java.awt.MediaTracker;
+import java.awt.Toolkit;
+import java.awt.image.BufferedImage;
+import java.net.URL;
+import javax.swing.ImageIcon;
+import junit.framework.TestCase;
+
+public class BufferedImageTest extends TestCase {
+
+	private final int EXP_WIDTH = 320;
+	private final int EXP_HEIGHT = 182;
+
+	public void testJpg() throws InterruptedException {
+		decodeImage("utest.jpg");
+	}
+
+	public void testGif() throws InterruptedException {
+		decodeImage("utest.gif");
+	}
+
+	public void testPng() throws InterruptedException {
+		decodeImage("utest.png");
+	}
+
+	private final ClassLoader c = ClassLoader.getSystemClassLoader();
+
+	private Image createImage(String name) {
+		final URL path = c.getResource("../resources/images/" + name);
+		assertNotNull("Resource not found: " + name, path); //$NON-NLS-1$
+		return Toolkit.getDefaultToolkit().createImage(path);
+	}
+
+	private void decodeImage(String name) throws InterruptedException {
+		final Image im = createImage(name);
+		final BufferedImage bim = new BufferedImage(EXP_WIDTH, EXP_HEIGHT,
+				BufferedImage.TYPE_INT_RGB);
+		final Frame f = new Frame();
+		final MediaTracker t = new MediaTracker(f);
+
+		t.addImage(im, 0);
+		t.waitForAll();
+
+		assertEquals(EXP_WIDTH, im.getWidth(null));
+		assertEquals(EXP_HEIGHT, im.getHeight(null));
+
+		bim.getGraphics().drawImage(im, 0, 0, null);
+		int rgbVal = bim.getRGB(0, 0);
+		assertEquals(0xFFFFFFFF, rgbVal);
+	}
+
+	/**
+	 * Regression test for HARMONY-3602
+	 */
+	public void testTerminate() {
+		final Image img = createImage("test.gif");
+
+		System.out.println(new ImageIcon(img)); // Loads the image.
+		img.flush(); // ERROR: Calls Thread.currentThread().interrupt().
+		assertFalse("Current thread is interrupted", Thread.currentThread()
+				.isInterrupted());
+	}
+}

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

Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/test/impl/boot/org/apache/harmony/awt/tests/image/BufferedImageTest.java
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message