Search in sources :

Example 1 with NewPortfolio

use of parReg.query.unittest.NewPortfolio in project geode by apache.

the class PRColocatedEquiJoinDUnitTest method testPRLocalQueryingWithIndexes.

/**
   * A very basic dunit test that <br>
   * 1. Creates two PR Data Stores with redundantCopies = 1. 2. Populates the region with test data.
   * 3. Fires a LOCAL query on one data store VM and verifies the result.
   * 
   * @throws Exception
   */
@Test
public void testPRLocalQueryingWithIndexes() throws Exception {
    Host host = Host.getHost(0);
    VM vm0 = host.getVM(0);
    setCacheInVMs(vm0);
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Querying PR Test with DACK Started");
    // Creting PR's on the participating VM's
    // Creating DataStore node on the VM0.
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Creating the DataStore node in the PR");
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRCreate(name, redundancy, Portfolio.class));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRIndexCreate(name, "IdIndex1", "r1.ID", "/" + name + " r1", null));
    // vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRIndexCreate(name, "IdIndex11",
    // "r1.status", "/"+name+" r1", null));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully created the DataStore node in the PR");
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully Created PR's across all VM's");
    // Creating Colocated Region DataStore node on the VM0.
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Creating the Colocated DataStore node in the PR");
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRColocatedCreate(coloName, redundancy, name));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRIndexCreate(coloName, "IdIndex2", "r2.id", "/" + coloName + " r2", null));
    // vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRIndexCreate(coloName, "IdIndex22",
    // "r2.status", "/"+coloName+" r2", null));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully created the Colocated DataStore node in the PR");
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully Created PR's across all VM's");
    // Creating local region on vm0 to compare the results of query.
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForLocalRegionCreation(localName, Portfolio.class));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForLocalRegionCreation(coloLocalName, NewPortfolio.class));
    // Generating portfolio object array to be populated across the PR's & Local
    // Regions
    final Portfolio[] portfolio = createPortfoliosAndPositions(cntDest);
    final NewPortfolio[] newPortfolio = createNewPortfoliosAndPositions(cntDest);
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(localName, portfolio, cnt, cntDest));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(coloLocalName, newPortfolio, cnt, cntDest));
    // Putting the data into the PR's created
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(name, portfolio, cnt, cntDest));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(coloName, newPortfolio, cnt, cntDest));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Inserted Portfolio data across PR's");
    // querying the VM for data and comparing the result with query result of
    // local region.
    // querying the VM for data
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRColocatedDataSetQueryAndCompareResults(name, coloName, localName, coloLocalName));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Querying PR's Test ENDED");
}
Also used : NewPortfolio(parReg.query.unittest.NewPortfolio) VM(org.apache.geode.test.dunit.VM) Portfolio(org.apache.geode.cache.query.data.Portfolio) NewPortfolio(parReg.query.unittest.NewPortfolio) Host(org.apache.geode.test.dunit.Host) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Example 2 with NewPortfolio

use of parReg.query.unittest.NewPortfolio in project geode by apache.

the class PRColocatedEquiJoinDUnitTest method testRRPRLocalQueryingWithIndexes.

/**
   * A very basic dunit test that <br>
   * 1. Creates two PR Data Stores with redundantCopies = 1. 2. Populates the region with test data.
   * 3. Fires a LOCAL query on one data store VM and verifies the result.
   * 
   * @throws Exception
   */
@Test
public void testRRPRLocalQueryingWithIndexes() throws Exception {
    Host host = Host.getHost(0);
    VM vm0 = host.getVM(0);
    setCacheInVMs(vm0);
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Querying PR Test with DACK Started");
    // Creting PR's on the participating VM's
    // Creating DataStore node on the VM0.
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Creating the DataStore node in the PR");
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRCreate(coloName, redundancy, NewPortfolio.class));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRIndexCreate(coloName, "IdIndex1", "r2.id", "/" + coloName + " r2", null));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully created the DataStore node in the PR");
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully Created PR's across all VM's");
    // Creating Colocated Region DataStore node on the VM0.
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Creating the Colocated DataStore node in the PR");
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForLocalRegionCreation(name, Portfolio.class));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRIndexCreate(name, "IdIndex2", "r1.ID", "/" + name + " r1", null));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully created the Colocated DataStore node in the PR");
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully Created PR's across all VM's");
    // Creating local region on vm0 to compare the results of query.
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForLocalRegionCreation(localName, Portfolio.class));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForLocalRegionCreation(coloLocalName, NewPortfolio.class));
    // Generating portfolio object array to be populated across the PR's & Local
    // Regions
    final Portfolio[] portfolio = createPortfoliosAndPositions(cntDest);
    final NewPortfolio[] newPortfolio = createNewPortfoliosAndPositions(cntDest);
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(localName, portfolio, cnt, cntDest));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(coloLocalName, newPortfolio, cnt, cntDest));
    // Putting the data into the PR's created
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(name, portfolio, cnt, cntDest));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(coloName, newPortfolio, cnt, cntDest));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Inserted Portfolio data across PR's");
    // querying the VM for data and comparing the result with query result of
    // local region.
    // querying the VM for data
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRColocatedDataSetQueryAndCompareResults(name, coloName, localName, coloLocalName));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Querying PR's Test ENDED");
}
Also used : NewPortfolio(parReg.query.unittest.NewPortfolio) VM(org.apache.geode.test.dunit.VM) Portfolio(org.apache.geode.cache.query.data.Portfolio) NewPortfolio(parReg.query.unittest.NewPortfolio) Host(org.apache.geode.test.dunit.Host) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Example 3 with NewPortfolio

