From 83355a7557cf91c455a65e0ce79ea8dd4d880052 Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 13 Jan 2010 02:16:12 +0000 Subject: Refactoring sandbox structure to accomodate 1.x versus 2.x stuff git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@898623 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/customer/CustomerServiceTestCase.java | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 sandbox/lresende/sca-1.x/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java (limited to 'sandbox/lresende/sca-1.x/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java') diff --git a/sandbox/lresende/sca-1.x/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java new file mode 100644 index 0000000000..7d289fd62a --- /dev/null +++ b/sandbox/lresende/sca-1.x/demos/customer-map/src/test/java/customer/CustomerServiceTestCase.java @@ -0,0 +1,60 @@ +/* + * 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 customer; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +import commonj.sdo.DataObject; +import customer.CustomerService; + +/** + * Tests the DAS service + */ +public class CustomerServiceTestCase extends TestCase { + + private SCADomain scaDomain; + private CustomerService customerService; + + /** + * @throws java.lang.Exception + */ + @Override + protected void setUp() throws Exception { + scaDomain = SCADomain.newInstance("customer.composite"); + customerService = scaDomain.getService(CustomerService.class, "CustomerServiceComponent/CustomerService"); + } + + /** + * @throws java.lang.Exception + */ + @Override + protected void tearDown() throws Exception { + scaDomain.close(); + } + + public void testGetCustomers() throws Exception { + DataObject root = customerService.getCustomers(); + assertNotNull(root); + assertEquals("Luciano Resende", root.getString("CUSTOMER[1]/NAME")); + } + + +} -- cgit v1.2.3