incubator-etch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grand...@apache.org
Subject svn commit: r998135 [2/2] - in /incubator/etch/trunk: ./ examples/ examples/helloworld/ examples/helloworld/src/ examples/helloworld/src/main/ examples/helloworld/src/main/c/ examples/helloworld/src/main/csharp/ examples/helloworld/src/main/csharp/Hell...
Date Fri, 17 Sep 2010 13:53:28 GMT
Added: incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/ImplHelloWorldClient.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/ImplHelloWorldClient.cs?rev=998135&view=auto
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/ImplHelloWorldClient.cs
(added)
+++ incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/ImplHelloWorldClient.cs
Fri Sep 17 13:53:26 2010
@@ -0,0 +1,46 @@
+// 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.
+// 
+using System;
+
+
+
+using org.apache.etch.examples.helloworld.types.HelloWorld;
+
+///<summary>Your custom implementation of BaseHelloWorldClient. Add methods here to
provide
+///implementation of messages from the server. </summary>
+namespace org.apache.etch.examples.helloworld
+{
+	///<summary>Implementation for ImplHelloWorldClient</summary>
+	public class ImplHelloWorldClient : BaseHelloWorldClient
+	{
+		/// <summary>Constructs the ImplHelloWorldClient.</summary>
+ 		/// <param name="server">a connection to the server session. Use this to
+ 		/// send a message to the server.</param>
+		public ImplHelloWorldClient(RemoteHelloWorldServer server)
+		{
+			this.server = server;
+		}
+		
+		/// <summary>A connection to the server session. Use this to
+ 		/// send a message to the server.</summary>
+		private readonly RemoteHelloWorldServer server;
+	
+		// TODO: Implement delegates or provide implementation of HelloWorldClient
+		// messages from the server	
+	}
+}

Added: incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/ImplHelloWorldServer.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/ImplHelloWorldServer.cs?rev=998135&view=auto
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/ImplHelloWorldServer.cs
(added)
+++ incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/ImplHelloWorldServer.cs
Fri Sep 17 13:53:26 2010
@@ -0,0 +1,51 @@
+// 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.
+// 
+
+using System;
+
+
+
+using org.apache.etch.examples.helloworld.types.HelloWorld;
+
+///<summary>Your custom implementation of BaseHelloWorldServer. Add methods here to
provide
+///implementation of messages from the client. </summary>
+namespace org.apache.etch.examples.helloworld
+{
+	///<summary>Implementation for ImplHelloWorldServer</summary>
+	public class ImplHelloWorldServer : BaseHelloWorldServer
+	{
+		/// <summary>Constructs the ImplHelloWorldServer.</summary>
+ 		/// <param name="client">a connection to the client session. Use this to
+ 		/// send a message to the client.</param>
+		public ImplHelloWorldServer(RemoteHelloWorldClient client)
+		{
+			this.client = client;
+		}
+		
+		/// <summary>A connection to the client session. Use this to
+ 		/// send a message to the client.</summary>
+		private readonly RemoteHelloWorldClient client;
+	
+		public override string say_hello (
+				org.apache.etch.examples.helloworld.types.HelloWorld.user to_whom
+		)
+		{
+			return "Hello " + to_whom.name;
+		}
+	}
+}

Added: incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/MainHelloWorldClient.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/MainHelloWorldClient.cs?rev=998135&view=auto
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/MainHelloWorldClient.cs
(added)
+++ incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/MainHelloWorldClient.cs
Fri Sep 17 13:53:26 2010
@@ -0,0 +1,56 @@
+// 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.
+// 
+
+using System;
+
+using org.apache.etch.examples.helloworld.types.HelloWorld;
+
+namespace org.apache.etch.examples.helloworld
+{
+	///<summary>Main implementation for HelloWorldClient.</summary>
+	public class MainHelloWorldClient : HelloWorldHelper.HelloWorldClientFactory
+	{
+		///<summary>Main for HelloWorldClient</summary>
+		///<param name="args">Command Line Arguments</param>
+		public static void Main(String[] args)
+		{
+			// TODO: Change to correct URI
+			string uri = "tcp://127.0.0.1:4001";
+			
+			RemoteHelloWorldServer server = HelloWorldHelper.NewServer( uri, null, new MainHelloWorldClient());
+		
+			// Connect to the service
+			server._StartAndWaitUp( 4000 );
+
+			org.apache.etch.examples.helloworld.types.HelloWorld.user theUser = new user(15,"Test");
+	            	string s = server.say_hello(theUser);
+			Console.Write(s);
+
+			// Disconnect from the service
+			server._StopAndWaitDown( 4000 );			
+		}
+
+		///<summary>Return a new instance of HelloWorldClient.</summary>
+		///<param name="server">Reference to remote service</param>
+		///<returns>Client Implementation</returns>
+		public HelloWorldClient NewHelloWorldClient( RemoteHelloWorldServer server )
+		{
+			return new ImplHelloWorldClient( server );
+		}
+	}
+}

