You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jb...@apache.org on 2018/04/26 17:05:53 UTC

[geode-native] branch develop updated: GEODE-4854: Fix bug in CqQuery::GetAttributesMutator

This is an automated email from the ASF dual-hosted git repository.

jbarrett pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
     new b99b383  GEODE-4854: Fix bug in CqQuery::GetAttributesMutator
b99b383 is described below

commit b99b383b84f14bbdacd073f9f25140722c81e63f
Author: Michael Martell <mm...@pivotal.io>
AuthorDate: Thu Apr 26 10:05:50 2018 -0700

    GEODE-4854: Fix bug in CqQuery::GetAttributesMutator
    
    * GEODE-4854: Split up the ThinClientCqTestsN into individual files.
    Signed-off-by: Mike Martell <mm...@pivotal.io>
---
 clicache/integration-test/CMakeLists.txt           |   2 +-
 .../ThinClientCqAttributesMutatorTests.cs          | 420 +++++++++++++++
 ...hinClientCqTestsN.cs => ThinClientCqPdxTest.cs} | 593 +++++++--------------
 .../integration-test/ThinClientCqStatusTest.cs     | 457 ++++++++++++++++
 .../ThinClientCqStatusTestTwoServers.cs            | 444 +++++++++++++++
 .../{ThinClientCqTestsN.cs => ThinClientCqTest.cs} | 592 +++++++-------------
 clicache/integration-test/UnitTests.csproj.in      |   6 +-
 clicache/src/CqAttributesMutator.hpp               |   6 +-
 clicache/src/CqQuery.cpp                           |   3 +-
 9 files changed, 1742 insertions(+), 781 deletions(-)

diff --git a/clicache/integration-test/CMakeLists.txt b/clicache/integration-test/CMakeLists.txt
index 3636408..f482f62 100644
--- a/clicache/integration-test/CMakeLists.txt
+++ b/clicache/integration-test/CMakeLists.txt
@@ -95,7 +95,7 @@ foreach(FILE ${SOURCES})
 endforeach()
 
 # Label any flaky tests here
-set_property(TEST ThinClientCqTestsN PROPERTY LABELS FLAKY)
+set_property(TEST ThinClientCqStatusTestTwoServers PROPERTY LABELS FLAKY)
 set_property(TEST ThinClientQueryTestsN PROPERTY LABELS FLAKY)
 
 # Label any tests that always fail here
diff --git a/clicache/integration-test/ThinClientCqAttributesMutatorTests.cs b/clicache/integration-test/ThinClientCqAttributesMutatorTests.cs
new file mode 100644
index 0000000..2a82ce3
--- /dev/null
+++ b/clicache/integration-test/ThinClientCqAttributesMutatorTests.cs
@@ -0,0 +1,420 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+
+namespace Apache.Geode.Client.UnitTests
+{
+  using NUnit.Framework;
+  using Apache.Geode.DUnitFramework;
+  using Apache.Geode.Client.Tests;
+  using Apache.Geode.Client;
+
+  [TestFixture]
+  [Category("group3")]
+  [Category("unicast_only")]
+  [Category("generics")]
+
+  public class ThinClientCqAttributesMutatorTests : ThinClientRegionSteps
+  {
+    public class MyCqListener<TKey, TResult> : ICqListener<TKey, TResult>
+    {
+      #region Private members
+      private bool m_failedOver = false;
+      private UInt32 m_eventCountBefore = 0;
+      private UInt32 m_errorCountBefore = 0;
+      private UInt32 m_eventCountAfter = 0;
+      private UInt32 m_errorCountAfter = 0;
+
+      #endregion
+
+      #region Public accessors
+
+      public void failedOver()
+      {
+        m_failedOver = true;
+      }
+      public UInt32 getEventCountBefore()
+      {
+        return m_eventCountBefore;
+      }
+      public UInt32 getErrorCountBefore()
+      {
+        return m_errorCountBefore;
+      }
+      public UInt32 getEventCountAfter()
+      {
+        return m_eventCountAfter;
+      }
+      public UInt32 getErrorCountAfter()
+      {
+        return m_errorCountAfter;
+      }
+      #endregion
+
+      public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqListener::OnEvent called");
+        if (m_failedOver == true)
+          m_eventCountAfter++;
+        else
+          m_eventCountBefore++;
+
+        //IGeodeSerializable val = ev.getNewValue();
+        //ICacheableKey key = ev.getKey();
+
+        TResult val = (TResult)ev.getNewValue();
+        /*ICacheableKey*/
+        TKey key = ev.getKey();
+
+        CqOperation opType = ev.getQueryOperation();
+        //CacheableString keyS = key as CacheableString;
+        string keyS = key.ToString(); //as string;
+        Portfolio pval = val as Portfolio;
+        PortfolioPdx pPdxVal = val as PortfolioPdx;
+        Assert.IsTrue((pPdxVal != null) || (pval != null));
+        //string opStr = "DESTROY";
+        /*if (opType == CqOperation.OP_TYPE_CREATE)
+          opStr = "CREATE";
+        else if (opType == CqOperation.OP_TYPE_UPDATE)
+          opStr = "UPDATE";*/
+
+        //Util.Log("key {0}, value ({1},{2}), op {3}.", keyS,
+        //  pval.ID, pval.Pkid, opStr);
+      }
+
+      public virtual void OnError(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqListener::OnError called");
+        if (m_failedOver == true)
+          m_errorCountAfter++;
+        else
+          m_errorCountBefore++;
+      }
+      public virtual void Close()
+      {
+        Util.Log("MyCqListener::close called");
+      }
+      public virtual void Clear()
+      {
+        Util.Log("MyCqListener::Clear called");
+        m_eventCountBefore = 0;
+        m_errorCountBefore = 0;
+        m_eventCountAfter = 0;
+        m_errorCountAfter = 0;
+      }
+    }
+
+    public class MyCqStatusListener<TKey, TResult> : ICqStatusListener<TKey, TResult>
+    {
+      #region Private members
+      private bool m_failedOver = false;
+      private UInt32 m_eventCountBefore = 0;
+      private UInt32 m_errorCountBefore = 0;
+      private UInt32 m_eventCountAfter = 0;
+      private UInt32 m_errorCountAfter = 0;
+      private UInt32 m_CqConnectedCount = 0;
+      private UInt32 m_CqDisConnectedCount = 0;
+
+      #endregion
+
+      #region Public accessors
+
+      public MyCqStatusListener(int id)
+      {
+      }
+
+      public void failedOver()
+      {
+        m_failedOver = true;
+      }
+      public UInt32 getEventCountBefore()
+      {
+        return m_eventCountBefore;
+      }
+      public UInt32 getErrorCountBefore()
+      {
+        return m_errorCountBefore;
+      }
+      public UInt32 getEventCountAfter()
+      {
+        return m_eventCountAfter;
+      }
+      public UInt32 getErrorCountAfter()
+      {
+        return m_errorCountAfter;
+      }
+      public UInt32 getCqConnectedCount()
+      {
+        return m_CqConnectedCount;
+      }
+      public UInt32 getCqDisConnectedCount()
+      {
+        return m_CqDisConnectedCount;
+      }
+      #endregion
+
+      public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqStatusListener::OnEvent called");
+        if (m_failedOver == true)
+          m_eventCountAfter++;
+        else
+          m_eventCountBefore++;
+
+        TResult val = (TResult)ev.getNewValue();
+        TKey key = ev.getKey();
+
+        CqOperation opType = ev.getQueryOperation();
+        string keyS = key.ToString(); //as string;      
+      }
+      public virtual void OnError(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqStatusListener::OnError called");
+        if (m_failedOver == true)
+          m_errorCountAfter++;
+        else
+          m_errorCountBefore++;
+      }
+      public virtual void Close()
+      {
+        Util.Log("MyCqStatusListener::close called");
+      }
+      public virtual void OnCqConnected()
+      {
+        m_CqConnectedCount++;
+        Util.Log("MyCqStatusListener::OnCqConnected called");
+      }
+      public virtual void OnCqDisconnected()
+      {
+        m_CqDisConnectedCount++;
+        Util.Log("MyCqStatusListener::OnCqDisconnected called");
+      }
+
+      public virtual void Clear()
+      {
+        Util.Log("MyCqStatusListener::Clear called");
+        m_eventCountBefore = 0;
+        m_errorCountBefore = 0;
+        m_eventCountAfter = 0;
+        m_errorCountAfter = 0;
+        m_CqConnectedCount = 0;
+        m_CqDisConnectedCount = 0;
+      }
+    }
+
+    #region Private members
+    private static bool m_usePdxObjects = false;
+    private UnitProcess m_client1;
+    private UnitProcess m_client2;
+    private static string[] QueryRegionNames = { "Portfolios", "Positions", "Portfolios2",
+      "Portfolios3" };
+    private static string QERegionName = "Portfolios";
+    private static string CqName = "MyCq";
+
+    #endregion
+
+    protected override ClientBase[] GetClients()
+    {
+      m_client1 = new UnitProcess();
+      m_client2 = new UnitProcess();
+      return new ClientBase[] { m_client1, m_client2 };
+    }
+
+    [TestFixtureSetUp]
+    public override void InitTests()
+    {
+      base.InitTests();
+      m_client1.Call(InitClient);
+      m_client2.Call(InitClient);
+    }
+
+    [TearDown]
+    public override void EndTest()
+    {
+      CacheHelper.StopJavaServers();
+      base.EndTest();
+    }
+
+
+    public void InitClient()
+    {
+      CacheHelper.Init();
+      try
+      {
+        CacheHelper.DCache.TypeRegistry.RegisterTypeGeneric(Portfolio.CreateDeserializable);
+        CacheHelper.DCache.TypeRegistry.RegisterTypeGeneric(Position.CreateDeserializable);
+      }
+      catch (IllegalStateException)
+      {
+        // ignore since we run multiple iterations for pool and non pool configs
+      }
+    }
+
+    public void ProcessCQ(string locators)
+    {
+      CacheHelper.CreateTCRegion_Pool<object, object>(QERegionName, true, true,
+      null, locators, "__TESTPOOL1_", true);
+
+      IRegion<object, object> region = CacheHelper.GetVerifyRegion<object, object>(QERegionName);
+      Portfolio p1 = new Portfolio(1, 100);
+      Portfolio p2 = new Portfolio(2, 100);
+      Portfolio p3 = new Portfolio(3, 100);
+      Portfolio p4 = new Portfolio(4, 100);
+
+      region["1"] = p1;
+      region["2"] = p2;
+      region["3"] = p3;
+      region["4"] = p4;
+
+      var qs = CacheHelper.DCache.GetPoolManager().Find("__TESTPOOL1_").GetQueryService();
+      
+      CqAttributesFactory<object, object> cqFac = new CqAttributesFactory<object, object>();
+      ICqListener<object, object> cqLstner = new MyCqListener<object, object>();
+      ICqStatusListener<object, object> cqStatusLstner = new MyCqStatusListener<object, object>(1);
+
+      ICqListener<object, object>[] v = new ICqListener<object, object>[2];
+      cqFac.AddCqListener(cqLstner);
+      v[0] = cqLstner;
+      v[1] = cqStatusLstner;
+      cqFac.InitCqListeners(v);
+      Util.Log("InitCqListeners called");
+      CqAttributes<object, object> cqAttr = cqFac.Create();
+      CqQuery<object, object> qry1 = qs.NewCq("CQ1", "select * from /" + QERegionName + "  p where p.ID >= 1", cqAttr, false);
+      qry1.Execute();
+
+      Thread.Sleep(18000); // sleep 0.3min to allow server c query to complete
+      region["4"] = p1;
+      region["3"] = p2;
+      region["2"] = p3;
+      region["1"] = p4;
+      Thread.Sleep(18000); // sleep 0.3min to allow server c query to complete
+
+      qry1 = qs.GetCq<object, object>("CQ1");
+      cqAttr = qry1.GetCqAttributes();
+      ICqListener<object, object>[] vl = cqAttr.getCqListeners();
+      Assert.IsNotNull(vl);
+      Assert.AreEqual(2, vl.Length);
+      cqLstner = vl[0];
+      Assert.IsNotNull(cqLstner);
+      MyCqListener<object, object> myLisner = (MyCqListener<object, object>)cqLstner;// as MyCqListener<object, object>;
+      Util.Log("event count:{0}, error count {1}.", myLisner.getEventCountBefore(), myLisner.getErrorCountBefore());
+      Assert.AreEqual(4, myLisner.getEventCountBefore());
+
+      cqStatusLstner = (ICqStatusListener<object, object>)vl[1];
+      Assert.IsNotNull(cqStatusLstner);
+      MyCqStatusListener<object, object> myStatLisner = (MyCqStatusListener<object, object>)cqStatusLstner;// as MyCqStatusListener<object, object>;
+      Util.Log("event count:{0}, error count {1}.", myStatLisner.getEventCountBefore(), myStatLisner.getErrorCountBefore());
+      Assert.AreEqual(1, myStatLisner.getCqConnectedCount());
+      Assert.AreEqual(4, myStatLisner.getEventCountBefore());
+
+      CqAttributesMutator<object, object> mutator = qry1.GetCqAttributesMutator();
+      mutator.RemoveCqListener(cqLstner);
+      cqAttr = qry1.GetCqAttributes();
+      Util.Log("cqAttr.getCqListeners().Length = {0}", cqAttr.getCqListeners().Length);
+      Assert.AreEqual(1, cqAttr.getCqListeners().Length);
+
+      mutator.RemoveCqListener(cqStatusLstner);
+      cqAttr = qry1.GetCqAttributes();
+      Util.Log("1 cqAttr.getCqListeners().Length = {0}", cqAttr.getCqListeners().Length);
+      Assert.AreEqual(0, cqAttr.getCqListeners().Length);
+      
+      ICqListener<object, object>[] v2 = new ICqListener<object, object>[2];
+      v2[0] = cqLstner;
+      v2[1] = cqStatusLstner;
+      MyCqListener<object, object> myLisner2 = (MyCqListener<object, object>)cqLstner;
+      myLisner2.Clear();
+      MyCqStatusListener<object, object> myStatLisner2 = (MyCqStatusListener<object, object>)cqStatusLstner;
+      myStatLisner2.Clear();
+      mutator.SetCqListeners(v2);
+      cqAttr = qry1.GetCqAttributes();
+      Assert.AreEqual(2, cqAttr.getCqListeners().Length);
+
+      region["4"] = p1;
+      region["3"] = p2;
+      region["2"] = p3;
+      region["1"] = p4;
+      Thread.Sleep(18000); // sleep 0.3min to allow server c query to complete
+
+      qry1 = qs.GetCq<object, object>("CQ1");
+      cqAttr = qry1.GetCqAttributes();
+      ICqListener<object, object>[] v3 = cqAttr.getCqListeners();
+      Assert.IsNotNull(v3);
+      Assert.AreEqual(2, vl.Length);
+      cqLstner = v3[0];
+      Assert.IsNotNull(cqLstner);
+      myLisner2 = (MyCqListener<object, object>)cqLstner;// as MyCqListener<object, object>;
+      Util.Log("event count:{0}, error count {1}.", myLisner2.getEventCountBefore(), myLisner2.getErrorCountBefore());
+      Assert.AreEqual(4, myLisner2.getEventCountBefore());
+
+      cqStatusLstner = (ICqStatusListener<object, object>)v3[1];
+      Assert.IsNotNull(cqStatusLstner);
+      myStatLisner2 = (MyCqStatusListener<object, object>)cqStatusLstner;// as MyCqStatusListener<object, object>;
+      Util.Log("event count:{0}, error count {1}.", myStatLisner2.getEventCountBefore(), myStatLisner2.getErrorCountBefore());
+      Assert.AreEqual(0, myStatLisner2.getCqConnectedCount());
+      Assert.AreEqual(4, myStatLisner2.getEventCountBefore());
+
+      mutator = qry1.GetCqAttributesMutator();
+      mutator.RemoveCqListener(cqLstner);
+      cqAttr = qry1.GetCqAttributes();
+      Util.Log("cqAttr.getCqListeners().Length = {0}", cqAttr.getCqListeners().Length);
+      Assert.AreEqual(1, cqAttr.getCqListeners().Length);
+
+      mutator.RemoveCqListener(cqStatusLstner);
+      cqAttr = qry1.GetCqAttributes();
+      Util.Log("1 cqAttr.getCqListeners().Length = {0}", cqAttr.getCqListeners().Length);
+      Assert.AreEqual(0, cqAttr.getCqListeners().Length);
+
+      region["4"] = p1;
+      region["3"] = p2;
+      region["2"] = p3;
+      region["1"] = p4;
+      Thread.Sleep(18000); // sleep 0.3min to allow server c query to complete
+
+      qry1 = qs.GetCq<object, object>("CQ1");
+      cqAttr = qry1.GetCqAttributes();
+      ICqListener<object, object>[] v4 = cqAttr.getCqListeners();      
+      Assert.IsNotNull(v4);      
+      Assert.AreEqual(0, v4.Length);
+      Util.Log("cqAttr.getCqListeners() done");
+    }
+
+    [Test]
+    public void CqQueryAttributeMutatorTest()
+    {
+      CacheHelper.SetupJavaServers(true, "remotequeryN.xml");
+      CacheHelper.StartJavaLocator(1, "GFELOC");
+      Util.Log("Locator started");
+      CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
+      Util.Log("Cacheserver 1 started.");
+
+      m_client1.Call(ProcessCQ, CacheHelper.Locators);
+      Util.Log("ProcessCQ complete.");
+
+      m_client1.Call(Close);
+
+      CacheHelper.StopJavaServer(1);
+      Util.Log("Cacheserver 1 stopped.");
+
+      CacheHelper.StopJavaLocator(1);
+      Util.Log("Locator stopped");
+    }
+
+  }
+}
diff --git a/clicache/integration-test/ThinClientCqTestsN.cs b/clicache/integration-test/ThinClientCqPdxTest.cs
similarity index 68%
copy from clicache/integration-test/ThinClientCqTestsN.cs
copy to clicache/integration-test/ThinClientCqPdxTest.cs
index 039a4e3..bd0ff30 100644
--- a/clicache/integration-test/ThinClientCqTestsN.cs
+++ b/clicache/integration-test/ThinClientCqPdxTest.cs
@@ -26,232 +26,231 @@ namespace Apache.Geode.Client.UnitTests
   using Apache.Geode.Client.Tests;
   using Apache.Geode.Client;
 
