labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r606757 - /labs/fluid/slice/src/test/java/org/apache/openjpa/slice/TestConfiguration.java
Date Tue, 25 Dec 2007 06:11:19 GMT
Author: ppoddar
Date: Mon Dec 24 22:11:18 2007
New Revision: 606757

URL: http://svn.apache.org/viewvc?rev=606757&view=rev
Log:
new test added

Added:
    labs/fluid/slice/src/test/java/org/apache/openjpa/slice/TestConfiguration.java

Added: labs/fluid/slice/src/test/java/org/apache/openjpa/slice/TestConfiguration.java
URL: http://svn.apache.org/viewvc/labs/fluid/slice/src/test/java/org/apache/openjpa/slice/TestConfiguration.java?rev=606757&view=auto
==============================================================================
--- labs/fluid/slice/src/test/java/org/apache/openjpa/slice/TestConfiguration.java (added)
+++ labs/fluid/slice/src/test/java/org/apache/openjpa/slice/TestConfiguration.java Mon Dec
24 22:11:18 2007
@@ -0,0 +1,35 @@
+package org.apache.openjpa.slice;
+
+import java.util.Set;
+
+import org.apache.openjpa.kernel.BrokerFactory;
+import org.apache.openjpa.persistence.EntityManagerFactoryImpl;
+import org.apache.openjpa.persistence.test.SingleEMFTestCase;
+import org.apache.openjpa.slice.jdbc.DistributedJDBCBrokerFactory;
+
+public class TestConfiguration extends SingleEMFTestCase {
+	/**
+	 * Tests that user-level configurations are set.
+	 */
+	public void testConfig() {
+		assertTrue(emf.getConfiguration() instanceof DistributedConfiguration);
+		DistributedConfiguration conf = (DistributedConfiguration)emf.getConfiguration();
+		Set<String> slices = conf.getSliceNames();
+		assertTrue(slices.size()>1);
+		assertTrue(slices.contains("One"));
+		assertTrue(slices.contains("Two"));
+		assertEquals("jdbc:mysql://localhost/slice1", conf.getSlice("One").getConnectionURL());
+		assertEquals("jdbc:mysql://localhost/slice2", conf.getSlice("Two").getConnectionURL());
+		BrokerFactory bf = ((EntityManagerFactoryImpl)emf).getBrokerFactory();
+		assertEquals(DistributedJDBCBrokerFactory.class, bf.getClass());
+		assertNotNull(conf.getDistributionPolicyInstance());
+		
+		emf.createEntityManager();
+		
+	}
+	
+    protected String getPersistenceUnitName() {
+        return "per-slice";
+    }
+
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message