本文整理了Java中com.simiacryptus.util.Util.mkString()
方法的一些代码示例,展示了Util.mkString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.mkString()
方法的具体详情如下:
包路径:com.simiacryptus.util.Util
类名称:Util
方法名:mkString
[英]Mk string string.
[中]Mk字符串。
代码示例来源:origin: com.simiacryptus/mindseye-labs
/**
* Gets test report location.
*
* @param sourceClass the source class
* @param reportingFolder
* @param suffix the suffix
* @return the test report location
*/
@Nonnull
public static File getTestReportLocation(@Nonnull final Class<?> sourceClass, String reportingFolder, @Nonnull final CharSequence... suffix) {
final StackTraceElement callingFrame = Thread.currentThread().getStackTrace()[2];
final CharSequence methodName = callingFrame.getMethodName();
final String className = sourceClass.getCanonicalName();
String classFilename = className.replaceAll("\\.", "/").replaceAll("\\$", "/");
@Nonnull File path = new File(Util.mkString(File.separator, reportingFolder, classFilename));
for (int i = 0; i < suffix.length - 1; i++) path = new File(path, suffix[i].toString());
String testName = suffix.length == 0 ? String.valueOf(methodName) : suffix[suffix.length - 1].toString();
File parent = path;
//parent = new File(path, new SimpleDateFormat("yyyy-MM-dd_HHmmss").format(new Date()));
path = new File(parent, testName + ".md");
path.getParentFile().mkdirs();
logger.info(String.format("Output Location: %s", path.getAbsoluteFile()));
return path;
}
代码示例来源:origin: com.simiacryptus/mindseye
/**
* Gets test report location.
*
* @param sourceClass the source class
* @param suffix the suffix
* @return the test report location
*/
@Nonnull
public static File getTestReportLocation(@Nonnull final Class<?> sourceClass, @Nonnull final CharSequence... suffix) {
final StackTraceElement callingFrame = Thread.currentThread().getStackTrace()[2];
final CharSequence methodName = callingFrame.getMethodName();
final String className = sourceClass.getCanonicalName();
String classFilename = className.replaceAll("\\.", "/").replaceAll("\\$", "/");
@Nonnull File path = new File(Util.mkString(File.separator, "reports", classFilename));
for (int i = 0; i < suffix.length - 1; i++) path = new File(path, suffix[i].toString());
String testName = suffix.length == 0 ? String.valueOf(methodName) : suffix[suffix.length - 1].toString();
File parent = path;
//parent = new File(path, new SimpleDateFormat("yyyy-MM-dd_HHmmss").format(new Date()));
path = new File(parent, testName + ".md");
path.getParentFile().mkdirs();
logger.info(String.format("Output Location: %s", path.getAbsoluteFile()));
return path;
}
代码示例来源:origin: com.simiacryptus/mindseye-test
/**
* Gets test report location.
*
* @param sourceClass the source class
* @param reportingFolder
* @param suffix the suffix
* @return the test report location
*/
@Nonnull
public static File getTestReportLocation(@Nonnull final Class<?> sourceClass, String reportingFolder, @Nonnull final CharSequence... suffix) {
final StackTraceElement callingFrame = Thread.currentThread().getStackTrace()[2];
final CharSequence methodName = callingFrame.getMethodName();
final String className = sourceClass.getCanonicalName();
String classFilename = className.replaceAll("\\.", "/").replaceAll("\\$", "/");
@Nonnull File path = new File(Util.mkString(File.separator, reportingFolder, classFilename));
for (int i = 0; i < suffix.length - 1; i++) path = new File(path, suffix[i].toString());
String testName = suffix.length == 0 ? String.valueOf(methodName) : suffix[suffix.length - 1].toString();
File parent = path;
//parent = new File(path, new SimpleDateFormat("yyyy-MM-dd_HHmmss").format(new Date()));
path = new File(parent, testName + ".md");
path.getParentFile().mkdirs();
logger.info(String.format("Output Location: %s", path.getAbsoluteFile()));
return path;
}
内容来源于网络,如有侵权,请联系作者删除!