本文整理汇总了Java中com.indeed.proctor.common.ProctorUtils.readSpecification方法的典型用法代码示例。如果您正苦于以下问题:Java ProctorUtils.readSpecification方法的具体用法?Java ProctorUtils.readSpecification怎么用?Java ProctorUtils.readSpecification使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.indeed.proctor.common.ProctorUtils
的用法示例。
在下文中一共展示了ProctorUtils.readSpecification方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import com.indeed.proctor.common.ProctorUtils; //导入方法依赖的package包/类
public Proctor load(String definitionUrl, boolean forceReload) {
Proctor proctor = proctorCache.get(definitionUrl);
if (proctor != null && !forceReload) {
System.out.println("reusing cached " + definitionUrl);
return proctor;
}
try {
HttpURLConnection.setFollowRedirects(true); // for demo purposes, allow Java to follow redirects
ProctorSpecification spec = ProctorUtils.readSpecification(DefinitionManager.class.getResourceAsStream(DEFAULT_SPEC));
UrlProctorLoader loader = new UrlProctorLoader(spec, definitionUrl + "?r=" + random.nextInt());
proctor = loader.doLoad();
System.out.println("loaded definition from " + definitionUrl);
proctorCache.put(definitionUrl, proctor);
} catch (Throwable t) {
logger.error("Failed to load test spec/definition", t);
t.printStackTrace();
}
return proctor;
}
示例2: populateRootMap
import com.indeed.proctor.common.ProctorUtils; //导入方法依赖的package包/类
@Override
protected Map<String, Object> populateRootMap(final String input, final Map<String, Object> baseContext, final String packageName, final String className) {
final File inputFile = new File(input);
final ProctorSpecification spec = ProctorUtils.readSpecification(inputFile);
return populateRootMap(spec, baseContext, packageName, className);
}
示例3: getProctorSpecification
import com.indeed.proctor.common.ProctorUtils; //导入方法依赖的package包/类
private ProctorSpecification getProctorSpecification() throws IOException {
final InputStream specificationStream = getClass().getResourceAsStream(SPECIFICATION_RESOURCE);
try {
return ProctorUtils.readSpecification(specificationStream);
} finally {
specificationStream.close();
}
}
示例4: getProctorSpecification
import com.indeed.proctor.common.ProctorUtils; //导入方法依赖的package包/类
private ProctorSpecification getProctorSpecification() throws IOException {
final InputStream specicationStream = getClass().getResourceAsStream(SPECIFICATION_RESOURCE);
try {
return ProctorUtils.readSpecification(specicationStream);
} finally {
specicationStream.close();
}
}