-  public class MyCqListener<TKey, TResult> : ICqListener<TKey, TResult>
+  [TestFixture]
+  [Category("group3")]
+  [Category("unicast_only")]
+  [Category("generics")]
+
+  public class ThinClientCqPdxTest : ThinClientRegionSteps
   {
-    #region Private members
-    private bool m_failedOver = false;
-    private UInt32 m_eventCountBefore = 0;
-    private UInt32 m_errorCountBefore = 0;
-    private UInt32 m_eventCountAfter = 0;
-    private UInt32 m_errorCountAfter = 0;
+    public class MyCqListener<TKey, TResult> : ICqListener<TKey, TResult>
+    {
+      #region Private members
+      private bool m_failedOver = false;
+      private UInt32 m_eventCountBefore = 0;
+      private UInt32 m_errorCountBefore = 0;
+      private UInt32 m_eventCountAfter = 0;
+      private UInt32 m_errorCountAfter = 0;
 
-    #endregion
+      #endregion
 
-    #region Public accessors
+      #region Public accessors
 
-    public void failedOver()
-    {
-      m_failedOver = true;
-    }
-    public UInt32 getEventCountBefore()
-    {
-      return m_eventCountBefore;
-    }
-    public UInt32 getErrorCountBefore()
-    {
-      return m_errorCountBefore;
-    }
-    public UInt32 getEventCountAfter()
-    {
-      return m_eventCountAfter;
-    }
-    public UInt32 getErrorCountAfter()
-    {
-      return m_errorCountAfter;
-    }
-    #endregion
+      public void failedOver()
+      {
+        m_failedOver = true;
+      }
+      public UInt32 getEventCountBefore()
+      {
+        return m_eventCountBefore;
+      }
+      public UInt32 getErrorCountBefore()
+      {
+        return m_errorCountBefore;
+      }
+      public UInt32 getEventCountAfter()
+      {
+        return m_eventCountAfter;
+      }
+      public UInt32 getErrorCountAfter()
+      {
+        return m_errorCountAfter;
+      }
+      #endregion
 
-    public virtual void OnEvent(CqEvent<TKey, TResult> ev)
-    {
-      Util.Log("MyCqListener::OnEvent called");
-      if (m_failedOver == true)
-        m_eventCountAfter++;
-      else
-        m_eventCountBefore++;
-
-      //IGeodeSerializable val = ev.getNewValue();
-      //ICacheableKey key = ev.getKey();
-
-      TResult val = (TResult)ev.getNewValue();
-      /*ICacheableKey*/
-      TKey key = ev.getKey();
-
-      CqOperation opType = ev.getQueryOperation();
-      //CacheableString keyS = key as CacheableString;
-      string keyS = key.ToString(); //as string;
-      Portfolio pval = val as Portfolio;
-      PortfolioPdx pPdxVal = val as PortfolioPdx;
-      Assert.IsTrue((pPdxVal != null) || (pval != null));
-      //string opStr = "DESTROY";
-      /*if (opType == CqOperation.OP_TYPE_CREATE)
-        opStr = "CREATE";
-      else if (opType == CqOperation.OP_TYPE_UPDATE)
-        opStr = "UPDATE";*/
-
-      //Util.Log("key {0}, value ({1},{2}), op {3}.", keyS,
-      //  pval.ID, pval.Pkid, opStr);
-    }
-    public virtual void OnError(CqEvent<TKey, TResult> ev)
-    {
-      Util.Log("MyCqListener::OnError called");
-      if (m_failedOver == true)
-        m_errorCountAfter++;
-      else
-        m_errorCountBefore++;
-    }
-    public virtual void Close()
-    {
-      Util.Log("MyCqListener::close called");
-    }
-    public virtual void Clear()
-    {
-      Util.Log("MyCqListener::Clear called");
-      m_eventCountBefore = 0;
-      m_errorCountBefore = 0;
-      m_eventCountAfter = 0;
-      m_errorCountAfter = 0;
+      public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqListener::OnEvent called");
+        if (m_failedOver == true)
+          m_eventCountAfter++;
+        else
+          m_eventCountBefore++;
+
+        //IGeodeSerializable val = ev.getNewValue();
+        //ICacheableKey key = ev.getKey();
+
+        TResult val = (TResult)ev.getNewValue();
+        /*ICacheableKey*/
+        TKey key = ev.getKey();
+
+        CqOperation opType = ev.getQueryOperation();
+        //CacheableString keyS = key as CacheableString;
+        string keyS = key.ToString(); //as string;
+        Portfolio pval = val as Portfolio;
+        PortfolioPdx pPdxVal = val as PortfolioPdx;
+        Assert.IsTrue((pPdxVal != null) || (pval != null));
+        //string opStr = "DESTROY";
+        /*if (opType == CqOperation.OP_TYPE_CREATE)
+          opStr = "CREATE";
+        else if (opType == CqOperation.OP_TYPE_UPDATE)
+          opStr = "UPDATE";*/
+
+        //Util.Log("key {0}, value ({1},{2}), op {3}.", keyS,
+        //  pval.ID, pval.Pkid, opStr);
+      }
+      public virtual void OnError(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqListener::OnError called");
+        if (m_failedOver == true)
+          m_errorCountAfter++;
+        else
+          m_errorCountBefore++;
+      }
+      public virtual void Close()
+      {
+        Util.Log("MyCqListener::close called");
+      }
+      public virtual void Clear()
+      {
+        Util.Log("MyCqListener::Clear called");
+        m_eventCountBefore = 0;
+        m_errorCountBefore = 0;
+        m_eventCountAfter = 0;
+        m_errorCountAfter = 0;
+      }
     }
-  }
-
-  public class MyCqListener1<TKey, TResult> : ICqListener<TKey, TResult>
-  {
-    public static UInt32 m_cntEvents = 0;
 
-    public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+    public class MyCqListener1<TKey, TResult> : ICqListener<TKey, TResult>
     {
-      m_cntEvents++;
-      Util.Log("MyCqListener1::OnEvent called");
-      Object val = (Object)ev.getNewValue();
-      Object pkey = (Object)ev.getKey();
-      int value = (int)val;
-      int key = (int)pkey;
-      CqOperation opType = ev.getQueryOperation();
-      String opStr = "Default";
-      if (opType == CqOperation.OP_TYPE_CREATE)
-        opStr = "CREATE";
-      else if (opType == CqOperation.OP_TYPE_UPDATE)
-        opStr = "UPDATE";
-
-      Util.Log("MyCqListener1::OnEvent called with {0} , key = {1}, value = {2} ",
-      opStr, key, value);
-    }
-    public virtual void OnError(CqEvent<TKey, TResult> ev)
-    {
-      Util.Log("MyCqListener1::OnError called");
-    }
-    public virtual void Close()
-    {
-      Util.Log("MyCqListener1::close called");
-    }
-  } 
-   
+      public static UInt32 m_cntEvents = 0;
 
