Java Code Examples for org.apache.kylin.cube.model.validation.ValidateContext#print()

The following examples show how to use org.apache.kylin.cube.model.validation.ValidateContext#print() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FunctionRuleTest.java    From kylin-on-parquet-v2 with Apache License 2.0 5 votes vote down vote up
@Test
public void testGoodDesc() throws IOException {
    FunctionRule rule = new FunctionRule();

    File f = new File(LocalFileMetadataTestCase.LOCALMETA_TEST_DATA + "/cube_desc/ssb.json");
    CubeDesc desc = JsonUtil.readValue(new FileInputStream(f), CubeDesc.class);
    desc.init(config);
    ValidateContext vContext = new ValidateContext();
    rule.validate(desc, vContext);
    vContext.print(System.out);
    assertTrue(vContext.getResults().length == 0);
}
 
Example 2
Source File: RowKeyAttrRuleTest.java    From kylin-on-parquet-v2 with Apache License 2.0 5 votes vote down vote up
@Test
public void testGoodDesc() throws IOException {
    for (File f : new File(LocalFileMetadataTestCase.LOCALMETA_TEST_DATA + "/cube_desc/").listFiles()) {
        CubeDesc desc = JsonUtil.readValue(new FileInputStream(f), CubeDesc.class);
        ValidateContext vContext = new ValidateContext();
        IValidatorRule<CubeDesc> rule = new RowKeyAttrRule();
        rule.validate(desc, vContext);
        vContext.print(System.out);
        assertTrue(vContext.getResults().length == 0);
    }
}
 
Example 3
Source File: RowKeyAttrRuleTest.java    From kylin-on-parquet-v2 with Apache License 2.0 5 votes vote down vote up
@Test
public void testBadDesc() throws IOException {
    ValidateContext vContext = new ValidateContext();
    CubeDesc desc = JsonUtil.readValue(new FileInputStream(LocalFileMetadataTestCase.LOCALMETA_TEST_DATA + "/cube_desc/test_kylin_cube_with_slr_desc.json"), CubeDesc.class);
    desc.getRowkey().getRowKeyColumns()[2].setColumn("");
    IValidatorRule<CubeDesc> rule = new RowKeyAttrRule();
    rule.validate(desc, vContext);
    vContext.print(System.out);
    assertTrue(vContext.getResults().length == 1);
    assertTrue("Rowkey column empty".equalsIgnoreCase(vContext.getResults()[0].getMessage()));
}
 
Example 4
Source File: FunctionRuleTest.java    From kylin with Apache License 2.0 5 votes vote down vote up
@Test
public void testGoodDesc() throws IOException {
    FunctionRule rule = new FunctionRule();

    File f = new File(LocalFileMetadataTestCase.LOCALMETA_TEST_DATA + "/cube_desc/ssb.json");
    CubeDesc desc = JsonUtil.readValue(new FileInputStream(f), CubeDesc.class);
    desc.init(config);
    ValidateContext vContext = new ValidateContext();
    rule.validate(desc, vContext);
    vContext.print(System.out);
    assertTrue(vContext.getResults().length == 0);
}
 
Example 5
Source File: RowKeyAttrRuleTest.java    From kylin with Apache License 2.0 5 votes vote down vote up
@Test
public void testGoodDesc() throws IOException {
    for (File f : new File(LocalFileMetadataTestCase.LOCALMETA_TEST_DATA + "/cube_desc/").listFiles()) {
        CubeDesc desc = JsonUtil.readValue(new FileInputStream(f), CubeDesc.class);
        ValidateContext vContext = new ValidateContext();
        IValidatorRule<CubeDesc> rule = new RowKeyAttrRule();
        rule.validate(desc, vContext);
        vContext.print(System.out);
        assertTrue(vContext.getResults().length == 0);
    }
}
 
Example 6
Source File: RowKeyAttrRuleTest.java    From kylin with Apache License 2.0 5 votes vote down vote up
@Test
public void testBadDesc() throws IOException {
    ValidateContext vContext = new ValidateContext();
    CubeDesc desc = JsonUtil.readValue(new FileInputStream(LocalFileMetadataTestCase.LOCALMETA_TEST_DATA + "/cube_desc/test_kylin_cube_with_slr_desc.json"), CubeDesc.class);
    desc.getRowkey().getRowKeyColumns()[2].setColumn("");
    IValidatorRule<CubeDesc> rule = new RowKeyAttrRule();
    rule.validate(desc, vContext);
    vContext.print(System.out);
    assertTrue(vContext.getResults().length == 1);
    assertTrue("Rowkey column empty".equalsIgnoreCase(vContext.getResults()[0].getMessage()));
}