Github user brightchen commented on a diff in the pull request:

    
https://github.com/apache/incubator-apex-malhar/pull/100#discussion_r45023991
  
    --- Diff: 
library/src/test/java/com/datatorrent/lib/appdata/snapshot/AppDataSnapshotServerTagsSupportTest.java
 ---
    @@ -0,0 +1,67 @@
    +package com.datatorrent.lib.appdata.snapshot;
    +
    +import org.codehaus.jettison.json.JSONArray;
    +import org.codehaus.jettison.json.JSONObject;
    +import org.junit.Assert;
    +import org.junit.Test;
    +
    +import com.google.common.collect.Sets;
    +
    +import com.datatorrent.lib.appdata.gpo.GPOMutable;
    +import com.datatorrent.lib.appdata.schemas.Schema;
    +import com.datatorrent.lib.appdata.schemas.SchemaResult;
    +import com.datatorrent.lib.appdata.schemas.SchemaUtils;
    +
    +public class AppDataSnapshotServerTagsSupportTest
    +{
    +  public static class AppDataSnapshotServerSchemaExport extends 
AbstractAppDataSnapshotServer<Object>
    +  {
    +    SchemaResult schemaResult;
    +    String schemaResultJSON;
    +
    +    @Override
    +    public GPOMutable convert(Object inputEvent)
    +    {
    +      return null;
    +    }
    +
    +    @Override
    +    public void endWindow()
    +    {
    +      while ((schemaResult = schemaQueue.poll()) != null) {
    +        schemaResultJSON = resultSerializerFactory.serialize(schemaResult);
    +        queryResult.emit(schemaResultJSON);
    +      }
    +
    +      queryProcessor.endWindow();
    +    }
    +  }
    +
    +  private static final String schemaLocation = 
"satisfactionRatingSnapshotSchema_test.json";
    +  private static final String TAG = "bulletin";
    +
    +  @Test
    +  public void testSchema() throws Exception
    --- End diff --
    
    The Preconditions.checkState() in the initialize() method forbid keys in 
the first level. I am not sure why this precondition was checked, but maybe 
have some trap here if break this logic.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to