From d5e70110c4bbffe76c6b7a934643d97f0c882583 Mon Sep 17 00:00:00 2001 From: antelder Date: Tue, 21 Apr 2009 11:07:41 +0000 Subject: Start of a testcase which show implemntation.jee pointing at an ear is processed correctly git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@767113 13f79535-47bb-0310-9956-ffa450edef68 --- .../implementation/jee/xml/JeeTestCaseFIXME.java | 53 +++++++++++++++++++++ .../src/test/java/test/Helloworld.java | 25 ++++++++++ .../test/MockImplementationProviderFactory.java | 44 +++++++++++++++++ ...cany.sca.provider.ImplementationProviderFactory | 19 ++++++++ .../src/test/resources/myarchive.ear | Bin 0 -> 21310 bytes 5 files changed, 141 insertions(+) create mode 100644 branches/sca-java-1.x/modules/implementation-jee/src/test/java/org/apache/tuscany/sca/implementation/jee/xml/JeeTestCaseFIXME.java create mode 100644 branches/sca-java-1.x/modules/implementation-jee/src/test/java/test/Helloworld.java create mode 100644 branches/sca-java-1.x/modules/implementation-jee/src/test/java/test/MockImplementationProviderFactory.java create mode 100644 branches/sca-java-1.x/modules/implementation-jee/src/test/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory create mode 100644 branches/sca-java-1.x/modules/implementation-jee/src/test/resources/myarchive.ear diff --git a/branches/sca-java-1.x/modules/implementation-jee/src/test/java/org/apache/tuscany/sca/implementation/jee/xml/JeeTestCaseFIXME.java b/branches/sca-java-1.x/modules/implementation-jee/src/test/java/org/apache/tuscany/sca/implementation/jee/xml/JeeTestCaseFIXME.java new file mode 100644 index 0000000000..11f3f47a1f --- /dev/null +++ b/branches/sca-java-1.x/modules/implementation-jee/src/test/java/org/apache/tuscany/sca/implementation/jee/xml/JeeTestCaseFIXME.java @@ -0,0 +1,53 @@ +/* + * 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 org.apache.tuscany.sca.implementation.jee.xml; + +import static org.junit.Assert.assertEquals; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import test.Helloworld; + +/** + */ +public class JeeTestCaseFIXME { + + + @Before + public void init() { + } + + @Test + public void testSayHello() throws Exception { + SCADomain scaDomain = SCADomain.newInstance("http://localhost", "/", "org/apache/tuscany/sca/implementation/jee/xml/TestJEE.composite"); + + Helloworld service = scaDomain.getService(Helloworld.class, "TestJEE/HelloworldServiceBean_HelloworldService"); + + //assertEquals("hello beate", service.getGreetings("beate")); + + scaDomain.close(); + } + + @After + public void end() { + } +} diff --git a/branches/sca-java-1.x/modules/implementation-jee/src/test/java/test/Helloworld.java b/branches/sca-java-1.x/modules/implementation-jee/src/test/java/test/Helloworld.java new file mode 100644 index 0000000000..2cb6886b31 --- /dev/null +++ b/branches/sca-java-1.x/modules/implementation-jee/src/test/java/test/Helloworld.java @@ -0,0 +1,25 @@ +/* + * 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 test; + +public interface Helloworld { + + String getGreetings(String name); +} diff --git a/branches/sca-java-1.x/modules/implementation-jee/src/test/java/test/MockImplementationProviderFactory.java b/branches/sca-java-1.x/modules/implementation-jee/src/test/java/test/MockImplementationProviderFactory.java new file mode 100644 index 0000000000..5b9b2a890b --- /dev/null +++ b/branches/sca-java-1.x/modules/implementation-jee/src/test/java/test/MockImplementationProviderFactory.java @@ -0,0 +1,44 @@ +/* + * 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 test; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.implementation.jee.JEEImplementation; +import org.apache.tuscany.sca.provider.ImplementationProvider; +import org.apache.tuscany.sca.provider.ImplementationProviderFactory; +import org.apache.tuscany.sca.runtime.RuntimeComponent; + +public class MockImplementationProviderFactory implements ImplementationProviderFactory{ + + public MockImplementationProviderFactory(ExtensionPointRegistry extensionPoints) { + + } + + + public ImplementationProvider createImplementationProvider(RuntimeComponent component, + JEEImplementation Implementation) { + return null; + } + + public Class getModelType() { + return null; + } + +} diff --git a/branches/sca-java-1.x/modules/implementation-jee/src/test/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/branches/sca-java-1.x/modules/implementation-jee/src/test/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory new file mode 100644 index 0000000000..0a7205ab61 --- /dev/null +++ b/branches/sca-java-1.x/modules/implementation-jee/src/test/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory @@ -0,0 +1,19 @@ +# 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. + +# Implementation class for the implementation extension +test.MockImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.jee.JEEImplementation diff --git a/branches/sca-java-1.x/modules/implementation-jee/src/test/resources/myarchive.ear b/branches/sca-java-1.x/modules/implementation-jee/src/test/resources/myarchive.ear new file mode 100644 index 0000000000..9fb1ed9d14 Binary files /dev/null and b/branches/sca-java-1.x/modules/implementation-jee/src/test/resources/myarchive.ear differ -- cgit v1.2.3