FileDocCategorySizeDatePackage
ORTestCase.javaAPI DocApache log4j 1.2.155642Sat Aug 25 00:09:32 BST 2007org.apache.log4j.or

ORTestCase

public class ORTestCase extends TestCase
Unit test the {@link ObjectRenderer}.
author
Ceki Gülcü
since
1.0

Fields Summary
static UTObjectRenderer
aor
static UTObjectRenderer
bor
static UTObjectRenderer
xor
static UTObjectRenderer
yor
static UTObjectRenderer
oor
static UTObjectRenderer
nor
static UTObjectRenderer
ior
static UTObjectRenderer
cor
static UTObjectRenderer
sor
Constructors Summary
public ORTestCase(String name)

    super(name);
  
Methods Summary
public voidsetUp()

    aor = new UTObjectRenderer("A");
    bor = new UTObjectRenderer("B");
    xor = new UTObjectRenderer("X");    
    yor = new UTObjectRenderer("Y");    

    oor = new UTObjectRenderer("Object");
    nor = new UTObjectRenderer("Number");
    ior = new UTObjectRenderer("Integer");
    cor = new UTObjectRenderer("Comparable");
    sor = new UTObjectRenderer("Serializable");
  
public static junit.framework.Testsuite()

    TestSuite suite = new TestSuite();
    suite.addTest(new ORTestCase("test1"));
    suite.addTest(new ORTestCase("test2"));
    suite.addTest(new ORTestCase("test3"));
    suite.addTest(new ORTestCase("test4"));
    suite.addTest(new ORTestCase("test5"));
    suite.addTest(new ORTestCase("test6"));
    suite.addTest(new ORTestCase("test7"));
    suite.addTest(new ORTestCase("test8"));
    suite.addTest(new ORTestCase("test9"));
    suite.addTest(new ORTestCase("test10"));
    return suite;
  
public voidtest1()

    RendererMap map = new RendererMap();
    ObjectRenderer dr = map.getDefaultRenderer();
    ObjectRenderer r = map.get(Integer.class);
    assertEquals(r, dr);
  
public voidtest10()

    RendererMap map = new RendererMap();
    map.put(X.class, xor); 
    ObjectRenderer r = map.get(B.class);
    assertEquals(r, xor);
  
public voidtest2()

    RendererMap map = new RendererMap();
    map.put(Integer.class, ior);
    ObjectRenderer r = map.get(Integer.class);
    assertEquals(r, ior);

  
public voidtest3()

    RendererMap map = new RendererMap();
    map.put(Number.class, ior);
    ObjectRenderer r = map.get(Integer.class);
    assertEquals(r, ior);
  
public voidtest4()

    RendererMap map = new RendererMap();
    map.put(Object.class, oor);
    ObjectRenderer r = map.get(Integer.class);
    assertEquals(r, oor);
  
public voidtest5()

    RendererMap map = new RendererMap();

    map.put(Object.class, oor);
    map.put(Number.class, nor);
    map.put(Integer.class, ior);

    ObjectRenderer r = map.get(Integer.class);
    assertEquals(r, ior);
  
public voidtest6()

    RendererMap map = new RendererMap();

    map.put(Object.class, oor);
    map.put(Number.class, nor);
 
    ObjectRenderer r = map.get(Integer.class);
    assertEquals(r, nor);
  
public voidtest7()

    RendererMap map = new RendererMap();
    Class comparable = null; 
    try {
        comparable = getClass().forName("java.lang.Comparable");
    } catch(Exception ex) {
        //  likely JDK 1.1
        return;
    }
    map.put(comparable, cor);
    ObjectRenderer r = map.get(Integer.class);
    assertEquals(r, cor);
  
public voidtest8()

    RendererMap map = new RendererMap();
    map.put(Serializable.class, sor); 
    ObjectRenderer r = map.get(Integer.class);
    assertEquals(r, sor);
  
public voidtest9()

    RendererMap map = new RendererMap();
    map.put(Y.class, yor); 
    ObjectRenderer r = map.get(B.class);
    assertEquals(r, yor);