gdamour 2005/09/10 10:49:08
Modified:
modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr
AbstractCMRTest.java
Log:
GERONIMO-710 Generating DDLs for CMP deployment.
o An Ant task to export the DDL associated to the CMP of an ejb-jar module.
o Refactor CMPEntityBuilder: all the logic specific to the creation of the
three TranQL schemata is refactored within SchemataBuilder.
Revision Changes Path
1.26 +8 -12
openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/AbstractCMRTest.java
Index: AbstractCMRTest.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/cmp/cmr/AbstractCMRTest.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- AbstractCMRTest.java 6 Sep 2005 08:29:36 -0000 1.25
+++ AbstractCMRTest.java 10 Sep 2005 14:49:08 -0000 1.26
@@ -83,6 +83,7 @@
import org.openejb.deployment.KernelHelper;
import org.openejb.deployment.MockConnectionProxyFactory;
import org.openejb.deployment.OpenEJBModuleBuilder;
+import org.openejb.deployment.Schemata;
import org.openejb.deployment.pkgen.TranQLPKGenBuilder;
import org.openejb.dispatch.InterfaceMethodSignature;
import org.openejb.transaction.TransactionPolicySource;
@@ -145,14 +146,8 @@
protected abstract EJBClass getB();
protected void setUp() throws Exception {
-// EmbeddedDataSource eds = new EmbeddedDataSource();
-// eds.setDatabaseName("/home/gianny/derbyDB");
-// eds.setCreateDatabase("create");
-// ds = eds;
-
ds = new AxionDataSource("jdbc:axiondb:testdb");
Connection c = ds.getConnection("root", null);
-// Connection c = ds.getConnection();
buildDBSchema(c);
kernel = DeploymentHelper.setUpKernelWithTransactionManager();
@@ -163,10 +158,6 @@
tmDelegate.setTransactionManager(tm);
- ejbSchema = new EJBSchema("Mock");
- sqlSchema = new BaseSQLSchema("Mock", ds, new
DerbyDBSyntaxtFactory(), new DerbyEJBQLCompilerFactory());
- cacheSchema = new GlobalSchema("Mock");
-
File ejbJarFile = new File(basedir, getEjbJarDD());
File openejbJarFile = new File(basedir, getOpenEjbJarDD());
EjbJarType ejbJarType = ((EjbJarDocument)
XmlObject.Factory.parse(ejbJarFile)).getEjbJar();
@@ -191,7 +182,12 @@
null, null);
ClassLoader cl = Thread.currentThread().getContextClassLoader();
- builder.buildCMPSchema(earContext, j2eeContext, ejbJarType,
openejbJarType, cl, ejbSchema, sqlSchema, cacheSchema, pkGen, null);
+ Schemata schemata = builder.buildCMPSchema(earContext,
j2eeContext, ejbJarType, openejbJarType, cl, pkGen, ds);
+
+ ejbSchema = schemata.getEjbSchema();
+ sqlSchema = schemata.getSqlSchema();
+ cacheSchema = schemata.getGlobalSchema();
+
GBeanData containerIndex = new
GBeanData(ContainerIndex.GBEAN_INFO);
Set patterns = new HashSet();
patterns.add(C_NAME_A);