summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2006-10-16 01:00:13 +0000
committerBrian S. O'Neill <bronee@gmail.com>2006-10-16 01:00:13 +0000
commitd0ba4bb3ee75fe146c593f2f1e96b8925233a941 (patch)
tree68e901c0ebb84203983b99badbcca661c864cdfa /src/test
parent444d975e2ff1e5186f88dbab85a27e29fa50b3aa (diff)
Incorporated acceptance tests for replicated repository.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/com/amazon/carbonado/repo/replicated/TestStorables.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/test/java/com/amazon/carbonado/repo/replicated/TestStorables.java b/src/test/java/com/amazon/carbonado/repo/replicated/TestStorables.java
new file mode 100644
index 0000000..ba5cf1f
--- /dev/null
+++ b/src/test/java/com/amazon/carbonado/repo/replicated/TestStorables.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2006 Amazon Technologies, Inc. or its affiliates.
+ * Amazon, Amazon.com and Carbonado are trademarks or registered trademarks
+ * of Amazon Technologies, Inc. or its affiliates. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.amazon.carbonado.repo.replicated;
+
+import junit.framework.TestSuite;
+
+import com.amazon.carbonado.Repository;
+import com.amazon.carbonado.RepositoryBuilder;
+import com.amazon.carbonado.RepositoryException;
+import com.amazon.carbonado.TestUtilities;
+
+/**
+ *
+ *
+ * @author Brian S O'Neill
+ */
+public class TestStorables extends com.amazon.carbonado.TestStorables {
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static TestSuite suite() {
+ TestSuite suite = new TestSuite();
+ suite.addTestSuite(TestStorables.class);
+ return suite;
+ }
+
+ public TestStorables(String name) {
+ super(name);
+ }
+
+ @Override
+ protected Repository buildRepository(boolean isMaster) throws RepositoryException {
+ RepositoryBuilder replica = TestUtilities.newTempRepositoryBuilder("rr-replica");
+ RepositoryBuilder master = TestUtilities.newTempRepositoryBuilder("rr-writer");
+ ReplicatedRepositoryBuilder builder = new ReplicatedRepositoryBuilder();
+ builder.setMaster(isMaster);
+ builder.setReplicaRepositoryBuilder(replica);
+ builder.setMasterRepositoryBuilder(master);
+ return builder.build();
+ }
+}