summaryrefslogtreecommitdiffstats
path: root/sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java')
-rw-r--r--sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java19
1 files changed, 9 insertions, 10 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 d6d22787db..f4d8ea1564 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
@@ -21,8 +21,6 @@ package organization;
import java.io.InputStream;
import java.util.Random;
-import junit.framework.Assert;
-
import org.apache.tuscany.das.rdb.Command;
import org.apache.tuscany.das.rdb.DAS;
import org.apache.tuscany.sca.host.embedded.SCADomain;
@@ -30,6 +28,7 @@ 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;
@@ -46,7 +45,7 @@ public class OrganizationTestCase {
DataObject root = null;
InputStream in = getClass().getClassLoader().getResourceAsStream("organizationConfiguration.xml");
- // Need to put in valid values for your DB
+ // Need to put in valid values for your DB
SchemaInfoType schemaInfo = TypesFactory.INSTANCE.createSchemaInfoType();
schemaInfo.setPASSWORD("");
schemaInfo.setSCHEMA("");
@@ -84,23 +83,25 @@ public class OrganizationTestCase {
@Test
public void testRetrieveOrganizationSCA() {
- /*
System.out.println("\n1. Organization-Service-Composite OrganizationClientRunner ");
- SCADomain scaDomain =
- SCADomain.newInstance("Organization-Service-Composite.composite");
+ SCADomain scaDomain = SCADomain.newInstance("organization.composite");
OrganizationService organizationService =
scaDomain.getService(OrganizationService.class, "OrganizationServiceComponent");
// Need to put in valid values for your DB
- SchemaInfoType schemaInfo = org.soa.types.TypeFactory.INSTANCE.createSchemaInfoType();
+ SchemaInfoType schemaInfo = TypesFactory.INSTANCE.createSchemaInfoType();
schemaInfo.setPASSWORD("");
schemaInfo.setSCHEMA("");
schemaInfo.setUSERNAME("");
// This doesn't work. Just retreive account, make a change, then apply changes
- //commonj.sdo.DataObject root = organizationService.findOrganizationBugOne("16", schemaInfo);
+ DataObject root = organizationService.findOrganizationBugOne(id, schemaInfo);
+ DataObject account = root.getDataObject("ACCOUNT[1]");
+
+ org.junit.Assert.assertEquals("TestNode2", account.get("ACCOUNT_NAME"));
+
// This doesn't work either. The root datagraph is null
// If you call das.applyChanges for a dataObject that has null as the dataGraph,
@@ -110,7 +111,5 @@ public class OrganizationTestCase {
//organizationService.updateOrganization(rootOne, schemaInfo);
scaDomain.close();
-
- */
}
}