You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by kw...@apache.org on 2006/11/07 20:19:02 UTC

svn commit: r472210 - in /incubator/tuscany/java/das/rdb/src/test: java/org/apache/tuscany/das/rdb/test/CrudWithChangeHistory.java resources/CustomerConfig.xml

Author: kwilliams
Date: Tue Nov  7 11:19:02 2006
New Revision: 472210

URL: http://svn.apache.org/viewvc?view=rev&rev=472210
Log:
a new, very simple test case

Added:
    incubator/tuscany/java/das/rdb/src/test/resources/CustomerConfig.xml   (with props)
Modified:
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CrudWithChangeHistory.java

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CrudWithChangeHistory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CrudWithChangeHistory.java?view=diff&rev=472210&r1=472209&r2=472210
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CrudWithChangeHistory.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CrudWithChangeHistory.java Tue Nov  7 11:19:02 2006
@@ -187,6 +187,30 @@
     }
 
     /**
+     * Builds on previous but: 1. Uses a named command
+     */
+    public void testReadModifyApply4() throws Exception {
+        DAS das = DAS.FACTORY.createDAS(getConfig("CustomerConfig.xml"), getConnection());
+        // Read customer with particular ID
+        Command select = das.getCommand("getCustomer");
+        select.setParameter(1, 1);
+        DataObject root = select.executeQuery();
+
+        DataObject customer = (DataObject) root.get("CUSTOMER[1]");
+
+        // Modify customer
+        customer.set("LASTNAME", "Pavick");
+
+        // Build apply changes command
+        das.applyChanges(root);
+
+        // Verify the change
+        root = select.executeQuery();
+        assertEquals("Pavick", root.getDataObject("CUSTOMER[1]").getString("LASTNAME"));
+
+    }
+    
+    /**
      * Test ability to handle multiple changes to the graph including Creates/Updates/Deletes Employs generated CUD
      */
     public void testReadModifyDeleteInsertApply() throws Exception {

Added: incubator/tuscany/java/das/rdb/src/test/resources/CustomerConfig.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/das/rdb/src/test/resources/CustomerConfig.xml?view=auto&rev=472210
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/resources/CustomerConfig.xml (added)
+++ incubator/tuscany/java/das/rdb/src/test/resources/CustomerConfig.xml Tue Nov  7 11:19:02 2006
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+  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.
+ -->
+<Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd"> 
+	
+  <Command name="getCustomer" SQL="Select * from CUSTOMER where ID = ?" kind="Select"/>
+	
+</Config>

Propchange: incubator/tuscany/java/das/rdb/src/test/resources/CustomerConfig.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/das/rdb/src/test/resources/CustomerConfig.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org