diff options
| author | Brian S. O'Neill <bronee@gmail.com> | 2006-11-08 00:27:19 +0000 |
|---|---|---|
| committer | Brian S. O'Neill <bronee@gmail.com> | 2006-11-08 00:27:19 +0000 |
| commit | 72b03fe96c91a27a2c065860cd4d3f6b458b6cbc (patch) | |
| tree | 5c0a9f4eb5e491912c0f15f3ed481c4a3b59c0e0 /src/test/java/com/amazon/carbonado/layout | |
| parent | ba6161a7d971dbcc4f3bc44ef8ce4c2b3963a955 (diff) | |
Tests and fixes for corruption repair.
Diffstat (limited to 'src/test/java/com/amazon/carbonado/layout')
| -rw-r--r-- | src/test/java/com/amazon/carbonado/layout/TestLayout.java | 29 |
1 files changed, 22 insertions, 7 deletions
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<? extends StorableTestMinimal> 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<? extends StorableTestMinimal> 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<? extends StorableTestMinimal> 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<? extends StorableTestMinimal> 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));
|
