@Ignore
  @Test
  public void testDataSerializability() throws Exception {

    Region region = CacheUtils.createRegion("Portfolios", Portfolio.class);
    for (int i = 0; i < 10000; i++) {
      region.put(i + "", new Portfolio(i));
    }

    String queryStr = "SELECT DISTINCT * FROM " + SEPARATOR + "Portfolios";
    Query q = CacheUtils.getQueryService().newQuery(queryStr);

    SelectResults res1 = (SelectResults) q.execute();

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream out = new DataOutputStream(baos);
    DataSerializer.writeObject(res1, out, false); // false prevents Java serialization
    out.close();

    DataInputStream in = new DataInputStream(new ByteArrayInputStream(baos.toByteArray()));
    SelectResults res2 = DataSerializer.readObject(in);
    in.close();

    assertEquals(res2.size(), res1.size());
  }
Test whether query results are DataSerializable
geode-core/src/integrationTest/java/org/apache/geode/cache/query/functional/ResultsDataSerializabilityJUnitTest.java