harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r465500 - in /incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows: java/awt/WinWindowRTest.java org/apache/harmony/awt/tests/java/awt/WinFontMetricsTest.java org/apache/harmony/awt/tests/java/awt/WinFontTest.java
Date Thu, 19 Oct 2006 05:27:17 GMT
Author: ndbeyer
Date: Wed Oct 18 22:27:16 2006
New Revision: 465500

URL: http://svn.apache.org/viewvc?view=rev&rev=465500
Log:
Cleanup compiler warnings and JUnit API usage.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/java/awt/WinWindowRTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/org/apache/harmony/awt/tests/java/awt/WinFontMetricsTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/org/apache/harmony/awt/tests/java/awt/WinFontTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/java/awt/WinWindowRTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/java/awt/WinWindowRTest.java?view=diff&rev=465500&r1=465499&r2=465500
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/java/awt/WinWindowRTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/java/awt/WinWindowRTest.java
Wed Oct 18 22:27:16 2006
@@ -41,6 +41,7 @@
     public final void testSetVisible() throws Throwable {
         Frame frame = new Frame();
         frame.addWindowListener(new WindowAdapter() {
+            @Override
             public void windowOpened(WindowEvent e) {
                 try {
                 assertTrue("window is focused before opened", 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/org/apache/harmony/awt/tests/java/awt/WinFontMetricsTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/org/apache/harmony/awt/tests/java/awt/WinFontMetricsTest.java?view=diff&rev=465500&r1=465499&r2=465500
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/org/apache/harmony/awt/tests/java/awt/WinFontMetricsTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/org/apache/harmony/awt/tests/java/awt/WinFontMetricsTest.java
Wed Oct 18 22:27:16 2006
@@ -42,6 +42,8 @@
     Graphics g;
     FontMetrics fm;
     
+    @SuppressWarnings("deprecation")
+    @Override
     public void setUp() throws Exception{
         super.setUp();
         physicalFont = new Font("Arial", Font.PLAIN, 12);
@@ -51,18 +53,11 @@
         g = new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB).getGraphics();
         g.setFont(physicalFont);
     }
-    
-    public WinFontMetricsTest(String name) {
-        super(name);
-    }
-
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
 
     /*
      * Test method for 'java.awt.FontMetrics.FontMetrics(Font)'
      */
+    @SuppressWarnings("deprecation")
     public final void testFontMetrics() {
         FontMetrics fMetrics = Toolkit.getDefaultToolkit().getFontMetrics(physicalFont);
         assertNotNull(fMetrics);
@@ -337,6 +332,7 @@
     /*
      * Test method for 'java.awt.FontMetrics.getMaxDecent()'
      */
+    @SuppressWarnings("deprecation")
     public final void testGetMaxDecent() {
         int maxDecent = 3;
         assertEquals(maxDecent, fm.getMaxDecent());
@@ -378,6 +374,7 @@
 
     }
     
+    @SuppressWarnings("boxing")
     private boolean lmEquals(LineMetrics lm1, LineMetrics lm2){
         assertEquals("Ascent", lm1.getAscent(), lm2.getAscent());
         assertEquals("Baseline Index", lm1.getBaselineIndex(), lm2.getBaselineIndex());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/org/apache/harmony/awt/tests/java/awt/WinFontTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/org/apache/harmony/awt/tests/java/awt/WinFontTest.java?view=diff&rev=465500&r1=465499&r2=465500
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/org/apache/harmony/awt/tests/java/awt/WinFontTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/windows/org/apache/harmony/awt/tests/java/awt/WinFontTest.java
Wed Oct 18 22:27:16 2006
@@ -55,20 +55,13 @@
     final String DIALOG_FAMILY_NAME = "Dialog"; 
     final String DIALOG_FACE_NAME = "Dialog.plain"; 
     
+    @Override
     public void setUp() throws Exception{
         super.setUp();
         physicalFont = new Font("Arial", Font.PLAIN, 12);
         dialogFont = new Font("dialog", Font.PLAIN, 12);
         
     }
-    
-    public WinFontTest(String name) {
-        super(name);
-    }
-
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
 
     /*
      * Test method for 'java.awt.Font.Font(Map<? extends Attribute, ?>)'
@@ -235,6 +228,7 @@
     /*
      * Test method for 'java.awt.Font.deriveFont(AffineTransform)'
      */
+    @SuppressWarnings("unchecked")
     public final void testDeriveFontAffineTransform() {
         AffineTransform transform = new AffineTransform(1, 1, 1, 1, 0, 0);
         Font derivedFont = physicalFont.deriveFont(transform);
@@ -276,6 +270,7 @@
     /*
      * Test method for 'java.awt.Font.deriveFont(int, AffineTransform)'
      */
+    @SuppressWarnings("unchecked")
     public final void testDeriveFontIntAffineTransform() {
         AffineTransform transform = new AffineTransform(1, 1, 1, 1, 0, 0);
         int style = Font.ITALIC;
@@ -335,14 +330,14 @@
         Map<TextAttribute, ?> attributes = physicalFont.getAttributes();
 
         // size
-        assertEquals(physicalFont.getSize(), (Float)attributes.get(TextAttribute.SIZE), 0.0);
+        assertEquals(physicalFont.getSize(), ((Float)attributes.get(TextAttribute.SIZE)).floatValue(),
0F);
         
         // style
         Float posture = (Float)attributes.get(TextAttribute.POSTURE);
-        assertEquals(TextAttribute.POSTURE_REGULAR, posture, .0);
+        assertEquals(TextAttribute.POSTURE_REGULAR.doubleValue(), posture.doubleValue(),
0F);
         
         Float weight = (Float)attributes.get(TextAttribute.WEIGHT);
-        assertEquals(TextAttribute.WEIGHT_REGULAR, weight, .0);
+        assertEquals(TextAttribute.WEIGHT_REGULAR.floatValue(), weight.floatValue(), 0F);
         
         // family
         String family = (String)attributes.get(TextAttribute.FAMILY);
@@ -370,8 +365,8 @@
         Attribute[] attribs = physicalFont.getAvailableAttributes();
         assertNotNull(attribs);
         assertEquals(7, attribs.length);
-        for (int i=0; i < attribs.length; i++){
-            assertTrue(attribs[i] + " attribute missed", attributes.indexOf(attribs[i])!=
-1);
+        for (Attribute element : attribs) {
+            assertTrue(element + " attribute missed", attributes.indexOf(element)!= -1);
         }
 
     }
@@ -561,6 +556,7 @@
     /*
      * Test method for 'java.awt.Font.getPeer()'
      */
+    @SuppressWarnings("deprecation")
     public final void testGetPeer() {
         assertNotNull(physicalFont.getPeer());
     }
@@ -681,7 +677,7 @@
      * Test method for 'java.awt.Font.getSize2D()'
      */
     public final void testGetSize2D() {
-        assertEquals((float)physicalFont.getSize(), physicalFont.getSize2D(), .0);
+        assertEquals(physicalFont.getSize(), physicalFont.getSize2D(), .0);
     }
 
     /*



Mime
View raw message