Added: incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/MainHelloWorldListener.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/MainHelloWorldListener.cs?rev=998135&view=auto
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/MainHelloWorldListener.cs
(added)
+++ incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/MainHelloWorldListener.cs
Fri Sep 17 13:53:26 2010
@@ -0,0 +1,51 @@
+// 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.
+// 
+using System;
+
+using Org.Apache.Etch.Bindings.Csharp.Support;
+using Org.Apache.Etch.Bindings.Csharp.Util;
+
+using org.apache.etch.examples.helloworld.types.HelloWorld;
+
+namespace org.apache.etch.examples.helloworld
+{
+	///<summary>Main implementation for HelloWorldListener.</summary>
+	public class MainHelloWorldListener : HelloWorldHelper.HelloWorldServerFactory
+	{
+ 		///<summary>Main for HelloWorldListener.</summary>
+		///<param name="args">Command Line Arguments</param>
+		public static void Main(String[] args)
+		{
+			// TODO: Change to correct URI
+			string uri = "tcp://127.0.0.1:4001";
+			
+			ServerFactory listener = HelloWorldHelper.NewListener( uri, null, new MainHelloWorldListener());
+			
+			// Start the Listener
+			listener.TransportControl( TransportConsts.START_AND_WAIT_UP, 400000 );
+		}
+
+		///<summary>Return a new instance of HelloWorldServer.</summary>
+		///<param name="client">Reference to remote service</param>
+		///<returns>Server Implementation</returns>
+		public HelloWorldServer NewHelloWorldServer( RemoteHelloWorldClient client )
+		{
+			return new ImplHelloWorldServer( client );
+		}
+	}
+}

Added: incubator/etch/trunk/examples/helloworld/src/main/etch/HelloWorld.etch
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/main/etch/HelloWorld.etch?rev=998135&view=auto
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/main/etch/HelloWorld.etch (added)
+++ incubator/etch/trunk/examples/helloworld/src/main/etch/HelloWorld.etch Fri Sep 17 13:53:26
2010
@@ -0,0 +1,34 @@
+// 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.
+// 
+
+module org.apache.etch.examples.helloworld
+
+service HelloWorld {
+	struct user (
+		int id,
+		string name
+	)
+
+	exception UserUnknownException (
+		string mes
+	)
+
+	@Direction(Server)
+	string say_hello(user to_whom) throws UserUnknownException
+
+}

Added: incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/ImplHelloWorldClient.java
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/ImplHelloWorldClient.java?rev=998135&view=auto
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/ImplHelloWorldClient.java
(added)
+++ incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/ImplHelloWorldClient.java
Fri Sep 17 13:53:26 2010
@@ -0,0 +1,57 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Wed Sep 15 17:22:46 CEST 2010
+// This file is automatically created for your convenience and will not be
+// overwritten once it exists! Please edit this file as necessary to implement
+// your service logic.
+
+package org.apache.etch.examples.helloworld;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+/**
+ * Your custom implementation of BaseHelloWorldClient. Add methods here to provide
+ * implementations of messages from the server.
+ */
+public class ImplHelloWorldClient extends BaseHelloWorldClient
+{
+	/**
+	 * Constructs the ImplHelloWorldClient.
+	 *
+	 * @param server a connection to the server session. Use this to send a
+	 * message to the server.
+	 */
+	public ImplHelloWorldClient( RemoteHelloWorldServer server )
+	{
+		this.server = server;
+	}
+	
+	/**
+	 * A connection to the server session. Use this to send a
+	 * message to the server.
+	 */
+	@SuppressWarnings( "unused" )
+	private final RemoteHelloWorldServer server;
+
+	// TODO insert methods here to provide implementations of HelloWorldClient
+	// messages from the server.
+}