use of parReg.query.unittest.NewPortfolio in project geode by apache.

the class PRColocatedEquiJoinDUnitTest method testRRPRLocalQuerying.

/**
   * A very basic dunit test that <br>
   * 1. Creates two PR Data Stores with redundantCopies = 1. 2. Populates the region with test data.
   * 3. Fires a LOCAL query on one data store VM and verifies the result.
   * 
   * @throws Exception
   */
@Test
public void testRRPRLocalQuerying() throws Exception {
    Host host = Host.getHost(0);
    VM vm0 = host.getVM(0);
    setCacheInVMs(vm0);
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Querying PR Test with DACK Started");
    // Creting PR's on the participating VM's
    // Creating DataStore node on the VM0.
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Creating the DataStore node in the PR");
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRCreate(coloName, redundancy, NewPortfolio.class));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully created the DataStore node in the PR");
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully Created PR's across all VM's");
    // Creating Colocated Region DataStore node on the VM0.
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Creating the Colocated DataStore node in the PR");
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForLocalRegionCreation(name, Portfolio.class));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully created the Colocated DataStore node in the PR");
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully Created PR's across all VM's");
    // Creating local region on vm0 to compare the results of query.
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForLocalRegionCreation(localName, Portfolio.class));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForLocalRegionCreation(coloLocalName, NewPortfolio.class));
    // Generating portfolio object array to be populated across the PR's & Local
    // Regions
    final Portfolio[] portfolio = createPortfoliosAndPositions(cntDest);
    final NewPortfolio[] newPortfolio = createNewPortfoliosAndPositions(cntDest);
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(localName, portfolio, cnt, cntDest));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(coloLocalName, newPortfolio, cnt, cntDest));
    // Putting the data into the PR's created
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(name, portfolio, cnt, cntDest));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(coloName, newPortfolio, cnt, cntDest));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Inserted Portfolio data across PR's");
    // querying the VM for data and comparing the result with query result of
    // local region.
    // querying the VM for data
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRColocatedDataSetQueryAndCompareResults(name, coloName, localName, coloLocalName));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Querying PR's Test ENDED");
}
Also used : NewPortfolio(parReg.query.unittest.NewPortfolio) VM(org.apache.geode.test.dunit.VM) Portfolio(org.apache.geode.cache.query.data.Portfolio) NewPortfolio(parReg.query.unittest.NewPortfolio) Host(org.apache.geode.test.dunit.Host) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Example 4 with NewPortfolio

use of parReg.query.unittest.NewPortfolio in project geode by apache.

the class PRColocatedEquiJoinDUnitTest method testPRNonLocalQueryException.

/**
   * A very basic dunit test that <br>
   * 1. Creates two PR Data Stores with redundantCopies = 1. 2. Populates the region with test data.
   * 3. Fires a LOCAL query on one data store VM and verifies the result.
   * 
   * @throws Exception
   */
