renamed tests

This commit is contained in:
Timo Westkämper 2010-09-11 13:57:04 +00:00
parent 84fa51e885
commit 3ad42e1d3e
12 changed files with 63 additions and 63 deletions

View File

@ -23,44 +23,44 @@ public class AnnotationTest {
private CodeWriter writer = new JavaWriter(w);
@Test
public void testClassAnnotation() throws IOException{
public void ClassAnnotation() throws IOException{
writer.annotation(getClass().getAnnotation(TestAnnotation.class));
assertEquals("@com.mysema.codegen.TestAnnotation(clazz=com.mysema.codegen.AnnotationTest.class, prop2=false)", w.toString().trim());
}
@Test
public void testClassAnnotation2() throws IOException{
public void ClassAnnotation2() throws IOException{
writer.annotation(getClass().getAnnotation(TestAnnotation2.class));
assertEquals("@com.mysema.codegen.TestAnnotation2(\"Hello\")", w.toString().trim());
}
@Test
public void testClassAnnotation3() throws IOException{
public void ClassAnnotation3() throws IOException{
writer.annotation(getClass().getAnnotation(TestAnnotation3.class));
assertEquals("@com.mysema.codegen.TestAnnotation3(type=java.lang.annotation.ElementType.ANNOTATION_TYPE)", w.toString().trim());
}
@Test
public void testMethodAnnotation() throws IOException, SecurityException, NoSuchMethodException {
public void MethodAnnotation() throws IOException, SecurityException, NoSuchMethodException {
writer.annotation(getClass().getMethod("testMethodAnnotation").getAnnotation(Test.class));
assertEquals("@org.junit.Test", w.toString().trim());
}
@Test
public void testMin() throws IOException{
public void Min() throws IOException{
writer.annotation(new MinImpl(10));
assertEquals("@javax.validation.constraints.Min(value=10)", w.toString().trim());
}
@Test
public void testMax() throws IOException{
public void Max() throws IOException{
writer.annotation(new MaxImpl(10));
assertEquals("@javax.validation.constraints.Max(value=10)", w.toString().trim());
}
@Test
public void testNotNull() throws IOException{
public void NotNull() throws IOException{
writer.annotation(new NotNullImpl());
assertEquals("@javax.validation.constraints.NotNull", w.toString().trim());
}

View File

@ -26,7 +26,7 @@ public class ComplexEvaluationTest {
@Test
@SuppressWarnings("unchecked")
public void testComplex(){
public void Complex(){
ClassType resultType = new ClassType(TypeCategory.LIST,List.class, Types.STRING);
StringBuilder source = new StringBuilder();
source.append("java.util.List<String> rv = new java.util.ArrayList<String>();\n");

View File

@ -52,7 +52,7 @@ public class EvaluatorFactoryTest {
}
@Test
public void testSimple(){
public void Simple(){
for (String expr : Arrays.asList("a.equals(b)", "a.startsWith(b)", "a.equalsIgnoreCase(b)")){
long start = System.currentTimeMillis();
evaluate(expr, boolean.class, names, strings, Arrays.asList("a","b"), Collections.<String,Object>emptyMap());
@ -69,7 +69,7 @@ public class EvaluatorFactoryTest {
}
@Test
public void testResults(){
public void Results(){
// String + String
test("a + b", String.class, names, strings, Arrays.asList("Hello ", "World"), "Hello World");
@ -81,7 +81,7 @@ public class EvaluatorFactoryTest {
}
@Test
public void testWithConstants(){
public void WithConstants(){
Map<String,Object> constants = new HashMap<String,Object>();
constants.put("x", "Hello World");
List<Class<?>> types = Arrays.<Class<?>>asList(String.class);
@ -91,7 +91,7 @@ public class EvaluatorFactoryTest {
}
@Test
public void testCustomType(){
public void CustomType(){
test("a.getName()", String.class,
Collections.singletonList("a"), Collections.<Class<?>>singletonList(TestEntity.class),
Arrays.asList(new TestEntity("Hello World")), "Hello World");

View File

@ -58,7 +58,7 @@ public class JavaWriterTest {
@Test
public void testBasic() throws IOException {
public void Basic() throws IOException {
writer.packageDecl("com.mysema.codegen");
writer.imports(IOException.class, StringWriter.class, Test.class);
writer.beginClass(testType);
@ -72,7 +72,7 @@ public class JavaWriterTest {
}
@Test
public void testExtends() throws IOException{
public void Extends() throws IOException{
writer.beginClass(testType2, testSuperType);
writer.end();
@ -80,7 +80,7 @@ public class JavaWriterTest {
}
@Test
public void testImplements() throws IOException{
public void Implements() throws IOException{
writer.beginClass(testType2, null, testInterface1,testInterface2);
writer.end();
@ -88,7 +88,7 @@ public class JavaWriterTest {
}
@Test
public void testInterface() throws IOException{
public void Interface() throws IOException{
writer.packageDecl("com.mysema.codegen");
writer.imports(IOException.class, StringWriter.class, Test.class);
writer.beginInterface(testType);
@ -98,7 +98,7 @@ public class JavaWriterTest {
}
@Test
public void testInterface2() throws IOException{
public void Interface2() throws IOException{
writer.beginInterface(testType2, testInterface1);
writer.end();
@ -106,7 +106,7 @@ public class JavaWriterTest {
}
@Test
public void testJavadoc() throws IOException{
public void Javadoc() throws IOException{
writer.packageDecl("com.mysema.codegen");
writer.imports(IOException.class, StringWriter.class, Test.class);
writer.javadoc("JavaWriterTest is a test class");
@ -118,7 +118,7 @@ public class JavaWriterTest {
@Test
public void testAnnotations() throws IOException{
public void Annotations() throws IOException{
writer.packageDecl("com.mysema.codegen");
writer.imports(IOException.class, StringWriter.class);
writer.annotation(Entity.class);
@ -132,7 +132,7 @@ public class JavaWriterTest {
}
@Test
public void testAnnotations2() throws IOException{
public void Annotations2() throws IOException{
writer.packageDecl("com.mysema.codegen");
writer.imports(IOException.class.getPackage(), StringWriter.class.getPackage());
writer.annotation(Entity.class);
@ -160,7 +160,7 @@ public class JavaWriterTest {
}
@Test
public void testFields() throws IOException{
public void Fields() throws IOException{
writer.beginClass(testType);
// private
writer.privateField(Types.STRING, "privateField");
@ -181,7 +181,7 @@ public class JavaWriterTest {
}
@Test
public void testMethods() throws IOException{
public void Methods() throws IOException{
writer.beginClass(testType);
// private
@ -204,7 +204,7 @@ public class JavaWriterTest {
}
@Test
public void testConstructors() throws IOException{
public void Constructors() throws IOException{
writer.beginClass(testType);
writer.beginConstructor(Arrays.asList(new Parameter("a", Types.STRING), new Parameter("b", Types.STRING)), transformer);
@ -220,7 +220,7 @@ public class JavaWriterTest {
}
@Test
public void testImports() throws IOException{
public void Imports() throws IOException{
writer.staticimports(Arrays.class);
match("/testImports", w.toString());
@ -228,7 +228,7 @@ public class JavaWriterTest {
@Test
public void testImports2() throws IOException{
public void Imports2() throws IOException{
writer.importPackages("java.lang.reflect","java.util");
match("/testImports2", w.toString());
@ -236,7 +236,7 @@ public class JavaWriterTest {
@Test
public void testSuppressWarnings() throws IOException{
public void SuppressWarnings() throws IOException{
writer.suppressWarnings("unused");
writer.privateField(Types.STRING, "test");

View File

@ -14,20 +14,20 @@ import org.junit.Test;
public class MemSourceFileObjectTest {
@Test
public void test(){
public void Simple(){
MemSourceFileObject obj = new MemSourceFileObject("Test", "Hello World");
assertEquals("Hello World", obj.getCharContent(true).toString());
}
@Test
public void testOpenWriter() throws IOException {
public void OpenWriter() throws IOException {
MemSourceFileObject obj = new MemSourceFileObject("Test");
obj.openWriter().write("Hello World");
assertEquals("Hello World", obj.getCharContent(true).toString());
}
@Test
public void testOpenWriter2() throws IOException {
public void OpenWriter2() throws IOException {
MemSourceFileObject obj = new MemSourceFileObject("Test");
obj.openWriter().append("Hello World");
assertEquals("Hello World", obj.getCharContent(true).toString());

View File

@ -96,7 +96,7 @@ public class ScalaWriterTest {
}
@Test
public void testBasic() throws IOException {
public void Basic() throws IOException {
writer.packageDecl("com.mysema.codegen");
writer.imports(IOException.class, StringWriter.class, Test.class);
writer.beginClass(testType);
@ -110,7 +110,7 @@ public class ScalaWriterTest {
}
@Test
public void testExtends() throws IOException{
public void Extends() throws IOException{
writer.beginClass(testType2, testSuperType);
writer.end();
@ -118,7 +118,7 @@ public class ScalaWriterTest {
}
@Test
public void testImplements() throws IOException{
public void Implements() throws IOException{
writer.beginClass(testType2, null, testInterface1,testInterface2);
writer.end();
@ -126,7 +126,7 @@ public class ScalaWriterTest {
}
@Test
public void testInterface() throws IOException{
public void Interface() throws IOException{
writer.packageDecl("com.mysema.codegen");
writer.imports(IOException.class, StringWriter.class, Test.class);
writer.beginInterface(testType);
@ -136,7 +136,7 @@ public class ScalaWriterTest {
}
@Test
public void testInterface2() throws IOException{
public void Interface2() throws IOException{
writer.beginInterface(testType2, testInterface1);
writer.end();
@ -144,7 +144,7 @@ public class ScalaWriterTest {
}
@Test
public void testJavadoc() throws IOException{
public void Javadoc() throws IOException{
writer.packageDecl("com.mysema.codegen");
writer.imports(IOException.class, StringWriter.class, Test.class);
writer.javadoc("JavaWriterTest is a test class");
@ -156,7 +156,7 @@ public class ScalaWriterTest {
@Test
public void testAnnotations() throws IOException{
public void Annotations() throws IOException{
writer.packageDecl("com.mysema.codegen");
writer.imports(IOException.class, StringWriter.class);
writer.annotation(Entity.class);
@ -170,7 +170,7 @@ public class ScalaWriterTest {
}
@Test
public void testAnnotations2() throws IOException{
public void Annotations2() throws IOException{
writer.packageDecl("com.mysema.codegen");
writer.imports(IOException.class.getPackage(), StringWriter.class.getPackage());
writer.annotation(Entity.class);
@ -198,7 +198,7 @@ public class ScalaWriterTest {
}
@Test
public void testFields() throws IOException{
public void Fields() throws IOException{
writer.beginClass(testType);
// private
writer.privateField(Types.STRING, "privateField");
@ -219,7 +219,7 @@ public class ScalaWriterTest {
}
@Test
public void testMethods() throws IOException{
public void Methods() throws IOException{
writer.beginClass(testType);
// private
@ -242,7 +242,7 @@ public class ScalaWriterTest {
}
@Test
public void testConstructors() throws IOException{
public void Constructors() throws IOException{
writer.beginClass(testType);
writer.beginConstructor(Arrays.asList(new Parameter("a", Types.STRING), new Parameter("b", Types.STRING)), transformer);

View File

@ -24,7 +24,7 @@ public class SimpleCompilerTest {
}
@Test
public void testRun() {
public void Run() {
new File("target/out").mkdir();
JavaCompiler compiler = new SimpleCompiler();
System.out.println(compiler.getClass().getName());

View File

@ -23,7 +23,7 @@ public class ClassTypeTest {
// }
@Test
public void as(){
public void As(){
assertEquals(TypeCategory.COMPARABLE, stringType.as(TypeCategory.COMPARABLE).getCategory());
}

View File

@ -20,7 +20,7 @@ public class ConstructorTest {
@Test
public void test(){
Parameter firstName = new Parameter("firstName", new ClassType(TypeCategory.STRING, String.class));
Parameter firstName = new Parameter("firstName", new ClassType(TypeCategory.STRING, String.class));
Parameter lastName = new Parameter("lastName", new ClassType(TypeCategory.STRING, String.class));
Constructor c1 = new Constructor(Arrays.asList(firstName, lastName));
Constructor c2 = new Constructor(Arrays.asList(firstName, lastName));

View File

@ -13,7 +13,7 @@ import org.junit.Test;
public class TypeCategoryTest {
@Test
public void testIsSubCategoryOf() {
public void IsSubCategoryOf() {
assertTrue(TypeCategory.BOOLEAN.isSubCategoryOf(TypeCategory.COMPARABLE));
assertTrue(TypeCategory.STRING.isSubCategoryOf(TypeCategory.COMPARABLE));
assertTrue(TypeCategory.NUMERIC.isSubCategoryOf(TypeCategory.COMPARABLE));

View File

@ -46,7 +46,7 @@ public class TypeTest {
}
@Test
public void testEquals(){
public void Equals(){
assertEquals(locale, locale2);
assertEquals(locale2, locale);
assertEquals(stringList, stringList2);
@ -54,13 +54,13 @@ public class TypeTest {
}
@Test
public void testHashcode(){
public void Hashcode(){
assertEquals(locale.hashCode(), locale2.hashCode());
assertEquals(stringList.hashCode(), stringList2.hashCode());
}
@Test
public void testGetGenericNameBoolean() {
public void GetGenericNameBoolean() {
assertEquals("java.util.Locale",locale.getGenericName(true));
assertEquals("java.util.Locale",locale2.getGenericName(true));
assertEquals("java.util.List<String>",stringList.getGenericName(true));
@ -73,7 +73,7 @@ public class TypeTest {
}
@Test
public void testGetRawName() {
public void GetRawName() {
assertEquals("java.util.Locale",locale.getRawName(packages, classes));
assertEquals("java.util.Locale",locale2.getRawName(packages, classes));
assertEquals("java.util.List",stringList.getRawName(packages, classes));
@ -84,7 +84,7 @@ public class TypeTest {
}
@Test
public void testGetGenericNameBooleanSetOfStringSetOfString() {
public void GetGenericNameBooleanSetOfStringSetOfString() {
assertEquals("java.util.Locale",locale.getGenericName(true, packages, classes));
assertEquals("java.util.Locale",locale2.getGenericName(true, packages, classes));
assertEquals("java.util.List<String>",stringList.getGenericName(true,packages, classes));
@ -92,7 +92,7 @@ public class TypeTest {
}
@Test
public void testGetFullName() {
public void GetFullName() {
assertEquals("java.util.Locale",locale.getFullName());
assertEquals("java.util.Locale",locale2.getFullName());
assertEquals("java.util.List",stringList.getFullName());
@ -100,7 +100,7 @@ public class TypeTest {
}
@Test
public void testGetPackageName() {
public void GetPackageName() {
assertEquals("java.util",locale.getPackageName());
assertEquals("java.util",locale2.getPackageName());
assertEquals("java.util",stringList.getPackageName());
@ -108,7 +108,7 @@ public class TypeTest {
}
@Test
public void testGetParameters() {
public void GetParameters() {
assertEquals(Collections.emptyList(), locale.getParameters());
assertEquals(Collections.emptyList(), locale2.getParameters());
assertEquals(Collections.singletonList(Types.STRING), stringList.getParameters());
@ -116,7 +116,7 @@ public class TypeTest {
}
@Test
public void testGetSimpleName() {
public void GetSimpleName() {
assertEquals("Locale",locale.getSimpleName());
assertEquals("Locale",locale2.getSimpleName());
assertEquals("List",stringList.getSimpleName());
@ -124,12 +124,12 @@ public class TypeTest {
}
@Test
public void testGetJavaClass() {
public void GetJavaClass() {
assertEquals(Locale.class,locale.getJavaClass());
}
@Test
public void testIsFinal() {
public void IsFinal() {
assertTrue(locale.isFinal());
assertTrue(locale2.isFinal());
assertFalse(stringList.isFinal());
@ -139,7 +139,7 @@ public class TypeTest {
}
@Test
public void testIsPrimitive() {
public void IsPrimitive() {
assertFalse(locale.isPrimitive());
assertFalse(locale2.isPrimitive());
assertFalse(stringList.isPrimitive());
@ -147,7 +147,7 @@ public class TypeTest {
}
@Test
public void testGetCategory() {
public void GetCategory() {
assertEquals(TypeCategory.SIMPLE, locale.getCategory());
assertEquals(TypeCategory.SIMPLE, locale2.getCategory());
assertEquals(TypeCategory.LIST, stringList.getCategory());
@ -155,13 +155,13 @@ public class TypeTest {
}
@Test
public void testAs() {
public void As() {
assertEquals(TypeCategory.SIMPLE, stringList.as(TypeCategory.SIMPLE).getCategory());
assertEquals(TypeCategory.SIMPLE, stringList2.as(TypeCategory.SIMPLE).getCategory());
}
@Test
public void testGetPrimitiveName() {
public void GetPrimitiveName() {
assertNull(locale.getPrimitiveName());
assertNull(locale2.getPrimitiveName());
assertNull(stringList.getPrimitiveName());
@ -169,7 +169,7 @@ public class TypeTest {
}
@Test
public void testToString() {
public void ToString() {
assertEquals("java.util.Locale",locale.toString());
assertEquals("java.util.Locale",locale2.toString());
assertEquals("java.util.List<String>",stringList.toString());
@ -177,7 +177,7 @@ public class TypeTest {
}
@Test
public void testAsArrayType() {
public void AsArrayType() {
assertEquals("java.util.Locale[]", locale.asArrayType().getFullName());
assertEquals(TypeCategory.ARRAY, locale.asArrayType().getCategory());
assertEquals("java.util.Locale[]", locale2.asArrayType().getFullName());

View File

@ -22,7 +22,7 @@ import org.junit.Test;
public class ClassUtilsTest {
@Test
public void testGetName() {
public void GetName() {
assertEquals("Object", ClassUtils.getName(Object.class));
assertEquals("Object[]", ClassUtils.getName(Object[].class));
assertEquals("int", ClassUtils.getName(int.class));
@ -33,7 +33,7 @@ public class ClassUtilsTest {
}
@Test
public void testNormalize(){
public void Normalize(){
assertEquals(List.class, ClassUtils.normalize(ArrayList.class));
assertEquals(Set.class, ClassUtils.normalize(HashSet.class));
assertEquals(Map.class, ClassUtils.normalize(HashMap.class));