Added: incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/ImplHelloWorldServer.java
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/ImplHelloWorldServer.java?rev=998135&view=auto
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/ImplHelloWorldServer.java
(added)
+++ incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/ImplHelloWorldServer.java
Fri Sep 17 13:53:26 2010
@@ -0,0 +1,61 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Wed Sep 15 17:22:46 CEST 2010
+// This file is automatically created for your convenience and will not be
+// overwritten once it exists! Please edit this file as necessary to implement
+// your service logic.
+
+package org.apache.etch.examples.helloworld;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+/**
+ * Your custom implementation of BaseHelloWorldServer. Add methods here to provide
+ * implementations of messages from the client.
+ */
+public class ImplHelloWorldServer extends BaseHelloWorldServer
+{
+	/**
+	 * Constructs the ImplHelloWorldServer.
+	 *
+	 * @param client a connection to the client session. Use this to send a
+	 * message to the client.
+	 */
+	public ImplHelloWorldServer( RemoteHelloWorldClient client )
+	{
+		this.client = client;
+	}
+	
+	/**
+	 * A connection to the client session. Use this to send a
+	 * message to the client.
+	 */
+	@SuppressWarnings( "unused" )
+	private final RemoteHelloWorldClient client;
+	
+	@Override
+	public String say_hello(user u){
+		return "Hello " + u.name;
+	}
+	
+	
+}	

Added: incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/MainHelloWorldClient.java
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/MainHelloWorldClient.java?rev=998135&view=auto
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/MainHelloWorldClient.java
(added)
+++ incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/MainHelloWorldClient.java
Fri Sep 17 13:53:26 2010
@@ -0,0 +1,68 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Wed Sep 15 17:22:46 CEST 2010
+// This file is automatically created for your convenience and will not be
+// overwritten once it exists! Please edit this file as necessary to implement
+// your service logic.
+
+package org.apache.etch.examples.helloworld;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import org.apache.etch.examples.helloworld.HelloWorld.user;
+
+/**
+ * Main program for HelloWorldClient. This program makes a connection to the
+ * listener created by MainHelloWorldListener.
+ */
+public class MainHelloWorldClient implements HelloWorldHelper.HelloWorldClientFactory
+{
+	/**
+	 * Main program for HelloWorldClient.
+	 * 
+	 * @param args command line arguments.
+	 * @throws Exception
+	 */
+	public static void main( String[] args ) throws Exception
+	{
+		// TODO Change to correct URI
+		String uri = "tcp://127.0.0.1:4001";
+		
+		RemoteHelloWorldServer server = HelloWorldHelper.newServer( uri, null,
+			new MainHelloWorldClient() );
+
+		// Connect to the service
+		server._startAndWaitUp( 4000 );
+
+		user u = new user(5, "Testuser");
+		System.out.println(server.say_hello(u));
+
+		// Disconnect from the service
+		server._stopAndWaitDown( 4000 );
+	}
+
+	public HelloWorldClient newHelloWorldClient( RemoteHelloWorldServer server )
+		throws Exception
+	{
+		return new ImplHelloWorldClient( server );
+	}
+}

