示例#1
0
        public void OnServerHAStepOne()
        {
            Region region = CacheHelper.GetVerifyRegion <object, object>(QERegionName);

            for (int i = 0; i < 34; i++)
            {
                region["KEY--" + i] = "VALUE--" + i;
            }

            object[] routingObj = new object[17];

            ArrayList args1 = new ArrayList();

            int j = 0;

            for (int i = 0; i < 34; i++)
            {
                if (i % 2 == 0)
                {
                    continue;
                }
                routingObj[j] = "KEY--" + i;
                j++;
            }
            Util.Log("routingObj count= {0}.", routingObj.Length);

            for (int i = 0; i < routingObj.Length; i++)
            {
                Console.WriteLine("routingObj[{0}]={1}.", i, (string)routingObj[i]);
                args1.Add(routingObj[i]);
            }

            //test data independant function execution with result onServer
            Pool /*<TKey, TValue>*/ pool = CacheHelper.DCache.GetPoolManager().Find(poolName);

            Apache.Geode.Client.Execution <object> exc = FunctionService <object> .OnServer(pool);

            Assert.IsTrue(exc != null, "onServer Returned NULL");

            IResultCollector <object> rc = exc.WithArgs <ArrayList>(args1).Execute(OnServerHAExceptionFunction, TimeSpan.FromSeconds(15));

            ICollection <object> executeFunctionResult = rc.GetResult();

            List <object> resultList = new List <object>();

            Console.WriteLine("executeFunctionResult.Length = {0}", executeFunctionResult.Count);

            foreach (List <object> item in executeFunctionResult)
            {
                foreach (object item2 in item)
                {
                    resultList.Add(item2);
                }
            }

            Util.Log("on region: result count= {0}.", resultList.Count);
            Assert.IsTrue(resultList.Count == 17, "result count check failed");
            for (int i = 0; i < resultList.Count; i++)
            {
                Util.Log("on region:get:result[{0}]={1}.", i, (string)resultList[i]);
                Assert.IsTrue(((string)resultList[i]) != null, "onServer Returned NULL");
            }

            rc = exc.WithArgs <ArrayList>(args1).Execute(OnServerHAShutdownFunction, TimeSpan.FromSeconds(15));

            ICollection <object> executeFunctionResult1 = rc.GetResult();

            List <object> resultList1 = new List <object>();

            foreach (List <object> item in executeFunctionResult1)
            {
                foreach (object item2 in item)
                {
                    resultList1.Add(item2);
                }
            }

            Util.Log("on region: result count= {0}.", resultList1.Count);

            Console.WriteLine("resultList1.Count = {0}", resultList1.Count);

            Assert.IsTrue(resultList1.Count == 17, "result count check failed");
            for (int i = 0; i < resultList1.Count; i++)
            {
                Util.Log("on region:get:result[{0}]={1}.", i, (string)resultList1[i]);
                Assert.IsTrue(((string)resultList1[i]) != null, "onServer Returned NULL");
            }

            // Bring down the region
            //region.LocalDestroyRegion();
        }