+      public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+      {
+        m_cntEvents++;
+        Util.Log("MyCqListener1::OnEvent called");
+        Object val = (Object)ev.getNewValue();
+        Object pkey = (Object)ev.getKey();
+        int value = (int)val;
+        int key = (int)pkey;
+        CqOperation opType = ev.getQueryOperation();
+        String opStr = "Default";
+        if (opType == CqOperation.OP_TYPE_CREATE)
+          opStr = "CREATE";
+        else if (opType == CqOperation.OP_TYPE_UPDATE)
+          opStr = "UPDATE";
+
+        Util.Log("MyCqListener1::OnEvent called with {0} , key = {1}, value = {2} ",
+        opStr, key, value);
+      }
+      public virtual void OnError(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqListener1::OnError called");
+      }
+      public virtual void Close()
+      {
+        Util.Log("MyCqListener1::close called");
+      }
+    }
 
-  public class MyCqStatusListener<TKey, TResult> : ICqStatusListener<TKey, TResult>
-  {
-    #region Private members
-    private bool m_failedOver = false;
-    private UInt32 m_eventCountBefore = 0;
-    private UInt32 m_errorCountBefore = 0;
-    private UInt32 m_eventCountAfter = 0;
-    private UInt32 m_errorCountAfter = 0;
-    private UInt32 m_CqConnectedCount = 0;
-    private UInt32 m_CqDisConnectedCount = 0;
+    public class MyCqStatusListener<TKey, TResult> : ICqStatusListener<TKey, TResult>
+    {
+      #region Private members
+      private bool m_failedOver = false;
+      private UInt32 m_eventCountBefore = 0;
+      private UInt32 m_errorCountBefore = 0;
+      private UInt32 m_eventCountAfter = 0;
+      private UInt32 m_errorCountAfter = 0;
+      private UInt32 m_CqConnectedCount = 0;
+      private UInt32 m_CqDisConnectedCount = 0;
 
-    #endregion
+      #endregion
 
-    #region Public accessors
+      #region Public accessors
 
-    public MyCqStatusListener(int id)
-    {
-    }
+      public MyCqStatusListener(int id)
+      {
+      }
 
-    public void failedOver()
-    {
-      m_failedOver = true;
-    }
-    public UInt32 getEventCountBefore()
-    {
-      return m_eventCountBefore;
-    }
-    public UInt32 getErrorCountBefore()
-    {
-      return m_errorCountBefore;
-    }
-    public UInt32 getEventCountAfter()
-    {
-      return m_eventCountAfter;
-    }
-    public UInt32 getErrorCountAfter()
-    {
-      return m_errorCountAfter;
-    }
-    public UInt32 getCqConnectedCount()
-    {
-      return m_CqConnectedCount;
-    }
-    public UInt32 getCqDisConnectedCount()
-    {
-      return m_CqDisConnectedCount;
-    }
-    #endregion
+      public void failedOver()
+      {
+        m_failedOver = true;
+      }
+      public UInt32 getEventCountBefore()
+      {
+        return m_eventCountBefore;
+      }
+      public UInt32 getErrorCountBefore()
+      {
+        return m_errorCountBefore;
+      }
+      public UInt32 getEventCountAfter()
+      {
+        return m_eventCountAfter;
+      }
+      public UInt32 getErrorCountAfter()
+      {
+        return m_errorCountAfter;
+      }
+      public UInt32 getCqConnectedCount()
+      {
+        return m_CqConnectedCount;
+      }
+      public UInt32 getCqDisConnectedCount()
+      {
+        return m_CqDisConnectedCount;
+      }
+      #endregion
 
-    public virtual void OnEvent(CqEvent<TKey, TResult> ev)
-    {
-      Util.Log("MyCqStatusListener::OnEvent called");
-      if (m_failedOver == true)
-        m_eventCountAfter++;
-      else
-        m_eventCountBefore++;      
+      public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqStatusListener::OnEvent called");
+        if (m_failedOver == true)
+          m_eventCountAfter++;
+        else
+          m_eventCountBefore++;
 
-      TResult val = (TResult)ev.getNewValue();      
-      TKey key = ev.getKey();
+        TResult val = (TResult)ev.getNewValue();
+        TKey key = ev.getKey();
 
-      CqOperation opType = ev.getQueryOperation();      
-      string keyS = key.ToString(); //as string;      
-    }
-    public virtual void OnError(CqEvent<TKey, TResult> ev)
-    {
-      Util.Log("MyCqStatusListener::OnError called");
-      if (m_failedOver == true)
-        m_errorCountAfter++;
-      else
-        m_errorCountBefore++;
-    }
-    public virtual void Close()
-    {
-      Util.Log("MyCqStatusListener::close called");
-    }
-    public virtual void OnCqConnected()
-    {
-      m_CqConnectedCount++;
-      Util.Log("MyCqStatusListener::OnCqConnected called");
-    }
-    public virtual void OnCqDisconnected()
-    {
-      m_CqDisConnectedCount++;
-      Util.Log("MyCqStatusListener::OnCqDisconnected called");
-    }
+        CqOperation opType = ev.getQueryOperation();
+        string keyS = key.ToString(); //as string;      
+      }
+      public virtual void OnError(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqStatusListener::OnError called");
+        if (m_failedOver == true)
+          m_errorCountAfter++;
+        else
+          m_errorCountBefore++;
+      }
+      public virtual void Close()
+      {
+        Util.Log("MyCqStatusListener::close called");
+      }
+      public virtual void OnCqConnected()
+      {
+        m_CqConnectedCount++;
+        Util.Log("MyCqStatusListener::OnCqConnected called");
+      }
+      public virtual void OnCqDisconnected()
+      {
+        m_CqDisConnectedCount++;
+        Util.Log("MyCqStatusListener::OnCqDisconnected called");
+      }
 
-    public virtual void Clear()
-    {
-      Util.Log("MyCqStatusListener::Clear called");
-      m_eventCountBefore = 0;
-      m_errorCountBefore = 0;
-      m_eventCountAfter = 0;
-      m_errorCountAfter = 0;
-      m_CqConnectedCount = 0;
-      m_CqDisConnectedCount = 0;
+      public virtual void Clear()
+      {
+        Util.Log("MyCqStatusListener::Clear called");
+        m_eventCountBefore = 0;
+        m_errorCountBefore = 0;
+        m_eventCountAfter = 0;
+        m_errorCountAfter = 0;
+        m_CqConnectedCount = 0;
+        m_CqDisConnectedCount = 0;
+      }
     }
-  }
 
-  [TestFixture]
-  [Category("group3")]
-  [Category("unicast_only")]
-  [Category("generics")]
 
-  public class ThinClientCqTests : ThinClientRegionSteps
-  {
     #region Private members
     private static bool m_usePdxObjects = false;
     private UnitProcess m_client1;
@@ -794,7 +793,7 @@ namespace Apache.Geode.Client.UnitTests
         null, locators, poolName, true, servergroup);
     }
 
-    void runCqQueryTest()
+    void runCqQueryPdxTest()
     {
       CacheHelper.SetupJavaServers(true, "remotequeryN.xml");
       CacheHelper.StartJavaLocator(1, "GFELOC");
@@ -823,192 +822,12 @@ namespace Apache.Geode.Client.UnitTests
       Util.Log("Locator stopped");
     }
 
-    void runCqQueryStatusTest()
-    {
-      CacheHelper.SetupJavaServers(true, "cacheserver.xml", "cacheserver2.xml");
-      CacheHelper.StartJavaLocator(1, "GFELOC");
-      Util.Log("Locator started");
-      CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
-      Util.Log("Cacheserver 1 started.");
-
-      m_client1.Call(StepOne, CacheHelper.Locators);
-      Util.Log("StepOne complete.");
-
-      m_client1.Call(CreateAndExecuteCQ_StatusListener, "__TESTPOOL1_", CqName1, CqQuery1, 100);
-      Util.Log("CreateAndExecuteCQ complete.");
-
-      m_client1.Call(CheckCQStatusOnConnect, "__TESTPOOL1_", CqName1, 1);
-      Util.Log("CheckCQStatusOnConnect complete.");
-
-      m_client1.Call(PutEntries, "DistRegionAck");
-      Util.Log("PutEntries complete.");
-
-      m_client1.Call(CheckCQStatusOnPutEvent, "__TESTPOOL1_", CqName1, 10);
-      Util.Log("CheckCQStatusOnPutEvent complete.");
-
-      CacheHelper.SetupJavaServers(true, "cacheserver.xml", "cacheserver2.xml");
-      CacheHelper.StartJavaServerWithLocators(2, "GFECS2", 1);
-      Util.Log("start server 2 complete.");
-
-      Thread.Sleep(20000);
-      CacheHelper.StopJavaServer(1);
-      Util.Log("Cacheserver 1 stopped.");
-      Thread.Sleep(20000);
-      m_client1.Call(CheckCQStatusOnDisConnect, "__TESTPOOL1_", CqName1, 0);
-      Util.Log("CheckCQStatusOnDisConnect complete.");
-
-      CacheHelper.StopJavaServer(2);
-      Util.Log("Cacheserver 2 stopped.");
-      Thread.Sleep(20000);
-      m_client1.Call(CheckCQStatusOnDisConnect, "__TESTPOOL1_", CqName1, 1);
-      Util.Log("CheckCQStatusOnDisConnect complete.");
-
-      CacheHelper.SetupJavaServers(true, "cacheserver.xml", "cacheserver2.xml");
-      CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
-      Util.Log("Cacheserver 1 started.");
-      Thread.Sleep(20000);
-
-      m_client1.Call(CheckCQStatusOnConnect, "__TESTPOOL1_", CqName1, 2);
-      Util.Log("CheckCQStatusOnConnect complete.");
-
-      CacheHelper.StopJavaServer(1);
-      Util.Log("Cacheserver 1 stopped.");
-      Thread.Sleep(20000);
-
-      m_client1.Call(CheckCQStatusOnDisConnect, "__TESTPOOL1_", CqName1, 2);
-      Util.Log("CheckCQStatusOnDisConnect complete.");
-
-      m_client1.Call(Close);
-
-      CacheHelper.StopJavaLocator(1);
-      Util.Log("Locator stopped");
-    }
-
-    void runCqQueryStatusTest2()
-    {
-      CacheHelper.SetupJavaServers(true, "cacheserver_servergroup.xml", "cacheserver_servergroup2.xml");
-      CacheHelper.StartJavaLocator(1, "GFELOC");
-      Util.Log("Locator started");
-      CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
-      Util.Log("start server 1 complete.");
-      CacheHelper.StartJavaServerWithLocators(2, "GFECS2", 1);
-      Util.Log("start server 2 complete.");
-
-      m_client1.Call(CreateRegion, CacheHelper.Locators, "group1", "DistRegionAck", "__TESTPOOL1_");
-      Util.Log("CreateRegion DistRegionAck complete.");
-
-      m_client1.Call(CreateRegion, CacheHelper.Locators, "group2", "DistRegionAck1", "__TESTPOOL2_");
-      Util.Log("CreateRegion DistRegionAck1 complete.");
-
-      m_client1.Call(CreateAndExecuteCQ_StatusListener, "__TESTPOOL1_", CqName1, CqQuery1, 100);
-      Util.Log("CreateAndExecuteCQ1 complete.");
-
-      m_client1.Call(CreateAndExecuteCQ_StatusListener, "__TESTPOOL2_", CqName2, CqQuery2, 101);
-      Util.Log("CreateAndExecuteCQ2 complete.");
-
-      m_client1.Call(CheckCQStatusOnConnect, "__TESTPOOL1_", CqName1, 1);
-      Util.Log("CheckCQStatusOnConnect1 complete.");
-
-      m_client1.Call(CheckCQStatusOnConnect, "__TESTPOOL2_", CqName2, 1);
-      Util.Log("CheckCQStatusOnConnect2 complete.");
-
-      m_client1.Call(PutEntries, "DistRegionAck");
-      Util.Log("PutEntries1 complete.");
-
-      m_client1.Call(PutEntries, "DistRegionAck1");
-      Util.Log("PutEntries2 complete.");
-
-      m_client1.Call(CheckCQStatusOnPutEvent, "__TESTPOOL1_", CqName1, 10);
-      Util.Log("CheckCQStatusOnPutEvent complete.");
-      
-      CacheHelper.StopJavaServer(1);
-      Util.Log("Cacheserver 1 stopped.");
-      Thread.Sleep(20000);
-
-      m_client1.Call(CheckCQStatusOnDisConnect, "__TESTPOOL1_", CqName1, 1);
-      Util.Log("CheckCQStatusOnDisConnect complete.");
-
-      CacheHelper.StopJavaServer(2);
-      Util.Log("Cacheserver 2 stopped.");
-      Thread.Sleep(20000);
-
-      m_client1.Call(CheckCQStatusOnDisConnect, "__TESTPOOL2_", CqName2, 1);
-      Util.Log("CheckCQStatusOnDisConnect complete.");
-
-      m_client1.Call(Close);
-
-      CacheHelper.StopJavaLocator(1);
-      Util.Log("Locator stopped");
-    }
-
-    void runCqQueryStatusTest3()
-    {
-      CacheHelper.SetupJavaServers(true, "remotequeryN.xml");
-      CacheHelper.StartJavaLocator(1, "GFELOC");
-      Util.Log("Locator started");
-      CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
-      Util.Log("Cacheserver 1 started.");
-
-      m_client1.Call(ProcessCQ, CacheHelper.Locators);
-      Util.Log("ProcessCQ complete.");
-
-      m_client1.Call(Close);
-
-      CacheHelper.StopJavaServer(1);
-      Util.Log("Cacheserver 1 stopped.");
-
-      CacheHelper.StopJavaLocator(1);
-      Util.Log("Locator stopped");
-    }
-
-    [Test]
-    public void CqQueryTest()
-    {
-      runCqQueryTest();
-    }
-
     [Test]
     public void CqQueryPdxTest()
     {
       m_usePdxObjects = true;
-      runCqQueryTest();
+      runCqQueryPdxTest();
       m_usePdxObjects = false;
     }