Added: incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/MainHelloWorldListener.java
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/MainHelloWorldListener.java?rev=998135&view=auto
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/MainHelloWorldListener.java
(added)
+++ incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/MainHelloWorldListener.java
Fri Sep 17 13:53:26 2010
@@ -0,0 +1,62 @@
+// This file automatically generated by:
+//   Apache Etch 1.1.0-incubating (LOCAL-0) / java 1.1.0-incubating (LOCAL-0)
+//   Wed Sep 15 17:22:46 CEST 2010
+// This file is automatically created for your convenience and will not be
+// overwritten once it exists! Please edit this file as necessary to implement
+// your service logic.
+
+package org.apache.etch.examples.helloworld;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import org.apache.etch.bindings.java.support.ServerFactory;
+import org.apache.etch.util.core.io.Transport;
+
+/**
+ * Main program for HelloWorldServer. This program makes a listener to accept
+ * connections from MainHelloWorldClient.
+ */
+public class MainHelloWorldListener implements HelloWorldHelper.HelloWorldServerFactory
+{
+	/**
+	 * Main program for HelloWorldServer.
+	 * 
+	 * @param args command line arguments.
+	 * @throws Exception
+	 */
+	public static void main( String[] args ) throws Exception
+	{
+		// TODO Change to correct URI
+		String uri = "tcp://127.0.0.1:4001";
+		
+		ServerFactory listener = HelloWorldHelper.newListener( uri, null,
+			new MainHelloWorldListener() );
+
+		// Start the Listener
+		listener.transportControl( Transport.START_AND_WAIT_UP, 4000 );
+	}
+
+	public HelloWorldServer newHelloWorldServer( RemoteHelloWorldClient client )
+	{
+		return new ImplHelloWorldServer( client );
+	}
+}

Added: incubator/etch/trunk/examples/helloworld/src/test/csharp/HelloWorldTestProj/HelloWorldTestProj.csproj
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/test/csharp/HelloWorldTestProj/HelloWorldTestProj.csproj?rev=998135&view=auto
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/test/csharp/HelloWorldTestProj/HelloWorldTestProj.csproj
(added)
+++ incubator/etch/trunk/examples/helloworld/src/test/csharp/HelloWorldTestProj/HelloWorldTestProj.csproj
Fri Sep 17 13:53:26 2010
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * 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.                                           *
+ -->
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.50727</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{E3676B8F-6BBB-4A7E-A48F-74BBB694F6B2}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HelloWorldTestProj</RootNamespace>
+    <AssemblyName>HelloWorldTestProj</AssemblyName>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="nunit.framework, Version=2.4.7.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77,
processorArchitecture=MSIL">
+      <HintPath>$(NUNIT_HOME)\bin\nunit.framework.dll</HintPath>
+      <SpecificVersion>False</SpecificVersion>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\..\..\..\target\generated-sources\main\etch\csharp\org.apache.etch.examples.helloworld\BaseHelloWorldClient.cs">
+      <Link>BaseHelloWorldClient.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\..\target\generated-sources\main\etch\csharp\org.apache.etch.examples.helloworld\BaseHelloWorldServer.cs">
+      <Link>BaseHelloWorldServer.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\..\target\generated-sources\main\etch\csharp\org.apache.etch.examples.helloworld\HelloWorld.cs">
+      <Link>HelloWorld.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\..\target\generated-sources\main\etch\csharp\org.apache.etch.examples.helloworld\HelloWorldClient.cs">
+      <Link>HelloWorldClient.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\..\target\generated-sources\main\etch\csharp\org.apache.etch.examples.helloworld\HelloWorldHelper.cs">
+      <Link>HelloWorldHelper.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\..\target\generated-sources\main\etch\csharp\org.apache.etch.examples.helloworld\HelloWorldServer.cs">
+      <Link>HelloWorldServer.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\..\target\generated-sources\main\etch\csharp\org.apache.etch.examples.helloworld\RemoteHelloWorld.cs">
+      <Link>RemoteHelloWorld.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\..\target\generated-sources\main\etch\csharp\org.apache.etch.examples.helloworld\RemoteHelloWorldClient.cs">
+      <Link>RemoteHelloWorldClient.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\..\target\generated-sources\main\etch\csharp\org.apache.etch.examples.helloworld\RemoteHelloWorldServer.cs">
+      <Link>RemoteHelloWorldServer.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\..\target\generated-sources\main\etch\csharp\org.apache.etch.examples.helloworld\StubHelloWorld.cs">
+      <Link>StubHelloWorld.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\..\target\generated-sources\main\etch\csharp\org.apache.etch.examples.helloworld\StubHelloWorldClient.cs">
+      <Link>StubHelloWorldClient.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\..\target\generated-sources\main\etch\csharp\org.apache.etch.examples.helloworld\StubHelloWorldServer.cs">
+      <Link>StubHelloWorldServer.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\..\target\generated-sources\main\etch\csharp\org.apache.etch.examples.helloworld\ValueFactoryHelloWorld.cs">
+      <Link>ValueFactoryHelloWorld.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\main\csharp\org.apache.etch.examples.helloworld\ImplHelloWorldClient.cs">
+      <Link>ImplHelloWorldClient.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\main\csharp\org.apache.etch.examples.helloworld\ImplHelloWorldServer.cs">
+      <Link>ImplHelloWorldServer.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\main\csharp\org.apache.etch.examples.helloworld\MainHelloWorldClient.cs">
+      <Link>MainHelloWorldClient.cs</Link>
+    </Compile>
+    <Compile Include="..\..\..\main\csharp\org.apache.etch.examples.helloworld\MainHelloWorldListener.cs">
+      <Link>MainHelloWorldListener.cs</Link>
+    </Compile>
+    <Compile Include="..\org.apache.etch.examples.helloworld\TestHelloWorldServer.cs">
+      <Link>TestHelloWorldServer.cs</Link>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\..\..\..\binding-csharp\runtime\src\main\csharp\EtchProj.csproj">
+      <Project>{0E518F2A-3016-4C2F-A21B-9BD52B2DC846}</Project>
+      <Name>EtchProj</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and
uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

