示例#1
0
  public void test_true() throws Exception {
    WallProvider provider = new MySqlWallProvider();

    Assert.assertTrue(
        provider.checkValid( //
            "COMMIT")); //

    Assert.assertEquals(0, provider.getTableStats().size());
    System.out.println(JSONUtils.toJSONString(provider.getStatsMap()));
  }
  protected void setUp() throws Exception {
    TabularData sqlList = JdbcStatManager.getInstance().getSqlList();
    if (sqlList.size() > 0) {
      for (Object item : JdbcStatManager.getInstance().getSqlList().values()) {
        String text = JSONUtils.toJSONString(item);
        System.out.println(text);
      }
    }

    Assert.assertEquals(0, JdbcStatManager.getInstance().getSqlList().size());

    dataSource = new DruidDataSource();
    dataSource.setUrl("jdbc:mock:xx");
    dataSource.setFilters("mergeStat");
    dataSource.setDbType("mysql");
  }
示例#3
0
 public static String returnJSONResult(int resultCode, Object content) {
   Map<String, Object> dataMap = new LinkedHashMap<String, Object>();
   dataMap.put("ResultCode", resultCode);
   dataMap.put("Content", content);
   return JSONUtils.toJSONString(dataMap);
 }