From 72b03fe96c91a27a2c065860cd4d3f6b458b6cbc Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Wed, 8 Nov 2006 00:27:19 +0000 Subject: Tests and fixes for corruption repair. --- .../com/amazon/carbonado/layout/TestLayout.java | 29 ++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'src/test/java/com/amazon/carbonado/layout/TestLayout.java') diff --git a/src/test/java/com/amazon/carbonado/layout/TestLayout.java b/src/test/java/com/amazon/carbonado/layout/TestLayout.java index 9fb97b1..f1edef3 100644 --- a/src/test/java/com/amazon/carbonado/layout/TestLayout.java +++ b/src/test/java/com/amazon/carbonado/layout/TestLayout.java @@ -773,9 +773,17 @@ public class TestLayout extends TestCase { } } - private Class defineStorable(String name, - int extraPropCount, - TypeDesc propType) + /** + * Defines a new Storable with a variable number of extra properties. + * + * @param name name of class to generate + * @param extraPropCount number of properties named "propN" to add, where N + * is the zero-based property number + * @param propType type of each extra property + */ + public static Class defineStorable(String name, + int extraPropCount, + TypeDesc propType) { ClassInjector ci = ClassInjector.createExplicit(name, null); ClassFile cf = new ClassFile(ci.getClassName()); @@ -793,9 +801,16 @@ public class TestLayout extends TestCase { return ci.defineClass(cf); } - private Class defineStorable(String name, - TypeDesc propType, - TypeDesc propType2) + /** + * Defines a new Storable with two extra properties named "prop0" and "prop1". + * + * @param name name of class to generate + * @param propType type of property 0 + * @param propType2 type of property 1 + */ + public static Class defineStorable(String name, + TypeDesc propType, + TypeDesc propType2) { ClassInjector ci = ClassInjector.createExplicit(name, null); ClassFile cf = new ClassFile(ci.getClassName()); @@ -816,7 +831,7 @@ public class TestLayout extends TestCase { return ci.defineClass(cf); } - private void definePrimaryKey(ClassFile cf) { + private static void definePrimaryKey(ClassFile cf) { // Add primary key on inherited "id" property. // @PrimaryKey(value={"id"}) Annotation pk = cf.addRuntimeVisibleAnnotation(TypeDesc.forClass(PrimaryKey.class)); -- cgit v1.2.3