use of com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest in project databus by linkedin.
the class TestParser method sortMultipleSourcesCheck.
/**
* Test to see if all the updates within a given transaction are clubbed to together by source, and is sorted by source.
*/
@Test
public void sortMultipleSourcesCheck() throws Exception {
SortCheckCallback callback = new SortCheckCallback();
StaxBuilderTest test = new StaxBuilderTest(actualXmlDataDir + "sortMultipleSources.xml", service, callback);
test.processXml();
}
use of com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest in project databus by linkedin.
the class TestParser method missingTokensCheck.
/**
* Missing tokens fields, this should terminate the parser
*/
@Test
public void missingTokensCheck() throws Exception {
BasicOperationsCheckCallback callback = new BasicOperationsCheckCallback();
try {
StaxBuilderTest test = new StaxBuilderTest(actualXmlDataDir + "missingtokens.xml", service, callback);
test.processXml();
Assert.fail("Test has not detected failure on missing tokens");
} catch (DatabusException e) {
LOG.info("Caught databus exception, verifying if it's for missing tokens..");
String error = e.getMessage();
String expected = "The current state is : columns(ENDELEMENT) the expected state was: [tokens(STARTELEMENT)]. The next state found was: dbupdate(ENDELEMENT)";
Assert.assertEquals(error, expected);
}
}
use of com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest in project databus by linkedin.
the class TestParser method nullTransactionsTest.
/**
* Checks if the parser it able to advance SCNs when there are no events for the current source
*/
@Test
public void nullTransactionsTest() throws Exception {
BasicOperationsCheckCallback callback = new BasicOperationsCheckCallback();
StaxBuilderTest test = new StaxBuilderTest(actualXmlDataDir + "nullTransactions.xml", service, callback);
test.processXml();
}
use of com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest in project databus by linkedin.
the class TestParser method formattingTest.
/**
* Check if the parser is able to construct event if there spaces, new lines between elements/tags
*/
@Test
public void formattingTest() throws Exception {
BasicOperationsCheckCallback callback = new BasicOperationsCheckCallback();
StaxBuilderTest test = new StaxBuilderTest(actualXmlDataDir + "extraspaces.xml", service, callback);
test.processXml();
}
use of com.linkedin.databus2.ggParser.staxparser.StaxBuilderTest in project databus by linkedin.
the class TestParser method nullFieldsCheck.
/**
* Test for null/empty fields, this should not terminate the parser. The test will verify is the field returns null
*/
@Test
public void nullFieldsCheck() throws Exception {
NullFieldsCallback callback = new NullFieldsCallback();
StaxBuilderTest test = new StaxBuilderTest(actualXmlDataDir + "nullfields.xml", service, callback);
test.processXml();
}
Aggregations