@Test
public void testPRNonLocalQueryException() throws Exception {
    Host host = Host.getHost(0);
    VM vm0 = host.getVM(0);
    VM vm1 = host.getVM(1);
    setCacheInVMs(vm0, vm1);
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Querying PR Test with DACK Started");
    // Creting PR's on the participating VM's
    // Creating DataStore node on the VM0.
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Creating the DataStore node in the PR");
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRCreate(name, redundancy, Portfolio.class));
    vm1.invoke(PRQHelp.getCacheSerializableRunnableForPRCreate(name, redundancy, Portfolio.class));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully created the DataStore node in the PR");
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully Created PR's across all VM's");
    // Creating Colocated Region DataStore node on the VM0.
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Creating the Colocated DataStore node in the PR");
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRColocatedCreate(coloName, redundancy, name));
    vm1.invoke(PRQHelp.getCacheSerializableRunnableForPRColocatedCreate(coloName, redundancy, name));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully created the Colocated DataStore node in the PR");
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully Created PR's across all VM's");
    // Creating local region on vm0 to compare the results of query.
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForLocalRegionCreation(localName, Portfolio.class));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForLocalRegionCreation(coloLocalName, NewPortfolio.class));
    // Generating portfolio object array to be populated across the PR's & Local
    // Regions
    final Portfolio[] portfolio = createPortfoliosAndPositions(cntDest);
    final NewPortfolio[] newPortfolio = createNewPortfoliosAndPositions(cntDest);
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(localName, portfolio, cnt, cntDest));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(coloLocalName, newPortfolio, cnt, cntDest));
    // Putting the data into the PR's created
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(name, portfolio, cnt, cntDest));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(coloName, newPortfolio, cnt, cntDest));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Inserted Portfolio data across PR's");
    // querying the VM for data and comparing the result with query result of
    // local region.
    // querying the VM for data
    vm0.invoke(new CacheSerializableRunnable("PRQuery") {

        @Override
        public void run2() throws CacheException {
            Cache cache = getCache();
            // Querying the PR region
            String[] queries = new String[] { "r1.ID = r2.id" };
            Object[][] r = new Object[queries.length][2];
            Region region = null;
            region = cache.getRegion(name);
            assertNotNull(region);
            region = cache.getRegion(coloName);
            assertNotNull(region);
            region = cache.getRegion(localName);
            assertNotNull(region);
            region = cache.getRegion(coloLocalName);
            assertNotNull(region);
            final String[] expectedExceptions = new String[] { RegionDestroyedException.class.getName(), ReplyException.class.getName(), CacheClosedException.class.getName(), ForceReattemptException.class.getName(), QueryInvocationTargetException.class.getName() };
            for (int i = 0; i < expectedExceptions.length; i++) {
                getCache().getLogger().info("<ExpectedException action=add>" + expectedExceptions[i] + "</ExpectedException>");
            }
            QueryService qs = getCache().getQueryService();
            Object[] params;
            try {
                for (int j = 0; j < queries.length; j++) {
                    getCache().getLogger().info("About to execute local query: " + queries[j]);
                    r[j][1] = qs.newQuery("Select " + (queries[j].contains("ORDER BY") ? "DISTINCT" : "") + " * from /" + name + " r1, /" + coloName + " r2 where " + queries[j]).execute();
                }
                fail("PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Queries Executed successfully on Local region & PR Region");
            } catch (QueryInvocationTargetException e) {
                // cause and see whether or not it's okay
                throw new TestException("PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught unexpected query exception", e);
            } catch (QueryException e) {
                LogWriterUtils.getLogWriter().error("PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught QueryException while querying" + e, e);
                throw new TestException("PRQueryDUnitHelper#getCacheSerializableRunnableForPRQueryAndCompareResults: Caught unexpected query exception", e);
            } catch (UnsupportedOperationException uso) {
                LogWriterUtils.getLogWriter().info(uso.getMessage());
                if (!uso.getMessage().equalsIgnoreCase(LocalizedStrings.DefaultQuery_A_QUERY_ON_A_PARTITIONED_REGION_0_MAY_NOT_REFERENCE_ANY_OTHER_REGION_1.toLocalizedString(new Object[] { name, "/" + coloName }))) {
                    fail("Query did not throw UnsupportedOperationException while using QueryService instead of LocalQueryService");
                } else {
                    LogWriterUtils.getLogWriter().info("Query received UnsupportedOperationException successfully while using QueryService.");
                }
            } finally {
                for (int i = 0; i < expectedExceptions.length; i++) {
                    getCache().getLogger().info("<ExpectedException action=remove>" + expectedExceptions[i] + "</ExpectedException>");
                }
            }
        }
    });
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Querying PR's Test ENDED");
}
Also used : TestException(util.TestException) NewPortfolio(parReg.query.unittest.NewPortfolio) CacheException(org.apache.geode.cache.CacheException) RegionDestroyedException(org.apache.geode.cache.RegionDestroyedException) Portfolio(org.apache.geode.cache.query.data.Portfolio) NewPortfolio(parReg.query.unittest.NewPortfolio) QueryInvocationTargetException(org.apache.geode.cache.query.QueryInvocationTargetException) Host(org.apache.geode.test.dunit.Host) CacheClosedException(org.apache.geode.cache.CacheClosedException) ReplyException(org.apache.geode.distributed.internal.ReplyException) QueryException(org.apache.geode.cache.query.QueryException) ForceReattemptException(org.apache.geode.internal.cache.ForceReattemptException) CacheSerializableRunnable(org.apache.geode.cache30.CacheSerializableRunnable) QueryService(org.apache.geode.cache.query.QueryService) VM(org.apache.geode.test.dunit.VM) Region(org.apache.geode.cache.Region) PartitionedRegion(org.apache.geode.internal.cache.PartitionedRegion) Cache(org.apache.geode.cache.Cache) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Example 5 with NewPortfolio