-
-    // [Test]
-    // public void CqFailover()
-    // {
-    //  try
-    //  {
-    //   m_client1.Call(StepOneFailover);
-    //    Util.Log("StepOneFailover complete.");
-    //
-    //       m_client1.Call(StepTwoFailover);
-    //      Util.Log("StepTwoFailover complete.");
-    //    }
-    //    finally
-    //   {
-    //     m_client1.Call(CacheHelper.StopJavaServers);
-    //  }
-    //  }
-
-    [Test]
-    public void CqQueryStatusTest()
-    {
-      runCqQueryStatusTest();
-    }
-
-    [Test]
-    public void CqQueryStatusTest2()
-    {
-      runCqQueryStatusTest2();
-    }
-
-    [Test]
-    public void CqQueryStatusTest3()
-    {
-      runCqQueryStatusTest3();
-    }
-
   }
 }
diff --git a/clicache/integration-test/ThinClientCqStatusTest.cs b/clicache/integration-test/ThinClientCqStatusTest.cs
new file mode 100644
index 0000000..68f582a
--- /dev/null
+++ b/clicache/integration-test/ThinClientCqStatusTest.cs
@@ -0,0 +1,457 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+
+namespace Apache.Geode.Client.UnitTests
+{
+  using NUnit.Framework;
+  using Apache.Geode.DUnitFramework;
+  using Apache.Geode.Client.Tests;
+  using Apache.Geode.Client;
+
+  [TestFixture]
+  [Category("group3")]
+  [Category("unicast_only")]
+  [Category("generics")]
+
+  public class ThinClientCqStatusTest : ThinClientRegionSteps
+  {
+    public class MyCqListener<TKey, TResult> : ICqListener<TKey, TResult>
+    {
+      #region Private members
+      private bool m_failedOver = false;
+      private UInt32 m_eventCountBefore = 0;
+      private UInt32 m_errorCountBefore = 0;
+      private UInt32 m_eventCountAfter = 0;
+      private UInt32 m_errorCountAfter = 0;
+
+      #endregion
+
+      #region Public accessors
+
+      public void failedOver()
+      {
+        m_failedOver = true;
+      }
+      public UInt32 getEventCountBefore()
+      {
+        return m_eventCountBefore;
+      }
+      public UInt32 getErrorCountBefore()
+      {
+        return m_errorCountBefore;
+      }
+      public UInt32 getEventCountAfter()
+      {
+        return m_eventCountAfter;
+      }
+      public UInt32 getErrorCountAfter()
+      {
+        return m_errorCountAfter;
+      }
+      #endregion
+
+      public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqListener::OnEvent called");
+        if (m_failedOver == true)
+          m_eventCountAfter++;
+        else
+          m_eventCountBefore++;
+
+        //IGeodeSerializable val = ev.getNewValue();
+        //ICacheableKey key = ev.getKey();
+
+        TResult val = (TResult)ev.getNewValue();
+        /*ICacheableKey*/
+        TKey key = ev.getKey();
+
+        CqOperation opType = ev.getQueryOperation();
+        //CacheableString keyS = key as CacheableString;
+        string keyS = key.ToString(); //as string;
+        Portfolio pval = val as Portfolio;
+        PortfolioPdx pPdxVal = val as PortfolioPdx;
+        Assert.IsTrue((pPdxVal != null) || (pval != null));
+        //string opStr = "DESTROY";
+        /*if (opType == CqOperation.OP_TYPE_CREATE)
+          opStr = "CREATE";
+        else if (opType == CqOperation.OP_TYPE_UPDATE)
+          opStr = "UPDATE";*/
+
+        //Util.Log("key {0}, value ({1},{2}), op {3}.", keyS,
+        //  pval.ID, pval.Pkid, opStr);
+      }
+      public virtual void OnError(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqListener::OnError called");
+        if (m_failedOver == true)
+          m_errorCountAfter++;
+        else
+          m_errorCountBefore++;
+      }
+      public virtual void Close()
+      {
+        Util.Log("MyCqListener::close called");
+      }
+      public virtual void Clear()
+      {
+        Util.Log("MyCqListener::Clear called");
+        m_eventCountBefore = 0;
+        m_errorCountBefore = 0;
+        m_eventCountAfter = 0;
+        m_errorCountAfter = 0;
+      }
+    }
+
+    public class MyCqListener1<TKey, TResult> : ICqListener<TKey, TResult>
+    {
+      public static UInt32 m_cntEvents = 0;
+
+      public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+      {
+        m_cntEvents++;
+        Util.Log("MyCqListener1::OnEvent called");
+        Object val = (Object)ev.getNewValue();
+        Object pkey = (Object)ev.getKey();
+        int value = (int)val;
+        int key = (int)pkey;
+        CqOperation opType = ev.getQueryOperation();
+        String opStr = "Default";
+        if (opType == CqOperation.OP_TYPE_CREATE)
+          opStr = "CREATE";
+        else if (opType == CqOperation.OP_TYPE_UPDATE)
+          opStr = "UPDATE";
+
+        Util.Log("MyCqListener1::OnEvent called with {0} , key = {1}, value = {2} ",
+        opStr, key, value);
+      }
+      public virtual void OnError(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqListener1::OnError called");
+      }
+      public virtual void Close()
+      {
+        Util.Log("MyCqListener1::close called");
+      }
+    }
+
+    public class MyCqStatusListener<TKey, TResult> : ICqStatusListener<TKey, TResult>
+    {
+      #region Private members
+      private bool m_failedOver = false;
+      private UInt32 m_eventCountBefore = 0;
+      private UInt32 m_errorCountBefore = 0;
+      private UInt32 m_eventCountAfter = 0;
+      private UInt32 m_errorCountAfter = 0;
+      private UInt32 m_CqConnectedCount = 0;
+      private UInt32 m_CqDisConnectedCount = 0;
+
+      #endregion
+
+      #region Public accessors
+
+      public MyCqStatusListener(int id)
+      {
+      }
+
+      public void failedOver()
+      {
+        m_failedOver = true;
+      }
+      public UInt32 getEventCountBefore()
+      {
+        return m_eventCountBefore;
+      }
+      public UInt32 getErrorCountBefore()
+      {
+        return m_errorCountBefore;
+      }
+      public UInt32 getEventCountAfter()
+      {
+        return m_eventCountAfter;
+      }
+      public UInt32 getErrorCountAfter()
+      {
+        return m_errorCountAfter;
+      }
+      public UInt32 getCqConnectedCount()
+      {
+        return m_CqConnectedCount;
+      }
+      public UInt32 getCqDisConnectedCount()
+      {
+        return m_CqDisConnectedCount;
+      }
+      #endregion
+
+      public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqStatusListener::OnEvent called");
+        if (m_failedOver == true)
+          m_eventCountAfter++;
+        else
+          m_eventCountBefore++;
+
+        TResult val = (TResult)ev.getNewValue();
+        TKey key = ev.getKey();
+
+        CqOperation opType = ev.getQueryOperation();
+        string keyS = key.ToString(); //as string;      
+      }
+      public virtual void OnError(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqStatusListener::OnError called");
+        if (m_failedOver == true)
+          m_errorCountAfter++;
+        else
+          m_errorCountBefore++;
+      }
+      public virtual void Close()
+      {
+        Util.Log("MyCqStatusListener::close called");
+      }
+      public virtual void OnCqConnected()
+      {
+        m_CqConnectedCount++;
+        Util.Log("MyCqStatusListener::OnCqConnected called");
+      }
+      public virtual void OnCqDisconnected()
+      {
+        m_CqDisConnectedCount++;
+        Util.Log("MyCqStatusListener::OnCqDisconnected called");
+      }
+
+      public virtual void Clear()
+      {
+        Util.Log("MyCqStatusListener::Clear called");
+        m_eventCountBefore = 0;
+        m_errorCountBefore = 0;
+        m_eventCountAfter = 0;
+        m_errorCountAfter = 0;
+        m_CqConnectedCount = 0;
+        m_CqDisConnectedCount = 0;
+      }
+    }
+
+
+    #region Private members
+    private static bool m_usePdxObjects = false;
+    private UnitProcess m_client1;
+    private UnitProcess m_client2;
+    private static string[] QueryRegionNames = { "Portfolios", "Positions", "Portfolios2",
+      "Portfolios3" };
+    private static string QERegionName = "Portfolios";
+    private static string CqName = "MyCq";
+
+    private static string CqName1 = "testCQAllServersLeave";
+    private static string CqName2 = "testCQAllServersLeave1";
+
+    private static string CqQuery1 = "select * from /DistRegionAck";
+    private static string CqQuery2 = "select * from /DistRegionAck1";
+    //private static string CqName1 = "MyCq1";
+
+    #endregion
+
+    protected override ClientBase[] GetClients()
+    {
+      m_client1 = new UnitProcess();
+      m_client2 = new UnitProcess();
+      return new ClientBase[] { m_client1, m_client2 };
+    }
+
+    [TestFixtureSetUp]
+    public override void InitTests()
+    {
+      base.InitTests();
+      m_client1.Call(InitClient);
+      m_client2.Call(InitClient);
+    }
+
+    [TearDown]
+    public override void EndTest()
+    {
+      CacheHelper.StopJavaServers();
+      base.EndTest();
+    }
+
+
+    public void InitClient()
+    {
+      CacheHelper.Init();
+      try
+      {
+        CacheHelper.DCache.TypeRegistry.RegisterTypeGeneric(Portfolio.CreateDeserializable);
+        CacheHelper.DCache.TypeRegistry.RegisterTypeGeneric(Position.CreateDeserializable);
+      }
+      catch (IllegalStateException)
+      {
+        // ignore since we run multiple iterations for pool and non pool configs
+      }
+    }
+
+    public void StepOne(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);
+      CacheHelper.CreateTCRegion_Pool<object, object>("DistRegionAck", true, true,
+        null, locators, "__TESTPOOL1_", true);
+      IRegion<object, object> region = CacheHelper.GetRegion<object, object>(QueryRegionNames[0]);
+      Apache.Geode.Client.RegionAttributes<object, object> regattrs = region.Attributes;
+      region.CreateSubRegion(QueryRegionNames[1], regattrs);
+    }
+
+    public void CreateAndExecuteCQ_StatusListener(string poolName, string cqName, string cqQuery, int id)
+    {
+      var qs = CacheHelper.DCache.GetPoolManager().Find(poolName).GetQueryService();
+      CqAttributesFactory<object, object> cqFac = new CqAttributesFactory<object, object>();
+      cqFac.AddCqListener(new MyCqStatusListener<object, object>(id));
+      CqAttributes<object, object> cqAttr = cqFac.Create();
+      CqQuery<object, object> qry = qs.NewCq(cqName, cqQuery, cqAttr, false);
+      qry.Execute();
+      Thread.Sleep(18000); // sleep 0.3min to allow server c query to complete
+    }
+
+    public void CreateAndExecuteCQ_Listener(string poolName, string cqName, string cqQuery, int id)
+    {
+      var qs = CacheHelper.DCache.GetPoolManager().Find(poolName).GetQueryService();
+      CqAttributesFactory<object, object> cqFac = new CqAttributesFactory<object, object>();
+      cqFac.AddCqListener(new MyCqListener<object, object>(/*id*/));
+      CqAttributes<object, object> cqAttr = cqFac.Create();
+      CqQuery<object, object> qry = qs.NewCq(cqName, cqQuery, cqAttr, false);
+      qry.Execute();
+      Thread.Sleep(18000); // sleep 0.3min to allow server c query to complete
+    }
+
+    public void CheckCQStatusOnConnect(string poolName, string cqName, int onCqStatusConnect)
+    {      
+      var qs = CacheHelper.DCache.GetPoolManager().Find(poolName).GetQueryService();
+      CqQuery<object, object> query = qs.GetCq<object, object>(cqName);
+      CqAttributes<object, object> cqAttr = query.GetCqAttributes();
+      ICqListener<object, object>[] vl = cqAttr.getCqListeners();
+      MyCqStatusListener<object, object> myCqStatusLstr = (MyCqStatusListener<object, object>) vl[0];
+      Util.Log("CheckCQStatusOnConnect = {0} ", myCqStatusLstr.getCqConnectedCount());
+      Assert.AreEqual(onCqStatusConnect, myCqStatusLstr.getCqConnectedCount());
+    }
+
+    public void CheckCQStatusOnDisConnect(string poolName, string cqName, int onCqStatusDisConnect)
+    {
+      var qs = CacheHelper.DCache.GetPoolManager().Find(poolName).GetQueryService();
+      CqQuery<object, object> query = qs.GetCq<object, object>(cqName);
+      CqAttributes<object, object> cqAttr = query.GetCqAttributes();
+      ICqListener<object, object>[] vl = cqAttr.getCqListeners();
+      MyCqStatusListener<object, object> myCqStatusLstr = (MyCqStatusListener<object, object>)vl[0];
+      Util.Log("CheckCQStatusOnDisConnect = {0} ", myCqStatusLstr.getCqDisConnectedCount());
+      Assert.AreEqual(onCqStatusDisConnect, myCqStatusLstr.getCqDisConnectedCount());
+    }
+
+    public void PutEntries(string regionName)
+    {
+      IRegion<object, object> region = CacheHelper.GetVerifyRegion<object, object>(regionName);
+      for (int i = 1; i <= 10; i++) {
+        region["key-" + i] = "val-" + i;
+      }
+      Thread.Sleep(18000); // sleep 0.3min to allow server c query to complete
+    }
+
+    public void CheckCQStatusOnPutEvent(string poolName, string cqName, int onCreateCount)
+    {
+      var qs = CacheHelper.DCache.GetPoolManager().Find(poolName).GetQueryService();
+      CqQuery<object, object> query = qs.GetCq<object, object>(cqName);
+      CqAttributes<object, object> cqAttr = query.GetCqAttributes();
+      ICqListener<object, object>[] vl = cqAttr.getCqListeners();
+      MyCqStatusListener<object, object> myCqStatusLstr = (MyCqStatusListener<object, object>)vl[0];
+      Util.Log("CheckCQStatusOnPutEvent = {0} ", myCqStatusLstr.getEventCountBefore());
+      Assert.AreEqual(onCreateCount, myCqStatusLstr.getEventCountBefore());
+    }
+
+    void runCqQueryStatusTest()
+    {
+      CacheHelper.SetupJavaServers(true, "cacheserver.xml", "cacheserver2.xml");
+      CacheHelper.StartJavaLocator(1, "GFELOC");
+      Util.Log("Locator started");
+      CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
+      Util.Log("Cacheserver 1 started.");
+
+      m_client1.Call(StepOne, CacheHelper.Locators);
+      Util.Log("StepOne complete.");
+
+      m_client1.Call(CreateAndExecuteCQ_StatusListener, "__TESTPOOL1_", CqName1, CqQuery1, 100);
+      Util.Log("CreateAndExecuteCQ complete.");
+
+      m_client1.Call(CheckCQStatusOnConnect, "__TESTPOOL1_", CqName1, 1);
+      Util.Log("CheckCQStatusOnConnect complete.");
+
+      m_client1.Call(PutEntries, "DistRegionAck");
+      Util.Log("PutEntries complete.");
+
+      m_client1.Call(CheckCQStatusOnPutEvent, "__TESTPOOL1_", CqName1, 10);
+      Util.Log("CheckCQStatusOnPutEvent complete.");
+
+      CacheHelper.SetupJavaServers(true, "cacheserver.xml", "cacheserver2.xml");
+      CacheHelper.StartJavaServerWithLocators(2, "GFECS2", 1);
+      Util.Log("start server 2 complete.");
+
+      Thread.Sleep(20000);
+      CacheHelper.StopJavaServer(1);
+      Util.Log("Cacheserver 1 stopped.");
+      Thread.Sleep(20000);
+      m_client1.Call(CheckCQStatusOnDisConnect, "__TESTPOOL1_", CqName1, 0);
+      Util.Log("CheckCQStatusOnDisConnect complete.");
+
+      CacheHelper.StopJavaServer(2);
+      Util.Log("Cacheserver 2 stopped.");
+      Thread.Sleep(20000);
+      m_client1.Call(CheckCQStatusOnDisConnect, "__TESTPOOL1_", CqName1, 1);
+      Util.Log("CheckCQStatusOnDisConnect complete.");
+
+      CacheHelper.SetupJavaServers(true, "cacheserver.xml", "cacheserver2.xml");
+      CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
+      Util.Log("Cacheserver 1 started.");
+      Thread.Sleep(20000);
+
+      m_client1.Call(CheckCQStatusOnConnect, "__TESTPOOL1_", CqName1, 2);
+      Util.Log("CheckCQStatusOnConnect complete.");
+
+      CacheHelper.StopJavaServer(1);
+      Util.Log("Cacheserver 1 stopped.");
+      Thread.Sleep(20000);
+
+      m_client1.Call(CheckCQStatusOnDisConnect, "__TESTPOOL1_", CqName1, 2);
+      Util.Log("CheckCQStatusOnDisConnect complete.");
+
+      m_client1.Call(Close);
+
+      CacheHelper.StopJavaLocator(1);
+      Util.Log("Locator stopped");
+    }
+
+    [Test]
+    public void CqQueryStatusTest()
+    {
+      runCqQueryStatusTest();
+    }
+  }
+}
diff --git a/clicache/integration-test/ThinClientCqStatusTestTwoServers.cs b/clicache/integration-test/ThinClientCqStatusTestTwoServers.cs
new file mode 100644
index 0000000..b5d2933
--- /dev/null
+++ b/clicache/integration-test/ThinClientCqStatusTestTwoServers.cs
@@ -0,0 +1,444 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+
+namespace Apache.Geode.Client.UnitTests
+{
+  using NUnit.Framework;
+  using Apache.Geode.DUnitFramework;
+  using Apache.Geode.Client.Tests;
+  using Apache.Geode.Client;
+
+  public class MyCqListener<TKey, TResult> : ICqListener<TKey, TResult>
+  {
+    #region Private members
+    private bool m_failedOver = false;
+    private UInt32 m_eventCountBefore = 0;
+    private UInt32 m_errorCountBefore = 0;
+    private UInt32 m_eventCountAfter = 0;
+    private UInt32 m_errorCountAfter = 0;
+
+    #endregion
+
+    #region Public accessors
+
+    public void failedOver()
+    {
+      m_failedOver = true;
+    }
+    public UInt32 getEventCountBefore()
+    {
+      return m_eventCountBefore;
+    }
+    public UInt32 getErrorCountBefore()
+    {
+      return m_errorCountBefore;
+    }
+    public UInt32 getEventCountAfter()
+    {
+      return m_eventCountAfter;
+    }
+    public UInt32 getErrorCountAfter()
+    {
+      return m_errorCountAfter;
+    }
+    #endregion
+
+    public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+    {
+      Util.Log("MyCqListener::OnEvent called");
+      if (m_failedOver == true)
+        m_eventCountAfter++;
+      else
+        m_eventCountBefore++;
+
+      //IGeodeSerializable val = ev.getNewValue();
+      //ICacheableKey key = ev.getKey();
+
+      TResult val = (TResult)ev.getNewValue();
+      /*ICacheableKey*/
+      TKey key = ev.getKey();
+
+      CqOperation opType = ev.getQueryOperation();
+      //CacheableString keyS = key as CacheableString;
+      string keyS = key.ToString(); //as string;
+      Portfolio pval = val as Portfolio;
+      PortfolioPdx pPdxVal = val as PortfolioPdx;
+      Assert.IsTrue((pPdxVal != null) || (pval != null));
+      //string opStr = "DESTROY";
+      /*if (opType == CqOperation.OP_TYPE_CREATE)
+        opStr = "CREATE";
+      else if (opType == CqOperation.OP_TYPE_UPDATE)
+        opStr = "UPDATE";*/
+
+      //Util.Log("key {0}, value ({1},{2}), op {3}.", keyS,
+      //  pval.ID, pval.Pkid, opStr);
+    }
+    public virtual void OnError(CqEvent<TKey, TResult> ev)
+    {
+      Util.Log("MyCqListener::OnError called");
+      if (m_failedOver == true)
+        m_errorCountAfter++;
+      else
+        m_errorCountBefore++;
+    }
+    public virtual void Close()
+    {
+      Util.Log("MyCqListener::close called");
+    }
+    public virtual void Clear()
+    {
+      Util.Log("MyCqListener::Clear called");
+      m_eventCountBefore = 0;
+      m_errorCountBefore = 0;
+      m_eventCountAfter = 0;
+      m_errorCountAfter = 0;
+    }
+  }
+
+  public class MyCqListener1<TKey, TResult> : ICqListener<TKey, TResult>
+  {
+    public static UInt32 m_cntEvents = 0;
+
+    public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+    {
+      m_cntEvents++;
+      Util.Log("MyCqListener1::OnEvent called");
+      Object val = (Object)ev.getNewValue();
+      Object pkey = (Object)ev.getKey();
+      int value = (int)val;
+      int key = (int)pkey;
+      CqOperation opType = ev.getQueryOperation();
+      String opStr = "Default";
+      if (opType == CqOperation.OP_TYPE_CREATE)
+        opStr = "CREATE";
+      else if (opType == CqOperation.OP_TYPE_UPDATE)
+        opStr = "UPDATE";
+
+      Util.Log("MyCqListener1::OnEvent called with {0} , key = {1}, value = {2} ",
+      opStr, key, value);
+    }
+    public virtual void OnError(CqEvent<TKey, TResult> ev)
+    {
+      Util.Log("MyCqListener1::OnError called");
+    }
+    public virtual void Close()
+    {
+      Util.Log("MyCqListener1::close called");
+    }
+  }
+
+
+
+  public class MyCqStatusListener<TKey, TResult> : ICqStatusListener<TKey, TResult>
+  {
+    #region Private members
+    private bool m_failedOver = false;
+    private UInt32 m_eventCountBefore = 0;
+    private UInt32 m_errorCountBefore = 0;
+    private UInt32 m_eventCountAfter = 0;
+    private UInt32 m_errorCountAfter = 0;
+    private UInt32 m_CqConnectedCount = 0;
+    private UInt32 m_CqDisConnectedCount = 0;
+
+    #endregion
+
+    #region Public accessors
+
+    public MyCqStatusListener(int id)
+    {
+    }
+
+    public void failedOver()
+    {
+      m_failedOver = true;
+    }
+    public UInt32 getEventCountBefore()
+    {
+      return m_eventCountBefore;
+    }
+    public UInt32 getErrorCountBefore()
+    {
+      return m_errorCountBefore;
+    }
+    public UInt32 getEventCountAfter()
+    {
+      return m_eventCountAfter;
+    }
+    public UInt32 getErrorCountAfter()
+    {
+      return m_errorCountAfter;
+    }
+    public UInt32 getCqConnectedCount()
+    {
+      return m_CqConnectedCount;
+    }
+    public UInt32 getCqDisConnectedCount()
+    {
+      return m_CqDisConnectedCount;
+    }
+    #endregion
+
+    public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+    {
+      Util.Log("MyCqStatusListener::OnEvent called");
+      if (m_failedOver == true)
+        m_eventCountAfter++;
+      else
+        m_eventCountBefore++;
+
+      TResult val = (TResult)ev.getNewValue();
+      TKey key = ev.getKey();
+
+      CqOperation opType = ev.getQueryOperation();
+      string keyS = key.ToString(); //as string;      
+    }
+    public virtual void OnError(CqEvent<TKey, TResult> ev)
+    {
+      Util.Log("MyCqStatusListener::OnError called");
+      if (m_failedOver == true)
+        m_errorCountAfter++;
+      else
+        m_errorCountBefore++;
+    }
+    public virtual void Close()
+    {
+      Util.Log("MyCqStatusListener::close called");
+    }
+    public virtual void OnCqConnected()
+    {
+      m_CqConnectedCount++;
+      Util.Log("MyCqStatusListener::OnCqConnected called");
+    }
+    public virtual void OnCqDisconnected()
+    {
+      m_CqDisConnectedCount++;
+      Util.Log("MyCqStatusListener::OnCqDisconnected called");
+    }
+
+    public virtual void Clear()
+    {
+      Util.Log("MyCqStatusListener::Clear called");
+      m_eventCountBefore = 0;
+      m_errorCountBefore = 0;
+      m_eventCountAfter = 0;
+      m_errorCountAfter = 0;
+      m_CqConnectedCount = 0;
+      m_CqDisConnectedCount = 0;
+    }
+  }
+
+  [TestFixture]
+  [Category("group3")]
+  [Category("unicast_only")]
+  [Category("generics")]
+
+  public class ThinClientCqStatusTestTwoServers : ThinClientRegionSteps
+  {
+    #region Private members
+    private static bool m_usePdxObjects = false;
+    private UnitProcess m_client1;
+    private UnitProcess m_client2;
+    private static string[] QueryRegionNames = { "Portfolios", "Positions", "Portfolios2",
+      "Portfolios3" };
+    private static string QERegionName = "Portfolios";
+    private static string CqName = "MyCq";
+
+    private static string CqName1 = "testCQAllServersLeave";
+    private static string CqName2 = "testCQAllServersLeave1";
+
+    private static string CqQuery1 = "select * from /DistRegionAck";
+    private static string CqQuery2 = "select * from /DistRegionAck1";
+    //private static string CqName1 = "MyCq1";
+
+    #endregion
+
+    protected override ClientBase[] GetClients()
+    {
+      m_client1 = new UnitProcess();
+      m_client2 = new UnitProcess();
+      return new ClientBase[] { m_client1, m_client2 };
+    }
+
+    [TestFixtureSetUp]
+    public override void InitTests()
+    {
+      base.InitTests();
+      m_client1.Call(InitClient);
+      m_client2.Call(InitClient);
+    }
+
+    [TearDown]
+    public override void EndTest()
+    {
+      CacheHelper.StopJavaServers();
+      base.EndTest();
+    }
+
+
+    public void InitClient()
+    {
+      CacheHelper.Init();
+      try
+      {
+        CacheHelper.DCache.TypeRegistry.RegisterTypeGeneric(Portfolio.CreateDeserializable);
+        CacheHelper.DCache.TypeRegistry.RegisterTypeGeneric(Position.CreateDeserializable);
+      }
+      catch (IllegalStateException)
+      {
+        // ignore since we run multiple iterations for pool and non pool configs
+      }
+    }
+
+    public void CreateAndExecuteCQ_StatusListener(string poolName, string cqName, string cqQuery, int id)
+    {
+      var qs = CacheHelper.DCache.GetPoolManager().Find(poolName).GetQueryService();
+      CqAttributesFactory<object, object> cqFac = new CqAttributesFactory<object, object>();
+      cqFac.AddCqListener(new MyCqStatusListener<object, object>(id));
+      CqAttributes<object, object> cqAttr = cqFac.Create();
+      CqQuery<object, object> qry = qs.NewCq(cqName, cqQuery, cqAttr, false);
+      qry.Execute();
+      Thread.Sleep(18000); // sleep 0.3min to allow server c query to complete
+    }
+
+    public void CreateAndExecuteCQ_Listener(string poolName, string cqName, string cqQuery, int id)
+    {
+      var qs = CacheHelper.DCache.GetPoolManager().Find(poolName).GetQueryService();
+      CqAttributesFactory<object, object> cqFac = new CqAttributesFactory<object, object>();
+      cqFac.AddCqListener(new MyCqListener<object, object>(/*id*/));
+      CqAttributes<object, object> cqAttr = cqFac.Create();
+      CqQuery<object, object> qry = qs.NewCq(cqName, cqQuery, cqAttr, false);
+      qry.Execute();
+      Thread.Sleep(18000); // sleep 0.3min to allow server c query to complete
+    }
+
+    public void CheckCQStatusOnConnect(string poolName, string cqName, int onCqStatusConnect)
+    {
+      var qs = CacheHelper.DCache.GetPoolManager().Find(poolName).GetQueryService();
+      CqQuery<object, object> query = qs.GetCq<object, object>(cqName);
+      CqAttributes<object, object> cqAttr = query.GetCqAttributes();
+      ICqListener<object, object>[] vl = cqAttr.getCqListeners();
+      MyCqStatusListener<object, object> myCqStatusLstr = (MyCqStatusListener<object, object>)vl[0];
+      Util.Log("CheckCQStatusOnConnect = {0} ", myCqStatusLstr.getCqConnectedCount());
+      Assert.AreEqual(onCqStatusConnect, myCqStatusLstr.getCqConnectedCount());
+    }
+
+    public void CheckCQStatusOnDisConnect(string poolName, string cqName, int onCqStatusDisConnect)
+    {
+      var qs = CacheHelper.DCache.GetPoolManager().Find(poolName).GetQueryService();
+      CqQuery<object, object> query = qs.GetCq<object, object>(cqName);
+      CqAttributes<object, object> cqAttr = query.GetCqAttributes();
+      ICqListener<object, object>[] vl = cqAttr.getCqListeners();
+      MyCqStatusListener<object, object> myCqStatusLstr = (MyCqStatusListener<object, object>)vl[0];
+      Util.Log("CheckCQStatusOnDisConnect = {0} ", myCqStatusLstr.getCqDisConnectedCount());
+      Assert.AreEqual(onCqStatusDisConnect, myCqStatusLstr.getCqDisConnectedCount());
+    }
+
+    public void PutEntries(string regionName)
+    {
+      IRegion<object, object> region = CacheHelper.GetVerifyRegion<object, object>(regionName);
+      for (int i = 1; i <= 10; i++)
+      {
+        region["key-" + i] = "val-" + i;
+      }
+      Thread.Sleep(18000); // sleep 0.3min to allow server c query to complete
+    }
+
+    public void CheckCQStatusOnPutEvent(string poolName, string cqName, int onCreateCount)
+    {
+      var qs = CacheHelper.DCache.GetPoolManager().Find(poolName).GetQueryService();
+      CqQuery<object, object> query = qs.GetCq<object, object>(cqName);
+      CqAttributes<object, object> cqAttr = query.GetCqAttributes();
+      ICqListener<object, object>[] vl = cqAttr.getCqListeners();
+      MyCqStatusListener<object, object> myCqStatusLstr = (MyCqStatusListener<object, object>)vl[0];
+      Util.Log("CheckCQStatusOnPutEvent = {0} ", myCqStatusLstr.getEventCountBefore());
+      Assert.AreEqual(onCreateCount, myCqStatusLstr.getEventCountBefore());
+    }
+
+    public void CreateRegion(string locators, string servergroup, string regionName, string poolName)
+    {
+      CacheHelper.CreateTCRegion_Pool<object, object>(regionName, true, true,
+        null, locators, poolName, true, servergroup);
+    }
+
+    void runCqQueryStatusTestTwoServers()
+    {
+      CacheHelper.SetupJavaServers(true, "cacheserver_servergroup.xml", "cacheserver_servergroup2.xml");
+      CacheHelper.StartJavaLocator(1, "GFELOC");
+      Util.Log("Locator started");
+      CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
+      Util.Log("start server 1 complete.");
+      CacheHelper.StartJavaServerWithLocators(2, "GFECS2", 1);
+      Util.Log("start server 2 complete.");
+
+      m_client1.Call(CreateRegion, CacheHelper.Locators, "group1", "DistRegionAck", "__TESTPOOL1_");
+      Util.Log("CreateRegion DistRegionAck complete.");
+
+      m_client1.Call(CreateRegion, CacheHelper.Locators, "group2", "DistRegionAck1", "__TESTPOOL2_");
+      Util.Log("CreateRegion DistRegionAck1 complete.");
+
+      m_client1.Call(CreateAndExecuteCQ_StatusListener, "__TESTPOOL1_", CqName1, CqQuery1, 100);
+      Util.Log("CreateAndExecuteCQ1 complete.");
+
+      m_client1.Call(CreateAndExecuteCQ_StatusListener, "__TESTPOOL2_", CqName2, CqQuery2, 101);
+      Util.Log("CreateAndExecuteCQ2 complete.");
+
+      m_client1.Call(CheckCQStatusOnConnect, "__TESTPOOL1_", CqName1, 1);
+      Util.Log("CheckCQStatusOnConnect1 complete.");
+
+      m_client1.Call(CheckCQStatusOnConnect, "__TESTPOOL2_", CqName2, 1);
+      Util.Log("CheckCQStatusOnConnect2 complete.");
+
+      m_client1.Call(PutEntries, "DistRegionAck");
+      Util.Log("PutEntries1 complete.");
+
+      m_client1.Call(PutEntries, "DistRegionAck1");
+      Util.Log("PutEntries2 complete.");
+
+      m_client1.Call(CheckCQStatusOnPutEvent, "__TESTPOOL1_", CqName1, 10);
+      Util.Log("CheckCQStatusOnPutEvent complete.");
+
+      CacheHelper.StopJavaServer(1);
+      Util.Log("Cacheserver 1 stopped.");
+      Thread.Sleep(20000);
+
+      m_client1.Call(CheckCQStatusOnDisConnect, "__TESTPOOL1_", CqName1, 1);
+      Util.Log("CheckCQStatusOnDisConnect complete.");
+
+      CacheHelper.StopJavaServer(2);
+      Util.Log("Cacheserver 2 stopped.");
+      Thread.Sleep(20000);
+
+      m_client1.Call(CheckCQStatusOnDisConnect, "__TESTPOOL2_", CqName2, 1);
+      Util.Log("CheckCQStatusOnDisConnect complete.");
+
+      m_client1.Call(Close);
+
+      CacheHelper.StopJavaLocator(1);
+      Util.Log("Locator stopped");
+    }
+
+    [Test]
+    public void CqQueryStatusTestTwoServers()
+    {
+      runCqQueryStatusTestTwoServers();
+    }
+  }
+}
diff --git a/clicache/integration-test/ThinClientCqTestsN.cs b/clicache/integration-test/ThinClientCqTest.cs
similarity index 68%
rename from clicache/integration-test/ThinClientCqTestsN.cs
rename to clicache/integration-test/ThinClientCqTest.cs
index 039a4e3..b718be6 100644
--- a/clicache/integration-test/ThinClientCqTestsN.cs
+++ b/clicache/integration-test/ThinClientCqTest.cs
@@ -26,232 +26,230 @@ namespace Apache.Geode.Client.UnitTests
   using Apache.Geode.Client.Tests;
   using Apache.Geode.Client;
 
