summaryrefslogtreecommitdiffstats
path: root/sandbox
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/lresende/sca/samples/organization-das/pom.xml1
-rw-r--r--sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataService.java2
-rw-r--r--sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataServiceImpl.java7
-rw-r--r--sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java2
-rw-r--r--sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java34
5 files changed, 35 insertions, 11 deletions
diff --git a/sandbox/lresende/sca/samples/organization-das/pom.xml b/sandbox/lresende/sca/samples/organization-das/pom.xml
index f100e8d647..b39c125f25 100644
--- a/sandbox/lresende/sca/samples/organization-das/pom.xml
+++ b/sandbox/lresende/sca/samples/organization-das/pom.xml
@@ -140,7 +140,6 @@
<id>config</id>
<configuration>
<schemaFile>${basedir}/src/main/resources/sdo-types.xsd</schemaFile>
- <noNotification>true</noNotification>
<noUnsettable>true</noUnsettable>
</configuration>
<goals>
diff --git a/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataService.java b/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataService.java
index e035720769..af71558b14 100644
--- a/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataService.java
+++ b/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataService.java
@@ -19,10 +19,8 @@
package organization.das;
-import org.osoa.sca.annotations.Remotable;
import org.soa.types.SchemaInfoType;
-@Remotable
public interface OrganizationDataService {
public commonj.sdo.DataObject findOrganizationBugTwo(java.lang.String id, SchemaInfoType schemaInfo);
diff --git a/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataServiceImpl.java b/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataServiceImpl.java
index 07c435d2bd..2f99dc84f5 100644
--- a/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataServiceImpl.java
+++ b/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataServiceImpl.java
@@ -80,7 +80,10 @@ public class OrganizationDataServiceImpl implements OrganizationDataService {
java.sql.Connection conn = ConnectionHelper.getConnection(schemaInfo);
DAS das = DAS.FACTORY.createDAS(in, conn);
-
- das.applyChanges(organization);
+ try {
+ das.applyChanges(organization);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
}
diff --git a/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java b/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java
index f29d94e30b..d821da47e5 100644
--- a/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java
+++ b/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java
@@ -19,12 +19,10 @@
package organization.services;
-import org.osoa.sca.annotations.Remotable;
import org.soa.types.SchemaInfoType;
import commonj.sdo.DataObject;
-@Remotable
public interface OrganizationService {
public DataObject findOrganizationBugTwo(String id, SchemaInfoType schemaInfo);
diff --git a/sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java b/sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java
index f4d8ea1564..33810f4325 100644
--- a/sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java
+++ b/sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java
@@ -27,8 +27,8 @@ import org.apache.tuscany.sca.host.embedded.SCADomain;
import org.junit.Test;
import org.soa.types.SchemaInfoType;
import org.soa.types.TypesFactory;
-
import organization.services.OrganizationService;
+
import util.ConnectionHelper;
import commonj.sdo.DataObject;
@@ -79,7 +79,31 @@ public class OrganizationTestCase {
}
+ @Test
+ public void testRetrieveOrganizationAndSaveDAS() {
+ DataObject root = null;
+ InputStream in = getClass().getClassLoader().getResourceAsStream("organizationConfiguration.xml");
+
+ // Need to put in valid values for your DB
+ SchemaInfoType schemaInfo = TypesFactory.INSTANCE.createSchemaInfoType();
+ schemaInfo.setPASSWORD("");
+ schemaInfo.setSCHEMA("");
+ schemaInfo.setUSERNAME("");
+
+ java.sql.Connection conn = ConnectionHelper.getConnection(schemaInfo);
+
+ DAS das = DAS.FACTORY.createDAS(in, conn);
+ Command read = das.getCommand("getAccountByID");
+ read.setParameter(1, Integer.valueOf(id));
+ root = read.executeQuery();
+
+ das.applyChanges(root);
+ }
+
+ /**
+ * This represents BUG_TWO from TUSCANY-2525
+ */
@Test
public void testRetrieveOrganizationSCA() {
@@ -106,9 +130,11 @@ public class OrganizationTestCase {
// This doesn't work either. The root datagraph is null
// If you call das.applyChanges for a dataObject that has null as the dataGraph,
// it hurls.
- //commonj.sdo.DataObject rootOne = organizationService.findOrganizationBugTwo(id, schemaInfo);
- //System.out.println("rootOne dataGraph -> " + rootOne.getDataGraph());
- //organizationService.updateOrganization(rootOne, schemaInfo);
+ DataObject rootOne = organizationService.findOrganizationBugTwo(id, schemaInfo);
+ ////account = root.getDataObject("ACCOUNT[1]");
+ ////account.set("ACCOUNT_NAME", "something");
+ System.out.println("rootOne dataGraph -> " + rootOne.getDataGraph());
+ organizationService.updateOrganization(rootOne, schemaInfo);
scaDomain.close();
}