Index: test/java/org/apache/harmony/beans/tests/java/beans/ExpressionTest.java =================================================================== --- test/java/org/apache/harmony/beans/tests/java/beans/ExpressionTest.java (revision 425093) +++ test/java/org/apache/harmony/beans/tests/java/beans/ExpressionTest.java (working copy) @@ -592,8 +592,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 +632,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 +700,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 +745,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 +862,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. @@ -1142,23 +1102,4 @@ } } - /* - * 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); - } - } }