-  public class MyCqListener<TKey, TResult> : ICqListener<TKey, TResult>
+  [TestFixture]
+  [Category("group3")]
+  [Category("unicast_only")]
+  [Category("generics")]
+
+  public class ThinClientCqTest : ThinClientRegionSteps
   {
-    #region Private members
-    private bool m_failedOver = false;
-    private UInt32 m_eventCountBefore = 0;
-    private UInt32 m_errorCountBefore = 0;
-    private UInt32 m_eventCountAfter = 0;
-    private UInt32 m_errorCountAfter = 0;
+    public class MyCqListener<TKey, TResult> : ICqListener<TKey, TResult>
+    {
+      #region Private members
+      private bool m_failedOver = false;
+      private UInt32 m_eventCountBefore = 0;
+      private UInt32 m_errorCountBefore = 0;
+      private UInt32 m_eventCountAfter = 0;
+      private UInt32 m_errorCountAfter = 0;
 
-    #endregion
+      #endregion
 
-    #region Public accessors
+      #region Public accessors
 
-    public void failedOver()
-    {
-      m_failedOver = true;
-    }
-    public UInt32 getEventCountBefore()
-    {
-      return m_eventCountBefore;
-    }
-    public UInt32 getErrorCountBefore()
-    {
-      return m_errorCountBefore;
-    }
-    public UInt32 getEventCountAfter()
-    {
-      return m_eventCountAfter;
-    }
-    public UInt32 getErrorCountAfter()
-    {
-      return m_errorCountAfter;
-    }
-    #endregion
+      public void failedOver()
+      {
+        m_failedOver = true;
+      }
+      public UInt32 getEventCountBefore()
+      {
+        return m_eventCountBefore;
+      }
+      public UInt32 getErrorCountBefore()
+      {
+        return m_errorCountBefore;
+      }
+      public UInt32 getEventCountAfter()
+      {
+        return m_eventCountAfter;
+      }
+      public UInt32 getErrorCountAfter()
+      {
+        return m_errorCountAfter;
+      }
+      #endregion
 
-    public virtual void OnEvent(CqEvent<TKey, TResult> ev)
-    {
-      Util.Log("MyCqListener::OnEvent called");
-      if (m_failedOver == true)
-        m_eventCountAfter++;
-      else
-        m_eventCountBefore++;
-
-      //IGeodeSerializable val = ev.getNewValue();
-      //ICacheableKey key = ev.getKey();
-
-      TResult val = (TResult)ev.getNewValue();
-      /*ICacheableKey*/
-      TKey key = ev.getKey();
-
-      CqOperation opType = ev.getQueryOperation();
-      //CacheableString keyS = key as CacheableString;
-      string keyS = key.ToString(); //as string;
-      Portfolio pval = val as Portfolio;
-      PortfolioPdx pPdxVal = val as PortfolioPdx;
-      Assert.IsTrue((pPdxVal != null) || (pval != null));
-      //string opStr = "DESTROY";
-      /*if (opType == CqOperation.OP_TYPE_CREATE)
-        opStr = "CREATE";
-      else if (opType == CqOperation.OP_TYPE_UPDATE)
-        opStr = "UPDATE";*/
-
-      //Util.Log("key {0}, value ({1},{2}), op {3}.", keyS,
-      //  pval.ID, pval.Pkid, opStr);
-    }
-    public virtual void OnError(CqEvent<TKey, TResult> ev)
-    {
-      Util.Log("MyCqListener::OnError called");
-      if (m_failedOver == true)
-        m_errorCountAfter++;
-      else
-        m_errorCountBefore++;
-    }
-    public virtual void Close()
-    {
-      Util.Log("MyCqListener::close called");
-    }
-    public virtual void Clear()
-    {
-      Util.Log("MyCqListener::Clear called");
-      m_eventCountBefore = 0;
-      m_errorCountBefore = 0;
-      m_eventCountAfter = 0;
-      m_errorCountAfter = 0;
+      public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqListener::OnEvent called");
+        if (m_failedOver == true)
+          m_eventCountAfter++;
+        else
+          m_eventCountBefore++;
+
+        //IGeodeSerializable val = ev.getNewValue();
+        //ICacheableKey key = ev.getKey();
+
+        TResult val = (TResult)ev.getNewValue();
+        /*ICacheableKey*/
+        TKey key = ev.getKey();
+
+        CqOperation opType = ev.getQueryOperation();
+        //CacheableString keyS = key as CacheableString;
+        string keyS = key.ToString(); //as string;
+        Portfolio pval = val as Portfolio;
+        PortfolioPdx pPdxVal = val as PortfolioPdx;
+        Assert.IsTrue((pPdxVal != null) || (pval != null));
+        //string opStr = "DESTROY";
+        /*if (opType == CqOperation.OP_TYPE_CREATE)
+          opStr = "CREATE";
+        else if (opType == CqOperation.OP_TYPE_UPDATE)
+          opStr = "UPDATE";*/
+
+        //Util.Log("key {0}, value ({1},{2}), op {3}.", keyS,
+        //  pval.ID, pval.Pkid, opStr);
+      }
+      public virtual void OnError(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqListener::OnError called");
+        if (m_failedOver == true)
+          m_errorCountAfter++;
+        else
+          m_errorCountBefore++;
+      }
+      public virtual void Close()
+      {
+        Util.Log("MyCqListener::close called");
+      }
+      public virtual void Clear()
+      {
+        Util.Log("MyCqListener::Clear called");
+        m_eventCountBefore = 0;
+        m_errorCountBefore = 0;
+        m_eventCountAfter = 0;
+        m_errorCountAfter = 0;
+      }
     }
-  }
-
-  public class MyCqListener1<TKey, TResult> : ICqListener<TKey, TResult>
-  {
-    public static UInt32 m_cntEvents = 0;
 
-    public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+    public class MyCqListener1<TKey, TResult> : ICqListener<TKey, TResult>
     {
-      m_cntEvents++;
-      Util.Log("MyCqListener1::OnEvent called");
-      Object val = (Object)ev.getNewValue();
-      Object pkey = (Object)ev.getKey();
-      int value = (int)val;
-      int key = (int)pkey;
-      CqOperation opType = ev.getQueryOperation();
-      String opStr = "Default";
-      if (opType == CqOperation.OP_TYPE_CREATE)
-        opStr = "CREATE";
-      else if (opType == CqOperation.OP_TYPE_UPDATE)
-        opStr = "UPDATE";
-
-      Util.Log("MyCqListener1::OnEvent called with {0} , key = {1}, value = {2} ",
-      opStr, key, value);
-    }
-    public virtual void OnError(CqEvent<TKey, TResult> ev)
-    {
-      Util.Log("MyCqListener1::OnError called");
-    }
-    public virtual void Close()
-    {
-      Util.Log("MyCqListener1::close called");
-    }
-  } 
-   
+      public static UInt32 m_cntEvents = 0;
 