示例#2
0
        public void DoPRSHTradeResolverTasks(string rname)
        {
            Util.Log("DoPRSHTradeResolverTasks rname = {0} ", rname);
            IRegion <TradeKey, Object> region = CacheHelper.GetRegion <TradeKey, Object>(rname);
            int nonSingleHopCount = 0, metadatarefreshCount = 0;
            int nonSingleHopCount1 = 0, metadatarefreshCount1 = 0;

            Assert.IsNotNull(region, "DoPRSHTradeResolverTasks: null region.");
            for (int i = 0; i < 1000; i++)
            {
                try
                {
                    region[new TradeKey(i)] = "Value" + i;
                    Util.Log("Put inside DoPRSHTradeResolverTasks successfull ");
                }
                catch (CacheServerException ex)
                {
                    Util.Log("CPPTEST: Put caused networkhop");
                    Assert.Fail("Got CacheServerException (0}", ex.Message);
                }
                catch (CacheWriterException ex)
                {
                    Util.Log("CPPTEST: Put caused networkhop");
                    Assert.Fail("Got CacheWriterException (0}", ex.Message);
                }
                catch (Exception ex)
                {
                    Util.Log("CPPTEST: Put caused networkhop");
                    Assert.Fail("Got Exception (0}", ex.Message);
                }
            }
            StatisticsFactory factory = StatisticsFactory.GetExistingInstance();
            StatisticsType    type    = factory.FindType("RegionStatistics");

            if (type != null)
            {
                Statistics rStats = factory.FindFirstStatisticsByType(type);
                if (rStats != null)
                {
                    nonSingleHopCount    = rStats.GetInt((string)"nonSingleHopCount");
                    metadatarefreshCount = rStats.GetInt((string)"metaDataRefreshCount");
                }
            }
            Util.Log("nonSingleHopCount = {0} & metadatarefreshCount = {1} ", nonSingleHopCount, metadatarefreshCount);
            Assert.GreaterOrEqual(nonSingleHopCount, 1, "nonSingleHopCount should be GreaterOrEqual to 1");
            Assert.GreaterOrEqual(metadatarefreshCount, 1, "metadatarefreshCount should be equal to 1");

            Util.Log("DoPRSHTradeResolverTasks WarmUp Task completed.");

            for (int i = 1000; i < 2000; i++)
            {
                try
                {
                    region[new TradeKey(i)] = "Value" + i;
                    Util.Log("Put inside DoPRSHTradeResolverTasks successfull");
                }
                catch (CacheServerException ex)
                {
                    Util.Log("CPPTEST: Put caused networkhop");
                    Assert.Fail("Got CacheServerException (0}", ex.Message);
                }
                catch (CacheWriterException ex)
                {
                    Util.Log("CPPTEST: Put caused networkhop");
                    Assert.Fail("Got CacheWriterException (0}", ex.Message);
                }
                catch (Exception ex)
                {
                    Util.Log("CPPTEST: Put caused networkhop");
                    Assert.Fail("Got Exception (0}", ex.Message);
                }

                try
                {
                    Object val = region[new TradeKey(i)];
                    Util.Log("Get inside DoPRSHTradeResolverTasks successfull ");
                }
                catch (CacheServerException ex)
                {
                    Util.Log("CPPTEST: Get caused networkhop");
                    Assert.Fail("Got CacheServerException (0}", ex.Message);
                }
                catch (CacheWriterException ex)
                {
                    Util.Log("CPPTEST: Get caused networkhop");
                    Assert.Fail("Got CacheWriterException (0}", ex.Message);
                }
                catch (Exception ex)
                {
                    Util.Log("CPPTEST: Get caused networkhop");
                    Assert.Fail("Got Exception (0}", ex.Message);
                }

                try
                {
                    region.Remove(new TradeKey(i)); //Destroy() replaced by Remove
                    Util.Log("Destroy inside DoPRSHTradeResolverTasks successfull ");
                }
                catch (CacheServerException ex)
                {
                    Util.Log("CPPTEST: Destroy caused networkhop");
                    Assert.Fail("Got CacheServerException (0}", ex.Message);
                }
                catch (CacheWriterException ex)
                {
                    Util.Log("CPPTEST: Destroy caused networkhop");
                    Assert.Fail("Got CacheWriterException (0}", ex.Message);
                }
                catch (Exception ex)
                {
                    Util.Log("CPPTEST: Destroy caused networkhop");
                    Assert.Fail("Got Exception (0}", ex.Message);
                }
            }
            if (type != null)
            {
                Statistics rStats = factory.FindFirstStatisticsByType(type);
                if (rStats != null)
                {
                    nonSingleHopCount1    = rStats.GetInt((string)"nonSingleHopCount");
                    metadatarefreshCount1 = rStats.GetInt((string)"metaDataRefreshCount");
                    Util.Log("nonSingleHopCount1 = {0} & metadatarefreshCount1 = {1} ", nonSingleHopCount1, metadatarefreshCount1);
                    //Assert.AreEqual(nonSingleHopCount1, nonSingleHopCount, "nonSingleHopCount1 should be equal to nonSingleHopCount");
                    Assert.AreEqual(metadatarefreshCount1, metadatarefreshCount, "metadatarefreshCount1 should be equal to metadatarefreshCount");
                }
            }

            Util.Log("Executing onRegion FE with custom key and custom partitionResolver");
            Apache.Geode.Client.Execution <object> exc = Client.FunctionService <object> .OnRegion <TradeKey, object>(region);

            Assert.IsTrue(exc != null, "onRegion Returned NULL");

            TradeKey[] filter = new TradeKey[901];
            int        j      = 0;

            for (int i = 100; i < 1001; i++)
            {
                filter[j] = new TradeKey(i);
                j++;
            }
            Util.Log("filter count= {0}.", filter.Length);

            Client.IResultCollector <object> rc = exc.WithFilter <TradeKey>(filter).Execute(FEOnRegionPrSHOP_OptimizeForWrite, 15);
            Util.Log("FEOnRegionPrSHOP_OptimizeForWrite executed");
            ICollection <object> executeFunctionResult = rc.GetResult();

            Util.Log("OnRegionPrSHOP for filter executeFunctionResult.Count = {0} ", executeFunctionResult.Count);
            Assert.AreEqual(3, executeFunctionResult.Count, "executeFunctionResult count check failed");
            foreach (Boolean item in executeFunctionResult)
            {
                Util.Log("on region:FEOnRegionPrSHOP:= {0}.", item);
                Assert.AreEqual(true, item, "FEOnRegionPrSHOP item not true");
            }
            Util.Log("FEOnRegionPrSHOP_OptimizeForWrite done");

            rc = exc.WithFilter <TradeKey>(filter).Execute(FEOnRegionPrSHOP, 15);
            Util.Log("FEOnRegionPrSHOP executed");
            executeFunctionResult = rc.GetResult();
            Util.Log("OnRegionPrSHOP for filter executeFunctionResult.Count = {0} ", executeFunctionResult.Count);
            Assert.AreEqual(3, executeFunctionResult.Count, "executeFunctionResult count check failed");
            foreach (Boolean item in executeFunctionResult)
            {
                Util.Log("on region:FEOnRegionPrSHOP:= {0}.", item);
                Assert.AreEqual(true, item, "FEOnRegionPrSHOP item not true");
            }
            Util.Log("FEOnRegionPrSHOP done");

            object args = true;

            rc = exc.WithFilter <TradeKey>(filter).Execute(getFuncName);
            executeFunctionResult = rc.GetResult();

            Util.Log("ExecuteFunctionOnRegion for filter executeFunctionResult.Count = {0} ", executeFunctionResult.Count);

            List <object> resultList = new List <object>();

            foreach (List <object> item in executeFunctionResult)
            {
                foreach (object item2 in item)
                {
                    resultList.Add(item2);
                }
            }

            Util.Log("on region: result count= {0}.", resultList.Count);
            Assert.AreEqual(1802, resultList.Count, "result count check failed");
            for (int i = 0; i < resultList.Count; i++)
            {
                Util.Log("on region:get:= {0}.", resultList[i]);
            }
        }
