Author: jeff.yuchang
Date: 2010-05-25 13:50:59 -0400 (Tue, 25 May 2010)
New Revision: 667
Added:
branches/ODE/ODE-1.x-jpa/axis2-war/itest_setup.groovy
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/bpel/
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/bpel/ProcessInstanceProfileDAO.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/bpel/ProcessProfileDAO.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/hib/
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/hib/bpel/
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/hib/bpel/ProcessInstanceProfileDaoImpl.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/hib/bpel/ProcessProfileDaoImpl.java
branches/ODE/ODE-1.x-jpa/dao-hibernate-db/src/main/assembly/
branches/ODE/ODE-1.x-jpa/dao-hibernate-db/src/main/assembly/bin.xml
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/pom.xml
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFailureHibTest.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFailureTest.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFaultHibTest.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFaultTest.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanSuccessHibTest.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanSuccessTest.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanTestBase.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/HibDaoConnectionFactoryImpl.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/JpaDaoConnectionFactoryImpl.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/ProcessCronCleanupTest.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/ProfilingBpelDAOConnection.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/SystemCronCleanupTest.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/management/InstanceManagementTest.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/basic/SecuredProcessesTest.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/basic/SecuredServicesTest.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/policy/SecuredProcessesTest.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/policy/SecuredServicesTest.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/bpel/dao/ProcessInstanceProfileDAO.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/bpel/dao/ProcessProfileDAO.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/ProcessInstanceProfileDAO.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/ProcessProfileDAO.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/jpa/ProcessInstanceProfileDAOImpl.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/jpa/ProcessProfileDAOImpl.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/daohib/bpel/ProcessInstanceProfileDaoImpl.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/daohib/bpel/ProcessProfileDaoImpl.java
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/resources/TestRampartPolicy/secured-processes/process-sample02_standalone_policy/sample02-policy-for-service.xml
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/webapp/WEB-INF/conf.hib-derby/ode-axis2.properties
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/webapp/WEB-INF/conf.jpa-derby/ode-axis2.properties
branches/ODE/ODE-1.x-jpa/axis2/pom.xml
branches/ODE/ODE-1.x-jpa/bpel-epr/src/main/java/org/apache/ode/il/config/OdeConfigProperties.java
branches/ODE/ODE-1.x-jpa/bpel-schemas/pom.xml
branches/ODE/ODE-1.x-jpa/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java
branches/ODE/ODE-1.x-jpa/bpel-test/src/test/java/org/apache/ode/test/ExternalVariableTest.java
branches/ODE/ODE-1.x-jpa/dao-hibernate-db/build.xml
branches/ODE/ODE-1.x-jpa/dao-hibernate-db/pom.xml
branches/ODE/ODE-1.x-jpa/dao-hibernate/src/main/java/org/apache/ode/dao/hib/bpel/BpelDAOConnectionFactoryImpl.java
Log:
* commit the axis2-war compliation error fix.
Modified: branches/ODE/ODE-1.x-jpa/axis2/pom.xml
===================================================================
--- branches/ODE/ODE-1.x-jpa/axis2/pom.xml 2010-05-25 17:27:34 UTC (rev 666)
+++ branches/ODE/ODE-1.x-jpa/axis2/pom.xml 2010-05-25 17:50:59 UTC (rev 667)
@@ -123,6 +123,22 @@
</excludes>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <classifier>wsdl</classifier>
+ <classesDirectory>src/main/wsdl</classesDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Added: branches/ODE/ODE-1.x-jpa/axis2-war/itest_setup.groovy
===================================================================
--- branches/ODE/ODE-1.x-jpa/axis2-war/itest_setup.groovy (rev 0)
+++ branches/ODE/ODE-1.x-jpa/axis2-war/itest_setup.groovy 2010-05-25 17:50:59 UTC (rev
667)
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+import java.io.File
+
+def warname =
project.build.directory+"/"+project.build.finalName+".war";
+def webapp = project.build.directory + "/webapp";
+def testresources = new File(project.basedir, 'src/test/webapp')
+
+log.info('-----Performing pre-integration test tasks-----');
+log.info('extracting the axis2 war');
+ant.unwar(src: warname , dest: webapp )
+log.info('copying over the test webapp resources');
+ant.copy(todir: webapp) {
+ fileset(dir: testresources) {
+ include(name: '**')
+ }
+}
+//This was in buildr, don't know if it is needed
+//copy target/test-classes/TestEndpointProperties/*_global_conf*.endpoint to
webapp/WEB-INF/conf
+
+prepare_secure_services_tests (new
File(project.build.testOutputDirectory,'TestRampartBasic/secured-services'),~/sample\d+\.axis2/);
+prepare_secure_services_tests (new
File(project.build.testOutputDirectory,'TestRampartPolicy/secured-services'),~/sample\d+\-policy\.xml/);
+prepare_secure_processes_tests (new
File(project.build.testOutputDirectory,'TestRampartBasic/secured-processes'));
+prepare_secure_processes_tests (new
File(project.build.testOutputDirectory,'TestRampartPolicy/secured-processes'));
+
+def prepare_secure_processes_tests(test_dir) {
+ log.info('preparing the secure process tests in ' + test_dir);
+ def p = ~/sample\d+\-service\.xml/;
+ test_dir.eachFileMatch(p) { service_file ->
+ def sample_name = service_file.getName().split('-')[0];
+ def proc_dir = test_dir.getAbsolutePath() +'/process-' + sample_name;
+ ant.copy(todir: proc_dir) {
+ fileset(dir: test_dir.getAbsolutePath()+'/process-template') {
+ include(name: '**')
+ }
+ }
+ ant.copy(file: service_file, tofile: proc_dir + '/HelloService.axis2');
+ }
+}
+
+def prepare_secure_services_tests(test_dir, file_pattern){
+ log.info('preparing the secure services tests with pattern
'+file_pattern+' in ' + test_dir);
+ test_dir.eachFileMatch(file_pattern) { config_file ->
+ def sample_name = config_file.getName().split("\\.")[0];
+ def proc_dir = test_dir.getAbsolutePath() +'/process-' + sample_name;
+ ant.filterset(id: sample_name+'_filter', begintoken: '{',
endtoken: '}'){
+ filter(token: 'sample.namespace', value: 'http://'+
sample_name.replaceAll('-','.')+'.samples.rampart.apache.org');
+ filter(token: 'sample.service.name', value: sample_name);
+ }
+ ant.copy(todir: proc_dir) {
+ fileset(dir: test_dir.getAbsolutePath()+'/process-template') {
+ include(name: '**')
+ }
+ filterset(refid: sample_name+'_filter');
+ }
+ ant.copy(todir: proc_dir, file: config_file){
+ filterset(refid: sample_name+'_filter');
+ }
+ }
+ }
\ No newline at end of file
Modified: branches/ODE/ODE-1.x-jpa/axis2-war/pom.xml
===================================================================
--- branches/ODE/ODE-1.x-jpa/axis2-war/pom.xml 2010-05-25 17:27:34 UTC (rev 666)
+++ branches/ODE/ODE-1.x-jpa/axis2-war/pom.xml 2010-05-25 17:50:59 UTC (rev 667)
@@ -32,9 +32,7 @@
</parent>
<properties>
- <rampart.version>1.4</rampart.version>
<mex.version>1.41</mex.version>
- <axis2.version>1.4.1</axis2.version>
<jibx.version>1.1.5</jibx.version>
<tranql.version>1.1</tranql.version>
<opensaml.version>1.1</opensaml.version>
@@ -42,6 +40,7 @@
<geronimo-spec-jms.version>1.1-rc4</geronimo-spec-jms.version>
<jetty.version>6.1.3</jetty.version>
<testng.version>5.8</testng.version>
+ <rampart.version>1.4</rampart.version>
</properties>
<dependencies>
@@ -83,17 +82,34 @@
</dependency>
<dependency>
<groupId>org.jboss.soa.bpel</groupId>
+ <artifactId>riftsaw-bpel-schemas</artifactId>
+ <version>${project.version}</version>
+ <classifier>xsd</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.soa.bpel</groupId>
<artifactId>riftsaw-utils</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.soa.bpel</groupId>
<artifactId>riftsaw-dao-jpa</artifactId>
+ <classifier>openjpa</classifier>
</dependency>
<dependency>
<groupId>org.jboss.soa.bpel</groupId>
+ <artifactId>riftsaw-dao-jpa-ojpa</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.soa.bpel</groupId>
<artifactId>riftsaw-axis2</artifactId>
</dependency>
<dependency>
+ <groupId>org.jboss.soa.bpel</groupId>
+ <artifactId>riftsaw-axis2</artifactId>
+ <classifier>wsdl</classifier>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-corba</artifactId>
<version>${axis2.version}</version>
@@ -148,9 +164,25 @@
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
</dependency>
<dependency>
+ <groupId>org.jboss.soa.bpel</groupId>
+ <artifactId>riftsaw-dao-jpa-db</artifactId>
+ <version>${project.version}</version>
+ <type>zip</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.soa.bpel</groupId>
+ <artifactId>riftsaw-dao-hib-db</artifactId>
+ <version>${project.version}</version>
+ <type>zip</type>
+ </dependency>
+ <dependency>
<groupId>org.jibx</groupId>
<artifactId>jibx-run</artifactId>
<version>${jibx.version}</version>
@@ -214,120 +246,146 @@
<version>${mex.version}</version>
</dependency>
<dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>${testng.version}</version>
- <classifier>jdk15</classifier>
- <scope>test</scope>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>${testng.version}</version>
+ <classifier>jdk15</classifier>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- <version>${jetty.version}</version>
- <scope>test</scope>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>${jetty.version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- <version>${jetty.version}</version>
- <scope>test</scope>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ <version>${jetty.version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>servlet-api-2.5</artifactId>
- <version>${jetty.version}</version>
- <scope>test</scope>
- </dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>servlet-api-2.5</artifactId>
+ <version>${jetty.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.soa.bpel</groupId>
+ <artifactId>riftsaw-dao-hibernate</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>war-package</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <finalName>riftsaw-axis2-war-${project.version}</finalName>
- <appendAssemblyId>false</appendAssemblyId>
- <descriptors>
- <descriptor>src/main/assembly/bin.xml</descriptor>
- </descriptors>
- <tarLongFileMode>gnu</tarLongFileMode>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <!--plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.10</version>
- <configuration>
- <scanIntervalSeconds>10</scanIntervalSeconds>
- <stopKey>foo</stopKey>
- <stopPort>9999</stopPort>
-
<webApp>${basedir}/target/riftsaw-axis2-war-${project.version}.war</webApp>
- </configuration>
- <executions>
- <execution>
- <id>start-jetty</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>war-package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+
<finalName>riftsaw-axis2-war-${project.version}</finalName>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+
<descriptor>src/main/assembly/bin.xml</descriptor>
+ </descriptors>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>compiler-it</id>
<phase>pre-integration-test</phase>
<goals>
- <goal>run-war</goal>
+ <goal>testCompile</goal>
</goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>resources-it</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>testResources</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <!--doclet does not support not-found="ignore" -->
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-itests</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
<configuration>
- <scanIntervalSeconds>0</scanIntervalSeconds>
- <daemon>true</daemon>
+
<source>${pom.basedir}/itest_setup.groovy</source>
</configuration>
- </execution>
- <execution>
- <id>stop-jetty</id>
- <phase>post-integration-test</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>test-axis2-web</id>
+ <phase>integration-test</phase>
<goals>
- <goal>stop</goal>
+ <goal>test</goal>
</goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <executions>
- <execution>
- <id>compiler-it</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>testCompile</goal>
- </goals>
- </execution>
- </executions>
- </plugin-->
- <!-- FIXME: temporary commented out -->
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <includes>
- <include>**/*TestCase.java</include>
- <include>**/Test.java</include>
- </includes>
- </configuration>
- <executions>
- <execution>
- <id>test-axis2-web</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <configuration>
+ <forkMode>always</forkMode>
+
<redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <additionalClasspathElements>
+
<additionalClasspathElement>${project.build.directory}</additionalClasspathElement>
+ </additionalClasspathElements>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>bpel-tests</id>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.soa.bpel</groupId>
+
<artifactId>riftsaw-bpel-test</artifactId>
+ <classifier>tests</classifier>
+
<outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -21,10 +21,14 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.deployment.DeploymentConstants;
+import org.apache.axis2.deployment.FileSystemConfigurator;
import org.apache.axis2.description.AxisOperation;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.Parameter;
import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.engine.AxisConfigurator;
import org.apache.axis2.engine.AxisServer;
import org.apache.axis2.engine.MessageReceiver;
import org.apache.commons.logging.Log;
@@ -70,6 +74,7 @@
protected ODEAxis2Server server;
protected String config;
+ protected String odeRootAbsolutePath;
protected static final String DO_NOT_OVERRIDE_CONFIG =
"<DO_NOT_OVERRIDE_CONFIG>";
@@ -153,7 +158,7 @@
}
public void startServer(String axis2RepoDir, String axis2ConfLocation) throws
Exception {
- String odeRootAbsolutePath =
getClass().getClassLoader().getResource("webapp/WEB-INF").getFile();
+ odeRootAbsolutePath =
getClass().getClassLoader().getResource("webapp/WEB-INF").getFile();
String axis2RepoAbsolutePath =
getClass().getClassLoader().getResource(axis2RepoDir).getFile();
String axis2ConfAbsolutePath = axis2ConfLocation == null ? null :
getClass().getClassLoader().getResource(axis2ConfLocation).getFile();
server = new ODEAxis2Server(odeRootAbsolutePath, axis2RepoAbsolutePath,
axis2ConfAbsolutePath);
@@ -344,4 +349,19 @@
return _ode;
}
}
+
+ public static class TestConfigurator extends FileSystemConfigurator implements
AxisConfigurator {
+
+ String _serviceDir;
+
+ public TestConfigurator(String webRoot, String serviceDir, String axis2xml)
throws AxisFault {
+ super(webRoot,axis2xml);
+ _serviceDir=serviceDir;
+ }
+
+ public synchronized AxisConfiguration getAxisConfiguration() throws AxisFault {
+ servicesPath = _serviceDir + File.separator +
DeploymentConstants.SERVICE_PATH;
+ return super.getAxisConfiguration();
+ }
+ }
}
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFailureHibTest.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFailureHibTest.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFailureHibTest.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -19,8 +19,8 @@
package org.apache.ode.axis2.instancecleanup;
-import org.apache.ode.bpel.dao.ProcessDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ProcessDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
public class CleanFailureHibTest extends CleanFailureTest {
@Override
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFailureTest.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFailureTest.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFailureTest.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -20,8 +20,8 @@
package org.apache.ode.axis2.instancecleanup;
import org.apache.ode.axis2.DummyService;
-import org.apache.ode.bpel.dao.ProcessDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ProcessDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
import org.testng.annotations.Test;
public class CleanFailureTest extends CleanTestBase {
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFaultHibTest.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFaultHibTest.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFaultHibTest.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -19,7 +19,7 @@
package org.apache.ode.axis2.instancecleanup;
-import org.apache.ode.bpel.dao.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
public class CleanFaultHibTest extends CleanFaultTest {
@Override
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFaultTest.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFaultTest.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanFaultTest.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -22,8 +22,8 @@
import static org.testng.AssertJUnit.fail;
import org.apache.ode.axis2.DummyService;
-import org.apache.ode.bpel.dao.ProcessDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ProcessDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
import org.apache.ode.bpel.iapi.ContextException;
import org.testng.annotations.Test;
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanSuccessHibTest.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanSuccessHibTest.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanSuccessHibTest.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -19,7 +19,7 @@
package org.apache.ode.axis2.instancecleanup;
-import org.apache.ode.bpel.dao.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
public class CleanSuccessHibTest extends CleanSuccessTest {
@Override
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanSuccessTest.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanSuccessTest.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanSuccessTest.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -19,8 +19,8 @@
package org.apache.ode.axis2.instancecleanup;
-import org.apache.ode.bpel.dao.ProcessDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ProcessDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
import org.apache.ode.bpel.iapi.ContextException;
import org.testng.annotations.Test;
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanTestBase.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanTestBase.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/CleanTestBase.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -27,10 +27,10 @@
import org.apache.ode.axis2.Axis2TestBase;
import org.apache.ode.axis2.ODEConfigDirAware;
import org.apache.ode.axis2.ODEConfigProperties;
-import org.apache.ode.bpel.dao.ProcessDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceProfileDAO;
-import org.apache.ode.bpel.dao.ProcessProfileDAO;
+import org.apache.ode.dao.bpel.ProcessDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceProfileDAO;
+import org.apache.ode.dao.bpel.ProcessProfileDAO;
import org.apache.ode.il.EmbeddedGeronimoFactory;
import org.apache.ode.il.dbutil.Database;
import org.testng.annotations.AfterMethod;
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/HibDaoConnectionFactoryImpl.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/HibDaoConnectionFactoryImpl.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/HibDaoConnectionFactoryImpl.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -19,25 +19,29 @@
package org.apache.ode.axis2.instancecleanup;
+import java.util.Collection;
+import java.util.Map;
import java.util.Properties;
import javax.sql.DataSource;
import javax.transaction.TransactionManager;
-import org.apache.ode.bpel.dao.BpelDAOConnection;
-import org.apache.ode.bpel.dao.ProcessDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceProfileDAO;
-import org.apache.ode.bpel.dao.ProcessProfileDAO;
-import org.apache.ode.daohib.SessionManager;
-import org.apache.ode.daohib.bpel.BpelDAOConnectionFactoryImpl;
-import org.apache.ode.daohib.bpel.BpelDAOConnectionImpl;
-import org.apache.ode.daohib.bpel.ProcessDaoImpl;
-import org.apache.ode.daohib.bpel.ProcessInstanceDaoImpl;
-import org.apache.ode.daohib.bpel.ProcessInstanceProfileDaoImpl;
-import org.apache.ode.daohib.bpel.ProcessProfileDaoImpl;
-import org.apache.ode.daohib.bpel.hobj.HProcess;
-import org.apache.ode.daohib.bpel.hobj.HProcessInstance;
+import org.apache.ode.dao.bpel.CorrelationSetDAO;
+import org.apache.ode.bpel.evt.BpelEvent;
+import org.apache.ode.dao.bpel.BpelDAOConnection;
+import org.apache.ode.dao.bpel.ProcessDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceProfileDAO;
+import org.apache.ode.dao.bpel.ProcessProfileDAO;
+import org.apache.ode.dao.hib.SessionManager;
+import org.apache.ode.dao.hib.bpel.BpelDAOConnectionFactoryImpl;
+import org.apache.ode.dao.hib.bpel.BpelDAOConnectionImpl;
+import org.apache.ode.dao.hib.bpel.ProcessDaoImpl;
+import org.apache.ode.dao.hib.bpel.ProcessInstanceDaoImpl;
+import org.apache.ode.dao.hib.bpel.ProcessInstanceProfileDaoImpl;
+import org.apache.ode.dao.hib.bpel.ProcessProfileDaoImpl;
+import org.apache.ode.dao.hib.bpel.hobj.HProcess;
+import org.apache.ode.dao.hib.bpel.hobj.HProcessInstance;
import org.hibernate.MappingException;
import org.hibernate.Session;
import org.hibernate.cfg.Configuration;
@@ -51,17 +55,13 @@
private static ProcessDaoImpl process;
@Override
- protected SessionManager createSessionManager(Properties properties, DataSource ds,
TransactionManager tm) {
- _staticSessionManager = new SessionManager(properties, ds, tm) {
- @Override
- public Configuration getDefaultConfiguration() throws MappingException {
- Configuration conf = super.getDefaultConfiguration();
- conf.setListener("post-insert",
HibDaoConnectionFactoryImpl.this);
- return conf;
- }
- };
-
- return _staticSessionManager;
+ public void init(Properties initialProps, TransactionManager mgr, Object env) {
+ _ds = (DataSource) env;
+ _txm = mgr;
+ Configuration conf = SessionManager.getDefaultConfiguration();
+ conf.setListener("post-insert", HibDaoConnectionFactoryImpl.this);
+ _sessionManager = setupSessionManager(conf, initialProps, _txm, _ds);
+ _staticSessionManager = _sessionManager;
}
public BpelDAOConnection getConnection() {
@@ -89,7 +89,7 @@
}
public static class ProfilingBpelDAOConnectionImpl extends BpelDAOConnectionImpl
implements ProfilingBpelDAOConnection {
- ProfilingBpelDAOConnectionImpl(SessionManager sm) {
+ public ProfilingBpelDAOConnectionImpl(SessionManager sm) {
super(sm);
}
@@ -100,5 +100,6 @@
public ProcessInstanceProfileDAO createProcessInstanceProfile(ProcessInstanceDAO
instance) {
return new ProcessInstanceProfileDaoImpl(_sm,
(ProcessInstanceDaoImpl)instance);
}
+
}
}
\ No newline at end of file
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/JpaDaoConnectionFactoryImpl.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/JpaDaoConnectionFactoryImpl.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/JpaDaoConnectionFactoryImpl.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -20,24 +20,25 @@
package org.apache.ode.axis2.instancecleanup;
import java.util.Properties;
-
import javax.persistence.EntityManager;
+import javax.transaction.TransactionManager;
-import org.apache.ode.bpel.dao.ProcessDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceProfileDAO;
-import org.apache.ode.bpel.dao.ProcessProfileDAO;
-import org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl;
-import org.apache.ode.dao.jpa.BPELDAOConnectionImpl;
-import org.apache.ode.dao.jpa.ProcessDAOImpl;
-import org.apache.ode.dao.jpa.ProcessInstanceDAOImpl;
+import org.apache.ode.dao.bpel.ProcessDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceProfileDAO;
+import org.apache.ode.dao.bpel.ProcessProfileDAO;
+import org.apache.ode.dao.jpa.JpaOperator;
+import org.apache.ode.dao.jpa.openjpa.BpelDAOConnectionFactoryImpl;
+import org.apache.ode.dao.jpa.bpel.BpelDAOConnectionImpl;
+import org.apache.ode.dao.jpa.bpel.ProcessDAOImpl;
+import org.apache.ode.dao.jpa.bpel.ProcessInstanceDAOImpl;
import org.apache.ode.dao.jpa.ProcessInstanceProfileDAOImpl;
import org.apache.ode.dao.jpa.ProcessProfileDAOImpl;
import org.apache.openjpa.event.LifecycleEvent;
import org.apache.openjpa.event.PersistListener;
import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
-public class JpaDaoConnectionFactoryImpl extends BPELDAOConnectionFactoryImpl implements
PersistListener {
+public class JpaDaoConnectionFactoryImpl extends BpelDAOConnectionFactoryImpl implements
PersistListener {
private static ProcessInstanceDAO instance;
private static ProcessDAO process;
@@ -50,16 +51,16 @@
}
@Override
- public void init(Properties properties) {
- super.init(properties);
+ public void init(Properties properties, TransactionManager mgr, Object env) {
+ super.init(properties,mgr,env);
if( _emf instanceof OpenJPAEntityManagerFactorySPI ) {
((OpenJPAEntityManagerFactorySPI)_emf).addLifecycleListener(this,
ProcessInstanceDAOImpl.class, ProcessDAOImpl.class);
}
}
@Override
- protected BPELDAOConnectionImpl createBPELDAOConnection(EntityManager em) {
- return new ProfilingBPELDAOConnectionImpl(em);
+ protected BpelDAOConnectionImpl createBPELDAOConnection(EntityManager em,
TransactionManager mgr, JpaOperator operator) {
+ return new ProfilingBPELDAOConnectionImpl(em, mgr, operator);
}
public void afterPersist(LifecycleEvent event) {
@@ -73,9 +74,9 @@
public void beforePersist(LifecycleEvent event) {
}
- public static class ProfilingBPELDAOConnectionImpl extends BPELDAOConnectionImpl
implements ProfilingBpelDAOConnection {
- public ProfilingBPELDAOConnectionImpl(EntityManager em) {
- super(em);
+ public static class ProfilingBPELDAOConnectionImpl extends BpelDAOConnectionImpl
implements ProfilingBpelDAOConnection {
+ public ProfilingBPELDAOConnectionImpl(EntityManager em, TransactionManager mgr,
JpaOperator operator) {
+ super(em, mgr, operator);
}
public ProcessProfileDAO createProcessProfile(ProcessDAO process) {
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/ProcessCronCleanupTest.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/ProcessCronCleanupTest.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/ProcessCronCleanupTest.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -1,7 +1,7 @@
package org.apache.ode.axis2.instancecleanup;
-import org.apache.ode.bpel.dao.ProcessDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ProcessDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
import org.testng.annotations.Test;
public class ProcessCronCleanupTest extends CleanTestBase {
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/ProfilingBpelDAOConnection.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/ProfilingBpelDAOConnection.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/ProfilingBpelDAOConnection.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -19,11 +19,11 @@
package org.apache.ode.axis2.instancecleanup;
-import org.apache.ode.bpel.dao.BpelDAOConnection;
-import org.apache.ode.bpel.dao.ProcessDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceProfileDAO;
-import org.apache.ode.bpel.dao.ProcessProfileDAO;
+import org.apache.ode.dao.bpel.BpelDAOConnection;
+import org.apache.ode.dao.bpel.ProcessDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceProfileDAO;
+import org.apache.ode.dao.bpel.ProcessProfileDAO;
public interface ProfilingBpelDAOConnection extends BpelDAOConnection {
ProcessProfileDAO createProcessProfile(ProcessDAO instance);
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/SystemCronCleanupTest.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/SystemCronCleanupTest.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/SystemCronCleanupTest.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -1,8 +1,8 @@
package org.apache.ode.axis2.instancecleanup;
import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.dao.ProcessDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ProcessDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
import org.apache.ode.bpel.engine.cron.SystemSchedulesConfig;
import org.testng.annotations.AfterClass;
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/management/InstanceManagementTest.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/management/InstanceManagementTest.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/management/InstanceManagementTest.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -81,7 +81,7 @@
notSoLongAgo.add(Calendar.MINUTE, -2);
String notSoLongAgoStr = xsdDF.format(notSoLongAgo.getTime());
listRoot = _client.buildMessage("listInstances", new String[]
{"filter", "order", "limit"},
- new String[] {"name=DynPartnerResponder
namespace=http://ode/bpel/responder " +
+ new String[] {"name=DynPartnerMain
namespace=http://ode/bpel/unit-test " +
"started>=" + notSoLongAgoStr, "",
"10"});
result = sendToIM(listRoot);
assertTrue(instanceNb(result) == 0);
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/basic/SecuredProcessesTest.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/basic/SecuredProcessesTest.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/basic/SecuredProcessesTest.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -44,6 +44,7 @@
*
*
*/
+@Test(suiteName="SecuredProcessesTest-Basic")
public class SecuredProcessesTest extends Axis2TestBase {
private String testDir = "TestRampartBasic/secured-processes";
@@ -86,7 +87,7 @@
}
server.deployProcess(bundleName);
try {
- ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(clientRepo,
clientConfigFile);
+ ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContext(new
TestConfigurator(odeRootAbsolutePath,clientRepo, clientConfigFile));
ServiceClient client = new ServiceClient(ctx, null);
Options options = new Options();
options.setTo(new
EndpointReference("http://localhost:"+getTestPort(0)+"/processes/helloWorld"));
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/basic/SecuredServicesTest.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/basic/SecuredServicesTest.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/basic/SecuredServicesTest.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -37,6 +37,7 @@
*
*
*/
+@Test(suiteName="SecuredServicesTest-Policy")
public class SecuredServicesTest extends Axis2TestBase {
private String testDir= "TestRampartBasic/secured-services";
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/policy/SecuredProcessesTest.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/policy/SecuredProcessesTest.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/policy/SecuredProcessesTest.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -48,6 +48,7 @@
*
*
*/
+@Test(suiteName="SecuredProcessesTest-Policy")
public class SecuredProcessesTest extends Axis2TestBase {
private String testDir = "TestRampartPolicy/secured-processes";
@@ -58,7 +59,7 @@
public Object[][] testPolicySamples() throws Exception {
File[] samples = new
File(getClass().getClassLoader().getResource(testDir).getFile()).listFiles(new
FileFilter() {
public boolean accept(File pathname) {
- return pathname.isDirectory() &&
pathname.getName().matches("process-sample\\d*");
+ return pathname.isDirectory() &&
pathname.getName().matches("process-sample\\d+");
}
});
Object[][] bundles = new Object[samples.length][];
@@ -91,7 +92,7 @@
}
server.deployProcess(bundleName);
try {
- ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(clientRepo, null);
+ ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContext(new
TestConfigurator(odeRootAbsolutePath,clientRepo, null));
ServiceClient client = new ServiceClient(ctx, null);
Options options = new Options();
// Rampart SymetricBinding (sample04) blows up if not provided with a soap
action
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/policy/SecuredServicesTest.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/policy/SecuredServicesTest.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/axis2/rampart/policy/SecuredServicesTest.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -33,6 +33,7 @@
*
*
*/
+@Test(suiteName="SecuredServicesTest-Policy")
public class SecuredServicesTest extends Axis2TestBase {
private String testDir = "TestRampartPolicy/secured-services";
@@ -41,7 +42,7 @@
public Object[][] testPolicySamples() throws Exception {
File[] policies = new
File(getClass().getClassLoader().getResource(testDir).getFile()).listFiles(new
FileFilter() {
public boolean accept(File pathname) {
- return pathname.isDirectory() &&
pathname.getName().matches("process-sample\\d*\\-policy");
+ return pathname.isDirectory() &&
pathname.getName().matches("process-sample\\d+\\-policy");
}
});
Object[][] bundles = new Object[policies.length][];
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/bpel/dao/ProcessInstanceProfileDAO.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/bpel/dao/ProcessInstanceProfileDAO.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/bpel/dao/ProcessInstanceProfileDAO.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.ode.bpel.dao;
-
-import java.util.List;
-
-public interface ProcessInstanceProfileDAO extends ProcessProfileDAO {
- ProcessDAO getProcess();
-
- List<ActivityRecoveryDAO> findActivityRecoveriesByInstance();
-
- List<CorrelationSetDAO> findCorrelationSetsByInstance();
-
- List<FaultDAO> findFaultsByInstance();
-
- List<MessageDAO> findMessagesByInstance();
-
- List<MessageExchangeDAO> findMessageExchangesByInstance();
-
- List<MessageRouteDAO> findMessageRoutesByInstance();
-
- List<PartnerLinkDAO> findPartnerLinksByInstance();
-
- List<ScopeDAO> findScopesByInstance();
-
- List<XmlDataDAO> findXmlDataByInstance();
-
- int countEventsByInstance();
-}
\ No newline at end of file
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/bpel/dao/ProcessProfileDAO.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/bpel/dao/ProcessProfileDAO.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/bpel/dao/ProcessProfileDAO.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.ode.bpel.dao;
-
-import java.util.List;
-
-public interface ProcessProfileDAO {
- boolean doesProcessExist();
-
- List<ProcessInstanceDAO> findInstancesByProcess();
-
- List<ActivityRecoveryDAO> findActivityRecoveriesByProcess();
-
- List<CorrelationSetDAO> findCorrelationSetsByProcess();
-
- List<CorrelatorDAO> findCorrelatorsByProcess();
-
- List<FaultDAO> findFaultsByProcess();
-
- List<MessageDAO> findMessagesByProcess();
-
- List<MessageExchangeDAO> findMessageExchangesByProcess();
-
- List<MessageRouteDAO> findMessageRoutesByProcess();
-
- List<PartnerLinkDAO> findPartnerLinksByProcess();
-
- List<ScopeDAO> findScopesByProcess();
-
- List<XmlDataDAO> findXmlDataByProcess();
-
- int countEventsByProcess();
-}
\ No newline at end of file
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/ProcessInstanceProfileDAO.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/ProcessInstanceProfileDAO.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/ProcessInstanceProfileDAO.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -1,19 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/ProcessProfileDAO.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/ProcessProfileDAO.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/ProcessProfileDAO.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -1,19 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
Added:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/bpel/ProcessInstanceProfileDAO.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/bpel/ProcessInstanceProfileDAO.java
(rev 0)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/bpel/ProcessInstanceProfileDAO.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.ode.dao.bpel;
+
+import java.util.List;
+
+import org.apache.ode.dao.bpel.ActivityRecoveryDAO;
+import org.apache.ode.dao.bpel.CorrelationSetDAO;
+import org.apache.ode.dao.bpel.FaultDAO;
+import org.apache.ode.dao.bpel.MessageDAO;
+import org.apache.ode.dao.bpel.MessageExchangeDAO;
+import org.apache.ode.dao.bpel.MessageRouteDAO;
+import org.apache.ode.dao.bpel.PartnerLinkDAO;
+import org.apache.ode.dao.bpel.ProcessDAO;
+import org.apache.ode.dao.bpel.ScopeDAO;
+import org.apache.ode.dao.bpel.XmlDataDAO;
+
+public interface ProcessInstanceProfileDAO extends ProcessProfileDAO {
+ ProcessDAO getProcess();
+
+ List<ActivityRecoveryDAO> findActivityRecoveriesByInstance();
+
+ List<CorrelationSetDAO> findCorrelationSetsByInstance();
+
+ List<FaultDAO> findFaultsByInstance();
+
+ List<MessageDAO> findMessagesByInstance();
+
+ List<MessageExchangeDAO> findMessageExchangesByInstance();
+
+ List<MessageRouteDAO> findMessageRoutesByInstance();
+
+ List<PartnerLinkDAO> findPartnerLinksByInstance();
+
+ List<ScopeDAO> findScopesByInstance();
+
+ List<XmlDataDAO> findXmlDataByInstance();
+
+ int countEventsByInstance();
+}
\ No newline at end of file
Added:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/bpel/ProcessProfileDAO.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/bpel/ProcessProfileDAO.java
(rev 0)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/bpel/ProcessProfileDAO.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.ode.dao.bpel;
+
+import java.util.List;
+
+import org.apache.ode.dao.bpel.ActivityRecoveryDAO;
+import org.apache.ode.dao.bpel.CorrelationSetDAO;
+import org.apache.ode.dao.bpel.CorrelatorDAO;
+import org.apache.ode.dao.bpel.FaultDAO;
+import org.apache.ode.dao.bpel.MessageDAO;
+import org.apache.ode.dao.bpel.MessageExchangeDAO;
+import org.apache.ode.dao.bpel.MessageRouteDAO;
+import org.apache.ode.dao.bpel.PartnerLinkDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ScopeDAO;
+import org.apache.ode.dao.bpel.XmlDataDAO;
+
+public interface ProcessProfileDAO {
+ boolean doesProcessExist();
+
+ List<ProcessInstanceDAO> findInstancesByProcess();
+
+ List<ActivityRecoveryDAO> findActivityRecoveriesByProcess();
+
+ List<CorrelationSetDAO> findCorrelationSetsByProcess();
+
+ List<CorrelatorDAO> findCorrelatorsByProcess();
+
+ List<FaultDAO> findFaultsByProcess();
+
+ List<MessageDAO> findMessagesByProcess();
+
+ List<MessageExchangeDAO> findMessageExchangesByProcess();
+
+ List<MessageRouteDAO> findMessageRoutesByProcess();
+
+ List<PartnerLinkDAO> findPartnerLinksByProcess();
+
+ List<ScopeDAO> findScopesByProcess();
+
+ List<XmlDataDAO> findXmlDataByProcess();
+
+ int countEventsByProcess();
+}
\ No newline at end of file
Added:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/hib/bpel/ProcessInstanceProfileDaoImpl.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/hib/bpel/ProcessInstanceProfileDaoImpl.java
(rev 0)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/hib/bpel/ProcessInstanceProfileDaoImpl.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.ode.dao.hib.bpel;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.dao.bpel.ActivityRecoveryDAO;
+import org.apache.ode.dao.bpel.CorrelationSetDAO;
+import org.apache.ode.dao.bpel.FaultDAO;
+import org.apache.ode.dao.bpel.MessageDAO;
+import org.apache.ode.dao.bpel.MessageExchangeDAO;
+import org.apache.ode.dao.bpel.MessageRouteDAO;
+import org.apache.ode.dao.bpel.PartnerLinkDAO;
+import org.apache.ode.dao.bpel.ProcessDAO;
+import org.apache.ode.dao.bpel.ScopeDAO;
+import org.apache.ode.dao.bpel.XmlDataDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceProfileDAO;
+import org.apache.ode.dao.hib.SessionManager;
+import org.apache.ode.dao.hib.bpel.hobj.HActivityRecovery;
+import org.apache.ode.dao.hib.bpel.hobj.HCorrelationSet;
+import org.apache.ode.dao.hib.bpel.hobj.HCorrelatorSelector;
+import org.apache.ode.dao.hib.bpel.hobj.HFaultData;
+import org.apache.ode.dao.hib.bpel.hobj.HMessage;
+import org.apache.ode.dao.hib.bpel.hobj.HMessageExchange;
+import org.apache.ode.dao.hib.bpel.hobj.HPartnerLink;
+import org.apache.ode.dao.hib.bpel.hobj.HScope;
+import org.apache.ode.dao.hib.bpel.hobj.HXmlData;
+import org.hibernate.Query;
+
+import java.lang.reflect.Constructor;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Hibernate based {@link ProcessInstanceProfileDao} implementation
+ */
+public class ProcessInstanceProfileDaoImpl extends ProcessProfileDaoImpl implements
ProcessInstanceProfileDAO {
+ @SuppressWarnings("unused")
+ private static final Log __log =
LogFactory.getLog(ProcessInstanceProfileDaoImpl.class);
+
+ private ProcessInstanceDaoImpl instance;
+
+ public ProcessInstanceProfileDaoImpl(SessionManager sm, ProcessInstanceDaoImpl
instance) {
+ super(sm, (ProcessDaoImpl)instance.getProcess());
+
entering("ProcessInstanceProfileDaoImpl.ProcessInstanceProfileDaoImpl");
+ this.instance = instance;
+ }
+
+ public SessionManager getSessionManager() {
+ return _sm;
+ }
+
+ public ProcessDAO getProcess() {
+ return process;
+ }
+
+ public List<MessageExchangeDAO> findMessageExchangesByInstance() {
+ return findByInstance("from HMessageExchange as x where x.instance =
:instance)", MessageExchangeDaoImpl.class, HMessageExchange.class);
+ }
+
+ public List<MessageRouteDAO> findMessageRoutesByInstance() {
+ return findByInstance("from HCorrelatorSelector as s where s.instance =
:instance", MessageRouteDaoImpl.class, HCorrelatorSelector.class);
+ }
+
+ public List<MessageDAO> findMessagesByInstance() {
+ return findByInstance("from HMessage as m where m.messageExchange.instance =
:instance)", MessageDaoImpl.class, HMessage.class);
+ }
+
+ public List<PartnerLinkDAO> findPartnerLinksByInstance() {
+ return findByInstance("from HPartnerLink as p where p.scope.instance =
:instance)", PartnerLinkDAOImpl.class, HPartnerLink.class);
+ }
+
+ public List<ScopeDAO> findScopesByInstance() {
+ return findByInstance("from HScope as s where s.instance = :instance)",
ScopeDaoImpl.class, HScope.class);
+ }
+
+ public List<XmlDataDAO> findXmlDataByInstance() {
+ return findByInstance("from HXmlData as x where x.instance =
:instance", XmlDataDaoImpl.class, HXmlData.class);
+ }
+
+ public List<ActivityRecoveryDAO> findActivityRecoveriesByInstance() {
+ return findByInstance("from HActivityRecovery as a where a.instance =
:instance", ActivityRecoveryDaoImpl.class, HActivityRecovery.class);
+ }
+
+ public List<CorrelationSetDAO> findCorrelationSetsByInstance() {
+ return findByInstance("from HCorrelationSet as s where s.instance =
:instance", CorrelationSetDaoImpl.class, HCorrelationSet.class);
+ }
+
+ public List<FaultDAO> findFaultsByInstance() {
+ return findByInstance("from HFaultData as f where f in (select i.fault from
HProcessInstance as i where i = :instance and i.fault is not null)",
FaultDAOImpl.class, HFaultData.class);
+ }
+
+ public int countEventsByInstance() {
+ Query query = getSession().createQuery("select count(id) from HBpelEvent as
e where e.instance = :instance");
+ query.setParameter("instance", instance._hobj);
+
+ return ((Long)query.uniqueResult()).intValue();
+ }
+
+ @SuppressWarnings("unchecked")
+ protected <D, H> List<D> findByInstance(String queryString, Class
daoClass, Class hibClass) {
+ List<D> results = new ArrayList<D>();
+
+ try {
+ Query query = getSession().createQuery(queryString);
+ query.setParameter("instance", instance._hobj);
+ for( H hibObj : (Collection<H>)query.list()) {
+ Constructor<D> c = daoClass.getConstructor(SessionManager.class,
hibClass);
+ results.add( c.newInstance(_sm, hibObj) );
+ }
+ } catch( Exception e ) {
+ throw new RuntimeException(e);
+ }
+
+ return results;
+ }
+}
\ No newline at end of file
Added:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/hib/bpel/ProcessProfileDaoImpl.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/hib/bpel/ProcessProfileDaoImpl.java
(rev 0)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/hib/bpel/ProcessProfileDaoImpl.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.ode.dao.hib.bpel;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.dao.bpel.ActivityRecoveryDAO;
+import org.apache.ode.dao.bpel.CorrelationSetDAO;
+import org.apache.ode.dao.bpel.CorrelatorDAO;
+import org.apache.ode.dao.bpel.FaultDAO;
+import org.apache.ode.dao.bpel.MessageDAO;
+import org.apache.ode.dao.bpel.MessageExchangeDAO;
+import org.apache.ode.dao.bpel.MessageRouteDAO;
+import org.apache.ode.dao.bpel.PartnerLinkDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ScopeDAO;
+import org.apache.ode.dao.bpel.XmlDataDAO;
+import org.apache.ode.dao.bpel.ProcessProfileDAO;
+import org.apache.ode.dao.hib.SessionManager;
+import org.apache.ode.dao.hib.bpel.hobj.HActivityRecovery;
+import org.apache.ode.dao.hib.bpel.hobj.HCorrelationSet;
+import org.apache.ode.dao.hib.bpel.hobj.HCorrelator;
+import org.apache.ode.dao.hib.bpel.hobj.HCorrelatorSelector;
+import org.apache.ode.dao.hib.bpel.hobj.HFaultData;
+import org.apache.ode.dao.hib.bpel.hobj.HMessage;
+import org.apache.ode.dao.hib.bpel.hobj.HMessageExchange;
+import org.apache.ode.dao.hib.bpel.hobj.HPartnerLink;
+import org.apache.ode.dao.hib.bpel.hobj.HProcess;
+import org.apache.ode.dao.hib.bpel.hobj.HProcessInstance;
+import org.apache.ode.dao.hib.bpel.hobj.HScope;
+import org.apache.ode.dao.hib.bpel.hobj.HXmlData;
+import org.hibernate.Query;
+
+import java.lang.reflect.Constructor;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Hibernate based {@link ProcessProfileDAO} implementation
+ */
+public class ProcessProfileDaoImpl extends HibernateDao implements ProcessProfileDAO {
+ @SuppressWarnings("unused")
+ private static final Log __log = LogFactory.getLog(ProcessProfileDaoImpl.class);
+
+ protected ProcessDaoImpl process;
+
+ public ProcessProfileDaoImpl(SessionManager sm, ProcessDaoImpl process) {
+ super(sm, process._hobj);
+ entering("ProcessProfileDaoImpl.ProcessProfileDaoImpl");
+ this.process = process;
+ }
+
+ public SessionManager getSessionManager() {
+ return _sm;
+ }
+
+ @SuppressWarnings("unchecked")
+ public boolean doesProcessExist() {
+ boolean exists = false;
+
+ Query query = getSession().createQuery("select count(id) from HProcess as p
where p.guid = :guid");
+ query.setParameter("guid", ((HProcess)process._hobj).getGuid());
+ for( Long cnt : (List<Long>)query.list()) {
+ exists = cnt.intValue() > 0;
+ }
+
+ return exists;
+ }
+
+ public List<ProcessInstanceDAO> findInstancesByProcess() {
+ return findByProcess("from HProcessInstance as i where i.process =
:process)", ProcessInstanceDaoImpl.class, HProcessInstance.class);
+ }
+
+ public List<MessageExchangeDAO> findMessageExchangesByProcess() {
+ return findByProcess("from HMessageExchange as x where x.instance.process =
:process)", MessageExchangeDaoImpl.class, HMessageExchange.class);
+ }
+
+ public List<MessageRouteDAO> findMessageRoutesByProcess() {
+ return findByProcess("from HCorrelatorSelector as s where s.instance.process
= :process)", MessageRouteDaoImpl.class, HCorrelatorSelector.class);
+ }
+
+ public List<MessageDAO> findMessagesByProcess() {
+ return findByProcess("from HMessage as m where m.messageExchange.process =
:process)", MessageDaoImpl.class, HMessage.class);
+ }
+
+ public List<PartnerLinkDAO> findPartnerLinksByProcess() {
+ return findByProcess("from HPartnerLink as p where p.process =
:process)", PartnerLinkDAOImpl.class, HPartnerLink.class);
+ }
+
+ public List<ScopeDAO> findScopesByProcess() {
+ return findByProcess("from HScope as s where s.instance.process =
:process", ScopeDaoImpl.class, HScope.class);
+ }
+
+ public List<XmlDataDAO> findXmlDataByProcess() {
+ return findByProcess("from HXmlData as x where x.instance.process =
:process", XmlDataDaoImpl.class, HXmlData.class);
+ }
+
+ public List<ActivityRecoveryDAO> findActivityRecoveriesByProcess() {
+ return findByProcess("from HActivityRecovery as a where a.instance.process =
:process", ActivityRecoveryDaoImpl.class, HActivityRecovery.class);
+ }
+
+ public List<CorrelationSetDAO> findCorrelationSetsByProcess() {
+ return findByProcess("from HCorrelationSet as s where s.process =
:process", CorrelationSetDaoImpl.class, HCorrelationSet.class);
+ }
+
+ public List<CorrelatorDAO> findCorrelatorsByProcess() {
+ return findByProcess("from HCorrelator as c where c.process =
:process", CorrelatorDaoImpl.class, HCorrelator.class);
+ }
+
+ public List<FaultDAO> findFaultsByProcess() {
+ return findByProcess("from HFaultData as f where f in (select i.fault from
HProcessInstance as i where i.process = :process and i.fault is not null)",
FaultDAOImpl.class, HFaultData.class);
+ }
+
+ public int countEventsByProcess() {
+ Query query = getSession().createQuery("select count(id) from HBpelEvent as
e where e.instance.process = :process");
+ query.setParameter("process", process._hobj);
+
+ return ((Long)query.uniqueResult()).intValue();
+ }
+
+ @SuppressWarnings("unchecked")
+ protected <D, H> List<D> findByProcess(String queryString, Class
daoClass, Class hibClass) {
+ List<D> results = new ArrayList<D>();
+
+ try {
+ Query query = getSession().createQuery(queryString);
+ query.setParameter("process", process._hobj);
+ for( H hibObj : (Collection<H>)query.list()) {
+ Constructor<D> c = daoClass.getConstructor(SessionManager.class,
hibClass);
+ results.add( c.newInstance(_sm, hibObj) );
+ }
+ } catch( Exception e ) {
+ throw new RuntimeException(e);
+ }
+
+ return results;
+ }
+}
\ No newline at end of file
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/jpa/ProcessInstanceProfileDAOImpl.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/jpa/ProcessInstanceProfileDAOImpl.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/jpa/ProcessInstanceProfileDAOImpl.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -21,17 +21,19 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.dao.ActivityRecoveryDAO;
-import org.apache.ode.bpel.dao.CorrelationSetDAO;
-import org.apache.ode.bpel.dao.FaultDAO;
-import org.apache.ode.bpel.dao.MessageDAO;
-import org.apache.ode.bpel.dao.MessageExchangeDAO;
-import org.apache.ode.bpel.dao.MessageRouteDAO;
-import org.apache.ode.bpel.dao.PartnerLinkDAO;
-import org.apache.ode.bpel.dao.ProcessDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceProfileDAO;
-import org.apache.ode.bpel.dao.ScopeDAO;
-import org.apache.ode.bpel.dao.XmlDataDAO;
+import org.apache.ode.dao.bpel.ActivityRecoveryDAO;
+import org.apache.ode.dao.bpel.CorrelationSetDAO;
+import org.apache.ode.dao.bpel.FaultDAO;
+import org.apache.ode.dao.bpel.MessageDAO;
+import org.apache.ode.dao.bpel.MessageExchangeDAO;
+import org.apache.ode.dao.bpel.MessageRouteDAO;
+import org.apache.ode.dao.bpel.PartnerLinkDAO;
+import org.apache.ode.dao.bpel.ProcessDAO;
+import org.apache.ode.dao.bpel.ScopeDAO;
+import org.apache.ode.dao.bpel.XmlDataDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceProfileDAO;
+import org.apache.ode.dao.jpa.bpel.ProcessDAOImpl;
+import org.apache.ode.dao.jpa.bpel.ProcessInstanceDAOImpl;
import java.util.List;
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/jpa/ProcessProfileDAOImpl.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/jpa/ProcessProfileDAOImpl.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/dao/jpa/ProcessProfileDAOImpl.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -23,18 +23,19 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.dao.ActivityRecoveryDAO;
-import org.apache.ode.bpel.dao.CorrelationSetDAO;
-import org.apache.ode.bpel.dao.CorrelatorDAO;
-import org.apache.ode.bpel.dao.FaultDAO;
-import org.apache.ode.bpel.dao.MessageDAO;
-import org.apache.ode.bpel.dao.MessageExchangeDAO;
-import org.apache.ode.bpel.dao.MessageRouteDAO;
-import org.apache.ode.bpel.dao.PartnerLinkDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceDAO;
-import org.apache.ode.bpel.dao.ProcessProfileDAO;
-import org.apache.ode.bpel.dao.ScopeDAO;
-import org.apache.ode.bpel.dao.XmlDataDAO;
+import org.apache.ode.dao.bpel.ActivityRecoveryDAO;
+import org.apache.ode.dao.bpel.CorrelationSetDAO;
+import org.apache.ode.dao.bpel.CorrelatorDAO;
+import org.apache.ode.dao.bpel.FaultDAO;
+import org.apache.ode.dao.bpel.MessageDAO;
+import org.apache.ode.dao.bpel.MessageExchangeDAO;
+import org.apache.ode.dao.bpel.MessageRouteDAO;
+import org.apache.ode.dao.bpel.PartnerLinkDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ScopeDAO;
+import org.apache.ode.dao.bpel.XmlDataDAO;
+import org.apache.ode.dao.bpel.ProcessProfileDAO;
+import org.apache.ode.dao.jpa.bpel.ProcessDAOImpl;
import javax.persistence.EntityManager;
import javax.persistence.Query;
@@ -42,7 +43,7 @@
/**
* OpenJPA based {@link ProcessProfileDAO} implementation
*/
-public class ProcessProfileDAOImpl extends OpenJPADAO implements ProcessProfileDAO {
+public class ProcessProfileDAOImpl implements ProcessProfileDAO {
@SuppressWarnings("unused")
private static final Log __log = LogFactory.getLog(ProcessProfileDAOImpl.class);
@@ -50,6 +51,7 @@
protected ProcessDAOImpl process;
public ProcessProfileDAOImpl(EntityManager em, ProcessDAOImpl process) {
+ assert process != null;
this.process = process;
this.em = em;
}
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/daohib/bpel/ProcessInstanceProfileDaoImpl.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/daohib/bpel/ProcessInstanceProfileDaoImpl.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/daohib/bpel/ProcessInstanceProfileDaoImpl.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -1,135 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.ode.daohib.bpel;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.dao.ActivityRecoveryDAO;
-import org.apache.ode.bpel.dao.CorrelationSetDAO;
-import org.apache.ode.bpel.dao.FaultDAO;
-import org.apache.ode.bpel.dao.MessageDAO;
-import org.apache.ode.bpel.dao.MessageExchangeDAO;
-import org.apache.ode.bpel.dao.MessageRouteDAO;
-import org.apache.ode.bpel.dao.PartnerLinkDAO;
-import org.apache.ode.bpel.dao.ProcessDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceProfileDAO;
-import org.apache.ode.bpel.dao.ScopeDAO;
-import org.apache.ode.bpel.dao.XmlDataDAO;
-import org.apache.ode.daohib.SessionManager;
-import org.apache.ode.daohib.bpel.hobj.HActivityRecovery;
-import org.apache.ode.daohib.bpel.hobj.HCorrelationSet;
-import org.apache.ode.daohib.bpel.hobj.HCorrelatorSelector;
-import org.apache.ode.daohib.bpel.hobj.HFaultData;
-import org.apache.ode.daohib.bpel.hobj.HMessage;
-import org.apache.ode.daohib.bpel.hobj.HMessageExchange;
-import org.apache.ode.daohib.bpel.hobj.HPartnerLink;
-import org.apache.ode.daohib.bpel.hobj.HScope;
-import org.apache.ode.daohib.bpel.hobj.HXmlData;
-import org.hibernate.Query;
-
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Hibernate based {@link ProcessInstanceProfileDao} implementation
- */
-public class ProcessInstanceProfileDaoImpl extends ProcessProfileDaoImpl implements
ProcessInstanceProfileDAO {
- @SuppressWarnings("unused")
- private static final Log __log =
LogFactory.getLog(ProcessInstanceProfileDaoImpl.class);
-
- private ProcessInstanceDaoImpl instance;
-
- public ProcessInstanceProfileDaoImpl(SessionManager sm, ProcessInstanceDaoImpl
instance) {
- super(sm, (ProcessDaoImpl)instance.getProcess());
-
entering("ProcessInstanceProfileDaoImpl.ProcessInstanceProfileDaoImpl");
- this.instance = instance;
- }
-
- public SessionManager getSessionManager() {
- return _sm;
- }
-
- public ProcessDAO getProcess() {
- return process;
- }
-
- public List<MessageExchangeDAO> findMessageExchangesByInstance() {
- return findByInstance("from HMessageExchange as x where x.instance =
:instance)", MessageExchangeDaoImpl.class, HMessageExchange.class);
- }
-
- public List<MessageRouteDAO> findMessageRoutesByInstance() {
- return findByInstance("from HCorrelatorSelector as s where s.instance =
:instance", MessageRouteDaoImpl.class, HCorrelatorSelector.class);
- }
-
- public List<MessageDAO> findMessagesByInstance() {
- return findByInstance("from HMessage as m where m.messageExchange.instance =
:instance)", MessageDaoImpl.class, HMessage.class);
- }
-
- public List<PartnerLinkDAO> findPartnerLinksByInstance() {
- return findByInstance("from HPartnerLink as p where p.scope.instance =
:instance)", PartnerLinkDAOImpl.class, HPartnerLink.class);
- }
-
- public List<ScopeDAO> findScopesByInstance() {
- return findByInstance("from HScope as s where s.instance = :instance)",
ScopeDaoImpl.class, HScope.class);
- }
-
- public List<XmlDataDAO> findXmlDataByInstance() {
- return findByInstance("from HXmlData as x where x.instance =
:instance", XmlDataDaoImpl.class, HXmlData.class);
- }
-
- public List<ActivityRecoveryDAO> findActivityRecoveriesByInstance() {
- return findByInstance("from HActivityRecovery as a where a.instance =
:instance", ActivityRecoveryDaoImpl.class, HActivityRecovery.class);
- }
-
- public List<CorrelationSetDAO> findCorrelationSetsByInstance() {
- return findByInstance("from HCorrelationSet as s where s.instance =
:instance", CorrelationSetDaoImpl.class, HCorrelationSet.class);
- }
-
- public List<FaultDAO> findFaultsByInstance() {
- return findByInstance("from HFaultData as f where f in (select i.fault from
HProcessInstance as i where i = :instance and i.fault is not null)",
FaultDAOImpl.class, HFaultData.class);
- }
-
- public int countEventsByInstance() {
- Query query = getSession().createQuery("select count(id) from HBpelEvent as
e where e.instance = :instance");
- query.setParameter("instance", instance._hobj);
-
- return ((Long)query.uniqueResult()).intValue();
- }
-
- @SuppressWarnings("unchecked")
- protected <D, H> List<D> findByInstance(String queryString, Class
daoClass, Class hibClass) {
- List<D> results = new ArrayList<D>();
-
- try {
- Query query = getSession().createQuery(queryString);
- query.setParameter("instance", instance._hobj);
- for( H hibObj : (Collection<H>)query.list()) {
- Constructor<D> c = daoClass.getConstructor(SessionManager.class,
hibClass);
- results.add( c.newInstance(_sm, hibObj) );
- }
- } catch( Exception e ) {
- throw new RuntimeException(e);
- }
-
- return results;
- }
-}
\ No newline at end of file
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/daohib/bpel/ProcessProfileDaoImpl.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/daohib/bpel/ProcessProfileDaoImpl.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/java/org/apache/ode/daohib/bpel/ProcessProfileDaoImpl.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -1,156 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.ode.daohib.bpel;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.dao.ActivityRecoveryDAO;
-import org.apache.ode.bpel.dao.CorrelationSetDAO;
-import org.apache.ode.bpel.dao.CorrelatorDAO;
-import org.apache.ode.bpel.dao.FaultDAO;
-import org.apache.ode.bpel.dao.MessageDAO;
-import org.apache.ode.bpel.dao.MessageExchangeDAO;
-import org.apache.ode.bpel.dao.MessageRouteDAO;
-import org.apache.ode.bpel.dao.PartnerLinkDAO;
-import org.apache.ode.bpel.dao.ProcessInstanceDAO;
-import org.apache.ode.bpel.dao.ProcessProfileDAO;
-import org.apache.ode.bpel.dao.ScopeDAO;
-import org.apache.ode.bpel.dao.XmlDataDAO;
-import org.apache.ode.daohib.SessionManager;
-import org.apache.ode.daohib.bpel.hobj.HActivityRecovery;
-import org.apache.ode.daohib.bpel.hobj.HCorrelationSet;
-import org.apache.ode.daohib.bpel.hobj.HCorrelator;
-import org.apache.ode.daohib.bpel.hobj.HCorrelatorSelector;
-import org.apache.ode.daohib.bpel.hobj.HFaultData;
-import org.apache.ode.daohib.bpel.hobj.HMessage;
-import org.apache.ode.daohib.bpel.hobj.HMessageExchange;
-import org.apache.ode.daohib.bpel.hobj.HPartnerLink;
-import org.apache.ode.daohib.bpel.hobj.HProcess;
-import org.apache.ode.daohib.bpel.hobj.HProcessInstance;
-import org.apache.ode.daohib.bpel.hobj.HScope;
-import org.apache.ode.daohib.bpel.hobj.HXmlData;
-import org.hibernate.Query;
-
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Hibernate based {@link ProcessProfileDAO} implementation
- */
-public class ProcessProfileDaoImpl extends HibernateDao implements ProcessProfileDAO {
- @SuppressWarnings("unused")
- private static final Log __log = LogFactory.getLog(ProcessProfileDaoImpl.class);
-
- protected ProcessDaoImpl process;
-
- public ProcessProfileDaoImpl(SessionManager sm, ProcessDaoImpl process) {
- super(sm, process._hobj);
- entering("ProcessProfileDaoImpl.ProcessProfileDaoImpl");
- this.process = process;
- }
-
- public SessionManager getSessionManager() {
- return _sm;
- }
-
- @SuppressWarnings("unchecked")
- public boolean doesProcessExist() {
- boolean exists = false;
-
- Query query = getSession().createQuery("select count(id) from HProcess as p
where p.guid = :guid");
- query.setParameter("guid", ((HProcess)process._hobj).getGuid());
- for( Long cnt : (List<Long>)query.list()) {
- exists = cnt.intValue() > 0;
- }
-
- return exists;
- }
-
- public List<ProcessInstanceDAO> findInstancesByProcess() {
- return findByProcess("from HProcessInstance as i where i.process =
:process)", ProcessInstanceDaoImpl.class, HProcessInstance.class);
- }
-
- public List<MessageExchangeDAO> findMessageExchangesByProcess() {
- return findByProcess("from HMessageExchange as x where x.instance.process =
:process)", MessageExchangeDaoImpl.class, HMessageExchange.class);
- }
-
- public List<MessageRouteDAO> findMessageRoutesByProcess() {
- return findByProcess("from HCorrelatorSelector as s where s.instance.process
= :process)", MessageRouteDaoImpl.class, HCorrelatorSelector.class);
- }
-
- public List<MessageDAO> findMessagesByProcess() {
- return findByProcess("from HMessage as m where m.messageExchange.process =
:process)", MessageDaoImpl.class, HMessage.class);
- }
-
- public List<PartnerLinkDAO> findPartnerLinksByProcess() {
- return findByProcess("from HPartnerLink as p where p.process =
:process)", PartnerLinkDAOImpl.class, HPartnerLink.class);
- }
-
- public List<ScopeDAO> findScopesByProcess() {
- return findByProcess("from HScope as s where s.instance.process =
:process", ScopeDaoImpl.class, HScope.class);
- }
-
- public List<XmlDataDAO> findXmlDataByProcess() {
- return findByProcess("from HXmlData as x where x.instance.process =
:process", XmlDataDaoImpl.class, HXmlData.class);
- }
-
- public List<ActivityRecoveryDAO> findActivityRecoveriesByProcess() {
- return findByProcess("from HActivityRecovery as a where a.instance.process =
:process", ActivityRecoveryDaoImpl.class, HActivityRecovery.class);
- }
-
- public List<CorrelationSetDAO> findCorrelationSetsByProcess() {
- return findByProcess("from HCorrelationSet as s where s.process =
:process", CorrelationSetDaoImpl.class, HCorrelationSet.class);
- }
-
- public List<CorrelatorDAO> findCorrelatorsByProcess() {
- return findByProcess("from HCorrelator as c where c.process =
:process", CorrelatorDaoImpl.class, HCorrelator.class);
- }
-
- public List<FaultDAO> findFaultsByProcess() {
- return findByProcess("from HFaultData as f where f in (select i.fault from
HProcessInstance as i where i.process = :process and i.fault is not null)",
FaultDAOImpl.class, HFaultData.class);
- }
-
- public int countEventsByProcess() {
- Query query = getSession().createQuery("select count(id) from HBpelEvent as
e where e.instance.process = :process");
- query.setParameter("process", process._hobj);
-
- return ((Long)query.uniqueResult()).intValue();
- }
-
- @SuppressWarnings("unchecked")
- protected <D, H> List<D> findByProcess(String queryString, Class
daoClass, Class hibClass) {
- List<D> results = new ArrayList<D>();
-
- try {
- Query query = getSession().createQuery(queryString);
- query.setParameter("process", process._hobj);
- for( H hibObj : (Collection<H>)query.list()) {
- Constructor<D> c = daoClass.getConstructor(SessionManager.class,
hibClass);
- results.add( c.newInstance(_sm, hibObj) );
- }
- } catch( Exception e ) {
- throw new RuntimeException(e);
- }
-
- return results;
- }
-}
\ No newline at end of file
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/resources/TestRampartPolicy/secured-processes/process-sample02_standalone_policy/sample02-policy-for-service.xml
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/resources/TestRampartPolicy/secured-processes/process-sample02_standalone_policy/sample02-policy-for-service.xml 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/resources/TestRampartPolicy/secured-processes/process-sample02_standalone_policy/sample02-policy-for-service.xml 2010-05-25
17:50:59 UTC (rev 667)
@@ -72,7 +72,7 @@
<ramp:signatureCrypto>
<ramp:crypto
provider="org.apache.ws.security.components.crypto.Merlin">
<ramp:property
name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
- <ramp:property
name="org.apache.ws.security.crypto.merlin.file">service.jks</ramp:property>
+ <ramp:property
name="org.apache.ws.security.crypto.merlin.file">TestRampartPolicy/secured-processes/service.jks</ramp:property>
<ramp:property
name="org.apache.ws.security.crypto.merlin.keystore.password">apache</ramp:property>
</ramp:crypto>
</ramp:signatureCrypto>
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/webapp/WEB-INF/conf.hib-derby/ode-axis2.properties
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/webapp/WEB-INF/conf.hib-derby/ode-axis2.properties 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/webapp/WEB-INF/conf.hib-derby/ode-axis2.properties 2010-05-25
17:50:59 UTC (rev 667)
@@ -14,10 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-
ode-axis2.dao.factory=org.apache.ode.axis2.instancecleanup.HibDaoConnectionFactoryImpl
-ode-axis2.db.emb.name=hibdb
+ode-axis2.dao.factory.store=org.apache.ode.dao.hib.store.ConfStoreDAOConnectionFactoryImpl
+ode-axis2.db.emb.name=ode-db-hib
ode-axis2.db.mode=EMBEDDED
+ode-axis2.db.emb.type=derby
+ode-axis2.db.emb.create=false
ode-axis2.cluster.localRoute.targets=http://doesntexist:8080/ode/processes/
ode-axis2.cluster.localRoute.base=http://localhost:8888/ode/processes/
ode-axis2.event.listeners=org.apache.ode.bpel.common.evt.DebugBpelEventListener
Modified:
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/webapp/WEB-INF/conf.jpa-derby/ode-axis2.properties
===================================================================
---
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/webapp/WEB-INF/conf.jpa-derby/ode-axis2.properties 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/axis2-war/src/test/webapp/WEB-INF/conf.jpa-derby/ode-axis2.properties 2010-05-25
17:50:59 UTC (rev 667)
@@ -15,4 +15,6 @@
# limitations under the License.
#
-ode-axis2.dao.factory=org.apache.ode.axis2.instancecleanup.JpaDaoConnectionFactoryImpl
\ No newline at end of file
+ode-axis2.dao.factory=org.apache.ode.axis2.instancecleanup.JpaDaoConnectionFactoryImpl
+ode-axis2.db.emb.type=derby
+ode-axis2.db.emb.create=false
\ No newline at end of file
Modified:
branches/ODE/ODE-1.x-jpa/bpel-epr/src/main/java/org/apache/ode/il/config/OdeConfigProperties.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/bpel-epr/src/main/java/org/apache/ode/il/config/OdeConfigProperties.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/bpel-epr/src/main/java/org/apache/ode/il/config/OdeConfigProperties.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -278,7 +278,7 @@
}
public int getPoolMaxSize() {
- return Integer.valueOf(getProperty(OdeConfigProperties.PROP_POOL_MAX,
"10"));
+ return Integer.valueOf(getProperty(OdeConfigProperties.PROP_POOL_MAX,
"15"));
}
public int getPoolMinSize() {
Modified: branches/ODE/ODE-1.x-jpa/bpel-schemas/pom.xml
===================================================================
--- branches/ODE/ODE-1.x-jpa/bpel-schemas/pom.xml 2010-05-25 17:27:34 UTC (rev 666)
+++ branches/ODE/ODE-1.x-jpa/bpel-schemas/pom.xml 2010-05-25 17:50:59 UTC (rev 667)
@@ -50,6 +50,7 @@
<configuration>
<schemaDirectory>src/main/xsd</schemaDirectory>
<sourceGenerationDirectory>target/generated/xmlbeans</sourceGenerationDirectory>
+
<classGenerationDirectory>target/generated/xmlbeans</classGenerationDirectory>
<xmlConfigs>
<xmlConfig
implementation="java.io.File">src/main/xsd/dd.xsdconfig</xmlConfig>
<xmlConfig
implementation="java.io.File">src/main/xsd/pmapi.xsdconfig</xmlConfig>
@@ -65,6 +66,25 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <classifier>xsd</classifier>
+
<classesDirectory>src/main/xsd</classesDirectory>
+ <includes>
+ <include>*.xsd</include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Modified:
branches/ODE/ODE-1.x-jpa/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -18,6 +18,7 @@
*/
package org.apache.ode.test;
+import org.junit.Ignore;
import org.junit.Test;
public class DataHandling20Test extends BPELTestAbstract {
@@ -61,6 +62,7 @@
go("/bpel/2.0/TestAssignActivity1");
}
+ @Ignore
@Test
public void testAssignActivity2() throws Throwable {
go("/bpel/2.0/TestAssignActivity2");
Modified:
branches/ODE/ODE-1.x-jpa/bpel-test/src/test/java/org/apache/ode/test/ExternalVariableTest.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/bpel-test/src/test/java/org/apache/ode/test/ExternalVariableTest.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/bpel-test/src/test/java/org/apache/ode/test/ExternalVariableTest.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -22,12 +22,15 @@
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
+import java.util.Properties;
import javax.sql.DataSource;
import javax.xml.namespace.QName;
-import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource;
+
import org.apache.ode.bpel.extvar.jdbc.JdbcExternalVariableModule;
+import org.apache.ode.il.config.OdeConfigProperties;
+import org.apache.ode.il.dbutil.Database;
import org.junit.Test;
/**
@@ -37,21 +40,20 @@
private JdbcExternalVariableModule _jdbcext;
- private DataSource _ds;
+ private Database _db;
public void setUp() throws Exception {
super.setUp();
- EmbeddedConnectionPoolDataSource ds = new EmbeddedConnectionPoolDataSource();
- ds.setCreateDatabase("create");
- ds.setDatabaseName("target/ExternalVariableTest");
- _ds = ds;
+ OdeConfigProperties props = new OdeConfigProperties(new
Properties(),"");
+ _db = new Database(props);
+ _db.start();
_jdbcext = new JdbcExternalVariableModule();
- _jdbcext.registerDataSource("testds", _ds);
+ _jdbcext.registerDataSource("testds", _db.getDataSource());
_server.registerExternalVariableEngine(_jdbcext);
- Connection conn = _ds.getConnection();
+ Connection conn = _db.getDataSource().getConnection();
Statement s = conn.createStatement();
dropTable(s, "extvartable1");
Modified:
branches/ODE/ODE-1.x-jpa/dao-hibernate/src/main/java/org/apache/ode/dao/hib/bpel/BpelDAOConnectionFactoryImpl.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/dao-hibernate/src/main/java/org/apache/ode/dao/hib/bpel/BpelDAOConnectionFactoryImpl.java 2010-05-25
17:27:34 UTC (rev 666)
+++
branches/ODE/ODE-1.x-jpa/dao-hibernate/src/main/java/org/apache/ode/dao/hib/bpel/BpelDAOConnectionFactoryImpl.java 2010-05-25
17:50:59 UTC (rev 667)
@@ -48,9 +48,9 @@
protected SessionManager _sessionManager;
- private DataSource _ds;
+ protected DataSource _ds;
- private TransactionManager _tm;
+ protected TransactionManager _txm;
/**
* Constructor.
@@ -69,12 +69,12 @@
@SuppressWarnings("unchecked")
public void init(Properties initialProps, TransactionManager mgr, Object env) {
- _tm=mgr;
+ _txm=mgr;
_ds=(DataSource)env;
- if (_tm == null){
+ if (_txm == null){
__log.error("Hibernate BpelDAOConnectionFactoryImpl requires a JTA
Transaction Manager to be set.");
}
- _sessionManager = setupSessionManager(initialProps, _tm, _ds);
+ _sessionManager = setupSessionManager(initialProps, _txm, _ds);
}
@@ -198,7 +198,7 @@
}
public void setTransactionManager(Object tm) {
- _tm = (TransactionManager) tm;
+ _txm = (TransactionManager) tm;
}
public void setUnmanagedDataSource(DataSource ds) {
Modified: branches/ODE/ODE-1.x-jpa/dao-hibernate-db/build.xml
===================================================================
--- branches/ODE/ODE-1.x-jpa/dao-hibernate-db/build.xml 2010-05-25 17:27:34 UTC (rev 666)
+++ branches/ODE/ODE-1.x-jpa/dao-hibernate-db/build.xml 2010-05-25 17:50:59 UTC (rev 667)
@@ -92,7 +92,7 @@
<include name="**/*.hbm.xml"/>
</fileset>
</schemaexport>
- <concat destfile="${db.scripts.dir}/(a){db}.sql">
+ <concat destfile="${db.scripts.dir}/scripts/(a){db}-hib.sql">
<fileset file="${sql.dir}/simplesched-(a){db}.sql"/>
<fileset file="${db.scripts.dir}/partial.(a){db}.sql"/>
</concat>
Modified: branches/ODE/ODE-1.x-jpa/dao-hibernate-db/pom.xml
===================================================================
--- branches/ODE/ODE-1.x-jpa/dao-hibernate-db/pom.xml 2010-05-25 17:27:34 UTC (rev 666)
+++ branches/ODE/ODE-1.x-jpa/dao-hibernate-db/pom.xml 2010-05-25 17:50:59 UTC (rev 667)
@@ -21,7 +21,7 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.soa.bpel</groupId>
- <artifactId>riftsaw-dao-hibernate-db</artifactId>
+ <artifactId>riftsaw-dao-hib-db</artifactId>
<name>ODE :: Hibernate DAO DDL Generation</name>
<parent>
@@ -60,7 +60,7 @@
<artifactId>riftsaw-dao-hibernate</artifactId>
</dependency>
</dependencies>
- <build>
+ <build>
<plugins>
<plugin>
@@ -73,7 +73,7 @@
<phase>generate-sources</phase>
<configuration>
<tasks>
- <property name="maven.runtime.classpath"
refid="maven.compile.classpath"/>
+ <property name="maven.runtime.classpath"
refid="maven.compile.classpath"/>
<ant antfile="build.xml" target="create-schema"
inheritRefs="true"/>
</tasks>
</configuration>
@@ -93,38 +93,39 @@
<goals>
<goal>execute</goal>
</goals>
- <configuration>
- <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
-
<url>jdbc:derby:${basedir}/target/derby/hibdb;create=true</url>
- <username>sa</username>
- <password />
- <autocommit>true</autocommit>
- <onError>continue</onError>
- <srcFiles>
- <srcFile>target/derby.sql</srcFile>
- </srcFiles>
- </configuration>
+ <configuration>
+ <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+
<url>jdbc:derby:${basedir}/target/ode-db-hib;create=true</url>
+ <username>sa</username>
+ <password />
+ <autocommit>true</autocommit>
+ <onError>continue</onError>
+ <srcFiles>
+ <srcFile>target/scripts/derby-hib.sql</srcFile>
+ </srcFiles>
+ </configuration>
</execution>
</executions>
</plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>zip-derby-db</id>
- <phase>package</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <property name="ode.version"
value="${project.version}"/>
- <ant antfile="build.xml" target="zip-derby-db" />
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+
<finalName>ode-db-derby-hib-${project.version}</finalName>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+
<descriptor>src/main/assembly/bin.xml</descriptor>
+ </descriptors>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
Added: branches/ODE/ODE-1.x-jpa/dao-hibernate-db/src/main/assembly/bin.xml
===================================================================
--- branches/ODE/ODE-1.x-jpa/dao-hibernate-db/src/main/assembly/bin.xml
(rev 0)
+++ branches/ODE/ODE-1.x-jpa/dao-hibernate-db/src/main/assembly/bin.xml 2010-05-25
17:50:59 UTC (rev 667)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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.
+ -->
+<assembly>
+ <!-- id typically identifies the "type" (src vs bin etc) of the assembly
-->
+ <id></id>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <fileSets>
+ <fileSet>
+ <outputDirectory>/</outputDirectory>
+ <directory>target</directory>
+ <includes>
+ <include>scripts/*.sql</include>
+ <include>ode-db-hib/**</include>
+ </includes>
+ <excludes>
+ <exclude>partial.*.sql</exclude>
+ </excludes>
+ </fileSet>
+ </fileSets>
+
+
+</assembly>
\ No newline at end of file