예제 #1
0
 public String getSqlBySqlFile(Class daoClass, Method method, String suffix) {
   String base = daoClass.getName().replace('.', '/') + "_" + method.getName();
   String dbmsPath =
       base + (StringUtil.isEmpty(suffix) ? "" : "_" + suffix) + DaoConstants.SQL_EXTENSION;
   String standardPath = base + DaoConstants.SQL_EXTENSION;
   if (ResourceUtil.isExist(dbmsPath)) {
     return TextUtil.readUTF8(dbmsPath);
   } else if (ResourceUtil.isExist(standardPath)) {
     return TextUtil.readUTF8(standardPath);
   }
   return null;
 }
예제 #2
0
 public DataSet read(TestContext testContext) {
   final String dirPath = testContext.getTestClassPackagePath();
   final boolean trimString = testContext.isTrimString();
   for (final String path : expectedDataXlsPaths) {
     if (ResourceUtil.isExist(path)) {
       return readXls(path, trimString);
     }
     final String newPath = dirPath + "/" + path;
     if (ResourceUtil.isExist(newPath)) {
       return readXls(newPath, trimString);
     }
   }
   return null;
 }