Пример #1
0
  @Test
  public void initTestStaticSchemaManagerWithSchemaFile() throws TddlException {
    ExecutorContext executorContext = new ExecutorContext();
    ExecutorContext.setContext(executorContext);
    StaticSchemaManager s = new StaticSchemaManager("test_schema.xml", "andor_show", null);
    s.init();

    Assert.assertTrue(s.getTable("BMW_USERS") != null);
    Assert.assertEquals(9, s.getAllTables().size());
  }
Пример #2
0
  @Test
  public void initTestRuleSchemaManager() throws TddlException {
    ExecutorContext executorContext = new ExecutorContext();
    ExecutorContext.setContext(executorContext);
    TopologyHandler topology =
        new TopologyHandler("andor_show", null, "test_matrix_without_group_config.xml");
    executorContext.setTopologyHandler(topology);

    topology.init();
    TddlRule rule = new TddlRule();
    rule.setAppName("andor_show");
    rule.init();

    OptimizerRule optimizerRule = new OptimizerRule(rule);
    RuleSchemaManager s = new RuleSchemaManager(optimizerRule, topology.getMatrix());
    s.init();
    Assert.assertTrue(s.getTable("BMW_USERS") != null);
  }