Search in sources :

Example 6 with StaxBuilderTest

use of com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest in project databus by linkedin.

the class TestParser method keyCompressionTest.

/**
   * Check key compression. If there are multiple updates on the same key, choose the last one
   */
@Test
public void keyCompressionTest() throws Exception {
    keyCompressionCallback callback = new keyCompressionCallback();
    StaxBuilderTest test = new StaxBuilderTest(actualXmlDataDir + "keyCompression.xml", service, callback);
    test.processXml();
}
Also used : StaxBuilderTest(com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest) StaxBuilderTest(com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest) Test(org.testng.annotations.Test)

Example 7 with StaxBuilderTest

use of com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest in project databus by linkedin.

the class TestParser method missingScnCheck.

/**
   * Missing scn should throw an exception
   */
@Test
public void missingScnCheck() throws Exception {
    BasicOperationsCheckCallback callback = new BasicOperationsCheckCallback();
    try {
        StaxBuilderTest test = new StaxBuilderTest(actualXmlDataDir + "missingscn.xml", service, callback);
        test.processXml();
        Assert.fail("Test has not detected failure on missing scn");
    } catch (DatabusException e) {
        LOG.info("Caught databus exception, verifying if it's for missing scn..");
        String error = e.getMessage();
        String expected = "Unable to find scn for the given dbUpdate, terminating the parser";
        Assert.assertEquals(error, expected);
    }
}
Also used : DatabusException(com.linkedin.databus2.core.DatabusException) StaxBuilderTest(com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest) StaxBuilderTest(com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest) Test(org.testng.annotations.Test)

Example 8 with StaxBuilderTest

use of com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest in project databus by linkedin.

the class TestParser method basicOperationsTest.

/**
   * Makes sure there are no exceptions is thrown on parsing xml, verify the keys processed.
   * @throws DatabusException
   * @throws FileNotFoundException
   */
@Test
public void basicOperationsTest() throws Exception {
    BasicOperationsCheckCallback callback = new BasicOperationsCheckCallback();
    StaxBuilderTest test = new StaxBuilderTest(actualXmlDataDir + "basicprocessing.xml", service, callback);
    test.processXml();
}
Also used : StaxBuilderTest(com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest) StaxBuilderTest(com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest) Test(org.testng.annotations.Test)

Example 9 with StaxBuilderTest

use of com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest in project databus by linkedin.

the class TestParser method extraFieldsTest.

/**
   *  Checks if the parser it able to construct events with extra fields
   */
@Test
public void extraFieldsTest() throws Exception {
    BasicOperationsCheckCallback callback = new BasicOperationsCheckCallback();
    StaxBuilderTest test = new StaxBuilderTest(actualXmlDataDir + "extrafields.xml", service, callback);
    test.processXml();
}
Also used : StaxBuilderTest(com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest) StaxBuilderTest(com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest) Test(org.testng.annotations.Test)

Aggregations

StaxBuilderTest (com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest)9 Test (org.testng.annotations.Test)9 DatabusException (com.linkedin.databus2.core.DatabusException)2