Package com.linkedin.data.transform

Examples of com.linkedin.data.transform.DataComplexProcessor.run()


    DataMap data = dataMapFromString("{ 'a': [1, 2, 3, 4, 5]}".replace('\'', '"'));
    DataMap filter = dataMapFromString("{ 'a': { '$*': { 'y': 1}}}".replace('\'', '"'));
    DataComplexProcessor processor = new DataComplexProcessor(new Filter(), filter, data);
    boolean thrown = false;
    try {
      processor.run(false);
    } catch (DataProcessingException e) {
      assertEquals(e.getMessages().size(), 5, "expected exactly 5 errors in non fast fail mode");
      thrown = true;
    }
    assertEquals(thrown, true, "exception should have been thrown");
View Full Code Here


    DataMap data = dataMapFromString("{ 'a': [1, 2, 3, 4, 5]}".replace('\'', '"'));
    DataMap filter = dataMapFromString("{ 'a': { '$*': { 'y': 1}}}".replace('\'', '"'));
    DataComplexProcessor processor = new DataComplexProcessor(new Filter(), filter, data);
    boolean thrown = false;
    try {
      processor.run(true);
    } catch (DataProcessingException e) {
      assertEquals(e.getMessages().size(), 1, "expected exactly 1 error in non fast fail mode");
      thrown = true;
    }
    assertEquals(thrown, true, "exception should have been thrown");
View Full Code Here

    DataMap data = dataMapFromString("{ 'a': [1, 2, 3, 4, 5]}".replace('\'', '"'));
    DataMap filter = dataMapFromString("{ 'a': { '$*': 'hola'}}".replace('\'', '"'));
    DataComplexProcessor processor = new DataComplexProcessor(new Filter(), filter, data);
    boolean thrown = false;
    try {
      processor.run(false);
    } catch (DataProcessingException e) {
      assertEquals(e.getMessages().size(), 1, "expected exactly 1 error in non fast fail mode");
      thrown = true;
    }
    assertEquals(thrown, true, "exception should have been thrown");
View Full Code Here

  {
    DataMap data = dataMapFromString("{ 'a': { 'b': 'b'}}".replace('\'', '"'));
    DataMap filter = dataMapFromString("{ '$*': { 'c': { 'd': 0}}, 'a': 1}".replace('\'', '"'));
    String originalFilter = filter.toString();
    DataComplexProcessor processor = new DataComplexProcessor(new Filter(), filter, data);
    processor.run(false);
    assertEquals(filter.toString(), originalFilter, "filter should not be modified");
  }

  @Test
  public void testInvalidArrayRangeInFilter() throws JsonParseException,
View Full Code Here

    DataMap data = dataMapFromString("{ 'a': [1, 2, 3, 4, 5]}".replace('\'', '"'));
    DataMap filter = dataMapFromString("{ 'a': { '$start': -2, '$count': -1}}".replace('\'', '"'));
    DataComplexProcessor processor = new DataComplexProcessor(new Filter(), filter, data);
    boolean thrown = false;
    try {
      processor.run(false);
    } catch (DataProcessingException e) {
      assertEquals(e.getMessages().size(), 2);
      thrown = true;
    }
    assertEquals(thrown, true, "exception should have been thrown");
View Full Code Here

  private void genericPatchTest(DataMap data, DataMap patch,
                                        DataMap expected, String description) throws DataProcessingException {
    String dataBefore = data.toString();
    DataComplexProcessor processor = new DataComplexProcessor(new Patch(), patch, data);
    processor.run(false);
    assertEquals(data, expected, "The following test failed: \n" + description  +
                 "\nData: " + dataBefore + "\nPatch: " + patch +
                 "\nExpected: " + expected + "\nActual result: " + data);
  }
View Full Code Here

                                                      dataMapFromString("{ \"a\": 1 }")//command $set should be used
                                                      dataMapFromString("{}"));
    boolean thrown = false;
    try
    {
      processor.run(false);
    }
    catch (DataProcessingException e)
    {
      thrown = true;
    }
View Full Code Here

                                                      dataMapFromString("{ \"a\": { \"b\": 1} }")//command $set should be used
                                                      dataMapFromString("{\"a\": 1}"));
    boolean thrown = false;
    try
    {
      processor.run(false);
    }
    catch (DataProcessingException e)
    {
      thrown = true;
    }
View Full Code Here

                                                        "{ \"$set\": { \"b\": 1}, \"$delete\": [\"b\"] }")//command $set should be used
                                                      dataMapFromString("{\"a\": 1}"));
    boolean thrown = false;
    try
    {
      processor.run(false);
    }
    catch (DataProcessingException e)
    {
      thrown = true;
    }
View Full Code Here

                                                        "{ \"b\": { \"$set\": { \"b\": 1} }, \"$delete\": [\"b\"] }")//command $set should be used
                                                      dataMapFromString("{\"a\": 1}"));
    boolean thrown = false;
    try
    {
      processor.run(false);
    }
    catch (DataProcessingException e)
    {
      thrown = true;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.