geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject [31/51] [partial] geode git commit: Software Grant Agreement (SGA) from Pivotal for Apache Geode
Date Fri, 13 Jan 2017 22:46:15 GMT
http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/integration-test/SerializationTestsN.cs
----------------------------------------------------------------------
diff --git a/src/clicache/integration-test/SerializationTestsN.cs b/src/clicache/integration-test/SerializationTestsN.cs
new file mode 100644
index 0000000..2a18047
--- /dev/null
+++ b/src/clicache/integration-test/SerializationTestsN.cs
@@ -0,0 +1,1269 @@
+//=========================================================================
+// Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+// This product is protected by U.S. and international copyright
+// and intellectual property laws. Pivotal products are covered by
+// more patents listed at http://www.pivotal.io/patents.
+//========================================================================
+
+using System;
+using System.Diagnostics;
+using System.IO;
+using System.Threading;
+
+namespace GemStone.GemFire.Cache.UnitTests.NewAPI
+{
+  using NUnit.Framework;
+  using GemStone.GemFire.DUnitFramework;
+  using GemStone.GemFire.Cache.Generic;
+
+
+  [TestFixture]
+  [Category("generics")]
+  public class SerializationTests : ThinClientRegionSteps
+  {
+    private const int OTHER_TYPE1 = 1;
+    private const int OTHER_TYPE2 = 2;
+    private const int OTHER_TYPE22 = 3;
+    private const int OTHER_TYPE4 = 4;
+    private const int OTHER_TYPE42 = 5;
+    private const int OTHER_TYPE43 = 6;
+
+    private UnitProcess sender, receiver;
+
+    protected override ClientBase[] GetClients()
+    {
+      sender = new UnitProcess();
+      receiver = new UnitProcess();
+      return new ClientBase[] { sender, receiver };
+    }
+
+    [TestFixtureTearDown]
+    public override void EndTests()
+    {
+      CacheHelper.StopJavaServers();
+      base.EndTests();
+    }
+
+    [TearDown]
+    public override void EndTest()
+    {
+      try
+      {
+        sender.Call(DestroyRegions);
+        receiver.Call(DestroyRegions);
+        CacheHelper.ClearEndpoints();
+      }
+      finally
+      {
+        CacheHelper.StopJavaServers();
+      }
+      base.EndTest();
+    }
+
+    private IGFSerializable CreateOtherType(int i, int otherType)
+    {
+      IGFSerializable ot;
+      switch (otherType)
+      {
+        case OTHER_TYPE1: ot = new OtherType(i, i + 20000); break;
+        case OTHER_TYPE2: ot = new OtherType2(i, i + 20000); break;
+        case OTHER_TYPE22: ot = new OtherType22(i, i + 20000); break;
+        case OTHER_TYPE4: ot = new OtherType4(i, i + 20000); break;
+        case OTHER_TYPE42: ot = new OtherType42(i, i + 20000); break;
+        case OTHER_TYPE43: ot = new OtherType43(i, i + 20000); break;
+        default: ot = new OtherType(i, i + 20000); break;
+      }
+      return ot;
+    }
+
+    #region Functions that are invoked by the tests
+
+    public void CreateRegionForOT(string locators)
+    {
+      CacheHelper.CreateTCRegion2<object, object>(RegionNames[0], true, false,
+        null, locators, false);
+      Serializable.RegisterTypeGeneric(OtherType.CreateDeserializable);
+      Serializable.RegisterTypeGeneric(OtherType2.CreateDeserializable);
+      Serializable.RegisterTypeGeneric(OtherType22.CreateDeserializable);
+      Serializable.RegisterTypeGeneric(OtherType4.CreateDeserializable);
+      Serializable.RegisterTypeGeneric(OtherType42.CreateDeserializable);
+      Serializable.RegisterTypeGeneric(OtherType43.CreateDeserializable);
+    }
+
+    public void DoNPuts(int n)
+    {
+      try
+      {
+        Serializable.RegisterTypeGeneric(OtherType.CreateDeserializable);
+        Assert.Fail("Expected exception in registering the type again.");
+      }
+      catch (IllegalStateException ex)
+      {
+        Util.Log("Got expected exception in RegisterType: {0}", ex);
+      }
+      IRegion<object, object> region = CacheHelper.GetVerifyRegion<object, object>(RegionNames[0]);
+      for (int i = 0; i < n; i++)
+      {
+        //CacheableInt32 key = new CacheableInt32(i);
+        //region.Put(key, key);
+
+        int key = i;
+        region[key] = key;
+      }
+    }
+
+    public void DoValidates(int n)
+    {
+      try
+      {
+        Serializable.RegisterTypeGeneric(OtherType.CreateDeserializable);
+        Assert.Fail("Expected exception in registering the type again.");
+      }
+      catch (IllegalStateException ex)
+      {
+        Util.Log("Got expected exception in RegisterType: {0}", ex);
+      }
+      IRegion<object, object> region = CacheHelper.GetVerifyRegion<object, object>(RegionNames[0]);
+      for (int i = 0; i < n; i++)
+      {
+        //CacheableInt32 val = region.Get(i) as CacheableInt32;
+        object val = region[i];
+        Assert.AreEqual(i, val, "Found unexpected value");
+      }
+    }
+
+    public void DoNPutsOtherType(int n, int otherType)
+    {
+      IRegion<object, object> region = CacheHelper.GetVerifyRegion<object, object>(RegionNames[0]);
+      for (int i = 0; i < n; i++)
+      {
+        IGFSerializable ot = CreateOtherType(i, otherType);
+        region[i + 10] = ot;
+      }
+    }
+
+    public void DoValidateNPutsOtherType(int n, int otherType)
+    {
+      IRegion<object, object> region = CacheHelper.GetVerifyRegion<object, object>(RegionNames[0]);
+      for (int i = 0; i < n; i++)
+      {
+        object val = region[i + 10];
+        IGFSerializable ot = CreateOtherType(i, otherType);
+        Assert.IsTrue(ot.Equals(val), "Found unexpected value");
+      }
+    }
+
+    #endregion
+
+    #region Tests
+
+    [Test]
+    public void CustomTypes()
+    {
+      CacheHelper.SetupJavaServers(true, "cacheserver.xml");
+      CacheHelper.StartJavaLocator(1, "GFELOC");
+      Util.Log("Locator 1 started.");
+      CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
+      Util.Log("Cacheserver 1 started.");
+
+      sender.Call(CreateRegionForOT, CacheHelper.Locators);
+      Util.Log("StepOne complete.");
+
+      receiver.Call(CreateRegionForOT, CacheHelper.Locators);
+      Util.Log("StepTwo complete.");
+
+      sender.Call(DoNPuts, 10);
+      receiver.Call(DoValidates, 10);
+      Util.Log("StepThree complete.");
+
+      sender.Call(DoNPutsOtherType, 10, OTHER_TYPE1);
+      receiver.Call(DoValidateNPutsOtherType, 10, OTHER_TYPE1);
+      Util.Log("StepFour complete.");
+
+      sender.Call(DoNPutsOtherType, 10, OTHER_TYPE2);
+      receiver.Call(DoValidateNPutsOtherType, 10, OTHER_TYPE2);
+      Util.Log("StepFive complete.");
+
+      sender.Call(DoNPutsOtherType, 10, OTHER_TYPE22);
+      receiver.Call(DoValidateNPutsOtherType, 10, OTHER_TYPE22);
+      Util.Log("StepSix complete.");
+
+      sender.Call(DoNPutsOtherType, 10, OTHER_TYPE4);
+      receiver.Call(DoValidateNPutsOtherType, 10, OTHER_TYPE4);
+      Util.Log("StepSeven complete.");
+
+      sender.Call(DoNPutsOtherType, 10, OTHER_TYPE42);
+      receiver.Call(DoValidateNPutsOtherType, 10, OTHER_TYPE42);
+      Util.Log("StepEight complete.");
+
+      sender.Call(DoNPutsOtherType, 10, OTHER_TYPE43);
+      receiver.Call(DoValidateNPutsOtherType, 10, OTHER_TYPE43);
+      Util.Log("StepNine complete.");
+
+      CacheHelper.StopJavaServer(1);
+      Util.Log("Cacheserver 1 stopped.");
+
+      CacheHelper.StopJavaLocator(1);
+    }
+
+    #endregion
+  }
+
+  [Serializable]
+  public struct CData
+  {
+    #region Private members
+
+    private Int32 m_first;
+    private Int64 m_second;
+
+    #endregion
+
+    #region Public accessors
+
+    public Int32 First
+    {
+      get
+      {
+        return m_first;
+      }
+      set
+      {
+        m_first = value;
+      }
+    }
+
+    public Int64 Second
+    {
+      get
+      {
+        return m_second;
+      }
+      set
+      {
+        m_second = value;
+      }
+    }
+
+    #endregion
+
+    public CData(Int32 first, Int64 second)
+    {
+      m_first = first;
+      m_second = second;
+    }
+
+    public static bool operator ==(CData obj1, CData obj2)
+    {
+      return ((obj1.m_first == obj2.m_first) && (obj1.m_second == obj2.m_second));
+    }
+
+    public static bool operator !=(CData obj1, CData obj2)
+    {
+      return ((obj1.m_first != obj2.m_first) || (obj1.m_second != obj2.m_second));
+    }
+
+    public override bool Equals(object obj)
+    {
+      if (obj is CData)
+      {
+        CData otherObj = (CData)obj;
+        return ((m_first == otherObj.m_first) && (m_second == otherObj.m_second));
+      }
+      return false;
+    }
+
+    public override int GetHashCode()
+    {
+      return m_first.GetHashCode() ^ m_second.GetHashCode();
+    }
+  };
+
+  public class PdxCData : IPdxSerializable
+  {
+    #region Private members
+
+    private Int32 m_first;
+    private Int64 m_second;
+
+    #endregion
+
+    #region Public accessors
+
+    public Int32 First
+    {
+      get
+      {
+        return m_first;
+      }
+      set
+      {
+        m_first = value;
+      }
+    }
+
+    public Int64 Second
+    {
+      get
+      {
+        return m_second;
+      }
+      set
+      {
+        m_second = value;
+      }
+    }
+
+    #endregion
+
+    public PdxCData(Int32 first, Int64 second)
+    {
+      m_first = first;
+      m_second = second;
+    }
+
+    public PdxCData() { }
+
+    public static PdxCData CreateDeserializable()
+    {
+      return new PdxCData();
+    }
+    public static bool operator ==(PdxCData obj1, PdxCData obj2)
+    {
+      return ((obj1.m_first == obj2.m_first) && (obj1.m_second == obj2.m_second));
+    }
+
+    public static bool operator !=(PdxCData obj1, PdxCData obj2)
+    {
+      return ((obj1.m_first != obj2.m_first) || (obj1.m_second != obj2.m_second));
+    }
+
+    public override bool Equals(object obj)
+    {
+      if (obj is PdxCData)
+      {
+        PdxCData otherObj = (PdxCData)obj;
+        return ((m_first == otherObj.m_first) && (m_second == otherObj.m_second));
+      }
+      return false;
+    }
+
+    public override int GetHashCode()
+    {
+      return m_first.GetHashCode() ;
+    }
+
+    #region IPdxSerializable Members
+
+    public void FromData(IPdxReader reader)
+    {
+      m_first = reader.ReadInt("m_first");
+      m_second = reader.ReadLong("m_second");
+    }
+
+    public void ToData(IPdxWriter writer)
+    {      
+      writer.WriteInt("m_first", m_first);
+      writer.MarkIdentityField("m_first");
+      writer.WriteLong("m_second", m_second);
+    }
+
+    #endregion
+
+   
+
+    
+  };
+
+  public class OtherType : IGFSerializable
+  {
+    private CData m_struct;
+    private ExceptionType m_exType;
+
+    public enum ExceptionType
+    {
+      None,
+      Gemfire,
+      System,
+      // below are with inner exceptions
+      GemfireGemfire,
+      GemfireSystem,
+      SystemGemfire,
+      SystemSystem
+    }
+
+    public OtherType()
+    {
+      m_exType = ExceptionType.None;
+    }
+
+    public OtherType(Int32 first, Int64 second)
+      : this(first, second, ExceptionType.None)
+    {
+    }
+
+    public OtherType(Int32 first, Int64 second, ExceptionType exType)
+    {
+      m_struct.First = first;
+      m_struct.Second = second;
+      m_exType = exType;
+    }
+
+    public CData Data
+    {
+      get
+      {
+        return m_struct;
+      }
+    }
+
+    public static IGFSerializable Duplicate(IGFSerializable orig)
+    {
+      DataOutput dout = new DataOutput();
+      orig.ToData(dout);
+
+      DataInput din = new DataInput(dout.GetBuffer());
+      IGFSerializable dup = (IGFSerializable)din.ReadObject();
+      return dup;
+    }
+
+    #region IGFSerializable Members
+
+    public IGFSerializable FromData(DataInput input)
+    {
+      m_struct.First = input.ReadInt32();
+      m_struct.Second = input.ReadInt64();
+      switch (m_exType)
+      {
+        case ExceptionType.None:
+          break;
+        case ExceptionType.Gemfire:
+          throw new GemFireIOException("Throwing an exception");
+        case ExceptionType.System:
+          throw new IOException("Throwing an exception");
+        case ExceptionType.GemfireGemfire:
+          throw new GemFireIOException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.GemfireSystem:
+          throw new CacheServerException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+        case ExceptionType.SystemGemfire:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.SystemSystem:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+      }
+      return this;
+    }
+
+    public void ToData(DataOutput output)
+    {
+      output.WriteInt32(m_struct.First);
+      output.WriteInt64(m_struct.Second);
+      switch (m_exType)
+      {
+        case ExceptionType.None:
+          break;
+        case ExceptionType.Gemfire:
+          throw new GemFireIOException("Throwing an exception");
+        case ExceptionType.System:
+          throw new IOException("Throwing an exception");
+        case ExceptionType.GemfireGemfire:
+          throw new GemFireIOException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.GemfireSystem:
+          throw new CacheServerException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+        case ExceptionType.SystemGemfire:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.SystemSystem:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+      }
+    }
+
+    public UInt32 ObjectSize
+    {
+      get
+      {
+        return (UInt32)(sizeof(Int32) + sizeof(Int64));
+      }
+    }
+
+    public UInt32 ClassId
+    {
+      get
+      {
+        return 0x0;
+      }
+    }
+
+    #endregion
+
+    public static IGFSerializable CreateDeserializable()
+    {
+      return new OtherType();
+    }
+
+    public override int GetHashCode()
+    {
+      return m_struct.First.GetHashCode() ^ m_struct.Second.GetHashCode();
+    }
+    
+    public override bool Equals(object obj)
+    {
+      OtherType ot = obj as OtherType;
+      if (ot != null)
+      {
+        return (m_struct.Equals(ot.m_struct));
+      }
+      return false;
+    }
+  }
+
+  public class OtherType2 : IGFSerializable
+  {
+    private CData m_struct;
+    private ExceptionType m_exType;
+
+    public enum ExceptionType
+    {
+      None,
+      Gemfire,
+      System,
+      // below are with inner exceptions
+      GemfireGemfire,
+      GemfireSystem,
+      SystemGemfire,
+      SystemSystem
+    }
+    
+    public OtherType2()
+    {
+      m_exType = ExceptionType.None;
+    }
+
+    public OtherType2(Int32 first, Int64 second)
+      : this(first, second, ExceptionType.None)
+    {
+    }
+
+    public OtherType2(Int32 first, Int64 second, ExceptionType exType)
+    {
+      m_struct.First = first;
+      m_struct.Second = second;
+      m_exType = exType;
+    }
+
+    public CData Data
+    {
+      get
+      {
+        return m_struct;
+      }
+    }
+
+    public static IGFSerializable Duplicate(IGFSerializable orig)
+    {
+      DataOutput dout = new DataOutput();
+      orig.ToData(dout);
+
+      DataInput din = new DataInput(dout.GetBuffer());
+      IGFSerializable dup = (IGFSerializable)din.ReadObject();
+      return dup;
+    }
+
+    #region IGFSerializable Members
+
+    public IGFSerializable FromData(DataInput input)
+    {
+      m_struct.First = input.ReadInt32();
+      m_struct.Second = input.ReadInt64();
+      switch (m_exType)
+      {
+        case ExceptionType.None:
+          break;
+        case ExceptionType.Gemfire:
+          throw new GemFireIOException("Throwing an exception");
+        case ExceptionType.System:
+          throw new IOException("Throwing an exception");
+        case ExceptionType.GemfireGemfire:
+          throw new GemFireIOException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.GemfireSystem:
+          throw new CacheServerException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+        case ExceptionType.SystemGemfire:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.SystemSystem:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+      }
+      return this;
+    }
+
+    public void ToData(DataOutput output)
+    {
+      output.WriteInt32(m_struct.First);
+      output.WriteInt64(m_struct.Second);
+      switch (m_exType)
+      {
+        case ExceptionType.None:
+          break;
+        case ExceptionType.Gemfire:
+          throw new GemFireIOException("Throwing an exception");
+        case ExceptionType.System:
+          throw new IOException("Throwing an exception");
+        case ExceptionType.GemfireGemfire:
+          throw new GemFireIOException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.GemfireSystem:
+          throw new CacheServerException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+        case ExceptionType.SystemGemfire:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.SystemSystem:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+      }
+    }
+
+    public UInt32 ObjectSize
+    {
+      get
+      {
+        return (UInt32)(sizeof(Int32) + sizeof(Int64));
+      }
+    }
+
+    public UInt32 ClassId
+    {
+      get
+      {
+        return 0x8C;
+      }
+    }
+
+    #endregion
+
+    public static IGFSerializable CreateDeserializable()
+    {
+      return new OtherType2();
+    }
+
+    public override int GetHashCode()
+    {
+      return m_struct.First.GetHashCode() ^ m_struct.Second.GetHashCode();
+    }
+
+    public override bool Equals(object obj)
+    {
+      OtherType2 ot = obj as OtherType2;
+      if (ot != null)
+      {
+        return (m_struct.Equals(ot.m_struct));
+      }
+      return false;
+    }
+
+  }
+
+  public class OtherType22 : IGFSerializable
+  {
+    private CData m_struct;
+    private ExceptionType m_exType;
+
+    public enum ExceptionType
+    {
+      None,
+      Gemfire,
+      System,
+      // below are with inner exceptions
+      GemfireGemfire,
+      GemfireSystem,
+      SystemGemfire,
+      SystemSystem
+    }
+
+    public OtherType22()
+    {
+      m_exType = ExceptionType.None;
+    }
+
+    public OtherType22(Int32 first, Int64 second)
+      : this(first, second, ExceptionType.None)
+    {
+    }
+
+    public OtherType22(Int32 first, Int64 second, ExceptionType exType)
+    {
+      m_struct.First = first;
+      m_struct.Second = second;
+      m_exType = exType;
+    }
+
+    public CData Data
+    {
+      get
+      {
+        return m_struct;
+      }
+    }
+
+    public static IGFSerializable Duplicate(IGFSerializable orig)
+    {
+      DataOutput dout = new DataOutput();
+      orig.ToData(dout);
+
+      DataInput din = new DataInput(dout.GetBuffer());
+      IGFSerializable dup = (IGFSerializable)din.ReadObject();
+      return dup;
+    }
+
+    #region IGFSerializable Members
+
+    public IGFSerializable FromData(DataInput input)
+    {
+      m_struct.First = input.ReadInt32();
+      m_struct.Second = input.ReadInt64();
+      switch (m_exType)
+      {
+        case ExceptionType.None:
+          break;
+        case ExceptionType.Gemfire:
+          throw new GemFireIOException("Throwing an exception");
+        case ExceptionType.System:
+          throw new IOException("Throwing an exception");
+        case ExceptionType.GemfireGemfire:
+          throw new GemFireIOException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.GemfireSystem:
+          throw new CacheServerException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+        case ExceptionType.SystemGemfire:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.SystemSystem:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+      }
+      return this;
+    }
+
+    public void ToData(DataOutput output)
+    {
+      output.WriteInt32(m_struct.First);
+      output.WriteInt64(m_struct.Second);
+      switch (m_exType)
+      {
+        case ExceptionType.None:
+          break;
+        case ExceptionType.Gemfire:
+          throw new GemFireIOException("Throwing an exception");
+        case ExceptionType.System:
+          throw new IOException("Throwing an exception");
+        case ExceptionType.GemfireGemfire:
+          throw new GemFireIOException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.GemfireSystem:
+          throw new CacheServerException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+        case ExceptionType.SystemGemfire:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.SystemSystem:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+      }
+    }
+
+    public UInt32 ObjectSize
+    {
+      get
+      {
+        return (UInt32)(sizeof(Int32) + sizeof(Int64));
+      }
+    }
+
+    public UInt32 ClassId
+    {
+      get
+      {
+        return 0x8C0;
+      }
+    }
+
+    #endregion
+
+    public static IGFSerializable CreateDeserializable()
+    {
+      return new OtherType22();
+    }
+
+    public override int GetHashCode()
+    {
+      return m_struct.First.GetHashCode() ^ m_struct.Second.GetHashCode();
+    }
+
+    public override bool Equals(object obj)
+    {
+      OtherType22 ot = obj as OtherType22;
+      if (ot != null)
+      {
+        return (m_struct.Equals(ot.m_struct));
+      }
+      return false;
+    }
+  }
+
+  public class OtherType4 : IGFSerializable
+  {
+    private CData m_struct;
+    private ExceptionType m_exType;
+
+    public enum ExceptionType
+    {
+      None,
+      Gemfire,
+      System,
+      // below are with inner exceptions
+      GemfireGemfire,
+      GemfireSystem,
+      SystemGemfire,
+      SystemSystem
+    }
+
+    public OtherType4()
+    {
+      m_exType = ExceptionType.None;
+    }
+
+    public OtherType4(Int32 first, Int64 second)
+      : this(first, second, ExceptionType.None)
+    {
+    }
+
+    public OtherType4(Int32 first, Int64 second, ExceptionType exType)
+    {
+      m_struct.First = first;
+      m_struct.Second = second;
+      m_exType = exType;
+    }
+
+    public CData Data
+    {
+      get
+      {
+        return m_struct;
+      }
+    }
+
+    public static IGFSerializable Duplicate(IGFSerializable orig)
+    {
+      DataOutput dout = new DataOutput();
+      orig.ToData(dout);
+
+      DataInput din = new DataInput(dout.GetBuffer());
+      IGFSerializable dup = (IGFSerializable)din.ReadObject();
+      return dup;
+    }
+
+    #region IGFSerializable Members
+
+    public IGFSerializable FromData(DataInput input)
+    {
+      m_struct.First = input.ReadInt32();
+      m_struct.Second = input.ReadInt64();
+      switch (m_exType)
+      {
+        case ExceptionType.None:
+          break;
+        case ExceptionType.Gemfire:
+          throw new GemFireIOException("Throwing an exception");
+        case ExceptionType.System:
+          throw new IOException("Throwing an exception");
+        case ExceptionType.GemfireGemfire:
+          throw new GemFireIOException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.GemfireSystem:
+          throw new CacheServerException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+        case ExceptionType.SystemGemfire:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.SystemSystem:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+      }
+      return this;
+    }
+
+    public void ToData(DataOutput output)
+    {
+      output.WriteInt32(m_struct.First);
+      output.WriteInt64(m_struct.Second);
+      switch (m_exType)
+      {
+        case ExceptionType.None:
+          break;
+        case ExceptionType.Gemfire:
+          throw new GemFireIOException("Throwing an exception");
+        case ExceptionType.System:
+          throw new IOException("Throwing an exception");
+        case ExceptionType.GemfireGemfire:
+          throw new GemFireIOException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.GemfireSystem:
+          throw new CacheServerException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+        case ExceptionType.SystemGemfire:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.SystemSystem:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+      }
+    }
+
+    public UInt32 ObjectSize
+    {
+      get
+      {
+        return (UInt32)(sizeof(Int32) + sizeof(Int64));
+      }
+    }
+
+    public UInt32 ClassId
+    {
+      get
+      {
+        return 0x8FC0;
+      }
+    }
+
+    #endregion
+
+    public static IGFSerializable CreateDeserializable()
+    {
+      return new OtherType4();
+    }
+
+    public override int GetHashCode()
+    {
+      return m_struct.First.GetHashCode() ^ m_struct.Second.GetHashCode();
+    }
+
+    public override bool Equals(object obj)
+    {
+      OtherType4 ot = obj as OtherType4;
+      if (ot != null)
+      {
+        return (m_struct.Equals(ot.m_struct));
+      }
+      return false;
+    }
+
+  }
+
+  public class OtherType42 : IGFSerializable
+  {
+    private CData m_struct;
+    private ExceptionType m_exType;
+
+    public enum ExceptionType
+    {
+      None,
+      Gemfire,
+      System,
+      // below are with inner exceptions
+      GemfireGemfire,
+      GemfireSystem,
+      SystemGemfire,
+      SystemSystem
+    }
+
+    public OtherType42()
+    {
+      m_exType = ExceptionType.None;
+    }
+
+    public OtherType42(Int32 first, Int64 second)
+      : this(first, second, ExceptionType.None)
+    {
+    }
+
+    public OtherType42(Int32 first, Int64 second, ExceptionType exType)
+    {
+      m_struct.First = first;
+      m_struct.Second = second;
+      m_exType = exType;
+    }
+
+    public CData Data
+    {
+      get
+      {
+        return m_struct;
+      }
+    }
+
+    public static IGFSerializable Duplicate(IGFSerializable orig)
+    {
+      DataOutput dout = new DataOutput();
+      orig.ToData(dout);
+
+      DataInput din = new DataInput(dout.GetBuffer());
+      IGFSerializable dup = (IGFSerializable)din.ReadObject();
+      return dup;
+    }
+
+    #region IGFSerializable Members
+
+    public IGFSerializable FromData(DataInput input)
+    {
+      m_struct.First = input.ReadInt32();
+      m_struct.Second = input.ReadInt64();
+      switch (m_exType)
+      {
+        case ExceptionType.None:
+          break;
+        case ExceptionType.Gemfire:
+          throw new GemFireIOException("Throwing an exception");
+        case ExceptionType.System:
+          throw new IOException("Throwing an exception");
+        case ExceptionType.GemfireGemfire:
+          throw new GemFireIOException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.GemfireSystem:
+          throw new CacheServerException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+        case ExceptionType.SystemGemfire:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.SystemSystem:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+      }
+      return this;
+    }
+
+    public void ToData(DataOutput output)
+    {
+      output.WriteInt32(m_struct.First);
+      output.WriteInt64(m_struct.Second);
+      switch (m_exType)
+      {
+        case ExceptionType.None:
+          break;
+        case ExceptionType.Gemfire:
+          throw new GemFireIOException("Throwing an exception");
+        case ExceptionType.System:
+          throw new IOException("Throwing an exception");
+        case ExceptionType.GemfireGemfire:
+          throw new GemFireIOException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.GemfireSystem:
+          throw new CacheServerException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+        case ExceptionType.SystemGemfire:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.SystemSystem:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+      }
+    }
+
+    public UInt32 ObjectSize
+    {
+      get
+      {
+        return (UInt32)(sizeof(Int32) + sizeof(Int64));
+      }
+    }
+
+    public UInt32 ClassId
+    {
+      get
+      {
+        return 0x6F3F97;
+      }
+    }
+
+    #endregion
+
+    public static IGFSerializable CreateDeserializable()
+    {
+      return new OtherType42();
+    }
+
+    public override int GetHashCode()
+    {
+      return m_struct.First.GetHashCode() ^ m_struct.Second.GetHashCode();
+    }
+
+    public override bool Equals(object obj)
+    {
+      OtherType42 ot = obj as OtherType42;
+      if (ot != null)
+      {
+        return (m_struct.Equals(ot.m_struct));
+      }
+      return false;
+    }
+
+  }
+
+  public class OtherType43 : IGFSerializable
+  {
+    private CData m_struct;
+    private ExceptionType m_exType;
+
+    public enum ExceptionType
+    {
+      None,
+      Gemfire,
+      System,
+      // below are with inner exceptions
+      GemfireGemfire,
+      GemfireSystem,
+      SystemGemfire,
+      SystemSystem
+    }
+
+    public OtherType43()
+    {
+      m_exType = ExceptionType.None;
+    }
+
+    public OtherType43(Int32 first, Int64 second)
+      : this(first, second, ExceptionType.None)
+    {
+    }
+
+    public OtherType43(Int32 first, Int64 second, ExceptionType exType)
+    {
+      m_struct.First = first;
+      m_struct.Second = second;
+      m_exType = exType;
+    }
+
+    public CData Data
+    {
+      get
+      {
+        return m_struct;
+      }
+    }
+
+    public static IGFSerializable Duplicate(IGFSerializable orig)
+    {
+      DataOutput dout = new DataOutput();
+      orig.ToData(dout);
+
+      DataInput din = new DataInput(dout.GetBuffer());
+      IGFSerializable dup = (IGFSerializable)din.ReadObject();
+      return dup;
+    }
+
+    #region IGFSerializable Members
+
+    public IGFSerializable FromData(DataInput input)
+    {
+      m_struct.First = input.ReadInt32();
+      m_struct.Second = input.ReadInt64();
+      switch (m_exType)
+      {
+        case ExceptionType.None:
+          break;
+        case ExceptionType.Gemfire:
+          throw new GemFireIOException("Throwing an exception");
+        case ExceptionType.System:
+          throw new IOException("Throwing an exception");
+        case ExceptionType.GemfireGemfire:
+          throw new GemFireIOException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.GemfireSystem:
+          throw new CacheServerException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+        case ExceptionType.SystemGemfire:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.SystemSystem:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+      }
+      return this;
+    }
+
+    public void ToData(DataOutput output)
+    {
+      output.WriteInt32(m_struct.First);
+      output.WriteInt64(m_struct.Second);
+      switch (m_exType)
+      {
+        case ExceptionType.None:
+          break;
+        case ExceptionType.Gemfire:
+          throw new GemFireIOException("Throwing an exception");
+        case ExceptionType.System:
+          throw new IOException("Throwing an exception");
+        case ExceptionType.GemfireGemfire:
+          throw new GemFireIOException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.GemfireSystem:
+          throw new CacheServerException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+        case ExceptionType.SystemGemfire:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new CacheServerException("This is an inner exception"));
+        case ExceptionType.SystemSystem:
+          throw new ApplicationException("Throwing an exception with inner " +
+            "exception", new IOException("This is an inner exception"));
+      }
+    }
+
+    public UInt32 ObjectSize
+    {
+      get
+      {
+        return (UInt32)(sizeof(Int32) + sizeof(Int64));
+      }
+    }
+
+    public UInt32 ClassId
+    {
+      get
+      {
+        return 0x7FFFFFFF;
+      }
+    }
+
+    #endregion
+
+    public static IGFSerializable CreateDeserializable()
+    {
+      return new OtherType43();
+    }
+
+    public override int GetHashCode()
+    {
+      return m_struct.First.GetHashCode() ^ m_struct.Second.GetHashCode();
+    }
+
+    public override bool Equals(object obj)
+    {
+      OtherType43 ot = obj as OtherType43;
+      if (ot != null)
+      {
+        return (m_struct.Equals(ot.m_struct));
+      }
+      return false;
+    }
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/integration-test/Settings.xml
----------------------------------------------------------------------
diff --git a/src/clicache/integration-test/Settings.xml b/src/clicache/integration-test/Settings.xml
new file mode 100644
index 0000000..e94643d
--- /dev/null
+++ b/src/clicache/integration-test/Settings.xml
@@ -0,0 +1,33 @@
+´╗┐<?xml version="1.0" encoding="utf-8"?>
+<Settings>
+  <DataIOTests>
+    <Byte>
+      <byte value="0x11" />
+    </Byte>
+    <Boolean>
+      <bool value="true" bytes="0x1" />
+      <bool value="false" bytes="0x0" />
+    </Boolean>
+    <Int16>
+      <short value="0x1122" bytes="0x11:0x22" />
+    </Int16>
+    <Int32>
+      <int value="0x11223344" bytes="0x11:0x22:0x33:0x44" />
+    </Int32>
+    <Int64>
+      <long value="0x1122334455667788" bytes="0x11:0x22:0x33:0x44:0x55:0x66:0x77:0x88" />
+    </Int64>
+    <Float>
+      <float value="1.2" bytes="0x3f:0x99:0x99:0x9a" />
+    </Float>
+    <Double>
+      <double value="1.2" bytes="0x3f:0xf3:0x33:0x33:0x33:0x33:0x33:0x33" />
+    </Double>
+    <ASCIIString>
+      <ascii value="This is fun." byte0="0x00" byte1="0x0c" />
+    </ASCIIString>
+    <UTFString>
+      <utf value="0x00:0x7f:0x80:0x81:0xffff" bytes="0x00:0x0a:0xc0:0x80:0x7f:0xc2:0x80:0xc2:0x81:0xef:0xbf:0xbf" />
+    </UTFString>
+  </DataIOTests>
+</Settings>

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/integration-test/SystemPropertiesTestsN.cs
----------------------------------------------------------------------
diff --git a/src/clicache/integration-test/SystemPropertiesTestsN.cs b/src/clicache/integration-test/SystemPropertiesTestsN.cs
new file mode 100644
index 0000000..e02b25a
--- /dev/null
+++ b/src/clicache/integration-test/SystemPropertiesTestsN.cs
@@ -0,0 +1,93 @@
+//=========================================================================
+// Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+// This product is protected by U.S. and international copyright
+// and intellectual property laws. Pivotal products are covered by
+// more patents listed at http://www.pivotal.io/patents.
+//========================================================================
+
+using System;
+using System.IO;
+
+namespace GemStone.GemFire.Cache.UnitTests.NewAPI
+{
+  using NUnit.Framework;
+  using GemStone.GemFire.DUnitFramework;
+  using GemStone.GemFire.Cache.Generic;
+
+  [TestFixture]
+  [Category("group3")]
+  [Category("unicast_only")]
+  [Category("generics")]
+  
+  public class SystemPropertiesTests : UnitTests
+  {
+    protected override ClientBase[] GetClients()
+    {
+      return null;
+    }
+
+    [Test]
+    public void Default()
+    {
+      SystemProperties sp = new SystemProperties(null, '.' +
+        Path.DirectorySeparatorChar + "non-existent");
+      Assert.AreEqual(1, sp.StatisticsSampleInterval);
+      Assert.IsTrue(sp.StatisticsEnabled);
+      Assert.AreEqual("statArchive.gfs", sp.StatisticsArchiveFile);
+      Assert.AreEqual(LogLevel.Config, sp.GFLogLevel);
+      Util.Log("Default: ReadTimeoutUnitInMillis = {0} ", sp.ReadTimeoutUnitInMillis);
+      Assert.AreEqual(false, sp.ReadTimeoutUnitInMillis);
+    }
+
+    [Test]
+    public void Config()
+    {
+      // create a file for alternate properties...
+      //StreamWriter sw = new StreamWriter("test.properties");
+      //sw.WriteLine("gf.transport.config=./gfconfig");
+      //sw.WriteLine("statistics.sample.interval=2000");
+      //sw.WriteLine("statistics.enabled=false");
+      //sw.WriteLine("statistics.archive.file=./stats.gfs");
+      //sw.WriteLine("log.level=error");
+      //sw.Close();
+
+      SystemProperties sp = new SystemProperties(null, "test.properties");
+      Assert.AreEqual(1, sp.StatisticsSampleInterval);
+      Assert.IsTrue(sp.StatisticsEnabled);
+      Assert.AreEqual("statArchive.gfs", sp.StatisticsArchiveFile);
+      Assert.AreEqual(LogLevel.Config, sp.GFLogLevel);
+      Assert.AreEqual(LogLevel.Config, sp.GFLogLevel);
+      Assert.IsFalse(sp.OnClientDisconnectClearPdxTypeIds);
+    }
+
+    [Test]
+    public void NewConfig()
+    {
+      // When the tests are run from the build script the environment variable
+      // TESTSRC is set.
+      string filePath = CacheHelper.TestDir + Path.DirectorySeparatorChar + "system.properties";
+
+      SystemProperties sp = new SystemProperties(null, filePath);
+
+      Assert.AreEqual(700, sp.StatisticsSampleInterval);
+      Assert.IsFalse(sp.StatisticsEnabled);
+      Assert.AreEqual("stats.gfs", sp.StatisticsArchiveFile);
+      Assert.AreEqual("gfcpp.log", sp.LogFileName);
+      Assert.AreEqual(LogLevel.Debug, sp.GFLogLevel);
+      Assert.AreEqual("system", sp.Name);
+      Assert.AreEqual("cache.xml", sp.CacheXmlFile);
+      Assert.AreEqual(1024000000, sp.LogFileSizeLimit);
+      Assert.AreEqual(1024000000, sp.StatsFileSizeLimit);
+      Assert.AreEqual(123, sp.PingInterval);
+      Assert.AreEqual(345, sp.ConnectTimeout);
+      Assert.AreEqual(456, sp.RedundancyMonitorInterval);
+      Assert.AreEqual(123, sp.HeapLRULimit);
+      Assert.AreEqual(45, sp.HeapLRUDelta);
+      Assert.AreEqual(1234, sp.NotifyAckInterval);
+      Assert.AreEqual(5678, sp.NotifyDupCheckLife);
+      Util.Log("NewConfig: ReadTimeoutUnitInMillis = {0} ", sp.ReadTimeoutUnitInMillis);
+      Assert.IsTrue(sp.ReadTimeoutUnitInMillis);
+      Assert.IsTrue(sp.OnClientDisconnectClearPdxTypeIds);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/integration-test/TallyListener.cs
----------------------------------------------------------------------
diff --git a/src/clicache/integration-test/TallyListener.cs b/src/clicache/integration-test/TallyListener.cs
new file mode 100644
index 0000000..d83df62
--- /dev/null
+++ b/src/clicache/integration-test/TallyListener.cs
@@ -0,0 +1,290 @@
+//=========================================================================
+// Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+// This product is protected by U.S. and international copyright
+// and intellectual property laws. Pivotal products are covered by
+// more patents listed at http://www.pivotal.io/patents.
+//========================================================================
+
+using System;
+using System.Threading;
+
+namespace GemStone.GemFire.Cache.UnitTests
+{
+  using GemStone.GemFire.DUnitFramework;
+
+  class TallyListener : GemStone.GemFire.Cache.Generic.CacheListenerAdapter<Object, Object>
+  {
+    #region Private members
+
+    private int m_creates = 0;
+    private int m_updates = 0;
+    private int m_invalidates = 0;
+    private int m_destroys = 0;
+    private int m_clears = 0;
+    private GemStone.GemFire.Cache.Generic.ICacheableKey m_lastKey = null;
+    private GemStone.GemFire.Cache.Generic.IGFSerializable m_lastValue = null;
+    private GemStone.GemFire.Cache.Generic.IGFSerializable m_callbackArg = null;
+    private bool m_ignoreTimeout = false;
+    private bool m_quiet = false;
+    private bool isListenerInvoke = false;
+    private bool isCallbackCalled = false;
+
+    #endregion
+
+    #region Public accessors
+
+    public int Creates
+    {
+      get
+      {
+        return m_creates;
+      }
+    }
+
+    public int Clears
+    {
+      get
+      {
+        return m_clears;
+      }
+    }
+
+    public int Updates
+    {
+      get
+      {
+        return m_updates;
+      }
+    }
+
+    public int Invalidates
+    {
+      get
+      {
+        return m_invalidates;
+      }
+    }
+
+    public int Destroys
+    {
+      get
+      {
+        return m_destroys;
+      }
+    }
+
+    public GemStone.GemFire.Cache.Generic.IGFSerializable LastKey
+    {
+      get
+      {
+        return m_lastKey;
+      }
+    }
+
+    public bool IsListenerInvoked
+    {
+      get
+      {
+        return isListenerInvoke;
+      }
+    }
+
+    public bool IsCallBackArgCalled
+    {
+      get
+      {
+        return isCallbackCalled;
+      }
+    }
+
+    public GemStone.GemFire.Cache.Generic.IGFSerializable LastValue
+    {
+      get
+      {
+        return m_lastValue;
+      }
+    }
+
+    public bool IgnoreTimeout
+    {
+      set
+      {
+        m_ignoreTimeout = value;
+      }
+    }
+
+    public bool Quiet
+    {
+      set
+      {
+        m_quiet = value;
+      }
+    }
+
+     public void SetCallBackArg(GemStone.GemFire.Cache.Generic.IGFSerializable callbackArg)
+    {
+      m_callbackArg = callbackArg;
+    }
+
+
+    #endregion
+
+    public void CheckcallbackArg(GemStone.GemFire.Cache.Generic.EntryEvent<Object, Object> ev)
+    {
+      if (!isListenerInvoke)
+        isListenerInvoke = true;
+      if (m_callbackArg != null)
+      {
+        GemStone.GemFire.Cache.Generic.IGFSerializable callbkArg = (GemStone.GemFire.Cache.Generic.IGFSerializable)ev.CallbackArgument;
+        if (m_callbackArg.Equals(callbkArg))
+          isCallbackCalled = true;
+      }
+    }
+
+   
+    public void ResetListenerInvokation()
+    {
+      isListenerInvoke = false;
+      isCallbackCalled = false;
+    }
+    public int ExpectCreates(int expected)
+    {
+      int tries = 0;
+      while ((m_creates < expected) && (tries < 200))
+      {
+        Thread.Sleep(100);
+        tries++;
+      }
+      return m_creates;
+    }
+
+    public int ExpectUpdates(int expected)
+    {
+      int tries = 0;
+      while ((m_updates < expected) && (tries < 200))
+      {
+        Thread.Sleep(100);
+        tries++;
+      }
+      return m_updates;
+    }
+
+    public int ExpectedInvalidates(int expected)
+    {
+      int tries = 0;
+      while ((m_invalidates < expected) && (tries < 200))
+      {
+        Thread.Sleep(100);
+        tries++;
+      }
+      return m_invalidates;
+    }
+
+    public int ExpectedDestroys(int expected)
+    {
+      int tries = 0;
+      while ((m_destroys < expected) && (tries < 200))
+      {
+        Thread.Sleep(100);
+        tries++;
+      }
+      return m_destroys;
+    }
+         
+    public void ShowTallies()
+    {
+      Util.Log("TallyListener state: (updates = {0}, creates = {1}, invalidates = {2}, destroys = {3})",
+        Updates,Creates, Invalidates, Destroys);
+    }
+
+    #region Logging functions that check for m_quiet
+
+    private void WriteLog(string message)
+    {
+      if (!m_quiet)
+      {
+        Util.Log(message);
+      }
+    }
+
+    private void WriteLog(string format, params object[] args)
+    {
+      if (!m_quiet)
+      {
+        Util.Log(format, args);
+      }
+    }
+
+    public static TallyListener Create()
+    {
+      return new TallyListener();
+    }
+
+    #endregion
+
+    #region ICacheListener Members
+
+    public override void AfterCreate(GemStone.GemFire.Cache.Generic.EntryEvent<Object, Object> ev)
+    {
+      m_creates++;
+      m_lastKey = (GemStone.GemFire.Cache.Generic.ICacheableKey)ev.Key;
+      m_lastValue = (GemStone.GemFire.Cache.Generic.IGFSerializable)ev.NewValue;
+      CheckcallbackArg(ev);
+
+      string keyString = m_lastKey.ToString();
+      WriteLog("TallyListener create - key = \"{0}\", value = \"{1}\"",
+        keyString, m_lastValue.ToString());
+
+      if ((!m_ignoreTimeout) && (keyString.IndexOf("timeout") >= 0))
+      {
+        WriteLog("TallyListener: Sleeping 10 seconds to force a timeout.");
+        Thread.Sleep(10000); // this should give the client cause to timeout...
+        WriteLog("TallyListener: done sleeping..");
+      }
+    }
+
+    public override void AfterUpdate(GemStone.GemFire.Cache.Generic.EntryEvent<Object, Object> ev)
+    {
+      m_updates++;
+      m_lastKey = (GemStone.GemFire.Cache.Generic.ICacheableKey)ev.Key;
+      m_lastValue = (GemStone.GemFire.Cache.Generic.IGFSerializable)ev.NewValue;
+      CheckcallbackArg(ev);
+     
+      string keyString = m_lastKey.ToString();
+      WriteLog("TallyListener update - key = \"{0}\", value = \"{1}\"",
+        keyString, m_lastValue.ToString());
+
+      if ((!m_ignoreTimeout) && (keyString.IndexOf("timeout") >= 0))
+      {
+        WriteLog("TallyListener: Sleeping 10 seconds to force a timeout.");
+        Thread.Sleep(10000); // this should give the client cause to timeout...
+        WriteLog("TallyListener: done sleeping..");
+      }
+    }
+    public override void AfterDestroy(GemStone.GemFire.Cache.Generic.EntryEvent<Object, Object> ev)
+    {
+      m_destroys++;
+      CheckcallbackArg(ev);
+    }
+    public override void AfterInvalidate(GemStone.GemFire.Cache.Generic.EntryEvent<Object, Object> ev)
+    {
+      m_invalidates++;
+      CheckcallbackArg(ev);
+    }
+
+    public override void AfterRegionDestroy(GemStone.GemFire.Cache.Generic.RegionEvent<Object, Object> ev) { }
+
+    public override void AfterRegionClear(GemStone.GemFire.Cache.Generic.RegionEvent<Object, Object> ev) 
+    { 
+        m_clears++;
+    }
+
+    public override void AfterRegionInvalidate(GemStone.GemFire.Cache.Generic.RegionEvent<Object, Object> ev) { }
+
+    public override void AfterRegionLive(GemStone.GemFire.Cache.Generic.RegionEvent<Object, Object> ev) { }
+
+    public override void Close(GemStone.GemFire.Cache.Generic.IRegion<Object, Object> region) { }
+
+    #endregion
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/integration-test/TallyListenerN.cs
----------------------------------------------------------------------
diff --git a/src/clicache/integration-test/TallyListenerN.cs b/src/clicache/integration-test/TallyListenerN.cs
new file mode 100644
index 0000000..880a1a0
--- /dev/null
+++ b/src/clicache/integration-test/TallyListenerN.cs
@@ -0,0 +1,323 @@
+//=========================================================================
+// Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+// This product is protected by U.S. and international copyright
+// and intellectual property laws. Pivotal products are covered by
+// more patents listed at http://www.pivotal.io/patents.
+//========================================================================
+
+using System;
+using System.Threading;
+
+namespace GemStone.GemFire.Cache.UnitTests.NewAPI
+{
+  using GemStone.GemFire.DUnitFramework;
+  using GemStone.GemFire.Cache.Generic;
+  //using Region = GemStone.GemFire.Cache.Generic.IRegion<Object, Object>;
+
+  class TallyListener<TKey, TVal> : CacheListenerAdapter<TKey, TVal>
+  {
+    #region Private members
+
+    private int m_creates = 0;
+    private int m_updates = 0;
+    private int m_invalidates = 0;
+    private int m_destroys = 0;
+    private int m_clears = 0;
+    private TKey m_lastKey = default(TKey);
+    private TVal m_lastValue = default(TVal);
+    private object m_callbackArg = null;
+    private bool m_ignoreTimeout = false;
+    private bool m_quiet = false;
+    private bool isListenerInvoke = false;
+    private bool isCallbackCalled = false;
+
+    #endregion
+
+    #region Public accessors
+
+    public int Creates
+    {
+      get
+      {
+        return m_creates;
+      }
+    }
+
+    public int Clears
+    {
+      get
+      {
+        return m_clears;
+      }
+    }
+
+    public int Updates
+    {
+      get
+      {
+        return m_updates;
+      }
+    }
+
+    public int Invalidates
+    {
+      get
+      {
+        return m_invalidates;
+      }
+    }
+
+    public int Destroys
+    {
+      get
+      {
+        return m_destroys;
+      }
+    }
+
+    public TKey LastKey
+    {
+      get
+      {
+        return m_lastKey;
+      }
+    }
+
+    public bool IsListenerInvoked
+    {
+      get
+      {
+        return isListenerInvoke;
+      }
+    }
+
+    public bool IsCallBackArgCalled
+    {
+      get
+      {
+        return isCallbackCalled;
+      }
+    }
+
+    public TVal LastValue
+    {
+      get
+      {
+        return m_lastValue;
+      }
+    }
+
+    public bool IgnoreTimeout
+    {
+      set
+      {
+        m_ignoreTimeout = value;
+      }
+    }
+
+    public bool Quiet
+    {
+      set
+      {
+        m_quiet = value;
+      }
+    }
+
+     public void SetCallBackArg(object callbackArg)
+    {
+      m_callbackArg = callbackArg;
+    }
+
+
+    #endregion
+
+     public void CheckcallbackArg<TKey1, TVal1>(EntryEvent<TKey1, TVal1> ev)
+    {
+      Util.Log("TallyListenerN: Checking callback arg for EntryEvent " +
+          "key:{0} oldval: {1} newval:{2} cbArg:{3} for region:{4} and remoteOrigin:{5}",
+          ev.Key, ev.NewValue, ev.OldValue, ev.CallbackArgument, ev.Region.Name, ev.RemoteOrigin);
+
+      if (!isListenerInvoke)
+        isListenerInvoke = true;
+      /*
+      if (m_callbackArg != null)
+      {
+        IGFSerializable callbkArg1 = ev.CallbackArgument as IGFSerializable;
+        IGFSerializable callbkArg2 = m_callbackArg as IGFSerializable;
+        if (callbkArg2 != null && callbkArg2.Equals(callbkArg1))
+        {
+          isCallbackCalled = true;
+        }
+        string callbkArg3 = ev.CallbackArgument as string;
+        string callbkArg4 = m_callbackArg as string;
+        if (callbkArg3 != null && callbkArg3.Equals(callbkArg4))
+        {
+          isCallbackCalled = true;
+        }
+      }
+      */
+      if (m_callbackArg != null && m_callbackArg.Equals(ev.CallbackArgument))
+      {
+        isCallbackCalled = true;
+      }
+    }
+
+   
+    public void ResetListenerInvokation()
+    {
+      isListenerInvoke = false;
+      isCallbackCalled = false;
+    }
+    public int ExpectCreates(int expected)
+    {
+      int tries = 0;
+      while ((m_creates < expected) && (tries < 200))
+      {
+        Thread.Sleep(100);
+        tries++;
+      }
+      return m_creates;
+    }
+
+    public int ExpectUpdates(int expected)
+    {
+      int tries = 0;
+      while ((m_updates < expected) && (tries < 200))
+      {
+        Thread.Sleep(100);
+        tries++;
+      }
+      return m_updates;
+    }
+
+    public int ExpectedInvalidates(int expected)
+    {
+      int tries = 0;
+      while ((m_invalidates < expected) && (tries < 200))
+      {
+        Thread.Sleep(100);
+        tries++;
+      }
+      return m_invalidates;
+    }
+
+    public int ExpectedDestroys(int expected)
+    {
+      int tries = 0;
+      while ((m_destroys < expected) && (tries < 200))
+      {
+        Thread.Sleep(100);
+        tries++;
+      }
+      return m_destroys;
+    }
+         
+    public void ShowTallies()
+    {
+      Util.Log("TallyListener state: (updates = {0}, creates = {1}, invalidates = {2}, destroys = {3})",
+        Updates,Creates, Invalidates, Destroys);
+    }
+
+    #region Logging functions that check for m_quiet
+
+    private void WriteLog(string message)
+    {
+      if (!m_quiet)
+      {
+        Util.Log(message);
+      }
+    }
+
+    private void WriteLog(string format, params object[] args)
+    {
+      if (!m_quiet)
+      {
+        Util.Log(format, args);
+      }
+    }
+
+    public static TallyListener<TKey, TVal> Create()
+    {
+      return new TallyListener<TKey, TVal>();
+    }
+
+    #endregion
+
+    #region ICacheListener Members
+
+    public override void AfterCreate(EntryEvent<TKey, TVal> ev)
+    {
+      m_creates++;
+      m_lastKey = (TKey)ev.Key;
+      m_lastValue = ev.NewValue;
+      CheckcallbackArg(ev);
+
+      string keyString = m_lastKey.ToString();
+      if (m_lastValue != null)
+        WriteLog("TallyListener create - key = \"{0}\", value = \"{1}\"",
+          keyString, m_lastValue.ToString());
+      else
+        WriteLog("TallyListener create - key = \"{0}\", value = \"null\"",
+          keyString);
+
+      if ((!m_ignoreTimeout) && (keyString.IndexOf("timeout") >= 0))
+      {
+        WriteLog("TallyListener: Sleeping 10 seconds to force a timeout.");
+        Thread.Sleep(10000); // this should give the client cause to timeout...
+        WriteLog("TallyListener: done sleeping..");
+      }
+    }
+
+    public override void AfterUpdate(EntryEvent<TKey, TVal> ev)
+    {
+      m_updates++;
+      m_lastKey = (TKey)ev.Key;
+      m_lastValue = ev.NewValue;
+      CheckcallbackArg(ev);
+     
+      string keyString = m_lastKey.ToString();
+      if (m_lastValue != null)
+        WriteLog("TallyListener update - key = \"{0}\", value = \"{1}\"",
+          keyString, m_lastValue.ToString());
+      else
+        WriteLog("TallyListener update - key = \"{0}\", value = \"null\"",
+          keyString);
+
+      if ((!m_ignoreTimeout) && (keyString.IndexOf("timeout") >= 0))
+      {
+        WriteLog("TallyListener: Sleeping 10 seconds to force a timeout.");
+        Thread.Sleep(10000); // this should give the client cause to timeout...
+        WriteLog("TallyListener: done sleeping..");
+      }
+    }
+    public override void AfterDestroy(EntryEvent<TKey, TVal> ev)
+    {
+      WriteLog("TallyListener destroy - key = \"{0}\"",
+          ((TKey)ev.Key).ToString());
+      m_destroys++;
+      CheckcallbackArg(ev);
+    }
+    public override void AfterInvalidate(EntryEvent<TKey, TVal> ev)
+    {
+      WriteLog("TallyListener invalidate - key = \"{0}\"",
+          ((TKey)ev.Key).ToString()); 
+      m_invalidates++;
+      CheckcallbackArg(ev);
+    }
+
+    public override void AfterRegionDestroy(RegionEvent<TKey, TVal> ev) { }
+
+    public override void AfterRegionClear(RegionEvent<TKey, TVal> ev) 
+    { 
+        m_clears++;
+    }
+
+    public override void AfterRegionInvalidate(RegionEvent<TKey, TVal> ev) { }
+
+    public override void AfterRegionLive(RegionEvent<TKey, TVal> ev) { }
+
+    public override void Close(IRegion<TKey, TVal> region) { }
+
+    #endregion
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/integration-test/TallyLoaderN.cs
----------------------------------------------------------------------
diff --git a/src/clicache/integration-test/TallyLoaderN.cs b/src/clicache/integration-test/TallyLoaderN.cs
new file mode 100644
index 0000000..9ce216e
--- /dev/null
+++ b/src/clicache/integration-test/TallyLoaderN.cs
@@ -0,0 +1,94 @@
+//=========================================================================
+// Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+// This product is protected by U.S. and international copyright
+// and intellectual property laws. Pivotal products are covered by
+// more patents listed at http://www.pivotal.io/patents.
+//========================================================================
+
+using System;
+using System.Threading;
+
+namespace GemStone.GemFire.Cache.UnitTests.NewAPI
+{
+  using GemStone.GemFire.DUnitFramework;
+
+  using GemStone.GemFire.Cache;
+  using GemStone.GemFire.Cache.Generic;
+
+  class TallyLoader<TKey, TVal> : ICacheLoader<TKey, TVal>
+  {
+    #region Private members
+
+    private int m_loads = 0;
+
+    #endregion
+
+    #region Public accessors
+
+    public int Loads
+    {
+      get
+      {
+        return m_loads;
+      }
+    }
+
+    #endregion
+
+    public int ExpectLoads(int expected)
+    {
+      int tries = 0;
+      while ((m_loads < expected) && (tries < 200))
+      {
+        Thread.Sleep(100);
+        tries++;
+      }
+      return m_loads;
+    }
+
+    public void Reset()
+    {
+      m_loads = 0;
+    }
+
+    public void ShowTallies()
+    {
+      Util.Log("TallyLoader state: (loads = {0})", Loads);
+    }
+
+    public static TallyLoader<TKey, TVal> Create()
+    {
+      return new TallyLoader<TKey, TVal>();
+    }
+
+    public virtual int GetLoadCount()
+    {
+      return m_loads;
+    }
+
+    #region ICacheLoader<TKey, TVal> Members
+
+    public virtual TVal Load(IRegion<TKey, TVal> region, TKey key, object helper)
+    {
+      m_loads++;
+      Util.Log("TallyLoader Load: (m_loads = {0}) TYPEOF key={1} val={2} for region {3}",
+        m_loads, typeof(TKey), typeof(TVal), region.Name);
+      if (typeof(TVal) == typeof(string))
+      {
+        return (TVal) (object) m_loads.ToString();
+      }
+      if (typeof(TVal) == typeof(int))
+      {
+        return (TVal)(object) m_loads;
+      }
+      return default(TVal);
+    }
+
+    public virtual void Close(IRegion<TKey, TVal> region)
+    {
+      Util.Log("TallyLoader<TKey, TVal>::Close");
+    }
+
+    #endregion
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/integration-test/TallyResolverN.cs
----------------------------------------------------------------------
diff --git a/src/clicache/integration-test/TallyResolverN.cs b/src/clicache/integration-test/TallyResolverN.cs
new file mode 100755
index 0000000..0c391c6
--- /dev/null
+++ b/src/clicache/integration-test/TallyResolverN.cs
@@ -0,0 +1,87 @@
+//=========================================================================
+// Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+// This product is protected by U.S. and international copyright
+// and intellectual property laws. Pivotal products are covered by
+// more patents listed at http://www.pivotal.io/patents.
+//========================================================================
+
+using System;
+using System.Threading;
+
+namespace GemStone.GemFire.Cache.UnitTests.NewAPI
+{
+  using GemStone.GemFire.DUnitFramework;
+
+  using GemStone.GemFire.Cache;
+  using GemStone.GemFire.Cache.Generic;
+
+  class TallyResolver<TKey, TVal> : IPartitionResolver<TKey, TVal>
+  {
+    #region Private members
+
+    private int m_loads = 0;
+
+    #endregion
+
+    #region Public accessors
+
+    public int Loads
+    {
+      get
+      {
+        return m_loads;
+      }
+    }
+
+    #endregion
+
+    public int ExpectLoads(int expected)
+    {
+      int tries = 0;
+      while ((m_loads < expected) && (tries < 200))
+      {
+        Thread.Sleep(100);
+        tries++;
+      }
+      return m_loads;
+    }
+
+    public void Reset()
+    {
+      m_loads = 0;
+    }
+
+    public void ShowTallies()
+    {
+      Util.Log("TallyResolver state: (loads = {0})", Loads);
+    }
+
+    public static TallyResolver<TKey, TVal> Create()
+    {
+      return new TallyResolver<TKey, TVal>();
+    }
+
+    public virtual int GetLoadCount()
+    {
+      return m_loads;
+    }
+
+    #region IPartitionResolver<TKey, TVal> Members
+
+    public virtual Object GetRoutingObject(EntryEvent<TKey, TVal> ev)
+    {
+      m_loads++;
+      Util.Log("TallyResolver Load: (m_loads = {0}) TYPEOF key={1} val={2} for region {3}",
+        m_loads, typeof(TKey), typeof(TVal), ev.Region.Name);
+      return ev.Key;
+    }
+
+    public virtual string GetName()
+    {
+      Util.Log("TallyResolver<TKey, TVal>::GetName");
+	    return "TallyResolver";
+    }
+
+    #endregion
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/integration-test/TallyWriter.cs
----------------------------------------------------------------------
diff --git a/src/clicache/integration-test/TallyWriter.cs b/src/clicache/integration-test/TallyWriter.cs
new file mode 100644
index 0000000..999183b
--- /dev/null
+++ b/src/clicache/integration-test/TallyWriter.cs
@@ -0,0 +1,212 @@
+//=========================================================================
+// Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+// This product is protected by U.S. and international copyright
+// and intellectual property laws. Pivotal products are covered by
+// more patents listed at http://www.pivotal.io/patents.
+//========================================================================
+
+using System;
+using System.Threading;
+
+namespace GemStone.GemFire.Cache.UnitTests
+{
+  using GemStone.GemFire.DUnitFramework;
+
+  class TallyWriter : GemStone.GemFire.Cache.Generic.CacheWriterAdapter<Object, Object>
+  {
+    #region Private members
+
+    private int m_creates = 0;
+    private int m_updates = 0;
+    private int m_invalidates = 0;
+    private int m_destroys = 0;
+    private GemStone.GemFire.Cache.Generic.IGFSerializable m_callbackArg = null;
+    private int m_clears = 0;
+    private GemStone.GemFire.Cache.Generic.IGFSerializable m_lastKey = null;
+    private GemStone.GemFire.Cache.Generic.IGFSerializable m_lastValue = null;
+    private bool isWriterFailed = false;
+    private bool isWriterInvoke = false;
+    private bool isCallbackCalled = false;
+
+    #endregion
+
+    #region Public accessors
+
+    public int Creates
+    {
+      get
+      {
+        return m_creates;
+      }
+    }
+    public int Clears
+    {
+      get
+      {
+        return m_clears;
+      }
+    }
+
+    public int Updates
+    {
+      get
+      {
+        return m_updates;
+      }
+    }
+
+    public int Invalidates
+    {
+      get
+      {
+        return m_invalidates;
+      }
+    }
+
+    public int Destroys
+    {
+      get
+      {
+        return m_destroys;
+      }
+    }
+
+
+    public GemStone.GemFire.Cache.Generic.IGFSerializable LastKey
+    {
+      get
+      {
+        return m_lastKey;
+      }
+    }
+
+    public GemStone.GemFire.Cache.Generic.IGFSerializable CallbackArgument
+    {
+      get
+      {
+        return m_callbackArg;
+      }
+    }
+
+
+    public GemStone.GemFire.Cache.Generic.IGFSerializable LastValue
+    {
+      get
+      {
+        return m_lastValue;
+      }
+    }
+
+   public void SetWriterFailed( )
+   {
+    isWriterFailed = true;
+   }
+
+  public void SetCallBackArg( GemStone.GemFire.Cache.Generic.IGFSerializable callbackArg )
+  {
+    m_callbackArg = callbackArg;
+  }
+
+  public void ResetWriterInvokation()
+  {
+    isWriterInvoke = false;
+    isCallbackCalled = false;
+  }
+
+  public  bool IsWriterInvoked
+  {
+    get
+    {
+      return isWriterInvoke;
+    }
+  }
+  public bool IsCallBackArgCalled
+  {
+    get
+    {
+      return isCallbackCalled;
+    }
+  }
+    #endregion
+
+    public int ExpectCreates(int expected)
+    {
+      int tries = 0;
+      while ((m_creates < expected) && (tries < 200))
+      {
+        Thread.Sleep(100);
+        tries++;
+      }
+      return m_creates;
+    }
+
+    public int ExpectUpdates(int expected)
+    {
+      int tries = 0;
+      while ((m_updates < expected) && (tries < 200))
+      {
+        Thread.Sleep(100);
+        tries++;
+      }
+      return m_updates;
+    }
+    
+    public void ShowTallies()
+    {
+      Util.Log("TallyWriter state: (updates = {0}, creates = {1}, invalidates = {2}, destroys = {3})",
+        Updates, Creates, Invalidates, Destroys);
+    }
+
+    public void CheckcallbackArg(GemStone.GemFire.Cache.Generic.EntryEvent<Object, Object> ev)
+      {
+
+        if(!isWriterInvoke)
+          isWriterInvoke = true;
+        if (m_callbackArg != null)
+        {
+          GemStone.GemFire.Cache.Generic.IGFSerializable callbkArg = (GemStone.GemFire.Cache.Generic.IGFSerializable)ev.CallbackArgument;
+          if (m_callbackArg.Equals(callbkArg))
+            isCallbackCalled = true;
+        }  
+      }
+
+    public static TallyWriter Create()
+    {
+      return new TallyWriter();
+    }
+
+    #region ICacheWriter Members
+
+    public override bool BeforeCreate(GemStone.GemFire.Cache.Generic.EntryEvent<Object, Object> ev)
+    {
+      m_creates++;
+      Util.Log("TallyWriter::BeforeCreate");
+      CheckcallbackArg(ev);
+      return !isWriterFailed;
+    }
+
+    public override bool BeforeDestroy(GemStone.GemFire.Cache.Generic.EntryEvent<Object, Object> ev)
+    {
+      m_destroys++;
+      Util.Log("TallyWriter::BeforeDestroy");
+      CheckcallbackArg(ev);
+      return !isWriterFailed;
+    }
+
+    public override bool BeforeRegionClear(GemStone.GemFire.Cache.Generic.RegionEvent<Object, Object> ev)
+    {
+      m_clears++;
+      Util.Log("TallyWriter::BeforeRegionClear");
+      return true;
+    }
+
+    public override bool BeforeUpdate(GemStone.GemFire.Cache.Generic.EntryEvent<Object, Object> ev)
+    {
+      m_updates++;
+      Util.Log("TallyWriter::BeforeUpdate");
+      CheckcallbackArg(ev);
+      return !isWriterFailed;
+    }
+   #endregion
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/integration-test/TallyWriterN.cs
----------------------------------------------------------------------
diff --git a/src/clicache/integration-test/TallyWriterN.cs b/src/clicache/integration-test/TallyWriterN.cs
new file mode 100644
index 0000000..40eb28a
--- /dev/null
+++ b/src/clicache/integration-test/TallyWriterN.cs
@@ -0,0 +1,230 @@
+//=========================================================================
+// Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+// This product is protected by U.S. and international copyright
+// and intellectual property laws. Pivotal products are covered by
+// more patents listed at http://www.pivotal.io/patents.
+//========================================================================
+
+using System;
+using System.Threading;
+
+namespace GemStone.GemFire.Cache.UnitTests.NewAPI
+{
+  using GemStone.GemFire.DUnitFramework;
+  using GemStone.GemFire.Cache.Generic;
+  class TallyWriter<TKey, TVal> : CacheWriterAdapter<TKey, TVal>
+  {
+    #region Private members
+
+    private int m_creates = 0;
+    private int m_updates = 0;
+    private int m_invalidates = 0;
+    private int m_destroys = 0;
+    private Object m_callbackArg = null;
+    private int m_clears = 0;
+    private Object m_lastKey = null;
+    private Object m_lastValue = null;
+    private bool isWriterFailed = false;
+    private bool isWriterInvoke = false;
+    private bool isCallbackCalled = false;
+
+    #endregion
+
+    #region Public accessors
+
+    public int Creates
+    {
+      get
+      {
+        return m_creates;
+      }
+    }
+    public int Clears
+    {
+      get
+      {
+        return m_clears;
+      }
+    }
+
+    public int Updates
+    {
+      get
+      {
+        return m_updates;
+      }
+    }
+
+    public int Invalidates
+    {
+      get
+      {
+        return m_invalidates;
+      }
+    }
+
+    public int Destroys
+    {
+      get
+      {
+        return m_destroys;
+      }
+    }
+
+
+    public Object LastKey
+    {
+      get
+      {
+        return m_lastKey;
+      }
+    }
+
+    public Object CallbackArgument
+    {
+      get
+      {
+        return m_callbackArg;
+      }
+    }
+
+
+    public Object LastValue
+    {
+      get
+      {
+        return m_lastValue;
+      }
+    }
+
+   public void SetWriterFailed( )
+   {
+    isWriterFailed = true;
+   }
+
+  public void SetCallBackArg( object callbackArg )
+  {
+    m_callbackArg = callbackArg;
+  }
+
+  public void ResetWriterInvokation()
+  {
+    isWriterInvoke = false;
+    isCallbackCalled = false;
+  }
+
+  public  bool IsWriterInvoked
+  {
+    get
+    {
+      return isWriterInvoke;
+    }
+  }
+  public bool IsCallBackArgCalled
+  {
+    get
+    {
+      return isCallbackCalled;
+    }
+  }
+    #endregion
+
+    public int ExpectCreates(int expected)
+    {
+      int tries = 0;
+      while ((m_creates < expected) && (tries < 200))
+      {
+        Thread.Sleep(100);
+        tries++;
+      }
+      return m_creates;
+    }
+
+    public int ExpectUpdates(int expected)
+    {
+      int tries = 0;
+      while ((m_updates < expected) && (tries < 200))
+      {
+        Thread.Sleep(100);
+        tries++;
+      }
+      return m_updates;
+    }
+    
+    public void ShowTallies()
+    {
+      Util.Log("TallyWriter state: (updates = {0}, creates = {1}, invalidates = {2}, destroys = {3})",
+        Updates, Creates, Invalidates, Destroys);
+    }
+
+    public void CheckcallbackArg<TKey1, TVal1>(EntryEvent<TKey1, TVal1> ev)
+      {
+        Util.Log("TallyWriterN: Checking callback arg for EntryEvent " +
+          "key:{0} oldval: {1} newval:{2} cbArg:{3} for region:{4} and remoteOrigin:{5}",
+          ev.Key, ev.NewValue, ev.OldValue, ev.CallbackArgument, ev.Region.Name, ev.RemoteOrigin);
+
+        if(!isWriterInvoke)
+          isWriterInvoke = true;
+      /*
+        if (m_callbackArg != null)
+        {
+          IGFSerializable callbkArg1 = ev.CallbackArgument as IGFSerializable;
+          IGFSerializable callbkArg2 = m_callbackArg as IGFSerializable;
+          if (callbkArg1 != null && callbkArg1.Equals(callbkArg2))
+          {
+            isCallbackCalled = true;
+          }
+          string callbkArg3 = ev.CallbackArgument as string;
+          string callbkArg4 = m_callbackArg as string;
+          if (callbkArg3 != null && callbkArg3.Equals(callbkArg4))
+          {
+            isCallbackCalled = true;
+          }
+        }
+           * */
+        if (m_callbackArg != null && m_callbackArg.Equals(ev.CallbackArgument))
+        {
+          isCallbackCalled = true;
+        }
+      }
+
+    public static TallyWriter<TKey, TVal> Create()
+    {
+      return new TallyWriter<TKey, TVal>();
+    }
+
+    #region ICacheWriter Members
+
+    public override bool BeforeCreate(EntryEvent<TKey, TVal> ev)
+    {
+      m_creates++;
+      Util.Log("TallyWriter::BeforeCreate");
+      CheckcallbackArg(ev);
+      return !isWriterFailed;
+    }
+
+    public override bool BeforeDestroy(EntryEvent<TKey, TVal> ev)
+    {
+      m_destroys++;
+      Util.Log("TallyWriter::BeforeDestroy");
+      CheckcallbackArg(ev);
+      return !isWriterFailed;
+    }
+
+    public override bool BeforeRegionClear(RegionEvent<TKey, TVal> ev)
+    {
+      m_clears++;
+      Util.Log("TallyWriter::BeforeRegionClear");
+      return true;
+    }
+
+    public override bool BeforeUpdate(EntryEvent<TKey, TVal> ev)
+    {
+      m_updates++;
+      Util.Log("TallyWriter::BeforeUpdate");
+      CheckcallbackArg(ev);
+      return !isWriterFailed;
+    }
+   #endregion
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/2d4a7ecd/src/clicache/integration-test/ThinClientAppDomainQueryTests.cs
----------------------------------------------------------------------
diff --git a/src/clicache/integration-test/ThinClientAppDomainQueryTests.cs b/src/clicache/integration-test/ThinClientAppDomainQueryTests.cs
new file mode 100644
index 0000000..e074ad4
--- /dev/null
+++ b/src/clicache/integration-test/ThinClientAppDomainQueryTests.cs
@@ -0,0 +1,263 @@
+´╗┐using System;
+
+namespace GemStone.GemFire.Cache.UnitTests.NewAPI
+{
+    using GemStone.GemFire.Cache.Generic;
+    using GemStone.GemFire.Cache.Tests.NewAPI;
+    using GemStone.GemFire.DUnitFramework;
+    using NUnit.Framework;
+    using QueryCategory = GemStone.GemFire.Cache.Tests.QueryCategory;
+    using QueryStatics = GemStone.GemFire.Cache.Tests.QueryStatics;
+    using QueryStrings = GemStone.GemFire.Cache.Tests.QueryStrings;
+
+    [TestFixture]
+    [Category("group1")]
+    [Category("unicast_only")]
+    [Category("generics")]
+    internal class ThinClientAppDomainQueryTests : ThinClientRegionSteps
+    {
+        #region Private members
+
+        private UnitProcess m_client1;
+        private UnitProcess m_client2;
+
+        private static string[] QueryRegionNames = { "Portfolios", "Positions", "Portfolios2",
+      "Portfolios3" };
+
+        private static string QERegionName = "Portfolios";
+        private static string endpoint1;
+        private static string endpoint2;
+
+        #endregion Private members
+
+        protected override ClientBase[] GetClients()
+        {
+            return new ClientBase[] { };
+        }
+
+        [TestFixtureSetUp]
+        public override void InitTests()
+        {
+            Properties<string, string> config = new Properties<string, string>();
+            config.Insert("appdomain-enabled", "true");
+            CacheHelper.InitConfig(config);
+        }
+
+
+        [TearDown]
+        public override void EndTest()
+        {
+            CacheHelper.StopJavaServers();
+            base.EndTest();
+        }
+
+        #region Functions invoked by the tests
+
+        public void InitClient()
+        {
+            Serializable.RegisterTypeGeneric(Portfolio.CreateDeserializable);
+            Serializable.RegisterTypeGeneric(Position.CreateDeserializable);
+            Serializable.RegisterPdxType(GemStone.GemFire.Cache.Tests.NewAPI.PortfolioPdx.CreateDeserializable);
+            Serializable.RegisterPdxType(GemStone.GemFire.Cache.Tests.NewAPI.PositionPdx.CreateDeserializable);
+        }
+
+        public void CreateCache(string locators)
+        {
+            CacheHelper.CreateTCRegion_Pool<object, object>(QueryRegionNames[0], true, true,
+            null, locators, "__TESTPOOL1_", true);
+            CacheHelper.CreateTCRegion_Pool<object, object>(QueryRegionNames[1], true, true,
+              null, locators, "__TESTPOOL1_", true);
+            CacheHelper.CreateTCRegion_Pool<object, object>(QueryRegionNames[2], true, true,
+              null, locators, "__TESTPOOL1_", true);
+            CacheHelper.CreateTCRegion_Pool<object, object>(QueryRegionNames[3], true, true,
+              null, locators, "__TESTPOOL1_", true);
+
+            IRegion<object, object> region = CacheHelper.GetRegion<object, object>(QueryRegionNames[0]);
+            GemStone.GemFire.Cache.Generic.RegionAttributes<object, object> regattrs = region.Attributes;
+            region.CreateSubRegion(QueryRegionNames[1], regattrs);
+        }
+
+        public void PopulateRegions()
+        {
+            IRegion<object, object> region0 = CacheHelper.GetRegion<object, object>(QueryRegionNames[0]);
+            IRegion<object, object> subRegion0 = (IRegion<object, object>)region0.GetSubRegion(QueryRegionNames[1]);
+            IRegion<object, object> region1 = CacheHelper.GetRegion<object, object>(QueryRegionNames[1]);
+            IRegion<object, object> region2 = CacheHelper.GetRegion<object, object>(QueryRegionNames[2]);
+            IRegion<object, object> region3 = CacheHelper.GetRegion<object, object>(QueryRegionNames[3]);
+
+            QueryHelper<object, object> qh = QueryHelper<object, object>.GetHelper();
+            Util.Log("SetSize {0}, NumSets {1}.", qh.PortfolioSetSize,
+              qh.PortfolioNumSets);
+
+            qh.PopulatePortfolioPdxData(region0, qh.PortfolioSetSize,
+              qh.PortfolioNumSets);
+            qh.PopulatePositionPdxData(subRegion0, qh.PortfolioSetSize,
+              qh.PortfolioNumSets);
+            qh.PopulatePositionPdxData(region1, qh.PortfolioSetSize,
+              qh.PortfolioNumSets);
+            qh.PopulatePortfolioPdxData(region2, qh.PortfolioSetSize,
+              qh.PortfolioNumSets);
+            qh.PopulatePortfolioPdxData(region3, qh.PortfolioSetSize,
+              qh.PortfolioNumSets);
+        }
+
+        public void VerifyQueries()
+        {
+            bool ErrorOccurred = false;
+
+            QueryHelper<object, object> qh = QueryHelper<object, object>.GetHelper();
+
+            QueryService<object, object> qs = PoolManager/*<object, object>*/.Find("__TESTPOOL1_").GetQueryService<object, object>();
+
+            int qryIdx = 0;
+
+            foreach (QueryStrings qrystr in QueryStatics.ResultSetQueries)
+            {
+                if (qrystr.Category == QueryCategory.Unsupported)
+                {
+                    Util.Log("Skipping query index {0} because it is unsupported.", qryIdx);
+                    qryIdx++;
+                    continue;
+                }
+
+                if (qryIdx == 2 || qryIdx == 3 || qryIdx == 4)
+                {
+                    Util.Log("Skipping query index {0} for Pdx because it is function type.", qryIdx);
+                    qryIdx++;
+                    continue;
+                }
+
+                Util.Log("Evaluating query index {0}. Query string {1}", qryIdx, qrystr.Query);
+
+                Query<object> query = qs.NewQuery(qrystr.Query);
+
+                ISelectResults<object> results = query.Execute();
+
+                int expectedRowCount = qh.IsExpectedRowsConstantRS(qryIdx) ?
+                  QueryStatics.ResultSetRowCounts[qryIdx] : QueryStatics.ResultSetRowCounts[qryIdx] * qh.PortfolioNumSets;
+
+                if (!qh.VerifyRS(results, expectedRowCount))
+                {
+                    ErrorOccurred = true;
+                    Util.Log("Query verify failed for query index {0}.", qryIdx);
+                    qryIdx++;
+                    continue;
+                }
+
+                ResultSet<object> rs = results as ResultSet<object>;
+
+                foreach (object item in rs)
+                {
+                    PortfolioPdx port = item as PortfolioPdx;
+                    if (port == null)
+                    {
+                        PositionPdx pos = item as PositionPdx;
+                        if (pos == null)
+                        {
+                            string cs = item.ToString();
+                            if (cs == null)
+                            {
+                                Util.Log("Query got other/unknown object.");
+                            }
+                            else
+                            {
+                                Util.Log("Query got string : {0}.", cs);
+                            }
+                        }
+                        else
+                        {
+                            Util.Log("Query got Position object with secId {0}, shares {1}.", pos.secId, pos.getSharesOutstanding);
+                        }
+                    }
+                    else
+                    {
+                        Util.Log("Query got Portfolio object with ID {0}, pkid {1}.", port.ID, port.Pkid);
+                    }
+                }
+
+                qryIdx++;
+            }
+
+            Assert.IsFalse(ErrorOccurred, "One or more query validation errors occurred.");
+        }
+
+        public void VerifyUnsupporteQueries()
+        {
+            bool ErrorOccurred = false;
+
+            QueryHelper<object, object> qh = QueryHelper<object, object>.GetHelper();
+
+            QueryService<object, object> qs = PoolManager/*<object, object>*/.Find("__TESTPOOL1_").GetQueryService<object, object>();
+
+            int qryIdx = 0;
+
+            foreach (QueryStrings qrystr in QueryStatics.ResultSetQueries)
+            {
+                if (qrystr.Category != QueryCategory.Unsupported)
+                {
+                    qryIdx++;
+                    continue;
+                }
+
+                Util.Log("Evaluating unsupported query index {0}.", qryIdx);
+
+                Query<object> query = qs.NewQuery(qrystr.Query);
+
+                try
+                {
+                    ISelectResults<object> results = query.Execute();
+
+                    Util.Log("Query exception did not occur for index {0}.", qryIdx);
+                    ErrorOccurred = true;
+                    qryIdx++;
+                }
+                catch (GemFireException)
+                {
+                    // ok, exception expected, do nothing.
+                    qryIdx++;
+                }
+                catch (Exception)
+                {
+                    Util.Log("Query unexpected exception occurred for index {0}.", qryIdx);
+                    ErrorOccurred = true;
+                    qryIdx++;
+                }
+            }
+
+            Assert.IsFalse(ErrorOccurred, "Query expected exceptions did not occur.");
+        }
+
+        #endregion Functions invoked by the tests
+
+        [Test]
+        public void RemoteQueryRS()
+        {
+            Util.Log("DoRemoteQueryRS: AppDomain: " + AppDomain.CurrentDomain.Id);
+            CacheHelper.SetupJavaServers(true, "remotequeryN.xml");
+            CacheHelper.StartJavaLocator(1, "GFELOC");
+            Util.Log("Locator started");
+            CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
+            Util.Log("Cacheserver 1 started.");
+
+            CreateCache(CacheHelper.Locators);
+            Util.Log("CreateCache complete.");
+
+            PopulateRegions();
+            Util.Log("PopulateRegions complete.");
+
+            VerifyQueries();
+            Util.Log("VerifyQueries complete.");
+
+            VerifyUnsupporteQueries();
+            Util.Log("VerifyUnsupporteQueries complete.");
+
+            Close();
+
+            CacheHelper.StopJavaServer(1);
+            Util.Log("Cacheserver 1 stopped.");
+
+            CacheHelper.StopJavaLocator(1);
+            Util.Log("Locator stopped");
+        }
+    }
+}
\ No newline at end of file


Mime
View raw message