Added: incubator/etch/trunk/examples/helloworld/src/test/csharp/HelloWorldTestProj/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/test/csharp/HelloWorldTestProj/Properties/AssemblyInfo.cs?rev=998135&view=auto
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/test/csharp/HelloWorldTestProj/Properties/AssemblyInfo.cs
(added)
+++ incubator/etch/trunk/examples/helloworld/src/test/csharp/HelloWorldTestProj/Properties/AssemblyInfo.cs
Fri Sep 17 13:53:26 2010
@@ -0,0 +1,50 @@
+// 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.                                           *
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HelloWorldTestProj")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Apache Software Foundation")]
+[assembly: AssemblyProduct("Apache Etch (incubating)")]
+[assembly: AssemblyCopyright("Copyright ? Apache Software Foundation 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("281472ff-b634-4e2a-93dd-9591e7b875f6")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

Added: incubator/etch/trunk/examples/helloworld/src/test/csharp/org.apache.etch.examples.helloworld/TestHelloWorldServer.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/test/csharp/org.apache.etch.examples.helloworld/TestHelloWorldServer.cs?rev=998135&view=auto
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/test/csharp/org.apache.etch.examples.helloworld/TestHelloWorldServer.cs
(added)
+++ incubator/etch/trunk/examples/helloworld/src/test/csharp/org.apache.etch.examples.helloworld/TestHelloWorldServer.cs
Fri Sep 17 13:53:26 2010
@@ -0,0 +1,99 @@
+// $Id: TestHelloWorldServer.cs 743358 2009-02-11 15:18:15Z sccomer $
+// 
+// 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.
+// 
+using System;
+using Org.Apache.Etch.Bindings.Csharp.Support;
+using Org.Apache.Etch.Bindings.Csharp.Util;
+using NUnit.Framework;
+using org.apache.etch.examples.helloworld.types.HelloWorld;
+
+namespace org.apache.etch.examples.helloworld
+{
+
+    /// <summary>
+    /// Unit Tests to test HelloWorld
+    /// </summary>
+    /// 
+    [TestFixture]
+    public class TestHelloWorldServer
+    {
+        private static RemoteHelloWorldServer server;
+
+        private static ServerFactory listener;
+
+        [TestFixtureSetUp]
+        public void StartListener()
+        {
+            String uri = "tcp://localhost:4010";
+
+            MainHelloWorldListener implFactory = new MainHelloWorldListener();
+            listener = HelloWorldHelper.NewListener(uri, null, implFactory);
+
+            listener.TransportControl(TransportConsts.START_AND_WAIT_UP, 4000);
+
+            Console.WriteLine("Listener Started");
+
+        }
+
+        [SetUp]
+        public void MakeConnection()
+        {
+            String uri = "tcp://localhost:4010";
+
+            MainHelloWorldClient client = new MainHelloWorldClient();
+            server = HelloWorldHelper.NewServer(uri, null, client);
+
+            server._StartAndWaitUp(4000);
+        }
+
+        [Test]
+        public void CheckConnection()
+        {
+            Assert.IsNotNull(server);
+        }
+
+        [Test]
+        public void TestSayHallo()
+        {
+	    org.apache.etch.examples.helloworld.types.HelloWorld.user theUser = new user(15,"Test");
+            string s = server.say_hello(theUser);
+            Assert.AreEqual(s, "Hello Test");
+        }
+
+        [TearDown]
+        public void CloseConnection()
+        {
+            if (server != null)
+            {
+                server._Stop();
+            }
+        }
+
+        [TestFixtureTearDown]
+        public void StopListener()
+        {
+            if (listener != null)
+            {
+                listener.TransportControl(TransportConsts.STOP_AND_WAIT_DOWN, 4000);
+                listener = null;
+            }
+        }
+
+    }
+}

Added: incubator/etch/trunk/examples/helloworld/src/test/java/org/apache/etch/examples/helloworld/TestHelloWorldServer.java
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/test/java/org/apache/etch/examples/helloworld/TestHelloWorldServer.java?rev=998135&view=auto
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/test/java/org/apache/etch/examples/helloworld/TestHelloWorldServer.java
(added)
+++ incubator/etch/trunk/examples/helloworld/src/test/java/org/apache/etch/examples/helloworld/TestHelloWorldServer.java
Fri Sep 17 13:53:26 2010
@@ -0,0 +1,131 @@
+/* $Id: TestHelloWorldServer.java 743147 2009-02-10 22:53:01Z sccomer $
+ *
+ * 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.etch.examples.helloworld;
+
+import java.util.Date;
+
+import junit.framework.Assert;
+
+import org.apache.etch.bindings.java.support.ServerFactory;
+import org.apache.etch.examples.helloworld.HelloWorld.user;
+import org.apache.etch.util.Log;
+import org.apache.etch.util.core.io.Transport;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+/** */
+public class TestHelloWorldServer
+{
+
+	/** transport */
+	public static ServerFactory listener;
+	
+	RemoteHelloWorldServer server;
+
+	/**
+	 * @throws Exception
+	 */
+	@BeforeClass
+	public static void startListener() throws Exception
+	{
+		Log.addSink(null);
+		Log.report("StartExampleListener");
+			
+		String uri = "tcp://localhost:4009";
+		MainHelloWorldListener implFactory = new MainHelloWorldListener();
+		listener = HelloWorldHelper.newListener( uri, null, implFactory );
+
+		listener.transportControl( Transport.START_AND_WAIT_UP, 4000 );
+	
+		Log.report( "StartExampleListener",
+				"status", "up",
+				"listener", listener );
+	}
+
+	/**
+	 * @throws Exception
+	 */
+	@AfterClass
+	public static void stopListener() throws Exception
+	{
+		if (listener != null)
+		{
+			listener.transportControl( Transport.STOP_AND_WAIT_DOWN, 4000 );
+			listener = null;
+		}
+	}
+	
+	/**
+	 * Connect client to serve
+	 * @throws Exception
+	 */
+	@Before
+	public void makeConnection()
+		throws Exception
+	{
+		String uri = "tcp://localhost:4009";
+
+		server = HelloWorldHelper.newServer( uri, null, new MainHelloWorldClient() );
+
+		server._startAndWaitUp( 4000 );
+	}
+
+	/**
+	 * Shutdown connection to server
+	 * @throws Exception
+	 */
+	@After
+	public void shutConnection()
+		throws Exception
+	{
+		if (server != null)
+		{
+			server._stop();
+		}
+	}
+	
+	/**
+	 * @throws Exception
+	 */
+	@Test
+	public void checkConnection() throws Exception
+	{
+		Assert.assertNotNull(server);
+	}
+	
+	/**
+	 * @throws Exception
+	 */
+	@Test
+	public void testSayHello() throws Exception
+	{
+		user u = new user(5, "Test");
+		String result = server.say_hello(u);
+		Assert.assertTrue(result.equals("Hello Test"));
+	}
+	
+
+
+}



Mime
View raw message