geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [geode] branch develop updated: GEODE-3545: rename and cleanup QueryDataFunctionIntegrationTest
Date Mon, 18 Sep 2017 20:34:37 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
     new 9010a47  GEODE-3545: rename and cleanup QueryDataFunctionIntegrationTest
9010a47 is described below

commit 9010a471f97dc06f030aefa10fc5386b9f3885a2
Author: Kirk Lund <klund@apache.org>
AuthorDate: Thu Aug 31 12:56:06 2017 -0700

    GEODE-3545: rename and cleanup QueryDataFunctionIntegrationTest
    
    * rename test to reflect what it actually does
    * use reasonable variable names
    * delete unused code
    * make constants to be static final
---
 .../DataBrowserJSONValidationJUnitTest.java        | 342 ---------------------
 .../QueryDataFunctionIntegrationTest.java          | 320 +++++++++++++++++++
 2 files changed, 320 insertions(+), 342 deletions(-)

diff --git a/geode-core/src/test/java/org/apache/geode/management/DataBrowserJSONValidationJUnitTest.java
b/geode-core/src/test/java/org/apache/geode/management/DataBrowserJSONValidationJUnitTest.java
deleted file mode 100644
index ff5adbf..0000000
--- a/geode-core/src/test/java/org/apache/geode/management/DataBrowserJSONValidationJUnitTest.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * 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.
- */
-package org.apache.geode.management;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
-import org.apache.geode.cache.*;
-import org.apache.geode.cache.query.data.Portfolio;
-import org.apache.geode.cache.query.data.Position;
-import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.management.internal.ManagementConstants;
-import org.apache.geode.management.internal.beans.QueryDataFunction;
-import org.apache.geode.management.internal.cli.json.TypedJson;
-import org.apache.geode.management.model.EmptyObject;
-import org.apache.geode.management.model.Item;
-import org.apache.geode.management.model.Order;
-import org.apache.geode.management.model.SubOrder;
-import org.apache.geode.pdx.PdxInstance;
-import org.apache.geode.pdx.PdxInstanceFactory;
-import org.apache.geode.pdx.internal.PdxInstanceFactoryImpl;
-import org.apache.geode.test.junit.categories.IntegrationTest;
-import org.json.JSONObject;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Properties;
-
-import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
-import static org.junit.Assert.fail;
-
-/**
- * @since GemFire 8.1
- *
- */
-@Category(IntegrationTest.class)
-public class DataBrowserJSONValidationJUnitTest {
-
-  protected static final long SLEEP = 100;
-  protected static final long TIMEOUT = 4 * 1000;
-
-  protected InternalDistributedSystem system;
-
-  private Cache cache;
-
-  Region replicatedRegion;
-
-  private static final String REPLICATED_REGION = "exampleRegion";
-
-  /**
-   * Number of rows queryData operation will return. By default it will be 1000
-   */
-  private int queryResultSetLimit = ManagementConstants.DEFAULT_QUERY_LIMIT;
-
-  /**
-   * NUmber of elements to be shown in queryData operation if query results contain collections
like
-   * Map, List etc.
-   */
-  private int queryCollectionsDepth = TypedJson.DEFAULT_COLLECTION_ELEMENT_LIMIT;
-
-  private String QUERY_1 = "SELECT * FROM /exampleRegion";
-
-  @After
-  public void tearDown() throws Exception {
-    this.system.disconnect();
-    this.system = null;
-  }
-
-  @SuppressWarnings("deprecation")
-  @Before
-  public void setUp() throws Exception {
-    // System.setProperty("gemfire.stats.debug.debugSampleCollector", "true");
-
-    final Properties props = new Properties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(ENABLE_TIME_STATISTICS, "true");
-    props.setProperty(STATISTIC_SAMPLING_ENABLED, "false");
-    props.setProperty(STATISTIC_SAMPLE_RATE, "60000");
-    props.setProperty(JMX_MANAGER, "true");
-    props.setProperty(JMX_MANAGER_START, "true");
-    props.setProperty(JMX_MANAGER_HTTP_PORT, "0");
-    props.setProperty(JMX_MANAGER_PORT, "0");
-
-    this.system = (InternalDistributedSystem) DistributedSystem.connect(props);
-
-    this.cache = new CacheFactory().create();
-    RegionFactory replicatedRegionFac = cache.createRegionFactory(RegionShortcut.REPLICATE);
-    replicatedRegion = replicatedRegionFac.create(REPLICATED_REGION);
-
-  }
-
-  private void queryData(String query, String members, int limit) {
-
-    try {
-      Object result = QueryDataFunction.queryData(query, members, limit, false, queryResultSetLimit,
-          queryCollectionsDepth);
-      String queryResult = (String) result;
-
-      System.out.println("Query Result :" + queryResult.toString());
-      JSONObject jobj = new JSONObject(queryResult);// If not correct JSON
-                                                    // format this will throw a
-                                                    // JSONException
-      System.out.println("Query Result :" + jobj.toString());
-
-    } catch (Exception e) {
-      fail(e.getLocalizedMessage());
-    }
-
-  }
-
-  /**
-   * #Issue 51048 Tests a model where Objects have a circular reference with object reference.
e.g.
-   * Order1-- Has--> Items each Item --Has --> OrderN where (OrderN == Order1)
-   */
-  @Test
-  public void testCyclicWithNestedObjectReference() {
-
-    Order order = new Order();
-
-    order.setId("test");
-
-    for (int i = 1; i <= 5; i++) {
-      Item item = new Item(order, "ID_" + i, "Book");
-      order.addItem(item);
-    }
-    replicatedRegion.put("oreder1", order);
-
-    queryData(QUERY_1, "", 0);
-
-  }
-
-  /**
-   * Tests a model where Objects have a circular reference with their class types. e.g. Order1--
-   * Has--> Items each Item --Has --> OrderN where (OrderN != Order1)
-   */
-  @Test
-  public void testCyclicWithNestedClasses() {
-
-    Order order = new Order();
-    order.setId("test");
-
-    for (int i = 1; i <= 5; i++) {
-      Order ord = new Order();
-      ord.setId("ORDER_ID_" + i);
-      Item item = new Item(ord, "ID_" + i, "Book");
-      order.addItem(item);
-    }
-
-    replicatedRegion.put("oreder1", order);
-
-    queryData(QUERY_1, "", 0);
-
-  }
-
-  /**
-   * Tests a model where Objects have a circular reference with their class types. e.g. Order1--
-   * Has--> Items each Item --Has --> OrderN where (OrderN != Order1)
-   */
-  @Test
-  public void testCyclicWithNestedRefernce2ndLayer() {
-
-    Collection<Item> items = new ArrayList<Item>();
-    Order order = new Order("ORDER_TEST", items);
-
-    for (int i = 1; i <= 5; i++) {
-      Order ord = new Order();
-      ord.setId("ORDER_ID_" + i);
-      ord.setItems(items);
-      Item item = new Item(ord, "ID_" + i, "Book");
-      order.addItem(item);
-
-    }
-
-    replicatedRegion.put("oreder1", order);
-    queryData(QUERY_1, "", 0);
-
-  }
-
-  @Test
-  public void testCyclicWithCollection1stLayer() {
-
-    Collection<Item> items = new ArrayList<Item>();
-    Order order = new Order("ORDER_TEST", items);
-
-    for (int i = 1; i <= 5; i++) {
-      Order ord = new Order();
-      ord.setId("ORDER_ID_" + i);
-      ord.setItems(items);
-      Item item = new Item(ord, "ID_" + i, "Book");
-      order.addItem(item);
-
-    }
-
-    replicatedRegion.put("items", items);
-    queryData(QUERY_1, "", 0);
-
-  }
-
-  @Test
-  public void testCyclicCollectionWithMultipleObjects() {
-
-    for (int j = 1; j <= 5; j++) {
-      Collection<Item> items = new ArrayList<Item>();
-      Order order = new Order("ORDER_TEST_" + j, items);
-
-      for (int i = 1; i <= 5; i++) {
-        Order ord = new Order();
-        ord.setId("ORDER_ID_" + i);
-        ord.setItems(items);
-        Item item = new Item(ord, "ID_" + i, "Book");
-        order.addItem(item);
-      }
-      replicatedRegion.put("items_" + j, items);
-    }
-
-    queryData(QUERY_1, "", 0);
-
-  }
-
-  @Test
-  public void testCyclicArrayMultipleObjects() {
-
-    for (int j = 1; j <= 5; j++) {
-      Collection<Item> items = new ArrayList<Item>();
-      Order order = new Order("ORDER_TEST_" + j, items);
-
-      for (int i = 1; i <= 5; i++) {
-        Order ord = new Order();
-        ord.setId("ORDER_ID_" + i);
-        ord.setItems(items);
-        Item item = new Item(ord, "ID_" + i, "Book");
-        order.addItem(item);
-      }
-      replicatedRegion.put("items_" + j, items);
-    }
-
-    queryData(QUERY_1, "", 0);
-
-  }
-
-  public Portfolio[] createPortfoliosAndPositions(int count) {
-    Position.cnt = 0; // reset Portfolio counter
-    Portfolio[] portfolios = new Portfolio[count];
-    for (int i = 0; i < count; i++) {
-      portfolios[i] = new Portfolio(i);
-    }
-    return portfolios;
-  }
-
-  @Test
-  public void testCyclicArrayMultipleObjectsMemberWise() {
-
-    Portfolio[] ports = createPortfoliosAndPositions(1);
-    int i = 1;
-    for (Portfolio p : ports) {
-      replicatedRegion.put(new Integer(i), p);
-      i++;
-    }
-
-    queryData(QUERY_1, cache.getDistributedSystem().getMemberId() + ","
-        + cache.getDistributedSystem().getMemberId(), 0);
-
-  }
-
-  @Test
-  public void testEmptyObject() {
-
-    EmptyObject p = new EmptyObject();
-
-    replicatedRegion.put("port", p);
-
-    queryData(QUERY_1, "", 0);
-
-  }
-
-  @Test
-  public void testSubClassOverridingMethods() {
-
-    SubOrder so = new SubOrder();
-
-    replicatedRegion.put("port", so);
-
-    queryData(QUERY_1, "", 0);
-
-  }
-
-  @Test
-  public void testNestedPDXObject() {
-
-    PdxInstanceFactory pf = PdxInstanceFactoryImpl.newCreator("Portfolio", false);
-
-    pf.writeInt("ID", 111);
-    pf.writeString("status", "active");
-    pf.writeString("secId", "IBM");
-    PdxInstance pi = pf.create();
-
-    replicatedRegion.put("port", pi);
-    queryData(QUERY_1, "", 0);
-
-  }
-
-  @Test
-  public void testArrayWithNullValues() {
-
-    SubOrder[] soArr = new SubOrder[2];
-    soArr[0] = new SubOrder();
-    soArr[1] = null;
-
-    replicatedRegion.put("p1", soArr);
-    queryData(QUERY_1, "", 0);
-
-  }
-
-  @Test
-  public void testWithSqlDate() {
-
-    SubOrder[] soArr = new SubOrder[2];
-    soArr[0] = new SubOrder();
-    soArr[1] = null;
-
-    replicatedRegion.put("p1", soArr);
-    queryData(QUERY_1, "", 0);
-
-  }
-
-}
diff --git a/geode-core/src/test/java/org/apache/geode/management/QueryDataFunctionIntegrationTest.java
b/geode-core/src/test/java/org/apache/geode/management/QueryDataFunctionIntegrationTest.java
new file mode 100644
index 0000000..7f19416
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/management/QueryDataFunctionIntegrationTest.java
@@ -0,0 +1,320 @@
+/*
+ * 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.
+ */
+package org.apache.geode.management;
+
+import static org.apache.geode.distributed.ConfigurationProperties.ENABLE_TIME_STATISTICS;
+import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER;
+import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_HTTP_PORT;
+import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_PORT;
+import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_START;
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.distributed.ConfigurationProperties.STATISTIC_SAMPLE_RATE;
+import static org.apache.geode.distributed.ConfigurationProperties.STATISTIC_SAMPLING_ENABLED;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Properties;
+
+import org.json.JSONObject;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionFactory;
+import org.apache.geode.cache.RegionShortcut;
+import org.apache.geode.cache.query.data.Portfolio;
+import org.apache.geode.cache.query.data.Position;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.DistributedSystem;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import org.apache.geode.management.internal.ManagementConstants;
+import org.apache.geode.management.internal.beans.QueryDataFunction;
+import org.apache.geode.management.internal.cli.json.TypedJson;
+import org.apache.geode.management.model.EmptyObject;
+import org.apache.geode.management.model.Item;
+import org.apache.geode.management.model.Order;
+import org.apache.geode.management.model.SubOrder;
+import org.apache.geode.pdx.PdxInstance;
+import org.apache.geode.pdx.PdxInstanceFactory;
+import org.apache.geode.pdx.internal.PdxInstanceFactoryImpl;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+
+/**
+ * Functional integration tests for {@link QueryDataFunction}.
+ *
+ * TODO: this test should really have some assertions
+ *
+ * @since GemFire 8.1
+ */
+@Category(IntegrationTest.class)
+public class QueryDataFunctionIntegrationTest {
+
+  private static final String REPLICATED_REGION = "exampleRegion";
+  private static final String QUERY_1 = "SELECT * FROM /exampleRegion";
+
+  /**
+   * Number of rows queryData operation will return. By default it will be 1000
+   */
+  private static final int queryResultSetLimit = ManagementConstants.DEFAULT_QUERY_LIMIT;
+
+  /**
+   * Number of elements to be shown in queryData operation if query results contain collections
like
+   * Map, List etc.
+   */
+  private static final int queryCollectionsDepth = TypedJson.DEFAULT_COLLECTION_ELEMENT_LIMIT;
+
+  private InternalDistributedSystem system;
+  private Region<Object, Object> replicatedRegion;
+  private DistributedMember member;
+
+  @Before
+  public void setUp() throws Exception {
+    Properties config = new Properties();
+    config.setProperty(MCAST_PORT, "0");
+    config.setProperty(ENABLE_TIME_STATISTICS, "true");
+    config.setProperty(STATISTIC_SAMPLING_ENABLED, "false");
+    config.setProperty(STATISTIC_SAMPLE_RATE, "60000");
+    config.setProperty(JMX_MANAGER, "true");
+    config.setProperty(JMX_MANAGER_START, "true");
+    config.setProperty(JMX_MANAGER_HTTP_PORT, "0");
+    config.setProperty(JMX_MANAGER_PORT, "0");
+
+    system = (InternalDistributedSystem) DistributedSystem.connect(config);
+    member = system.getDistributedMember();
+    Cache cache = new CacheFactory().create();
+
+    RegionFactory regionFactory = cache.createRegionFactory(RegionShortcut.REPLICATE);
+    replicatedRegion = regionFactory.<String, Object>create(REPLICATED_REGION);
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    system.disconnect();
+  }
+
+  /**
+   * #Issue 51048 Tests a model where Objects have a circular reference with object reference.
e.g.
+   * Order1-- Has--> Items each Item --Has --> OrderN where (OrderN == Order1)
+   */
+  @Test
+  public void testCyclicWithNestedObjectReference() throws Exception {
+    Order order = new Order();
+    order.setId("test");
+
+    for (int subOrderIndex = 1; subOrderIndex <= 5; subOrderIndex++) {
+      Item item = new Item(order, "ID_" + subOrderIndex, "Book");
+      order.addItem(item);
+    }
+
+    replicatedRegion.put("order1", order);
+
+    queryData(QUERY_1, "", 0);
+  }
+
+  /**
+   * Tests a model where Objects have a circular reference with their class types. e.g. Order1--
+   * Has--> Items each Item --Has --> OrderN where (OrderN != Order1)
+   */
+  @Test
+  public void testCyclicWithNestedClasses() throws Exception {
+    Order order = new Order();
+    order.setId("test");
+
+    for (int subOrderIndex = 1; subOrderIndex <= 5; subOrderIndex++) {
+      Order subOrder = new Order();
+      subOrder.setId("ORDER_ID_" + subOrderIndex);
+
+      Item item = new Item(subOrder, "ID_" + subOrderIndex, "Book");
+      order.addItem(item);
+    }
+
+    replicatedRegion.put("order1", order);
+
+    queryData(QUERY_1, "", 0);
+  }
+
+  /**
+   * Tests a model where Objects have a circular reference with their class types. e.g. Order1--
+   * Has--> Items each Item --Has --> OrderN where (OrderN != Order1)
+   */
+  @Test
+  public void testCyclicWithNestedRefernce2ndLayer() throws Exception {
+    Collection<Item> items = new ArrayList<>();
+    Order order = new Order("ORDER_TEST", items);
+
+    for (int subOrderIndex = 1; subOrderIndex <= 5; subOrderIndex++) {
+      Order subOrder = new Order();
+      subOrder.setId("ORDER_ID_" + subOrderIndex);
+      subOrder.setItems(items);
+
+      Item item = new Item(subOrder, "ID_" + subOrderIndex, "Book");
+      order.addItem(item);
+    }
+
+    replicatedRegion.put("order1", order);
+
+    queryData(QUERY_1, "", 0);
+  }
+
+  @Test
+  public void testCyclicWithCollection1stLayer() throws Exception {
+    Collection<Item> items = new ArrayList<>();
+    Order order = new Order("ORDER_TEST", items);
+
+    for (int subOrderIndex = 1; subOrderIndex <= 5; subOrderIndex++) {
+      Order subOrder = new Order();
+      subOrder.setId("ORDER_ID_" + subOrderIndex);
+      subOrder.setItems(items);
+
+      Item item = new Item(subOrder, "ID_" + subOrderIndex, "Book");
+      order.addItem(item);
+    }
+
+    replicatedRegion.put("items", items);
+
+    queryData(QUERY_1, "", 0);
+  }
+
+  @Test
+  public void testCyclicCollectionWithMultipleObjects() throws Exception {
+    for (int orderIndex = 1; orderIndex <= 5; orderIndex++) {
+      Collection<Item> items = new ArrayList<>();
+      Order order = new Order("ORDER_TEST_" + orderIndex, items);
+
+      for (int subOrderIndex = 1; subOrderIndex <= 5; subOrderIndex++) {
+        Order subOrder = new Order();
+        subOrder.setId("ORDER_ID_" + subOrderIndex);
+        subOrder.setItems(items);
+
+        Item item = new Item(subOrder, "ID_" + subOrderIndex, "Book");
+        order.addItem(item);
+      }
+
+      replicatedRegion.put("items_" + orderIndex, items);
+    }
+
+    queryData(QUERY_1, "", 0);
+  }
+
+  @Test
+  public void testCyclicArrayMultipleObjects() throws Exception {
+    for (int orderIndex = 1; orderIndex <= 5; orderIndex++) {
+      Collection<Item> items = new ArrayList<>();
+      Order order = new Order("ORDER_TEST_" + orderIndex, items);
+
+      for (int subOrderIndex = 1; subOrderIndex <= 5; subOrderIndex++) {
+        Order subOrder = new Order();
+        subOrder.setId("ORDER_ID_" + subOrderIndex);
+        subOrder.setItems(items);
+
+        Item item = new Item(subOrder, "ID_" + subOrderIndex, "Book");
+        order.addItem(item);
+      }
+
+      replicatedRegion.put("items_" + orderIndex, items);
+    }
+
+    queryData(QUERY_1, "", 0);
+  }
+
+  @Test
+  public void testCyclicArrayMultipleObjectsMemberWise() throws Exception {
+    Portfolio[] portfolios = createPortfoliosAndPositions(1);
+    int portfolioId = 1;
+    for (Portfolio portfolio : portfolios) {
+      replicatedRegion.put(portfolioId, portfolio);
+      portfolioId++;
+    }
+
+    queryData(QUERY_1, member.getId(), 0);
+  }
+
+  @Test
+  public void testEmptyObject() throws Exception {
+    EmptyObject emptyObject = new EmptyObject();
+    replicatedRegion.put("port", emptyObject);
+    queryData(QUERY_1, "", 0);
+  }
+
+  @Test
+  public void testSubClassOverridingMethods() throws Exception {
+    SubOrder subOrder = new SubOrder();
+    replicatedRegion.put("port", subOrder);
+    queryData(QUERY_1, "", 0);
+  }
+
+  @Test
+  public void testNestedPDXObject() throws Exception {
+    PdxInstanceFactory factory = PdxInstanceFactoryImpl.newCreator("Portfolio", false);
+
+    factory.writeInt("ID", 111);
+    factory.writeString("status", "active");
+    factory.writeString("secId", "IBM");
+
+    PdxInstance pdxInstance = factory.create();
+
+    replicatedRegion.put("port", pdxInstance);
+
+    queryData(QUERY_1, "", 0);
+  }
+
+  @Test
+  public void testArrayWithNullValues() throws Exception {
+    SubOrder[] subOrderArray = new SubOrder[2];
+    subOrderArray[0] = new SubOrder();
+    subOrderArray[1] = null;
+
+    replicatedRegion.put("p1", subOrderArray);
+
+    queryData(QUERY_1, "", 0);
+  }
+
+  @Test
+  public void testWithSqlDate() throws Exception {
+    SubOrder[] subOrderArray = new SubOrder[2];
+    subOrderArray[0] = new SubOrder();
+    subOrderArray[1] = null;
+
+    replicatedRegion.put("p1", subOrderArray);
+
+    queryData(QUERY_1, "", 0);
+  }
+
+  private void queryData(final String query, final String members, final int limit)
+      throws Exception {
+    Object result = QueryDataFunction.queryData(query, members, limit, false, queryResultSetLimit,
+        queryCollectionsDepth);
+    String queryResult = (String) result;
+    System.out.println("Query Result: " + queryResult);
+
+    // If not correct JSON format this will throw a JSONException
+    JSONObject jsonObject = new JSONObject(queryResult);
+    System.out.println("Query Result: " + jsonObject);
+  }
+
+  private Portfolio[] createPortfoliosAndPositions(final int count) {
+    Position.cnt = 0; // reset Portfolio counter
+    Portfolio[] portfolios = new Portfolio[count];
+    for (int i = 0; i < count; i++) {
+      portfolios[i] = new Portfolio(i);
+    }
+    return portfolios;
+  }
+
+}

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message