+      public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+      {
+        m_cntEvents++;
+        Util.Log("MyCqListener1::OnEvent called");
+        Object val = (Object)ev.getNewValue();
+        Object pkey = (Object)ev.getKey();
+        int value = (int)val;
+        int key = (int)pkey;
+        CqOperation opType = ev.getQueryOperation();
+        String opStr = "Default";
+        if (opType == CqOperation.OP_TYPE_CREATE)
+          opStr = "CREATE";
+        else if (opType == CqOperation.OP_TYPE_UPDATE)
+          opStr = "UPDATE";
+
+        Util.Log("MyCqListener1::OnEvent called with {0} , key = {1}, value = {2} ",
+        opStr, key, value);
+      }
+      public virtual void OnError(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqListener1::OnError called");
+      }
+      public virtual void Close()
+      {
+        Util.Log("MyCqListener1::close called");
+      }
+    }
 
-  public class MyCqStatusListener<TKey, TResult> : ICqStatusListener<TKey, TResult>
-  {
-    #region Private members
-    private bool m_failedOver = false;
-    private UInt32 m_eventCountBefore = 0;
-    private UInt32 m_errorCountBefore = 0;
-    private UInt32 m_eventCountAfter = 0;
-    private UInt32 m_errorCountAfter = 0;
-    private UInt32 m_CqConnectedCount = 0;
-    private UInt32 m_CqDisConnectedCount = 0;
+    public class MyCqStatusListener<TKey, TResult> : ICqStatusListener<TKey, TResult>
+    {
+      #region Private members
+      private bool m_failedOver = false;
+      private UInt32 m_eventCountBefore = 0;
+      private UInt32 m_errorCountBefore = 0;
+      private UInt32 m_eventCountAfter = 0;
+      private UInt32 m_errorCountAfter = 0;
+      private UInt32 m_CqConnectedCount = 0;
+      private UInt32 m_CqDisConnectedCount = 0;
 
-    #endregion
+      #endregion
 
-    #region Public accessors
+      #region Public accessors
 
-    public MyCqStatusListener(int id)
-    {
-    }
+      public MyCqStatusListener(int id)
+      {
+      }
 
-    public void failedOver()
-    {
-      m_failedOver = true;
-    }
-    public UInt32 getEventCountBefore()
-    {
-      return m_eventCountBefore;
-    }
-    public UInt32 getErrorCountBefore()
-    {
-      return m_errorCountBefore;
-    }
-    public UInt32 getEventCountAfter()
-    {
-      return m_eventCountAfter;
-    }
-    public UInt32 getErrorCountAfter()
-    {
-      return m_errorCountAfter;
-    }
-    public UInt32 getCqConnectedCount()
-    {
-      return m_CqConnectedCount;
-    }
-    public UInt32 getCqDisConnectedCount()
-    {
-      return m_CqDisConnectedCount;
-    }
-    #endregion
+      public void failedOver()
+      {
+        m_failedOver = true;
+      }
+      public UInt32 getEventCountBefore()
+      {
+        return m_eventCountBefore;
+      }
+      public UInt32 getErrorCountBefore()
+      {
+        return m_errorCountBefore;
+      }
+      public UInt32 getEventCountAfter()
+      {
+        return m_eventCountAfter;
+      }
+      public UInt32 getErrorCountAfter()
+      {
+        return m_errorCountAfter;
+      }
+      public UInt32 getCqConnectedCount()
+      {
+        return m_CqConnectedCount;
+      }
+      public UInt32 getCqDisConnectedCount()
+      {
+        return m_CqDisConnectedCount;
+      }
+      #endregion
 
-    public virtual void OnEvent(CqEvent<TKey, TResult> ev)
-    {
-      Util.Log("MyCqStatusListener::OnEvent called");
-      if (m_failedOver == true)
-        m_eventCountAfter++;
-      else
-        m_eventCountBefore++;      
+      public virtual void OnEvent(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqStatusListener::OnEvent called");
+        if (m_failedOver == true)
+          m_eventCountAfter++;
+        else
+          m_eventCountBefore++;
 
-      TResult val = (TResult)ev.getNewValue();      
-      TKey key = ev.getKey();
+        TResult val = (TResult)ev.getNewValue();
+        TKey key = ev.getKey();
 
-      CqOperation opType = ev.getQueryOperation();      
-      string keyS = key.ToString(); //as string;      
-    }
-    public virtual void OnError(CqEvent<TKey, TResult> ev)
-    {
-      Util.Log("MyCqStatusListener::OnError called");
-      if (m_failedOver == true)
-        m_errorCountAfter++;
-      else
-        m_errorCountBefore++;
-    }
-    public virtual void Close()
-    {
-      Util.Log("MyCqStatusListener::close called");
-    }
-    public virtual void OnCqConnected()
-    {
-      m_CqConnectedCount++;
-      Util.Log("MyCqStatusListener::OnCqConnected called");
-    }
-    public virtual void OnCqDisconnected()
-    {
-      m_CqDisConnectedCount++;
-      Util.Log("MyCqStatusListener::OnCqDisconnected called");
-    }
+        CqOperation opType = ev.getQueryOperation();
+        string keyS = key.ToString(); //as string;      
+      }
+      public virtual void OnError(CqEvent<TKey, TResult> ev)
+      {
+        Util.Log("MyCqStatusListener::OnError called");
+        if (m_failedOver == true)
+          m_errorCountAfter++;
+        else
+          m_errorCountBefore++;
+      }
+      public virtual void Close()
+      {
+        Util.Log("MyCqStatusListener::close called");
+      }
+      public virtual void OnCqConnected()
+      {
+        m_CqConnectedCount++;
+        Util.Log("MyCqStatusListener::OnCqConnected called");
+      }
+      public virtual void OnCqDisconnected()
+      {
+        m_CqDisConnectedCount++;
+        Util.Log("MyCqStatusListener::OnCqDisconnected called");
+      }
 
-    public virtual void Clear()
-    {
-      Util.Log("MyCqStatusListener::Clear called");
-      m_eventCountBefore = 0;
-      m_errorCountBefore = 0;
-      m_eventCountAfter = 0;
-      m_errorCountAfter = 0;
-      m_CqConnectedCount = 0;
-      m_CqDisConnectedCount = 0;
+      public virtual void Clear()
+      {
+        Util.Log("MyCqStatusListener::Clear called");
+        m_eventCountBefore = 0;
+        m_errorCountBefore = 0;
+        m_eventCountAfter = 0;
+        m_errorCountAfter = 0;
+        m_CqConnectedCount = 0;
+        m_CqDisConnectedCount = 0;
+      }
     }
-  }
-
-  [TestFixture]
-  [Category("group3")]
-  [Category("unicast_only")]
-  [Category("generics")]
 
-  public class ThinClientCqTests : ThinClientRegionSteps
-  {
     #region Private members
     private static bool m_usePdxObjects = false;
     private UnitProcess m_client1;
@@ -823,192 +821,10 @@ namespace Apache.Geode.Client.UnitTests
       Util.Log("Locator stopped");
     }
 
-    void runCqQueryStatusTest()
-    {
-      CacheHelper.SetupJavaServers(true, "cacheserver.xml", "cacheserver2.xml");
-      CacheHelper.StartJavaLocator(1, "GFELOC");
-      Util.Log("Locator started");
-      CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
-      Util.Log("Cacheserver 1 started.");
-
-      m_client1.Call(StepOne, CacheHelper.Locators);
-      Util.Log("StepOne complete.");
-
-      m_client1.Call(CreateAndExecuteCQ_StatusListener, "__TESTPOOL1_", CqName1, CqQuery1, 100);
-      Util.Log("CreateAndExecuteCQ complete.");
-
-      m_client1.Call(CheckCQStatusOnConnect, "__TESTPOOL1_", CqName1, 1);
-      Util.Log("CheckCQStatusOnConnect complete.");
-
-      m_client1.Call(PutEntries, "DistRegionAck");
-      Util.Log("PutEntries complete.");
-
-      m_client1.Call(CheckCQStatusOnPutEvent, "__TESTPOOL1_", CqName1, 10);
-      Util.Log("CheckCQStatusOnPutEvent complete.");
-
-      CacheHelper.SetupJavaServers(true, "cacheserver.xml", "cacheserver2.xml");
-      CacheHelper.StartJavaServerWithLocators(2, "GFECS2", 1);
-      Util.Log("start server 2 complete.");
-
-      Thread.Sleep(20000);
-      CacheHelper.StopJavaServer(1);
-      Util.Log("Cacheserver 1 stopped.");
-      Thread.Sleep(20000);
-      m_client1.Call(CheckCQStatusOnDisConnect, "__TESTPOOL1_", CqName1, 0);
-      Util.Log("CheckCQStatusOnDisConnect complete.");
-
-      CacheHelper.StopJavaServer(2);
-      Util.Log("Cacheserver 2 stopped.");
-      Thread.Sleep(20000);
-      m_client1.Call(CheckCQStatusOnDisConnect, "__TESTPOOL1_", CqName1, 1);
-      Util.Log("CheckCQStatusOnDisConnect complete.");
-
-      CacheHelper.SetupJavaServers(true, "cacheserver.xml", "cacheserver2.xml");
-      CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
-      Util.Log("Cacheserver 1 started.");
-      Thread.Sleep(20000);
-
-      m_client1.Call(CheckCQStatusOnConnect, "__TESTPOOL1_", CqName1, 2);
-      Util.Log("CheckCQStatusOnConnect complete.");
-
-      CacheHelper.StopJavaServer(1);
-      Util.Log("Cacheserver 1 stopped.");
-      Thread.Sleep(20000);
-
-      m_client1.Call(CheckCQStatusOnDisConnect, "__TESTPOOL1_", CqName1, 2);
-      Util.Log("CheckCQStatusOnDisConnect complete.");
-
-      m_client1.Call(Close);
-
-      CacheHelper.StopJavaLocator(1);
-      Util.Log("Locator stopped");
-    }
-
-    void runCqQueryStatusTest2()
-    {
-      CacheHelper.SetupJavaServers(true, "cacheserver_servergroup.xml", "cacheserver_servergroup2.xml");
-      CacheHelper.StartJavaLocator(1, "GFELOC");
-      Util.Log("Locator started");
-      CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
-      Util.Log("start server 1 complete.");
-      CacheHelper.StartJavaServerWithLocators(2, "GFECS2", 1);
-      Util.Log("start server 2 complete.");
-
-      m_client1.Call(CreateRegion, CacheHelper.Locators, "group1", "DistRegionAck", "__TESTPOOL1_");
-      Util.Log("CreateRegion DistRegionAck complete.");
-
-      m_client1.Call(CreateRegion, CacheHelper.Locators, "group2", "DistRegionAck1", "__TESTPOOL2_");
-      Util.Log("CreateRegion DistRegionAck1 complete.");
-
-      m_client1.Call(CreateAndExecuteCQ_StatusListener, "__TESTPOOL1_", CqName1, CqQuery1, 100);
-      Util.Log("CreateAndExecuteCQ1 complete.");
-
-      m_client1.Call(CreateAndExecuteCQ_StatusListener, "__TESTPOOL2_", CqName2, CqQuery2, 101);
-      Util.Log("CreateAndExecuteCQ2 complete.");
-
-      m_client1.Call(CheckCQStatusOnConnect, "__TESTPOOL1_", CqName1, 1);
-      Util.Log("CheckCQStatusOnConnect1 complete.");
-
-      m_client1.Call(CheckCQStatusOnConnect, "__TESTPOOL2_", CqName2, 1);
-      Util.Log("CheckCQStatusOnConnect2 complete.");
-
-      m_client1.Call(PutEntries, "DistRegionAck");
-      Util.Log("PutEntries1 complete.");
-
-      m_client1.Call(PutEntries, "DistRegionAck1");
-      Util.Log("PutEntries2 complete.");
-
-      m_client1.Call(CheckCQStatusOnPutEvent, "__TESTPOOL1_", CqName1, 10);
-      Util.Log("CheckCQStatusOnPutEvent complete.");
-      
-      CacheHelper.StopJavaServer(1);
-      Util.Log("Cacheserver 1 stopped.");
-      Thread.Sleep(20000);
-
-      m_client1.Call(CheckCQStatusOnDisConnect, "__TESTPOOL1_", CqName1, 1);
-      Util.Log("CheckCQStatusOnDisConnect complete.");
-
-      CacheHelper.StopJavaServer(2);
-      Util.Log("Cacheserver 2 stopped.");
-      Thread.Sleep(20000);
-
-      m_client1.Call(CheckCQStatusOnDisConnect, "__TESTPOOL2_", CqName2, 1);
-      Util.Log("CheckCQStatusOnDisConnect complete.");
-
-      m_client1.Call(Close);
-
-      CacheHelper.StopJavaLocator(1);
-      Util.Log("Locator stopped");
-    }
-
-    void runCqQueryStatusTest3()
-    {
-      CacheHelper.SetupJavaServers(true, "remotequeryN.xml");
-      CacheHelper.StartJavaLocator(1, "GFELOC");
-      Util.Log("Locator started");
-      CacheHelper.StartJavaServerWithLocators(1, "GFECS1", 1);
-      Util.Log("Cacheserver 1 started.");
-
-      m_client1.Call(ProcessCQ, CacheHelper.Locators);
-      Util.Log("ProcessCQ complete.");
-
-      m_client1.Call(Close);
-
-      CacheHelper.StopJavaServer(1);
-      Util.Log("Cacheserver 1 stopped.");
-
-      CacheHelper.StopJavaLocator(1);
-      Util.Log("Locator stopped");
-    }
-
     [Test]
     public void CqQueryTest()
     {
       runCqQueryTest();
     }
-
-    [Test]
-    public void CqQueryPdxTest()
-    {
-      m_usePdxObjects = true;
-      runCqQueryTest();
-      m_usePdxObjects = false;
-    }
-
-    // [Test]
-    // public void CqFailover()
-    // {
-    //  try
-    //  {
-    //   m_client1.Call(StepOneFailover);
-    //    Util.Log("StepOneFailover complete.");
-    //
-    //       m_client1.Call(StepTwoFailover);
-    //      Util.Log("StepTwoFailover complete.");
-    //    }
-    //    finally
-    //   {
-    //     m_client1.Call(CacheHelper.StopJavaServers);
-    //  }
-    //  }
-
-    [Test]
-    public void CqQueryStatusTest()
-    {
-      runCqQueryStatusTest();
-    }
-
-    [Test]
-    public void CqQueryStatusTest2()
-    {
-      runCqQueryStatusTest2();
-    }
-
-    [Test]
-    public void CqQueryStatusTest3()
-    {
-      runCqQueryStatusTest3();
-    }
-
   }
 }
