* {@link SystemConfiguration system config} settings.</li>
* </ul>
*/
@BeforeClass
public static void createProtoNetwork() {
final CacheableResourceService crs = new DefaultCacheableResourceService();
final CacheLookupService cls = new DefaultCacheLookupService();
final NamespaceService nss = new DefaultNamespaceService( crs, cls,
new NamespaceIndexerServiceImpl());
final DefaultPhaseOne p1;
try {
p1 = new PhaseOneImpl(
new XBELValidatorServiceImpl(),
new XBELConverterServiceImpl(),
new BELValidatorServiceImpl(),
new BELConverterServiceImpl(),
nss,
new SemanticServiceImpl(nss), new ExpansionServiceImpl(),
new ProtoNetworkServiceImpl(),
new DefaultAnnotationService(),
new DefaultAnnotationDefinitionService(crs, cls));
} catch (Exception e) {
e.printStackTrace();
fail("failed to create Phase One due to exception");
return;
}
// read in BEL document and compile to proto network
final File doc = new File(DOC_PATH);
assertThat("test BEL document cannot be read", doc.canRead(), is(true));
Stage1Output p1s1 = p1.stage1BELValidation(doc);
final ProtoNetworkBuilder bldr = new ProtoNetworkBuilder(p1s1.getDocument());
pn = bldr.buildProtoNetwork();
// Create system configuration, BELFRAMEWORK_HOME must be set.
try {
createSystemConfiguration();
} catch (IOException e) {
e.printStackTrace();
fail("failed to load system configuration, set BELFRAMEWORK_HOME");
}
// Load resource index from system configuration settings.
final CacheableResourceService cache = new DefaultCacheableResourceService();
String resourceIndexURL = getSystemConfiguration().getResourceIndexURL();
try {
final ResolvedResource resource = cache.resolveResource(
ResourceType.RESOURCE_INDEX, resourceIndexURL);
ResourceIndex.INSTANCE.loadIndex(resource.getCacheResourceCopy());
} catch (ResourceDownloadError e) {
fail("failed to load resource index, download error");
} catch (FileNotFoundException e) {