assertEquals(0, source.getClasses().length);
}
public void testClassExtends() throws Exception {
ClassDef cls = new ClassDef();
builder.beginClass(cls);
builder.endClass();
ClassDef cls2 = new ClassDef();
cls2.extendz.add("Another");
builder.beginClass(cls2);
builder.endClass();
builder.addImport("com.thoughtworks.*");
JavaSource source = builder.getSource();
assertEquals("java.lang.Object", source.getClasses()[0].getSuperClass().getValue());
assertEquals("Another", source.getClasses()[1].getSuperClass().getValue());
assertEquals(0, source.getClasses()[0].getImplements().length);
assertEquals(0, source.getClasses()[1].getImplements().length);
//Add another class and see if Another gets resolved
builder.addPackage("com.thoughtworks");
ClassDef anotherCls = new ClassDef();
anotherCls.name = "Another";
builder.beginClass(anotherCls);
builder.endClass();
assertEquals("com.thoughtworks.Another", source.getClasses()[1].getSuperClass().getValue());