use of parReg.query.unittest.NewPortfolio in project geode by apache.

the class PRColocatedEquiJoinDUnitTest method testPRLocalQuerying.

/**
   * A very basic dunit test that <br>
   * 1. Creates two PR Data Stores with redundantCopies = 1. 2. Populates the region with test data.
   * 3. Fires a LOCAL query on one data store VM and verifies the result.
   * 
   * @throws Exception
   */
@Test
public void testPRLocalQuerying() throws Exception {
    Host host = Host.getHost(0);
    VM vm0 = host.getVM(0);
    setCacheInVMs(vm0);
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Querying PR Test with DACK Started");
    // Creting PR's on the participating VM's
    // Creating DataStore node on the VM0.
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Creating the DataStore node in the PR");
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRCreate(name, redundancy, Portfolio.class));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully created the DataStore node in the PR");
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully Created PR's across all VM's");
    // Creating Colocated Region DataStore node on the VM0.
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Creating the Colocated DataStore node in the PR");
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRColocatedCreate(coloName, redundancy, name));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully created the Colocated DataStore node in the PR");
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Successfully Created PR's across all VM's");
    // Creating local region on vm0 to compare the results of query.
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForLocalRegionCreation(localName, Portfolio.class));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForLocalRegionCreation(coloLocalName, NewPortfolio.class));
    // Generating portfolio object array to be populated across the PR's & Local
    // Regions
    final Portfolio[] portfolio = createPortfoliosAndPositions(cntDest);
    final NewPortfolio[] newPortfolio = createNewPortfoliosAndPositions(cntDest);
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(localName, portfolio, cnt, cntDest));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(coloLocalName, newPortfolio, cnt, cntDest));
    // Putting the data into the PR's created
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(name, portfolio, cnt, cntDest));
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRPuts(coloName, newPortfolio, cnt, cntDest));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Inserted Portfolio data across PR's");
    // querying the VM for data and comparing the result with query result of
    // local region.
    // querying the VM for data
    vm0.invoke(PRQHelp.getCacheSerializableRunnableForPRColocatedDataSetQueryAndCompareResults(name, coloName, localName, coloLocalName));
    LogWriterUtils.getLogWriter().info("PRQBasicQueryDUnitTest#testPRBasicQuerying: Querying PR's Test ENDED");
}
Also used : NewPortfolio(parReg.query.unittest.NewPortfolio) VM(org.apache.geode.test.dunit.VM) Portfolio(org.apache.geode.cache.query.data.Portfolio) NewPortfolio(parReg.query.unittest.NewPortfolio) Host(org.apache.geode.test.dunit.Host) FlakyTest(org.apache.geode.test.junit.categories.FlakyTest) Test(org.junit.Test) DistributedTest(org.apache.geode.test.junit.categories.DistributedTest)

Aggregations

NewPortfolio (parReg.query.unittest.NewPortfolio)19 Test (org.junit.Test)17 Portfolio (org.apache.geode.cache.query.data.Portfolio)16 Host (org.apache.geode.test.dunit.Host)16 VM (org.apache.geode.test.dunit.VM)16 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)16 FlakyTest (org.apache.geode.test.junit.categories.FlakyTest)16 Region (org.apache.geode.cache.Region)5 QueryService (org.apache.geode.cache.query.QueryService)5 Cache (org.apache.geode.cache.Cache)4 Query (org.apache.geode.cache.query.Query)4 CacheClosedException (org.apache.geode.cache.CacheClosedException)3 CacheException (org.apache.geode.cache.CacheException)3 RegionDestroyedException (org.apache.geode.cache.RegionDestroyedException)3 QueryException (org.apache.geode.cache.query.QueryException)3 QueryInvocationTargetException (org.apache.geode.cache.query.QueryInvocationTargetException)3 CacheSerializableRunnable (org.apache.geode.cache30.CacheSerializableRunnable)3 ReplyException (org.apache.geode.distributed.internal.ReplyException)3 ForceReattemptException (org.apache.geode.internal.cache.ForceReattemptException)3 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)3