Author: lresende Date: Tue May 1 12:03:20 2007 New Revision: 534200 URL: http://svn.apache.org/viewvc?view=rev&rev=534200 Log: [work in progress] More updates to bring up das-service sample... The service itself is working fine, now i need to finish work on the web client. Added: incubator/tuscany/java/sca/samples/das-service/service/src/test/java/das/DASServiceTestCase.java incubator/tuscany/java/sca/samples/das-service/service/src/test/resources/dastest/ - copied from r534127, incubator/tuscany/java/sca/samples/das-service/webclient/dastest/ incubator/tuscany/java/sca/samples/das-service/webclient/src/main/webapp/WEB-INF/default.composite - copied unchanged from r534127, incubator/tuscany/java/sca/samples/das-service/webclient/src/main/webapp/WEB-INF/default.scdl Removed: incubator/tuscany/java/sca/samples/das-service/service/src/main/java/org/ incubator/tuscany/java/sca/samples/das-service/webclient/src/main/webapp/WEB-INF/default.scdl Modified: incubator/tuscany/java/sca/samples/das-service/service/pom.xml incubator/tuscany/java/sca/samples/das-service/service/src/main/resources/dasservice.composite incubator/tuscany/java/sca/samples/das-service/webclient/src/main/webapp/Company.jsp incubator/tuscany/java/sca/samples/das-service/webclient/src/main/webapp/WEB-INF/web.xml Modified: incubator/tuscany/java/sca/samples/das-service/service/pom.xml URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/das-service/service/pom.xml?view=diff&rev=534200&r1=534199&r2=534200 ============================================================================== --- incubator/tuscany/java/sca/samples/das-service/service/pom.xml (original) +++ incubator/tuscany/java/sca/samples/das-service/service/pom.xml Tue May 1 12:03:20 2007 @@ -65,6 +65,20 @@ compile + + org.apache.derby + derby + 10.1.2.1 + test + + + + junit + junit + 4.2 + test + + Modified: incubator/tuscany/java/sca/samples/das-service/service/src/main/resources/dasservice.composite URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/das-service/service/src/main/resources/dasservice.composite?view=diff&rev=534200&r1=534199&r2=534200 ============================================================================== --- incubator/tuscany/java/sca/samples/das-service/service/src/main/resources/dasservice.composite (original) +++ incubator/tuscany/java/sca/samples/das-service/service/src/main/resources/dasservice.composite Tue May 1 12:03:20 2007 @@ -21,13 +21,13 @@ targetNamespace="http://DASService" name="DASService"> - - - DASComponent + + + DASServiceComponent - - + + Added: incubator/tuscany/java/sca/samples/das-service/service/src/test/java/das/DASServiceTestCase.java URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/das-service/service/src/test/java/das/DASServiceTestCase.java?view=auto&rev=534200 ============================================================================== --- incubator/tuscany/java/sca/samples/das-service/service/src/test/java/das/DASServiceTestCase.java (added) +++ incubator/tuscany/java/sca/samples/das-service/service/src/test/java/das/DASServiceTestCase.java Tue May 1 12:03:20 2007 @@ -0,0 +1,54 @@ +/* + * 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 das; + +import java.util.List; + +import junit.framework.TestCase; + +import org.apache.tuscany.host.embedded.SCARuntime; +import org.osoa.sca.ComponentContext; +import org.osoa.sca.ServiceReference; + +import commonj.sdo.DataObject; + +public class DASServiceTestCase extends TestCase { + + private DASService dasService; + + protected void setUp() throws Exception { + SCARuntime.start("dasservice.composite"); + ComponentContext context = SCARuntime.getComponentContext("DASServiceComponent"); + ServiceReference service = context.createSelfReference(DASService.class); + dasService = service.getService(); + } + + protected void tearDown() throws Exception { + SCARuntime.stop(); + } + + public void testDAS() throws Exception{ + dasService.configureService(getClass().getResourceAsStream("/CompanyConfig.xml")); + DataObject root = dasService.executeCommand("all companies", null); + List companyList = root.getList("COMPANY"); + + assertNotNull(companyList); + assertEquals(3,companyList.size()); + } +} Modified: incubator/tuscany/java/sca/samples/das-service/webclient/src/main/webapp/Company.jsp URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/das-service/webclient/src/main/webapp/Company.jsp?view=diff&rev=534200&r1=534199&r2=534200 ============================================================================== --- incubator/tuscany/java/sca/samples/das-service/webclient/src/main/webapp/Company.jsp (original) +++ incubator/tuscany/java/sca/samples/das-service/webclient/src/main/webapp/Company.jsp Tue May 1 12:03:20 2007 @@ -20,26 +20,33 @@ <%@ page import="java.util.*" %> -<%@ page import="org.osoa.sca.CompositeContext" %> -<%@ page import="org.osoa.sca.CurrentCompositeContext" %> +<%@ page import="org.apache.tuscany.host.embedded.SCARuntime"%> +<%@ page import="org.osoa.sca.ComponentContext" %> +<%@ page import="org.osoa.sca.ServiceReference" %> <%@ page import="commonj.sdo.*" %> -<%@ page import="org.apache.tuscany.samples.das.service.*" %> +<%@ page import="das.*" %> <%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%> <% - CompositeContext context = CurrentCompositeContext.getContext(); - DASService dasService = context.locateService(DASService.class, "DASServiceComponent"); - List companyList = null; - try{ + + SCARuntime.start("dasservice.composite"); + + ComponentContext context = SCARuntime.getComponentContext("DASServiceComponent"); + ServiceReference service = context.createSelfReference(DASService.class); + DASService dasService = service.getService(); + List companyList = null; + + try{ dasService.configureService(getClass().getClassLoader().getResourceAsStream("CompanyConfig.xml")); DataObject root = dasService.executeCommand("all companies", null); - companyList = root.getList("COMPANY"); - }catch(Exception e){ - //TODO: handle case where dasService can't be initiated properly - } + companyList = root.getList("COMPANY"); + }catch(Exception e){ + //TODO: handle case where dasService can't be initiated properly + } + %> @@ -78,4 +85,8 @@ +<% + //stop the runtime + SCARuntime.stop(); +%> Modified: incubator/tuscany/java/sca/samples/das-service/webclient/src/main/webapp/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/das-service/webclient/src/main/webapp/WEB-INF/web.xml?view=diff&rev=534200&r1=534199&r2=534200 ============================================================================== --- incubator/tuscany/java/sca/samples/das-service/webclient/src/main/webapp/WEB-INF/web.xml (original) +++ incubator/tuscany/java/sca/samples/das-service/webclient/src/main/webapp/WEB-INF/web.xml Tue May 1 12:03:20 2007 @@ -28,6 +28,7 @@ + --------------------------------------------------------------------- To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org For additional commands, e-mail: tuscany-commits-help@ws.apache.org