示例#3
0
        protected void DoOp(OperationCode op, int[] indices,
                            OpFlags flags, ExpectedResult expectedResult, Properties <string, string> creds, bool isMultiuser)
        {
            IRegion <object, object> region;

            if (isMultiuser)
            {
                region = CacheHelper.GetRegion <object, object>(RegionName, creds);
            }
            else
            {
                region = CacheHelper.GetRegion <object, object>(RegionName);
            }

            if (CheckFlags(flags, OpFlags.UseSubRegion))
            {
                IRegion <object, object> subregion = null;
                if (CheckFlags(flags, OpFlags.NoCreateSubRegion))
                {
                    subregion = region.GetSubRegion(SubregionName);
                    if (CheckFlags(flags, OpFlags.CheckNoRegion))
                    {
                        Assert.IsNull(subregion);
                        return;
                    }
                    else
                    {
                        Assert.IsNotNull(subregion);
                    }
                }
                else
                {
                    subregion = CreateSubregion(region);
                    if (isMultiuser)
                    {
                        subregion = region.GetSubRegion(SubregionName);
                    }
                }
                Assert.IsNotNull(subregion);
                region = subregion;
            }
            else if (CheckFlags(flags, OpFlags.CheckNoRegion))
            {
                Assert.IsNull(region);
                return;
            }
            else
            {
                Assert.IsNotNull(region);
            }
            string valPrefix;

            if (CheckFlags(flags, OpFlags.UseNewVal))
            {
                valPrefix = NValuePrefix;
            }
            else
            {
                valPrefix = ValuePrefix;
            }
            int numOps = indices.Length;

            Util.Log("Got DoOp for op: " + op + ", numOps: " + numOps
                     + ", indices: " + IndicesToString(indices));
            bool exceptionOccured = false;
            bool breakLoop        = false;

            for (int indexIndex = 0; indexIndex < indices.Length; ++indexIndex)
            {
                if (breakLoop)
                {
                    break;
                }
                int    index         = indices[indexIndex];
                string key           = KeyPrefix + index;
                string expectedValue = (valPrefix + index);
                try
                {
                    switch (op)
                    {
                    case OperationCode.Get:
                        Object value = null;
                        if (CheckFlags(flags, OpFlags.LocalOp))
                        {
                            int  sleepMillis = 100;
                            int  numTries    = 30;
                            bool success     = false;
                            while (!success && numTries-- > 0)
                            {
                                if (!isMultiuser && region.ContainsValueForKey(key))
                                {
                                    value   = region[key];
                                    success = expectedValue.Equals(value.ToString());
                                    if (CheckFlags(flags, OpFlags.CheckFail))
                                    {
                                        success = !success;
                                    }
                                }
                                else
                                {
                                    value   = null;
                                    success = CheckFlags(flags, OpFlags.CheckFail);
                                }
                                if (!success)
                                {
                                    Thread.Sleep(sleepMillis);
                                }
                            }
                        }
                        else
                        {
                            if (!isMultiuser)
                            {
                                if (CheckFlags(flags, OpFlags.CheckNoKey))
                                {
                                    Assert.IsFalse(region.GetLocalView().ContainsKey(key));
                                }
                                else
                                {
                                    Assert.IsTrue(region.GetLocalView().ContainsKey(key));
                                    region.GetLocalView().Invalidate(key);
                                }
                            }
                            try
                            {
                                value = region[key];
                            }
                            catch (Client.KeyNotFoundException)
                            {
                                Util.Log("KeyNotFoundException while getting key. should be ok as we are just testing auth");
                            }
                        }
                        if (!isMultiuser && value != null)
                        {
                            if (CheckFlags(flags, OpFlags.CheckFail))
                            {
                                Assert.AreNotEqual(expectedValue, value.ToString());
                            }
                            else
                            {
                                Assert.AreEqual(expectedValue, value.ToString());
                            }
                        }
                        break;

                    case OperationCode.Put:
                        region[key] = expectedValue;
                        break;

                    case OperationCode.Destroy:
                        if (!isMultiuser && !region.GetLocalView().ContainsKey(key))
                        {
                            // Since DESTROY will fail unless the value is present
                            // in the local cache, this is a workaround for two cases:
                            // 1. When the operation is supposed to succeed then in
                            // the current AuthzCredentialGenerators the clients having
                            // DESTROY permission also has CREATE/UPDATE permission
                            // so that calling region.Put() will work for that case.
                            // 2. When the operation is supposed to fail with
                            // NotAuthorizedException then in the current
                            // AuthzCredentialGenerators the clients not
                            // having DESTROY permission are those with reader role that have
                            // GET permission.
                            //
                            // If either of these assumptions fails, then this has to be
                            // adjusted or reworked accordingly.
                            if (CheckFlags(flags, OpFlags.CheckNotAuthz))
                            {
                                value = region[key];
                                Assert.AreEqual(expectedValue, value.ToString());
                            }
                            else
                            {
                                region[key] = expectedValue;
                            }
                        }
                        if (!isMultiuser && CheckFlags(flags, OpFlags.LocalOp))
                        {
                            region.GetLocalView().Remove(key); //Destroyed replaced by Remove() API
                        }
                        else
                        {
                            region.Remove(key); //Destroyed replaced by Remove API
                        }
                        break;

                    //TODO: Need to fix Stack overflow exception..
                    case OperationCode.RegisterInterest:
                        if (CheckFlags(flags, OpFlags.UseList))
                        {
                            breakLoop = true;
                            // Register interest list in this case
                            List <CacheableKey> keyList = new List <CacheableKey>(numOps);
                            for (int keyNumIndex = 0; keyNumIndex < numOps; ++keyNumIndex)
                            {
                                int keyNum = indices[keyNumIndex];
                                keyList.Add(KeyPrefix + keyNum);
                            }
                            region.GetSubscriptionService().RegisterKeys(keyList.ToArray());
                        }
                        else if (CheckFlags(flags, OpFlags.UseRegex))
                        {
                            breakLoop = true;
                            region.GetSubscriptionService().RegisterRegex(KeyPrefix + "[0-" + (numOps - 1) + ']');
                        }
                        else if (CheckFlags(flags, OpFlags.UseAllKeys))
                        {
                            breakLoop = true;
                            region.GetSubscriptionService().RegisterAllKeys();
                        }
                        break;

                    //TODO: Need to fix Stack overflow exception..
                    case OperationCode.UnregisterInterest:
                        if (CheckFlags(flags, OpFlags.UseList))
                        {
                            breakLoop = true;
                            // Register interest list in this case
                            List <CacheableKey> keyList = new List <CacheableKey>(numOps);
                            for (int keyNumIndex = 0; keyNumIndex < numOps; ++keyNumIndex)
                            {
                                int keyNum = indices[keyNumIndex];
                                keyList.Add(KeyPrefix + keyNum);
                            }
                            region.GetSubscriptionService().UnregisterKeys(keyList.ToArray());
                        }
                        else if (CheckFlags(flags, OpFlags.UseRegex))
                        {
                            breakLoop = true;
                            region.GetSubscriptionService().UnregisterRegex(KeyPrefix + "[0-" + (numOps - 1) + ']');
                        }
                        else if (CheckFlags(flags, OpFlags.UseAllKeys))
                        {
                            breakLoop = true;
                            region.GetSubscriptionService().UnregisterAllKeys();
                        }
                        break;

                    case OperationCode.Query:
                        breakLoop = true;
                        ISelectResults <object> queryResults;

                        if (!isMultiuser)
                        {
                            queryResults = (ResultSet <object>)region.Query <object>(
                                "SELECT DISTINCT * FROM " + region.FullPath);
                        }
                        else
                        {
                            queryResults = CacheHelper.getMultiuserCache(creds).GetQueryService().NewQuery <object>("SELECT DISTINCT * FROM " + region.FullPath).Execute();
                        }
                        Assert.IsNotNull(queryResults);
                        if (!CheckFlags(flags, OpFlags.CheckFail))
                        {
                            Assert.AreEqual(numOps, queryResults.Size);
                        }
                        //CacheableHashSet querySet = new CacheableHashSet(queryResults.Size);
                        List <string>      querySet = new List <string>(queryResults.Size);
                        ResultSet <object> rs       = queryResults as ResultSet <object>;
                        foreach (object result in  rs)
                        {
                            querySet.Add(result.ToString());
                        }
                        for (int keyNumIndex = 0; keyNumIndex < numOps; ++keyNumIndex)
                        {
                            int    keyNum      = indices[keyNumIndex];
                            string expectedVal = valPrefix + keyNumIndex;
                            if (CheckFlags(flags, OpFlags.CheckFail))
                            {
                                Assert.IsFalse(querySet.Contains(expectedVal));
                            }
                            else
                            {
                                Assert.IsTrue(querySet.Contains(expectedVal));
                            }
                        }
                        break;

                    case OperationCode.RegionDestroy:
                        breakLoop = true;
                        if (!isMultiuser && CheckFlags(flags, OpFlags.LocalOp))
                        {
                            region.GetLocalView().DestroyRegion();
                        }
                        else
                        {
                            region.DestroyRegion();
                        }
                        break;

                    case OperationCode.GetServerKeys:
                        breakLoop = true;
                        ICollection <object> serverKeys = region.Keys;
                        break;

                    //TODO: Need to fix System.ArgumentOutOfRangeException: Index was out of range. Know issue with GetAll()
                    case OperationCode.GetAll:
                        //ICacheableKey[] keymap = new ICacheableKey[5];
                        List <object> keymap = new List <object>();
                        for (int i = 0; i < 5; i++)
                        {
                            keymap.Add(i);
                            //CacheableInt32 item = CacheableInt32.Create(i);
                            //Int32 item = i;
                            // NOTE: GetAll should operate right after PutAll
                            //keymap[i] = item;
                        }
                        Dictionary <Object, Object> entrymap = new Dictionary <Object, Object>();
                        //CacheableHashMap entrymap = CacheableHashMap.Create();
                        region.GetAll(keymap, entrymap, null, false);
                        if (entrymap.Count < 5)
                        {
                            Assert.Fail("DoOp: Got fewer entries for op " + op);
                        }
                        break;

                    case OperationCode.PutAll:
                        // NOTE: PutAll should operate right before GetAll
                        //CacheableHashMap entrymap2 = CacheableHashMap.Create();
                        Dictionary <Object, Object> entrymap2 = new Dictionary <object, object>();
                        for (int i = 0; i < 5; i++)
                        {
                            //CacheableInt32 item = CacheableInt32.Create(i);
                            Int32 item = i;
                            entrymap2.Add(item, item);
                        }
                        region.PutAll(entrymap2);
                        break;

                    case OperationCode.RemoveAll:
                        Dictionary <Object, Object> entrymap3 = new Dictionary <object, object>();
                        for (int i = 0; i < 5; i++)
                        {
                            //CacheableInt32 item = CacheableInt32.Create(i);
                            Int32 item = i;
                            entrymap3.Add(item, item);
                        }
                        region.PutAll(entrymap3);
                        ICollection <object> keys = new LinkedList <object>();
                        for (int i = 0; i < 5; i++)
                        {
                            Int32 item = i;
                            keys.Add(item);
                        }
                        region.RemoveAll(keys);
                        break;

                    case OperationCode.ExecuteCQ:
                        Pool /*<object, object>*/ pool = CacheHelper.DCache.GetPoolManager().Find("__TESTPOOL1_");
                        QueryService qs;
                        if (pool != null)
                        {
                            qs = pool.GetQueryService();
                        }
                        else
                        {
                            //qs = CacheHelper.DCache.GetQueryService();
                            qs = null;
                        }
                        CqAttributesFactory <object, object> cqattrsfact = new CqAttributesFactory <object, object>();
                        CqAttributes <object, object>        cqattrs     = cqattrsfact.Create();
                        CqQuery <object, object>             cq          = qs.NewCq("cq_security", "SELECT * FROM /" + region.Name, cqattrs, false);
                        qs.ExecuteCqs();
                        qs.StopCqs();
                        qs.CloseCqs();
                        break;

                    case OperationCode.ExecuteFunction:
                        if (!isMultiuser)
                        {
                            Pool /*<object, object>*/ pool2 = CacheHelper.DCache.GetPoolManager().Find("__TESTPOOL1_");
                            if (pool2 != null)
                            {
                                Client.FunctionService <object> .OnServer(pool2).Execute("securityTest");

                                Client.FunctionService <object> .OnRegion <object, object>(region).Execute("FireNForget");
                            }
                            else
                            {
                                expectedResult = ExpectedResult.Success;
                            }
                        }
                        else
                        {
                            //FunctionService fs = CacheHelper.getMultiuserCache(creds).GetFunctionService();
                            //Execution exe =  fs.OnServer();
                            IRegionService userCache = CacheHelper.getMultiuserCache(creds);
                            Apache.Geode.Client.Execution <object> exe = Client.FunctionService <object> .OnServer(userCache);

                            exe.Execute("securityTest");
                            exe = Client.FunctionService <object> .OnServers(userCache);

                            Client.FunctionService <object> .OnRegion <object, object>(region);

                            Client.FunctionService <object> .OnRegion <object, object>(userCache.GetRegion <object, object>(region.Name)).Execute("FireNForget");
                        }
                        break;

                    default:
                        Assert.Fail("DoOp: Unhandled operation " + op);
                        break;
                    }

                    if (expectedResult != ExpectedResult.Success)
                    {
                        Assert.Fail("Expected an exception while performing operation");
                    }
                }
                catch (AssertionException ex)
                {
                    Util.Log("DoOp: failed assertion: {0}", ex);
                    throw;
                }
                catch (NotAuthorizedException ex)
                {
                    exceptionOccured = true;
                    if (expectedResult == ExpectedResult.NotAuthorizedException)
                    {
                        Util.Log(
                            "DoOp: Got expected NotAuthorizedException when doing operation ["
                            + op + "] with flags [" + flags + "]: " + ex.Message);
                        continue;
                    }
                    else
                    {
                        Assert.Fail("DoOp: Got unexpected NotAuthorizedException when " +
                                    "doing operation: " + ex.Message);
                    }
                }
                catch (Exception ex)
                {
                    exceptionOccured = true;
                    if (expectedResult == ExpectedResult.OtherException)
                    {
                        Util.Log("DoOp: Got expected exception when doing operation: " +
                                 ex.GetType() + "::" + ex.Message);
                        continue;
                    }
                    else
                    {
                        Assert.Fail("DoOp: Got unexpected exception when doing operation: " + ex);
                    }
                }
            }

            if (!exceptionOccured &&
                expectedResult != ExpectedResult.Success)
            {
                Assert.Fail("Expected an exception while performing operation");
            }
            Util.Log(" doop done");
        }