harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r986223 - in /harmony/enhanced/java/trunk/classlib/modules/imageio/src: main/java/javax/imageio/plugins/jpeg/ main/java/javax/imageio/spi/ test/java/javax/imageio/plugins/ test/java/javax/imageio/plugins/jpeg/
Date Tue, 17 Aug 2010 07:40:01 GMT
Author: hindessm
Date: Tue Aug 17 07:40:00 2010
New Revision: 986223

URL: http://svn.apache.org/viewvc?rev=986223&view=rev
Log:
Applying patch from "[#HARMONY-6615] Add more informative info in the
imageio.plugins.jpeg.JPEGQTable.toString()".

Added:
    harmony/enhanced/java/trunk/classlib/modules/imageio/src/test/java/javax/imageio/plugins/
    harmony/enhanced/java/trunk/classlib/modules/imageio/src/test/java/javax/imageio/plugins/jpeg/
    harmony/enhanced/java/trunk/classlib/modules/imageio/src/test/java/javax/imageio/plugins/jpeg/JPEGQTableTest.java
  (with props)
Modified:
    harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/plugins/jpeg/JPEGQTable.java
    harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/spi/ServiceRegistry.java

Modified: harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/plugins/jpeg/JPEGQTable.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/plugins/jpeg/JPEGQTable.java?rev=986223&r1=986222&r2=986223&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/plugins/jpeg/JPEGQTable.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/plugins/jpeg/JPEGQTable.java
Tue Aug 17 07:40:00 2010
@@ -97,7 +97,18 @@ public class JPEGQTable {
 
     @Override
     public String toString() {
-        //-- TODO more informative info
-        return "JPEGQTable";
+    	StringBuilder sb = new StringBuilder();
+    	
+    	sb.append("JPEGQTable:\n");
+    	for (int i = 0; i < 8; i++) {
+    		sb.append('\t');
+    		for (int j = 0; j < 8; j++) {
+    			sb.append(theTable[i*8+j]);
+    			sb.append(' ');
+    		}
+    		sb.append('\n');
+    	}
+    	
+        return sb.toString();
     }
 }

Modified: harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/spi/ServiceRegistry.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/spi/ServiceRegistry.java?rev=986223&r1=986222&r2=986223&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/spi/ServiceRegistry.java
(original)
+++ harmony/enhanced/java/trunk/classlib/modules/imageio/src/main/java/javax/imageio/spi/ServiceRegistry.java
Tue Aug 17 07:40:00 2010
@@ -30,9 +30,6 @@ import java.util.Map.Entry;
 import org.apache.harmony.luni.util.NotImplementedException;
 import org.apache.harmony.x.imageio.internal.nls.Messages;
 
-/**
- * TODO: add all the methods from the spec
- */
 public class ServiceRegistry {
 
     CategoriesMap categories = new CategoriesMap(this);
@@ -169,7 +166,6 @@ public class ServiceRegistry {
             return providers.unsetOrdering(firstProvider, secondProvider);
         }
         
-        //-- TODO: useOrdering
         Iterator<?> getProviders(Class<?> category, boolean useOrdering) {
             ProvidersMap providers = categories.get(category);
             if (null == providers) {

Added: harmony/enhanced/java/trunk/classlib/modules/imageio/src/test/java/javax/imageio/plugins/jpeg/JPEGQTableTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/imageio/src/test/java/javax/imageio/plugins/jpeg/JPEGQTableTest.java?rev=986223&view=auto
==============================================================================
--- harmony/enhanced/java/trunk/classlib/modules/imageio/src/test/java/javax/imageio/plugins/jpeg/JPEGQTableTest.java
(added)
+++ harmony/enhanced/java/trunk/classlib/modules/imageio/src/test/java/javax/imageio/plugins/jpeg/JPEGQTableTest.java
Tue Aug 17 07:40:00 2010
@@ -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 javax.imageio.plugins.jpeg;
+
+import junit.framework.TestCase;
+
+public class JPEGQTableTest extends TestCase {
+	
+	public void testToString() {
+		String K1Luminance = "JPEGQTable:\n" +
+							 "\t16 11 10 16 24 40 51 61 \n" +
+							 "\t12 12 14 19 26 58 60 55 \n" +
+							 "\t14 13 16 24 40 57 69 56 \n" +
+							 "\t14 17 22 29 51 87 80 62 \n" +
+							 "\t18 22 37 56 68 109 103 77 \n" +
+							 "\t24 35 55 64 81 104 113 92 \n" +
+							 "\t49 64 78 87 103 121 120 101 \n" +
+							 "\t72 92 95 98 112 100 103 99 \n";
+		
+		String K2Chrominance = "JPEGQTable:\n" +
+							   "\t17 18 24 47 99 99 99 99 \n" +
+							   "\t18 21 26 66 99 99 99 99 \n" +
+							   "\t24 26 56 99 99 99 99 99 \n" +
+							   "\t47 66 99 99 99 99 99 99 \n" +
+							   "\t99 99 99 99 99 99 99 99 \n" +
+							   "\t99 99 99 99 99 99 99 99 \n" +
+							   "\t99 99 99 99 99 99 99 99 \n" +
+							   "\t99 99 99 99 99 99 99 99 \n";
+						 
+		assertEquals(K1Luminance, JPEGQTable.K1Luminance.toString());
+		assertEquals(K2Chrominance, JPEGQTable.K2Chrominance.toString());
+	}
+	
+}

Propchange: harmony/enhanced/java/trunk/classlib/modules/imageio/src/test/java/javax/imageio/plugins/jpeg/JPEGQTableTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message