public static void prepareTest(String[] additionalLayers, Object[] additionalLookupContent) throws IOException, SAXException, PropertyVetoException {
URL[] layers = new URL[additionalLayers.length + 1];
layers[0] = Utilities.class.getResource("/org/netbeans/modules/editor/errorstripe/resources/layer.xml");
for (int cntr = 0; cntr < additionalLayers.length; cntr++) {
layers[cntr + 1] = Utilities.class.getResource(additionalLayers[cntr]);
}
for (int cntr = 0; cntr < layers.length; cntr++) {
if (layers[cntr] == null) {
throw new IllegalStateException("layers[" + cntr + "]=null");
}
}
XMLFileSystem system = new XMLFileSystem();
system.setXmlUrls(layers);
Repository repository = new Repository(system);
Object[] lookupContent = new Object[additionalLookupContent.length + 1];
System.arraycopy(additionalLookupContent, 0, lookupContent, 1, additionalLookupContent.length);
lookupContent[0] = repository;
DEFAULT_LOOKUP.setLookup(lookupContent, UnitUtilities.class.getClassLoader());
}
UnitUtilities.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:incubator-netbeans
作者:
评论列表
文章目录