Iron out SLC migration
authorMathieu Baudier <mbaudier@argeo.org>
Tue, 17 Feb 2015 08:54:49 +0000 (08:54 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Tue, 17 Feb 2015 08:54:49 +0000 (08:54 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@7911 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

19 files changed:
demo/modules/pom.xml
dep/org.argeo.slc.dep.backend/pom.xml
dep/org.argeo.slc.dep.detached/p2.inf [deleted file]
dep/org.argeo.slc.dep.detached/pom.xml [deleted file]
dep/org.argeo.slc.dep.eclipse/pom.xml
dep/org.argeo.slc.dep.minimal/pom.xml
dep/org.argeo.slc.dep.rap/pom.xml
legacy/plugins/org.argeo.slc.client.rcp/.classpath
org.argeo.slc.client.rap/.classpath
org.argeo.slc.client.rap/bnd.bnd
org.argeo.slc.client.rap/plugin.xml
org.argeo.slc.client.ui.dist/.classpath
org.argeo.slc.client.ui.dist/bnd.bnd
org.argeo.slc.client.ui/.classpath
org.argeo.slc.client.ui/bnd.bnd
org.argeo.slc.unit/bnd.bnd
org.argeo.slc.unit/pom.xml
org.argeo.slc.unit/src/org/argeo/slc/unit/db/DbUnitDeployment.java [new file with mode: 0644]
org.argeo.slc.unit/src/org/argeo/slc/unit/db/DbUnitDeploymentData.java [new file with mode: 0644]

index 442d5056ac3e76cad03ff16bc5a1734cffed2646..4bf6764b732f43454645331176aed66cc2b2d1b3 100644 (file)
@@ -35,9 +35,6 @@
                                                <SLC-ExecutionModule>default</SLC-ExecutionModule>
                                                <!-- Minimal imports + some optional convenience imports -->
                                                <Import-Package>
-                                                       net.sf.cglib.core,
-                                                       net.sf.cglib.proxy,
-                                                       net.sf.cglib.reflect,
                                                        org.aopalliance.aop,
                                                        org.argeo.slc.core.execution,
                                                        org.argeo.slc.core.execution.tasks,
index b128cd7f43673ce27fa5d8a0a030e19e0dbd17ab..f369a2c86adeb58f50b1b576b767090bcb61062e 100644 (file)
@@ -7,8 +7,7 @@
                <relativePath>..</relativePath>
        </parent>
        <artifactId>org.argeo.slc.dep.backend</artifactId>
-       <name>SLC Backend Dependencies</name>
-       <description>Shared by RAP and pure server</description>
+       <name>SLC Backend</name>
        <build>
                <plugins>
                        <plugin>
diff --git a/dep/org.argeo.slc.dep.detached/p2.inf b/dep/org.argeo.slc.dep.detached/p2.inf
deleted file mode 100644 (file)
index 0423aa5..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-properties.1.name=org.eclipse.equinox.p2.type.category
-properties.1.value=true
\ No newline at end of file
diff --git a/dep/org.argeo.slc.dep.detached/pom.xml b/dep/org.argeo.slc.dep.detached/pom.xml
deleted file mode 100644 (file)
index a3805d1..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-       <modelVersion>4.0.0</modelVersion>
-       <parent>
-               <groupId>org.argeo.slc</groupId>
-               <artifactId>dep</artifactId>
-               <version>2.1.1-SNAPSHOT</version>
-               <relativePath>..</relativePath>
-       </parent>
-       <artifactId>org.argeo.slc.dep.detached</artifactId>
-       <packaging>jar</packaging>
-       <name>SLC Detached Dependencies</name>
-       <dependencies>
-               <dependency>
-                       <groupId>org.argeo.slc</groupId>
-                       <artifactId>org.argeo.slc.detached</artifactId>
-                       <version>2.1.1-SNAPSHOT</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.argeo.slc</groupId>
-                       <artifactId>org.argeo.slc.support.jemmy</artifactId>
-                       <version>2.1.1-SNAPSHOT</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.argeo.slc</groupId>
-                       <artifactId>org.argeo.slc.ext.castor</artifactId>
-                       <version>2.1.1-SNAPSHOT</version>
-               </dependency>
-               <!-- For JDK 1.4 -->
-               <dependency>
-                       <groupId>org.argeo.tp</groupId>
-                       <artifactId>mx4j</artifactId>
-               </dependency>
-       </dependencies>
-</project>
\ No newline at end of file
index a2de2acb5b4c2a3e3224dc7e9f3481aef81bfdc2..5653d1393df2dd9e6cbd45625ab6b87373e16cd4 100644 (file)
@@ -7,7 +7,7 @@
                <relativePath>..</relativePath>
        </parent>
        <artifactId>org.argeo.slc.dep.eclipse</artifactId>
-       <name>SLC Eclipse Dependencies</name>
+       <name>SLC Eclipse</name>
        <build>
                <plugins>
                        <plugin>
index 0b2a6a544cd5bba42e9ed3c9a517aadbfb0c37f7..8794d4302ae7d88ff1acc12a5ee7d46c7ff946fc 100644 (file)
@@ -8,8 +8,7 @@
                <relativePath>..</relativePath>
        </parent>
        <artifactId>org.argeo.slc.dep.minimal</artifactId>
-       <name>SLC Minimal Dependencies</name>
-       <description>The minimal set of dependencies required to run an SLC execution</description>
+       <name>SLC Minimal</name>
        <build>
                <plugins>
                        <plugin>
index 0f68a548cd1aa0c1b197e29223cd4ab34127ef57..797f1bb5f74dd779c3d02012a0cad511ff98c8cc 100644 (file)
@@ -8,7 +8,7 @@
                <relativePath>..</relativePath>
        </parent>
        <artifactId>org.argeo.slc.dep.rap</artifactId>
-       <name>SLC Eclipse RAP Dependencies</name>
+       <name>SLC Eclipse RAP</name>
        <build>
                <plugins>
                        <plugin>
index 848725036e3c30100a159f43b86918882aa1b104..57ffbb6c8d9a5a2db41e65fbabbb42b8ad8daf58 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
        <classpathentry kind="src" path="src/main/java"/>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry kind="output" path="target/classes"/>
 </classpath>
index e2c2faee5cc3722b86dee351272a800ec0819de6..06bea9468e5f3c75a4af1c0a00b5832147fafde3 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-       <classpathentry kind="src" path="src/main/java"/>
+       <classpathentry kind="src" path="src"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
        <classpathentry kind="output" path="target/classes"/>
 </classpath>
index 37cffce2e713104f25fb475ca0451752267faf3a..f772f588613faac7ba1cb78517b27c0968a8cc74 100644 (file)
@@ -1,7 +1,11 @@
 Bundle-SymbolicName: org.argeo.slc.client.rap;singleton=true
 Bundle-ActivationPolicy: lazy
-
 Bundle-Activator: org.argeo.slc.client.rap.SlcRapPlugin
+Require-Bundle: org.eclipse.ui;resolution:=optional,\
+org.eclipse.core.runtime,\
+org.eclipse.rap.ui;resolution:=optional,\
+org.eclipse.rap.ui.workbench;resolution:=optional
+
 Import-Package: javax.jcr.nodetype,\
 javax.servlet,\
 javax.servlet.http,\
index 6e71fa27e63d664c0139ebbbfc0abbc7364967fb..c64cdf9e856ca77c17fb0aa48ea9cbd2106c5134 100644 (file)
@@ -6,7 +6,7 @@
                <entrypoint\r
                        id="org.argeo.slc.client.rap.slcSecureRap"\r
                        class="org.argeo.slc.client.rap.SlcSecureRap"\r
-                       parameter="slc">\r
+                       path="slc">\r
                </entrypoint>\r
        </extension>\r
    \r
index 5641c7ca39f6826ec4ff5af926bfd34f528f3684..120e381bb7c8f3f46e8a2185fee348b3def10458 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="src" path="src/main/java"/>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry kind="output" path="target/classes"/>
 </classpath>
index 9ecad5935d8d10aff81dd227e99f09606fcd852a..600659884d0ba2bb48b74fcc517b702749fa07ce 100644 (file)
@@ -1,6 +1,9 @@
 Bundle-SymbolicName: org.argeo.slc.client.ui.distp;singleton=true
 Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.ui;resolution:=optional
+Require-Bundle: org.eclipse.ui;resolution:=optional,\
+org.eclipse.core.runtime,\
+org.eclipse.rap.ui;resolution:=optional,\
+org.eclipse.rap.ui.workbench;resolution:=optional
 
 Bundle-Activator: org.argeo.slc.client.ui.dist.DistPlugin
 Import-Package: org.argeo.eclipse.spring,\
index 5641c7ca39f6826ec4ff5af926bfd34f528f3684..120e381bb7c8f3f46e8a2185fee348b3def10458 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="src" path="src/main/java"/>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry kind="output" path="target/classes"/>
 </classpath>
index 435d28a2902a4da19d02fb351527696d57f9d87f..479968ac56d5c47386dd09b0412183c4429c932d 100644 (file)
@@ -1,8 +1,12 @@
 Bundle-SymbolicName: org.argeo.slc.client.ui;singleton=true
 Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.ui;resolution:=optional
+Require-Bundle: org.eclipse.ui;resolution:=optional,\
+org.eclipse.core.runtime,\
+org.eclipse.rap.ui;resolution:=optional,\
+org.eclipse.rap.ui.workbench;resolution:=optional
 
 Bundle-Activator: org.argeo.slc.client.ui.ClientUiPlugin
 Import-Package: org.argeo.eclipse.spring,\
 org.argeo.security.ui,\
+org.eclipse.core.runtime,\
 *
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0c604e6a25663eb43a51042db45ccade2917f211 100644 (file)
@@ -0,0 +1,2 @@
+Import-Package: org.springframework.core,\
+*
\ No newline at end of file
index 8c1ceca6aa02e3343e7c2f3fefc37d8142101b41..ac85574d27517b82c57b3787532100291dbac24d 100644 (file)
                        <artifactId>org.argeo.slc.core</artifactId>
                        <version>2.1.1-SNAPSHOT</version>
                </dependency>
+               <dependency>
+                       <groupId>org.argeo.slc</groupId>
+                       <artifactId>org.argeo.slc.support</artifactId>
+                       <version>2.1.1-SNAPSHOT</version>
+               </dependency>
        </dependencies>
 </project>
\ No newline at end of file
diff --git a/org.argeo.slc.unit/src/org/argeo/slc/unit/db/DbUnitDeployment.java b/org.argeo.slc.unit/src/org/argeo/slc/unit/db/DbUnitDeployment.java
new file mode 100644 (file)
index 0000000..25ecb06
--- /dev/null
@@ -0,0 +1,95 @@
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.unit.db;\r
+\r
+import java.sql.SQLException;\r
+\r
+import org.apache.commons.logging.Log;\r
+import org.apache.commons.logging.LogFactory;\r
+import org.argeo.slc.SlcException;\r
+import org.argeo.slc.UnsupportedException;\r
+import org.argeo.slc.build.Distribution;\r
+import org.argeo.slc.deploy.DeployedSystem;\r
+import org.argeo.slc.deploy.Deployment;\r
+import org.argeo.slc.deploy.DeploymentData;\r
+import org.argeo.slc.deploy.TargetData;\r
+import org.argeo.slc.support.deploy.db.DbModel;\r
+import org.argeo.slc.support.deploy.db.JdbcAware;\r
+import org.dbunit.DataSourceDatabaseTester;\r
+import org.dbunit.DatabaseUnitException;\r
+import org.dbunit.IDatabaseTester;\r
+import org.dbunit.database.IDatabaseConnection;\r
+import org.dbunit.dataset.IDataSet;\r
+import org.dbunit.operation.DatabaseOperation;\r
+\r
+public class DbUnitDeployment implements Deployment {\r
+       private static Log log = LogFactory.getLog(DbUnitDeployment.class);\r
+\r
+       private JdbcAware jdbcAware;\r
+       private DbUnitDeploymentData deploymentData;\r
+       private DbModel dbModel;\r
+\r
+       public void run() {\r
+               try {\r
+                       IDatabaseTester databaseTester = new DataSourceDatabaseTester(\r
+                                       jdbcAware.getDataSource());\r
+                       databaseTester.setSetUpOperation(new DatabaseOperation() {\r
+\r
+                               @Override\r
+                               public void execute(IDatabaseConnection connection,\r
+                                               IDataSet dataSet) throws DatabaseUnitException,\r
+                                               SQLException {\r
+                                       if (dbModel != null) {\r
+                                               dbModel.createSchema(connection.getConnection());\r
+                                               DatabaseOperation.INSERT.execute(connection, dataSet);\r
+                                       } else {\r
+                                               DatabaseOperation.UPDATE.execute(connection, dataSet);\r
+                                       }\r
+                               }\r
+\r
+                       });\r
+                       databaseTester.setDataSet(deploymentData.createDataSet());\r
+                       databaseTester.onSetup();\r
+                       databaseTester.onTearDown();\r
+\r
+                       log.info("Database deployed.");\r
+               } catch (Exception e) {\r
+                       throw new SlcException("Could not initialize the database", e);\r
+               }\r
+       }\r
+\r
+       public DeployedSystem getDeployedSystem() {\r
+               throw new UnsupportedOperationException();\r
+       }\r
+\r
+       public void setDbModel(DbModel dbModel) {\r
+               this.dbModel = dbModel;\r
+       }\r
+\r
+       public void setDeploymentData(DeploymentData deploymentData) {\r
+               this.deploymentData = (DbUnitDeploymentData) deploymentData;\r
+       }\r
+\r
+       public void setTargetData(TargetData targetData) {\r
+               this.jdbcAware = (JdbcAware) targetData;\r
+\r
+       }\r
+\r
+       public void setDistribution(Distribution distribution) {\r
+               throw new UnsupportedException("Method not supported");\r
+       }\r
+\r
+}\r
diff --git a/org.argeo.slc.unit/src/org/argeo/slc/unit/db/DbUnitDeploymentData.java b/org.argeo.slc.unit/src/org/argeo/slc/unit/db/DbUnitDeploymentData.java
new file mode 100644 (file)
index 0000000..46835c6
--- /dev/null
@@ -0,0 +1,45 @@
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.unit.db;\r
+\r
+import java.io.InputStream;\r
+\r
+import org.argeo.slc.SlcException;\r
+import org.argeo.slc.deploy.DeploymentData;\r
+import org.dbunit.dataset.IDataSet;\r
+import org.dbunit.dataset.xml.FlatXmlDataSet;\r
+import org.springframework.core.io.Resource;\r
+\r
+public class DbUnitDeploymentData implements DeploymentData {\r
+       private Resource dataSetLocation;\r
+\r
+       public IDataSet createDataSet() {\r
+               try {\r
+                       InputStream in = dataSetLocation.getInputStream();\r
+                       IDataSet dataSet = new FlatXmlDataSet(in);\r
+                       in.close();\r
+                       return dataSet;\r
+               } catch (Exception e) {\r
+                       throw new SlcException("Cannot create data set", e);\r
+               }\r
+\r
+       }\r
+\r
+       public void setDataSetLocation(Resource dataSetLocation) {\r
+               this.dataSetLocation = dataSetLocation;\r
+       }\r
+\r
+}\r