diff --git a/clicache/integration-test/UnitTests.csproj.in b/clicache/integration-test/UnitTests.csproj.in
index f0360e4..5e2c522 100644
--- a/clicache/integration-test/UnitTests.csproj.in
+++ b/clicache/integration-test/UnitTests.csproj.in
@@ -217,7 +217,11 @@
     <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\SerializationTestsN.cs" />
     <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\ThinClientConflationTestsN.cs" />
     <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\ThinClientCqIRTestsN.cs" />
-    <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\ThinClientCqTestsN.cs" />
+    <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\ThinClientCqPdxTest.cs" />
+    <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\ThinClientCqAttributesMutatorTests.cs" />
+    <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\ThinClientCqTest.cs" />
+    <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\ThinClientCqStatusTest.cs" />
+    <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\ThinClientCqStatusTestTwoServers.cs" />
     <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\ThinClientStringArrayTestsN.cs" />
     <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\ThinClientCSTXN.cs" />
     <Compile Include="$(CMAKE_CURRENT_SOURCE_DIR)\ThinClientDeltaTestN.cs" />
diff --git a/clicache/src/CqAttributesMutator.hpp b/clicache/src/CqAttributesMutator.hpp
index f7c29e4..ed9e3da 100644
--- a/clicache/src/CqAttributesMutator.hpp
+++ b/clicache/src/CqAttributesMutator.hpp
@@ -23,7 +23,7 @@
 #include "end_native.hpp"
 
 #include "native_shared_ptr.hpp"
