diff options
author | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
---|---|---|
committer | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
commit | bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a (patch) | |
tree | 38a92061c0793434c4be189f1d70c3458b6bc41d /tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src |
Move Tuscany from Incubator to top level.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src')
6 files changed, 210 insertions, 0 deletions
diff --git a/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/.cdtbuild b/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/.cdtbuild new file mode 100644 index 0000000000..73f28e14fd --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/.cdtbuild @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?fileVersion 3.0.0?>
+
+<ManagedProjectBuildInfo>
+<project id="tuscany_sca_test.cdt.managedbuild.target.gnu.exe.2075572137" name="Executable (Gnu)" projectType="cdt.managedbuild.target.gnu.exe">
+<configuration artifactName="tuscany_sca_test" cleanCommand="rm -rf" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="cdt.managedbuild.config.gnu.exe.debug.961609061" name="Debug" parent="cdt.managedbuild.config.gnu.exe.debug">
+<toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.1940833295" name="GCC Tool Chain" superClass="cdt.managedbuild.toolchain.gnu.exe.debug">
+<tool command="gcc" id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1305113089" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug"/>
+<tool command="g++" id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.526049094" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug">
+<option id="gnu.cpp.compiler.option.preprocessor.def.257257608" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
+<listOptionValue builtIn="false" value="_DEBUG"/>
+</option>
+<option id="gnu.cpp.compiler.option.include.paths.2142231807" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+<listOptionValue builtIn="false" value="${SCA4CPP_HOME}/runtime/core/src"/>
+<listOptionValue builtIn="false" value="${SDO4CPP}/include"/>
+<listOptionValue builtIn="false" value="${SCA4CPP_HOME}/runtime/core/test/MyValue"/>
+</option>
+</tool>
+<tool command="gcc" id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.966487740" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug"/>
+<tool command="g++" id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.1717129068" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug">
+<option id="gnu.cpp.link.option.libs.111258106" superClass="gnu.cpp.link.option.libs" valueType="libs">
+<listOptionValue builtIn="false" value="tuscany_sca"/>
+<listOptionValue builtIn="false" value="axis_clientC"/>
+<listOptionValue builtIn="false" value="axis_client"/>
+<listOptionValue builtIn="false" value="tuscany_sdo"/>
+<listOptionValue builtIn="false" value="xml2"/>
+</option>
+<option id="gnu.cpp.link.option.paths.746681481" superClass="gnu.cpp.link.option.paths" valueType="stringList">
+<listOptionValue builtIn="false" value="${SCA4CPP_HOME}/runtime/core/src/Debug"/>
+<listOptionValue builtIn="false" value="${AXISCPP_DEPLOY}/lib"/>
+<listOptionValue builtIn="false" value="${SDO4CPP}/lib"/>
+</option>
+</tool>
+<tool command="as" id="cdt.managedbuild.tool.gnu.assembler.exe.debug.888159856" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug"/>
+<macros/>
+</toolChain>
+</configuration>
+<configuration artifactName="tuscany_sca_test" cleanCommand="rm -rf" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="cdt.managedbuild.config.gnu.exe.release.278641057" name="Release" parent="cdt.managedbuild.config.gnu.exe.release">
+<toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.204044209" name="GCC Tool Chain" superClass="cdt.managedbuild.toolchain.gnu.exe.release">
+<tool command="gcc" id="cdt.managedbuild.tool.gnu.c.compiler.exe.release.822246239" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.release"/>
+<tool command="g++" id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1002800488" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release">
+<option id="gnu.cpp.compiler.option.include.paths.454857737" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+<listOptionValue builtIn="false" value="${SCA4CPP_HOME}/runtime/core/src"/>
+<listOptionValue builtIn="false" value="${SDO4CPP}/include"/>
+<listOptionValue builtIn="false" value="${SCA4CPP_HOME}/runtime/core/test/MyValue"/>
+</option>
+</tool>
+<tool command="gcc" id="cdt.managedbuild.tool.gnu.c.linker.exe.release.1733957415" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.release"/>
+<tool command="g++" id="cdt.managedbuild.tool.gnu.cpp.linker.exe.release.1578655729" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.release">
+<option id="gnu.cpp.link.option.libs.18758324" superClass="gnu.cpp.link.option.libs" valueType="libs">
+<listOptionValue builtIn="false" value="xml2"/>
+<listOptionValue builtIn="false" value="tuscany_sca"/>
+<listOptionValue builtIn="false" value="tuscany_sdo"/>
+<listOptionValue builtIn="false" value="axis_clientC"/>
+<listOptionValue builtIn="false" value="axis_client"/>
+</option>
+<option id="gnu.cpp.link.option.paths.1663707007" superClass="gnu.cpp.link.option.paths" valueType="stringList">
+<listOptionValue builtIn="false" value="${SCA4CPP_HOME}/runtime/core/src/Release"/>
+<listOptionValue builtIn="false" value="${SDO4CPP}/lib"/>
+<listOptionValue builtIn="false" value="${AXISCPP_DEPLOY}/lib"/>
+</option>
+</tool>
+<tool command="as" id="cdt.managedbuild.tool.gnu.assembler.exe.release.464104013" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.release"/>
+<macros/>
+</toolChain>
+</configuration>
+<macros/>
+</project>
+</ManagedProjectBuildInfo>
diff --git a/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/.cdtproject b/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/.cdtproject new file mode 100644 index 0000000000..48a12e6664 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/.cdtproject @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="org.eclipse.cdt.managedbuilder.core.managedMake">
+<extension id="org.eclipse.cdt.managedbuilder.core.ManagedBuildManager" point="org.eclipse.cdt.core.ScannerInfoProvider"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.domsourceindexer" point="org.eclipse.cdt.core.CIndexer"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path=""/>
+<pathentry kind="out" path=""/>
+<pathentry kind="con" path="org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER"/>
+</item>
+</data>
+</cdtproject>
diff --git a/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/.project b/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/.project new file mode 100644 index 0000000000..5e5b12e9d8 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/.project @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>tuscany_sca_test</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.cdt.core.cnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> + <nature>org.eclipse.cdt.core.ccnature</nature> + </natures> +</projectDescription> diff --git a/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/.settings/org.eclipse.cdt.managedbuilder.core.prefs new file mode 100644 index 0000000000..fe629d7d5b --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/.settings/org.eclipse.cdt.managedbuilder.core.prefs @@ -0,0 +1,9 @@ +#Tue Nov 29 17:30:33 GMT 2005
+eclipse.preferences.version=1
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.961609061=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="CPATH" operation\="remove"/>\n<variable name\="CPLUS_INCLUDE_PATH" operation\="remove"/>\n</environment>\n
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.278641057=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="CPATH" operation\="remove"/>\n<variable name\="CPLUS_INCLUDE_PATH" operation\="remove"/>\n</environment>\n
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.961609061=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="LIBRARY_PATH" operation\="remove"/>\n</environment>\n
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.release.278641057=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="LIBRARY_PATH" operation\="remove"/>\n</environment>\n
+environment/project=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment/>\n
+environment/project/cdt.managedbuild.config.gnu.exe.debug.961609061=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment/>\n
+environment/project/cdt.managedbuild.config.gnu.exe.release.278641057=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment/>\n
diff --git a/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/Makefile.am b/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/Makefile.am new file mode 100644 index 0000000000..e9a449aaf0 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/Makefile.am @@ -0,0 +1,12 @@ +prgbindir=$(prefix)/bin/test +prgbin_PROGRAMS = tuscany_sca_test +SUBDIRS = +AM_CPPFLAGS = $(CPPFLAGS) +tuscany_sca_test_SOURCES = TestSCA.cpp + +tuscany_sca_test_LDADD = -L$(top_builddir)/runtime/core/src -ltuscany_sca \ + -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo + +INCLUDES = -I$(top_builddir)/runtime/core/test/MyValue \ + -I$(top_builddir)/runtime/core/src \ + -I${TUSCANY_SDOCPP}/include diff --git a/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/TestSCA.cpp b/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/TestSCA.cpp new file mode 100644 index 0000000000..489fdab622 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3b/sca/runtime/core/test/src/TestSCA.cpp @@ -0,0 +1,86 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +/* $Rev$ $Date: 2005/12/22 11:33:21 $ */ + +#include "tuscany/sca/util/Logger.h" +#include "commonj/sdo/Logger.h" +#include "osoa/sca/sca.h" +#include <iostream> +using namespace std; + +using namespace osoa::sca; +#include "tuscany/sca/core/TuscanyRuntime.h" +using namespace tuscany::sca; +#include "MyValue.h" + +int main(int argc, char* argv[]) +{ + tuscany::sca::Logger::setLogging(4); + commonj::sdo::Logger::setLogging(20); + cout << "Start of SCA test" << endl; + + // Set default module + TuscanyRuntime runtime("SubSystem1"); + + try + { + runtime.start(); + + // Locate a service + ModuleContext myContext = ModuleContext::getCurrent(); + ModuleContext myContext2 = myContext; + + MyValue* myService = (MyValue*) myContext.locateService("MyValueServiceComponent"); + if (myService == 0) + { + cout << "Unable to find service" << endl; + } + else + { + + try + { + float value = myService->getMyValue("12345"); + cout << "My value is: " << value << endl; + value = myService->getMyValueS("12345"); + cout << "My valueSS is: " << value << endl; + string custid = "fred"; + string name = myService->getCustname(custid); + cout << "Returned string: " << name.c_str() << " custid now: " << custid.c_str() <<endl; + custid = "fred"; + const string& csname = myService->getCustnamecs(custid); + cout << "Returned string: " << csname.c_str() << " custid now: " << custid.c_str() <<endl; + //value = myService->getMyValue("999"); + cout << "My value is: " << value << endl; + } + catch (char* x) + { + cout << "Exception caught: " << x << endl; + } + } + cout << "End of SCA test" << endl; + + } + catch (ServiceRuntimeException& ex) + { + cout << ex << endl; + } + + runtime.stop(); + return 0; +} |