public void DoGets()

in clicache/integration-test/ThinClientRegionStepsN.cs [531:663]


    public void DoGets(int numOps, bool useNewVal, ExpectedResult expect, Client.Properties<string, string> credential, bool isMultiuser)
    {
      string valPrefix = (useNewVal ? NValuePrefix : ValuePrefix);
      IRegion<object, object> region;
      CacheHelper.DCache.TypeRegistry.RegisterPdxType(PdxTests.PdxTypes1.CreateDeserializable);
      CacheHelper.DCache.TypeRegistry.RegisterPdxType(PdxTests.PdxTypes8.CreateDeserializable);
      if (isMultiuser)
      {
        region = CacheHelper.GetVerifyRegion<object, object>(RegionName, credential);
      }
      else
      {
        region = CacheHelper.GetVerifyRegion<object, object>(RegionName);
      }

      for (int index = 1; index <= numOps; ++index)
      {
        try
        {
          region.GetLocalView().Invalidate(index + "_pdxputall81");
          region.GetLocalView().Invalidate(index + "_pdxputall82");
        }
        catch (Exception )
        { }
      }
      
      if (expect == ExpectedResult.Success)
      {
        for (int index = 1; index <= numOps; ++index)
        {
          object ret1 = region[index + "_pdxputall81"];
          object ret2 = region[index + "_pdxputall82"];

          Assert.IsTrue(ret1 != null && ret1 is PdxTests.PdxTypes8);
          Assert.IsTrue(ret1 != null && ret2 is PdxTests.PdxTypes8);
        }
      }

      for (int index = 1; index <= numOps; ++index)
      {
        try
        {
          region.GetLocalView().Invalidate(index + "_pdxputall81");
          region.GetLocalView().Invalidate(index + "_pdxputall82");
        }
        catch (Exception )
        { }
      }

      if (expect == ExpectedResult.Success)
      {
        for (int index = 1; index <= numOps; ++index)
        {
          ICollection<object> pdxKeys = new List<object>();
          pdxKeys.Add(index + "_pdxputall81");
          pdxKeys.Add(index + "_pdxputall82");
          IDictionary<object, object> getall = new Dictionary<object, object>();
          region.GetAll(pdxKeys, getall, null);

          Assert.AreEqual(2, getall.Count);
        }
      }

      for (int index = 1; index <= numOps; ++index)
      {
        string key = KeyPrefix + index;
        try
        {
          region.GetLocalView().Invalidate(key);
        }
        catch (Exception)
        {
          // ignore exception if key is not found in the region
        }
        Object value = null;
        try
        {
          value = region[key];
          Object retPdx = region[index];

          Assert.IsTrue(retPdx != null && retPdx is PdxTests.PdxTypes8);
          if (expect != ExpectedResult.Success)
          {
            Assert.Fail("DoGets: Expected an exception in get");
          }
        }
        catch (AssertionException)
        {
          throw;
        }
        catch (NotAuthorizedException ex)
        {
          if (expect == ExpectedResult.NotAuthorizedException)
          {
            Util.Log("DoGets: got expected unauthorized exception: " +
              ex.GetType() + "::" + ex.Message);
            continue;
          }
          else
          {
            Assert.Fail("DoGets: unexpected unauthorized exception caught: " +
              ex);
          }
        }
        catch (AuthenticationFailedException ex)
        {
          if (expect == ExpectedResult.AuthFailedException)
          {
            Util.Log("DoPuts: got expected authentication Failed exception: " +
              ex.GetType() + "::" + ex.Message);
          }
          else
          {
            Assert.Fail("DoPuts: unexpected exception caught: " + ex);
          }
        }
        catch (Exception ex)
        {
          if (expect == ExpectedResult.OtherException)
          {
            Util.Log("DoGets: got expected exception: " +
              ex.GetType() + "::" + ex.Message);
            continue;
          }
          else
          {
            Assert.Fail("DoGets: unexpected exception caught: " + ex);
          }
        }
        Assert.IsNotNull(value);
        Assert.AreEqual(valPrefix + index, value.ToString());
      }
    }