-#include "native_conditional_unique_ptr.hpp"
+#include "native_unique_ptr.hpp"
 
 using namespace System;
 using namespace System::Collections::Generic;
@@ -105,10 +105,10 @@ namespace Apache
         /// <param name="nativeptr">The native object pointer</param>
         inline CqAttributesMutator<TKey, TResult>(native::CqAttributesMutator* nativeptr)
         {
-            m_nativeptr = gcnew native_conditional_unique_ptr<native::CqAttributesMutator>(nativeptr);
+            m_nativeptr = gcnew native_unique_ptr<native::CqAttributesMutator>(nativeptr);
         }
 
-        native_conditional_unique_ptr<native::CqAttributesMutator>^ m_nativeptr;
+        native_unique_ptr<native::CqAttributesMutator>^ m_nativeptr;
       };
     }  // namespace Client
   }  // namespace Geode
diff --git a/clicache/src/CqQuery.cpp b/clicache/src/CqQuery.cpp
index d1a67c8..f3aba04 100644
--- a/clicache/src/CqQuery.cpp
+++ b/clicache/src/CqQuery.cpp
@@ -141,7 +141,8 @@ namespace Apache
       {
         try
         {
-          return CqAttributesMutator<TKey, TResult>::Create(&(m_nativeptr->get()->getCqAttributesMutator()));
+          return CqAttributesMutator<TKey, TResult>::Create(
+            new native::CqAttributesMutator(m_nativeptr->get()->getCqAttributesMutator()));
         }
         finally
         {

-- 
To stop receiving notification emails like this one, please contact
jbarrett@apache.org.