harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r425378 - in /incubator/harmony/enhanced/classlib/trunk/modules/beans: build.xml src/test/java/org/apache/harmony/beans/tests/java/beans/ExpressionTest.java
Date Tue, 25 Jul 2006 11:52:50 GMT
Author: mloenko
Date: Tue Jul 25 04:52:50 2006
New Revision: 425378

URL: http://svn.apache.org/viewvc?rev=425378&view=rev
Log:
fixes for HARMONY-966
[classlib][beans] final fixes for ExpressionTest (2)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/beans/build.xml
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/ExpressionTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/build.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/build.xml?rev=425378&r1=425377&r2=425378&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/build.xml (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/build.xml Tue Jul 25 04:52:50
2006
@@ -216,7 +216,6 @@
                     <exclude name="org/apache/harmony/beans/tests/java/beans/EncoderTest.java"
/>
                     <exclude name="org/apache/harmony/beans/tests/java/beans/EventHandlerTest.java"
/>
                     <exclude name="org/apache/harmony/beans/tests/java/beans/EventSetDescriptorTest.java"
/>
-                    <exclude name="org/apache/harmony/beans/tests/java/beans/ExpressionTest.java"
/>
                     <exclude name="org/apache/harmony/beans/tests/java/beans/IndexedPropertyDescriptorTest.java"
/>
                     <exclude name="org/apache/harmony/beans/tests/java/beans/IntrospectorTest.java"
/>
                     <exclude name="org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java"
/>

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/ExpressionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/ExpressionTest.java?rev=425378&r1=425377&r2=425378&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/ExpressionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/ExpressionTest.java
Tue Jul 25 04:52:50 2006
@@ -20,10 +20,7 @@
 import java.util.Arrays;
 import java.util.Vector;
 
-import junit.framework.Test;
 import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
 
 import org.apache.harmony.beans.tests.support.SampleBean;
 
@@ -33,20 +30,6 @@
 public class ExpressionTest extends TestCase {
 
     /**
-     * 
-     */
-    public ExpressionTest() {
-        super();
-    }
-
-    /**
-     * 
-     */
-    public ExpressionTest(String name) {
-        super(name);
-    }
-
-    /**
      * The test checks the correct constructor is initialized
      */
     public void testConstructor() throws Exception {
@@ -112,20 +95,6 @@
         }
     }
 
-    /**
-     * 
-     */
-    public static Test suite() {
-        return new TestSuite(ExpressionTest.class);
-    }
-
-    /**
-     * 
-     */
-    public static void main(String[] args) {
-        TestRunner.run(suite());
-    }
-
     /*
      * Test the constructor under normal conditions.
      */
@@ -592,8 +561,8 @@
         Expression t = new Expression(mo, null, new Object[] { null, null });
         try {
             t.getValue();
-            fail("Should throw NoSuchMethodException!");
-        } catch (NoSuchMethodException ex) {
+            fail("Should throw NullPointerException!");
+        } catch (NullPointerException ex) {
             // expected
         }
     }
@@ -632,20 +601,6 @@
     }
 
     /*
-     * Test the method getValue() with a normal object, an overloaded method and
-     * null arguments.
-     * 
-     * Note: decided by definition position.
-     */
-    public void testGetValue_UnboundedOverloadedMethodsNull() throws Exception {
-        MockObject mo = new MockObject(false);
-        Object[] arguments = new Object[] { null };
-        Expression t = new Expression(mo, "method", arguments);
-        assertEquals("method1-2", t.getValue());
-        MockObject.assertCalled("method1-2", arguments);
-    }
-
-    /*
      * Test the method getValue() with a normal object, the method name "new"
      * and valid arguments.
      */
@@ -714,23 +669,6 @@
     }
 
     /*
-     * Test the method getValue() with a normal object with overloaded
-     * constructors, the method name "new" and null arguments. See Java Language
-     * Specification (15.11) for reference.
-     */
-    public void testGetValue_UnboundedOverloadedConstructorsNull()
-            throws Exception {
-        Object[] arguments = new Object[] { null };
-        Expression t = new Expression(MockObject.class, "new", arguments);
-        try {
-            t.getValue();
-            fail("Should throw NullPointerException!");
-        } catch (NullPointerException ex) {
-            // expected
-        }
-    }
-
-    /*
      * Test the method getValue() with the Class object, a static method name
      * and valid arguments.
      */
@@ -776,9 +714,9 @@
      * Test the method getValue() with the special method Class.forName().
      */
     public void testGetValue_UnboundedClassForName() throws Exception {
-        Object[] arguments = new String[] { this.getClass().getName() };
+        Object[] arguments = new String[] { Expression.class.getName() };
         Expression t = new Expression(Class.class, "forName", arguments);
-        assertSame(this.getClass(), t.getValue());
+        assertSame(Expression.class, t.getValue());
 
         // t = new Expression(String.class, "forName", arguments);
         // assertSame(this.getClass(), t.getValue());
@@ -893,15 +831,6 @@
     }
 
     /*
-     * Test that setValue() is called in the constructor.
-     */
-    public void testConstructor_Value_SetValueCalledIn() {
-        Object o = new Object();
-        MockExpression exp = new MockExpression(o);
-        exp.assertCalled(o);
-    }
-
-    /*
      * Test the method getValue() with two equal specific methods.
      * 
      * Note: decided by definition position! should be ambiguous.
@@ -1139,26 +1068,6 @@
         public static void assertNotCalled() {
             assertEquals(null, calledMethod);
             assertTrue(receivedArguments.isEmpty());
-        }
-    }
-
-    /*
-     * Mock expression to test that setValue() is called in the constructor.
-     */
-    public static class MockExpression extends Expression {
-
-        private Object acceptedValue;
-
-        public MockExpression(Object o) {
-            super(o, null, null, null);
-        }
-
-        public void setValue(Object o) {
-            acceptedValue = o;
-        }
-
-        public void assertCalled(Object o) {
-            assertSame(o, acceptedValue);
         }
     }
 }



Mime
View raw message