diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-11 21:17:34 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-11 21:17:34 +0000 |
commit | 993ff15cd6749572834e83f61ac9efeb0e27ad97 (patch) | |
tree | 00e6b61d6d17ec9acadd5e607ea5a6936d12d5dc /sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java | |
parent | e28d47b5d1a2ed8623e62fa36ee35a77671e92ef (diff) |
Updates to remove @Remotable to avoid SDO copyHelper bug
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@684934 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java | 34 |
1 files changed, 30 insertions, 4 deletions
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(); } |