You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@etch.apache.org by fi...@apache.org on 2011/05/15 15:54:30 UTC
svn commit: r1103377 - in /incubator/etch/trunk/binding-csharp/runtime/src:
main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/ test/csharp/Etch/Support/
test/csharp/Etch/Transport/Filter/ test/csharp/Etch/Transport/Fmt/Binary/
test/csharp/Etch/Util/
Author: fitzner
Date: Sun May 15 13:54:29 2011
New Revision: 1103377
URL: http://svn.apache.org/viewvc?rev=1103377&view=rev
Log:
[ETCH-160]
Changed .Net Culture for Tests, fix thread handling for TodoManager, add livecycle to TestKeepAlive tests
Modified:
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/TodoManager.cs
incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Support/TestTodoManager.cs
incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Transport/Filter/TestKeepAlive.cs
incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Transport/Fmt/Binary/TestBinaryTaggedDataInOut.cs
incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestCircularQueue.cs
incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestDateSerializer.cs
incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestMonitor.cs
incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestTcpConnection.cs
incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestURL.cs
Modified: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/TodoManager.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/TodoManager.cs?rev=1103377&r1=1103376&r2=1103377&view=diff
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/TodoManager.cs (original)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/TodoManager.cs Sun May 15 13:54:29 2011
@@ -83,7 +83,7 @@ namespace Org.Apache.Etch.Bindings.Cshar
{
// nothing to do
}
-
+
protected override void Stop0()
{
lock (this)
@@ -362,7 +362,18 @@ namespace Org.Apache.Etch.Bindings.Cshar
oldTodoManager.Stop();
}
- private static TodoManager todomanager;
+ /// <summary>
+ /// Shuts down the given todo manager if any.
+ /// </summary>
+ /// Exception:
+ /// throws Exception
+ public static void ShutDown(TodoManager toDoManager)
+ {
+ if ( toDoManager != null )
+ toDoManager.Stop();
+ }
+
+ private static TodoManager todomanager;
/// <summary>
/// Since C# doesn't allow locking on an entire class, the substitute
Modified: incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Support/TestTodoManager.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Support/TestTodoManager.cs?rev=1103377&r1=1103376&r2=1103377&view=diff
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Support/TestTodoManager.cs (original)
+++ incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Support/TestTodoManager.cs Sun May 15 13:54:29 2011
@@ -91,8 +91,7 @@ namespace Org.Apache.Etch.Bindings.Cshar
// test if all todo's were executed.
Assert.AreEqual( 0, mgr.NumEntries() );
- TodoManager.ShutDown();
-
+ TodoManager.ShutDown(mgr);
}
//[Test]
Modified: incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Transport/Filter/TestKeepAlive.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Transport/Filter/TestKeepAlive.cs?rev=1103377&r1=1103376&r2=1103377&view=diff
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Transport/Filter/TestKeepAlive.cs (original)
+++ incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Transport/Filter/TestKeepAlive.cs Sun May 15 13:54:29 2011
@@ -111,7 +111,9 @@ namespace Org.Apache.Etch.Bindings.Cshar
Assert.AreEqual("_Etch_KeepAliveReq", msg.GetXType.Name);
Assert.AreEqual(4, msg.Get(new Field("count")));
Assert.AreEqual(3, msg.Get(new Field("delay")));
- }
+ filter.SessionNotify(SessionConsts.DOWN);
+ Assert.IsFalse(session.up);
+}
[Test]
public void clientup1()
@@ -129,6 +131,8 @@ namespace Org.Apache.Etch.Bindings.Cshar
Assert.AreEqual("_Etch_KeepAliveReq", msg.GetXType.Name);
Assert.AreEqual(4, msg.Get(new Field("count")));
Assert.AreEqual(2, msg.Get(new Field("delay")));
+ filter.SessionNotify(SessionConsts.DOWN);
+ Assert.IsFalse(session.up);
}
[Test]
@@ -155,6 +159,9 @@ namespace Org.Apache.Etch.Bindings.Cshar
filter.SessionMessage(null, req);
Assert.AreEqual(req.Reply().ToString(), transport.msg.ToString());
+
+ filter.SessionNotify(SessionConsts.DOWN);
+ Assert.IsFalse(session.up);
}
[Test]
Modified: incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Transport/Fmt/Binary/TestBinaryTaggedDataInOut.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Transport/Fmt/Binary/TestBinaryTaggedDataInOut.cs?rev=1103377&r1=1103376&r2=1103377&view=diff
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Transport/Fmt/Binary/TestBinaryTaggedDataInOut.cs (original)
+++ incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Transport/Fmt/Binary/TestBinaryTaggedDataInOut.cs Sun May 15 13:54:29 2011
@@ -28,7 +28,7 @@ namespace Org.Apache.Etch.Bindings.Cshar
/// <summary>
/// Test binary input and output.
/// </summary>
- [TestFixture]
+ [TestFixture]
public class TestBinaryTaggedDataInOut
{
Modified: incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestCircularQueue.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestCircularQueue.cs?rev=1103377&r1=1103376&r2=1103377&view=diff
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestCircularQueue.cs (original)
+++ incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestCircularQueue.cs Sun May 15 13:54:29 2011
@@ -36,16 +36,14 @@ namespace Org.Apache.Etch.Bindings.Cshar
Console.Write("TestCircularQueue");
}
-
- [Test]
- [ExpectedException( typeof( ArgumentOutOfRangeException ) )]
- public void construct1()
- {
- new CircularQueue<int?>( 0 );
- }
+ [Test]
+ [ExpectedException( typeof( ArgumentOutOfRangeException ) )]
+ public void construct1()
+ {
+ new CircularQueue<int?>( 0 );
+ }
-
- [Test]
+ [Test]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
public void construct2()
{
@@ -311,400 +309,390 @@ namespace Org.Apache.Etch.Bindings.Cshar
}
- [Test]
- public void stress1()
- {
- CircularQueue<int?> queue = new CircularQueue<int?>( 1 );
- int n = 10000;
+ [Test]
+ public void stress1()
+ {
+ CircularQueue<int?> queue = new CircularQueue<int?>( 1 );
+ int n = 10000;
Thread t = new Thread(
delegate()
{
for (int i = 0; i < n; i++)
- {
- try
- {
- queue.Put( i );
- }
- catch ( ThreadInterruptedException e )
- {
- Console.WriteLine(e);
- }
- }
- }
- );
-
- t.Start();
-
- for (int i = 0; i < n; i++)
- Assert.AreEqual( i, queue.Get() );
- }
-
-
- [Test]
- public void stress2()
- {
- CircularQueue<int?> queue = new CircularQueue<int?>( 1 );
- int n = 1000;
-
- Thread t = new Thread(
- delegate()
- {
- for (int i = 0; i < n; i++)
- {
- try
- {
- Thread.Sleep( 5 );
+ {
+ try
+ {
queue.Put( i );
- }
- catch ( ThreadInterruptedException e )
- {
- Console.WriteLine(e);
- }
- }
+ }
+ catch ( ThreadInterruptedException e )
+ {
+ Console.WriteLine(e);
+ }
+ }
}
);
-
- t.Start();
-
- for (int i = 0; i < n; i++)
- Assert.AreEqual( i, queue.Get() );
- }
-
-
- [Test]
- public void stress3()
- {
-
- CircularQueue<int?> queue = new CircularQueue<int?>( 1 );
- int n = 1000;
- Thread t = new Thread(
- delegate()
- {
- for (int i = 0; i < n; i++)
- {
- try
- {
-
- queue.Put( i );
- }
- catch ( ThreadInterruptedException e )
- {
- Console.WriteLine(e);
- }
- }
- }
- );
-
- t.Start();
-
-
-
- for (int i = 0; i < n; i++)
- {
- Thread.Sleep( 5 );
- Assert.AreEqual( i, queue.Get() );
- }
- }
-
-
- [Test]
- public void stress4()
- {
- CircularQueue<int?> queue = new CircularQueue<int?>();
-
- // we will setup two threads waiting to get and
- // then in a single synchronized step put two
- // items in the queue. the first thread will be
- // woken to get, and once done the second thread
- // should be woken by the first.
-
- Thread t1 = new Thread(
- delegate()
- {
- try
- {
- Assert.IsNotNull( queue.Get() );
- }
- catch ( ThreadInterruptedException e )
- {
- Console.WriteLine(e);
- }
- }
- );
+ t.Start();
+
+ for (int i = 0; i < n; i++)
+ Assert.AreEqual(i, queue.Get());
+ }
+
+ [Test]
+ public void stress2()
+ {
+ CircularQueue<int?> queue = new CircularQueue<int?>(1);
+ int n = 1000;
+
+ Thread t = new Thread(
+ delegate()
+ {
+ for (int i = 0; i < n; i++)
+ {
+ try
+ {
+ Thread.Sleep(5);
+ queue.Put(i);
+ }
+ catch (ThreadInterruptedException e)
+ {
+ Console.WriteLine(e);
+ }
+ }
+ }
+ );
+
+ t.Start();
+
+ for (int i = 0; i < n; i++)
+ Assert.AreEqual(i, queue.Get());
+ }
+
+
+ [Test]
+ public void stress3()
+ {
+
+ CircularQueue<int?> queue = new CircularQueue<int?>(1);
+ int n = 1000;
+
+ Thread t = new Thread(
+ delegate()
+ {
+ for (int i = 0; i < n; i++)
+ {
+ try
+ {
+
+ queue.Put(i);
+ }
+ catch (ThreadInterruptedException e)
+ {
+ Console.WriteLine(e);
+ }
+ }
+ }
+ );
+
+ t.Start();
+
+
+
+ for (int i = 0; i < n; i++)
+ {
+ Thread.Sleep(5);
+ Assert.AreEqual(i, queue.Get());
+ }
+ }
+
+ [Test]
+ public void stress4()
+ {
+ CircularQueue<int?> queue = new CircularQueue<int?>();
+
+ // we will setup two threads waiting to get and
+ // then in a single synchronized step put two
+ // items in the queue. the first thread will be
+ // woken to get, and once done the second thread
+ // should be woken by the first.
- Thread t2 = new Thread(
+ Thread t1 = new Thread(
delegate()
- {
- try
- {
- Assert.IsNotNull( queue.Get() );
- }
- catch ( ThreadInterruptedException e )
- {
+ {
+ try
+ {
+ Assert.IsNotNull( queue.Get() );
+ }
+ catch ( ThreadInterruptedException e )
+ {
Console.WriteLine(e);
- }
- }
- );
+ }
+ }
+ );
+
+ Thread t2 = new Thread(
+ delegate()
+ {
+ try
+ {
+ Assert.IsNotNull(queue.Get());
+ }
+ catch (ThreadInterruptedException e)
+ {
+ Console.WriteLine(e);
+ }
+ }
+ );
+
+ t1.Start();
+ t2.Start();
+
+ // wait until both threads are waiting on queue...
+
+ Thread.Sleep(100);
+
+ lock (queue)
+ {
+ queue.Put(1);
+ queue.Put(2);
+ }
+
+ harvest(t1);
+ harvest(t2);
+ }
- t1.Start();
- t2.Start();
-
- // wait until both threads are waiting on queue...
-
- Thread.Sleep( 100 );
-
- lock(queue)
- {
- queue.Put( 1 );
- queue.Put( 2 );
- }
- harvest( t1 );
- harvest( t2 );
- }
-
-
- [Test]
- public void stress5()
- {
- CircularQueue<int?> queue = new CircularQueue<int?>( 3 );
-
- // we will setup two threads waiting to put to the queue,
- // then in a single synchronized step, read two items from
- // the queue. the first thread will be woken to put, and
- // once done the second thread should be woken by the first.
-
- queue.Put( 0 );
- queue.Put( 1 );
- queue.Put( 2 );
- Assert.IsTrue( queue.IsFull() );
-
- Thread t1 = new Thread(
- delegate()
- {
-
- try
- {
- Assert.IsTrue( queue.Put( 3 ) );
- }
- catch ( ThreadInterruptedException e )
- {
- Console.WriteLine(e);
- }
- }
- );
-
- Thread t2 = new Thread(
- delegate()
- {
- try
- {
- Assert.IsTrue( queue.Put( 4 ) );
- }
- catch ( ThreadInterruptedException e )
- {
- Console.WriteLine(e);
- }
- }
- );
-
- t1.Start();
- t2.Start();
-
- // wait until both threads are waiting on queue...
-
- Thread.Sleep( 100 );
-
- lock(queue)
- {
- Assert.IsNotNull( queue.Get() );
- Assert.IsNotNull( queue.Get() );
- }
+ [Test]
+ public void stress5()
+ {
+ CircularQueue<int?> queue = new CircularQueue<int?>( 3 );
+
+ // we will setup two threads waiting to put to the queue,
+ // then in a single synchronized step, read two items from
+ // the queue. the first thread will be woken to put, and
+ // once done the second thread should be woken by the first.
+
+ queue.Put( 0 );
+ queue.Put( 1 );
+ queue.Put( 2 );
+ Assert.IsTrue( queue.IsFull() );
- harvest( t1 );
- harvest( t2 );
- }
-
-
- [Test]
- public void stress6()
- {
- CircularQueue<int?> queue = new CircularQueue<int?>( 5 );
-
- // start two getters and two putters and let 'em duke it out...
-
- Thread t1 = new Thread(
- delegate()
- {
- try
- {
- for (int i = 0; i < 100; i++)
- Assert.IsTrue( queue.Put( i ) );
- }
- catch ( ThreadInterruptedException e )
- {
- Console.WriteLine(e);
- }
- }
- );
-
- Thread t2 = new Thread(
- delegate()
- {
- try
- {
- for (int i = 0; i < 100; i++)
- Assert.IsTrue( queue.Put( i ) );
- }
- catch ( ThreadInterruptedException e )
- {
- Console.WriteLine(e);
- }
- }
- );
-
- Thread t3 = new Thread(
- delegate()
- {
- try
- {
- for (int i = 0; i < 100; i++)
- Assert.IsNotNull( queue.Get() );
- }
- catch ( ThreadInterruptedException e )
- {
- Console.WriteLine(e);
- }
- }
- );
-
- Thread t4 = new Thread(
+ Thread t1 = new Thread(
delegate()
- {
- try
- {
- for (int i = 0; i < 100; i++)
- Assert.IsNotNull( queue.Get() );
- }
- catch ( ThreadInterruptedException e )
- {
+ {
+ try
+ {
+ Assert.IsTrue( queue.Put( 3 ) );
+ }
+ catch ( ThreadInterruptedException e )
+ {
Console.WriteLine(e);
- }
- }
- );
-
- t1.Start();
- t2.Start();
- t3.Start();
- t4.Start();
+ }
+ }
+ );
- harvest( t1 );
- harvest( t2 );
- harvest( t3 );
- harvest( t4 );
- }
-
-
- [Test]
- public void harvest1()
- {
- Thread t = new Thread(
+ Thread t2 = new Thread(
delegate()
{
- }
- );
- t.Start();
- harvest( t );
- }
-
-
- [Test]
- [ExpectedException( typeof( TimeoutException ) )]
- public void harvest2()
- {
- Thread t = new Thread(
- delegate()
- {
- try
- {
- Thread.Sleep( 10000 );
- }
- catch ( ThreadInterruptedException e )
- {
+ try
+ {
+ Assert.IsTrue( queue.Put( 4 ) );
+ }
+ catch ( ThreadInterruptedException e )
+ {
Console.WriteLine(e);
- }
- }
- );
- t.Start();
- harvest( t );
- }
-
- private void harvest( Thread t )
- {
- t.Join( 1000 );
- if (t.IsAlive)
- {
- t.Interrupt();
- throw new TimeoutException( t.Name+" is stuck" );
- }
- }
-
-
- [Test]
- public void testRelError1()
- {
- assertRelError( 10, 9, .11 );
- assertRelError( 10, 11, .14 );
- assertRelError( 20, 19, .07 );
- assertRelError( 19, 23, .22 );
- }
-
-
- [Test]
- [ExpectedException( typeof(AssertionException ) )]
- public void testRelError2()
- {
- assertRelError( 9, 8, .1 );
- }
-
-
- [Test]
- [ExpectedException( typeof(AssertionException ) )]
- public void testRelError3()
- {
- assertRelError( 9, 10, .1 );
- }
-
-
- [Test]
- public void testAbsError1()
- {
- AssertAbsError( 11, 15, 4 );
- AssertAbsError( 15, 10, 5 );
- AssertAbsError( 5, 3, 2 );
- AssertAbsError( 4, 7, 3 );
- }
-
-
- [Test]
- [ExpectedException( typeof(AssertionException ) )]
- public void testAbsError2()
- {
- AssertAbsError( 11, 15, 3 );
- }
-
-
- [Test]
- [ExpectedException(typeof(AssertionException))]
- public void testAbsError3()
- {
- AssertAbsError( 19, 15, 3 );
- }
-
- private void Delay( int delay, run del )
- {
+ }
+ }
+ );
+
+ t1.Start();
+ t2.Start();
+
+ // wait until both threads are waiting on queue...
+
+ Thread.Sleep(100);
+
+ lock (queue)
+ {
+ Assert.IsNotNull(queue.Get());
+ Assert.IsNotNull(queue.Get());
+ }
+
+ harvest(t1);
+ harvest(t2);
+ }
+
+ [Test]
+ public void stress6()
+ {
+ CircularQueue<int?> queue = new CircularQueue<int?>(5);
+
+ // start two getters and two putters and let 'em duke it out...
+
+ Thread t1 = new Thread(
+ delegate()
+ {
+ try
+ {
+ for (int i = 0; i < 100; i++)
+ Assert.IsTrue(queue.Put(i));
+ }
+ catch (ThreadInterruptedException e)
+ {
+ Console.WriteLine(e);
+ }
+ }
+ );
+
+ Thread t2 = new Thread(
+ delegate()
+ {
+ try
+ {
+ for (int i = 0; i < 100; i++)
+ Assert.IsTrue(queue.Put(i));
+ }
+ catch (ThreadInterruptedException e)
+ {
+ Console.WriteLine(e);
+ }
+ }
+ );
+
+ Thread t3 = new Thread(
+ delegate()
+ {
+ try
+ {
+ for (int i = 0; i < 100; i++)
+ Assert.IsNotNull(queue.Get());
+ }
+ catch (ThreadInterruptedException e)
+ {
+ Console.WriteLine(e);
+ }
+ }
+ );
+
+ Thread t4 = new Thread(
+ delegate()
+ {
+ try
+ {
+ for (int i = 0; i < 100; i++)
+ Assert.IsNotNull(queue.Get());
+ }
+ catch (ThreadInterruptedException e)
+ {
+ Console.WriteLine(e);
+ }
+ }
+ );
+
+ t1.Start();
+ t2.Start();
+ t3.Start();
+ t4.Start();
+
+ harvest(t1);
+ harvest(t2);
+ harvest(t3);
+ harvest(t4);
+ }
+
+ [Test]
+ public void harvest1()
+ {
+ Thread t = new Thread(
+ delegate()
+ {
+ }
+ );
+ t.Start();
+ harvest(t);
+ }
+
+ [Test]
+ [ExpectedException(typeof(TimeoutException))]
+ public void harvest2()
+ {
+ Thread t = new Thread(
+ delegate()
+ {
+ try
+ {
+ Thread.Sleep(10000);
+ }
+ catch (ThreadInterruptedException e)
+ {
+ Console.WriteLine(e);
+ }
+ }
+ );
+ t.Start();
+ harvest(t);
+ }
+
+ private void harvest(Thread t)
+ {
+ t.Join(1000);
+ if (t.IsAlive)
+ {
+ t.Interrupt();
+ throw new TimeoutException(t.Name + " is stuck");
+ }
+ }
+
+
+ [Test]
+ public void testRelError1()
+ {
+ assertRelError(10, 9, .11);
+ assertRelError(10, 11, .14);
+ assertRelError(20, 19, .07);
+ assertRelError(19, 23, .22);
+ }
+
+
+ [Test]
+ [ExpectedException(typeof(AssertionException))]
+ public void testRelError2()
+ {
+ assertRelError(9, 8, .1);
+ }
+
+ [Test]
+ [ExpectedException(typeof(AssertionException))]
+ public void testRelError3()
+ {
+ assertRelError(9, 10, .1);
+ }
+
+ [Test]
+ public void testAbsError1()
+ {
+ AssertAbsError(11, 15, 4);
+ AssertAbsError(15, 10, 5);
+ AssertAbsError(5, 3, 2);
+ AssertAbsError(4, 7, 3);
+ }
+
+ [Test]
+ [ExpectedException(typeof(AssertionException))]
+ public void testAbsError2()
+ {
+ AssertAbsError(11, 15, 3);
+ }
+
+ [Test]
+ [ExpectedException(typeof(AssertionException))]
+ public void testAbsError3()
+ {
+ AssertAbsError(19, 15, 3);
+ }
+
+ private void Delay( int delay, run del )
+ {
Thread t = new Thread(delegate()
{
@@ -719,11 +707,7 @@ namespace Org.Apache.Etch.Bindings.Cshar
}
});
t.Start();
-
-
- }
-
-
+ }
private void assertRelError( double expected, double actual, double error )
{
Modified: incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestDateSerializer.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestDateSerializer.cs?rev=1103377&r1=1103376&r2=1103377&view=diff
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestDateSerializer.cs (original)
+++ incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestDateSerializer.cs Sun May 15 13:54:29 2011
@@ -40,7 +40,7 @@ namespace Org.Apache.Etch.Bindings.Cshar
[Test]
public void TestImport()
{
- DateTime date = new DateTime();
+ DateTime date = new DateTime().ToLocalTime();
TestDate( date );
}
Modified: incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestMonitor.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestMonitor.cs?rev=1103377&r1=1103376&r2=1103377&view=diff
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestMonitor.cs (original)
+++ incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestMonitor.cs Sun May 15 13:54:29 2011
@@ -18,7 +18,8 @@
// under the License.
//
using System;
-using System.Threading;
+using System.Threading;
+using System.Globalization;
using Etch4.Util.Test;
using NUnit.Framework;
@@ -27,8 +28,23 @@ namespace Org.Apache.Etch.Bindings.Cshar
[TestFixture]
public class TestMonitor
{
- private const double REL_ERROR = 100000;
-
+
+ private const double REL_ERROR = 100000;
+ private CultureInfo savedCulture;
+
+ [SetUp]
+ public void SetUp()
+ {
+ savedCulture = Thread.CurrentThread.CurrentCulture;
+ Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ Thread.CurrentThread.CurrentCulture = savedCulture;
+ }
+
/** @ */
[Test]
public void construct1()
Modified: incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestTcpConnection.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestTcpConnection.cs?rev=1103377&r1=1103376&r2=1103377&view=diff
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestTcpConnection.cs (original)
+++ incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestTcpConnection.cs Sun May 15 13:54:29 2011
@@ -352,7 +352,7 @@ namespace Org.Apache.Etch.Bindings.Cshar
#endregion
// Cause BuildServer to hang, hence ignored
- [Ignore]
+ [Ignore]
[Test]
public void restart1()
{
Modified: incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestURL.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestURL.cs?rev=1103377&r1=1103376&r2=1103377&view=diff
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestURL.cs (original)
+++ incubator/etch/trunk/binding-csharp/runtime/src/test/csharp/Etch/Util/TestURL.cs Sun May 15 13:54:29 2011
@@ -17,7 +17,9 @@
// specific language governing permissions and limitations
// under the License.
//
-using System;
+using System;
+using System.Threading;
+using System.Globalization;
using NUnit.Framework;
// s is scheme:[//[user[:password]@]host[:port]/]uri[;params][?terms][#fragment]
@@ -26,7 +28,22 @@ namespace Org.Apache.Etch.Bindings.Cshar
{
[TestFixture]
public class TestURL
- {
+ {
+
+ private CultureInfo savedCulture;
+
+ [SetUp]
+ public void SetUp()
+ {
+ savedCulture = Thread.CurrentThread.CurrentCulture;
+ Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ Thread.CurrentThread.CurrentCulture = savedCulture;
+ }
[TestFixtureSetUp]
public void First()