|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase org.eigenbase.util.ReflectVisitorTest
public class ReflectVisitorTest
ReflectVisitorTest tests ReflectUtil.invokeVisitor(org.eigenbase.util.ReflectiveVisitor, java.lang.Object, java.lang.Class, java.lang.String)
and ReflectiveVisitor
and provides a contrived example of how to use them.
Nested Class Summary | |
---|---|
class |
ReflectVisitorTest.AmbiguousNumber
A class inheriting two interfaces, leading to ambiguity. |
class |
ReflectVisitorTest.CarefulNumberNegater
CarefulNumberNegater implements NumberNegater in a careful fashion by providing overloads for each known subclass of Number and returning the same subclass for the result. |
class |
ReflectVisitorTest.CarelessNumberNegater
CarelessNumberNegater implements NumberNegater in a careless fashion by converting its input to a double and then negating that. |
class |
ReflectVisitorTest.CluelessNumberNegater
CluelessNumberNegater implements NumberNegater in a very broken fashion; does the right thing for Shorts, but attempts to override visit(Object). |
static interface |
ReflectVisitorTest.CrunchableNumber
An interface for introducing ambiguity into the class hierarchy. |
static interface |
ReflectVisitorTest.DiceyNumber
|
static interface |
ReflectVisitorTest.FudgeableNumber
An interface for introducing ambiguity into the class hierarchy. |
class |
ReflectVisitorTest.IndecisiveNumberNegater
IndecisiveNumberNegater implements NumberNegater in such a way that it doesn't know what to do when presented with an AmbiguousNumber. |
class |
ReflectVisitorTest.NumberNegater
NumberNegater defines the abstract base for a computation object capable of negating an arbitrary number. |
class |
ReflectVisitorTest.SomewhatAmbiguousNumber
A class inheriting a root interface (FudgeableNumber) two different ways, which should not lead to ambiguity in some cases. |
class |
ReflectVisitorTest.SomewhatIndecisiveNumberNegater
SomewhatIndecisiveNumberNegater implements NumberNegater in such a way that it knows what to do when presented with a SomewhatAmbiguousNumber. |
Constructor Summary | |
---|---|
ReflectVisitorTest(String name)
|
Method Summary | |
---|---|
void |
testAmbiguity()
Tests for ambiguity detection in method lookup. |
void |
testCarefulNegater()
Tests CarefulNumberNegater. |
void |
testCarelessNegater()
Tests CarelessNumberNegater. |
void |
testCluelessNegater()
Tests CluelessNumberNegater. |
void |
testNonAmbiguity()
Tests that ambiguity detection in method lookup does not kick in when a better match is available. |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ReflectVisitorTest(String name)
Method Detail |
---|
public void testCarelessNegater()
public void testCarefulNegater()
public void testCluelessNegater()
public void testAmbiguity()
public void testNonAmbiguity()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |