@Test @Ignore public void testVerifyParameter() { URL nsresource = getClass().getResource( "/org/openbel/framework/core/namespace/test.belns"); String nsFileUrl = nsresource.toString(); if (nsFileUrl == null) { fail("Cannot read namespace location: " + nsFileUrl); } final Parameter p = CommonModelFactory.getInstance().createParameter( new Namespace("COMPLEX", nsFileUrl), "Propionyl Coa Carboxylase Complex"); try { namespaceService.verify(p); } catch (NamespaceSyntaxWarning e) { e.printStackTrace(); fail(e.getMessage()); } catch (IndexingFailure e) { e.printStackTrace(); fail(e.getMessage()); } catch (ResourceDownloadError e) { e.printStackTrace(); fail(e.getMessage()); } }
@Override public void verify(Parameter p) throws NamespaceSyntaxWarning, IndexingFailure, ResourceDownloadError { if (nulls(p, p.getValue())) { throw new InvalidArgument("p", p); } Namespace ns = p.getNamespace(); if (ns == null) { return; } String resourceLocation = ns.getResourceLocation(); if (resourceLocation == null) { throw new InvalidArgument("resourceLocation", resourceLocation); } synchronized (resourceLocation) { if (!isOpen(resourceLocation)) { final String indexPath = doCompile(resourceLocation); openNamespace(resourceLocation, indexPath); } } doVerify(p); }
DefaultNamespaceService implements NamespaceService,
        Destroyable { @Override public void verify(Parameter p) throws NamespaceSyntaxWarning, IndexingFailure, ResourceDownloadError { if (nulls(p, p.getValue())) { throw new InvalidArgument("p", p); } Namespace ns = p.getNamespace(); if (ns == null) { return; } String resourceLocation = ns.getResourceLocation(); if (resourceLocation == null) { throw new InvalidArgument("resourceLocation", resourceLocation); } synchronized (resourceLocation) { if (!isOpen(resourceLocation)) { final String indexPath = doCompile(resourceLocation); openNamespace(resourceLocation, indexPath); } } doVerify(p); } }
DefaultNamespaceService implements NamespaceService,
        Destroyable { @Override public void verify(Parameter p) throws NamespaceSyntaxWarning, IndexingFailure, ResourceDownloadError { if (nulls(p, p.getValue())) { throw new InvalidArgument("p", p); } Namespace ns = p.getNamespace(); if (ns == null) { return; } String resourceLocation = ns.getResourceLocation(); if (resourceLocation == null) { throw new InvalidArgument("resourceLocation", resourceLocation); } synchronized (resourceLocation) { if (!isOpen(resourceLocation)) { final String indexPath = doCompile(resourceLocation); openNamespace(resourceLocation, indexPath); } } doVerify(p); } DefaultNamespaceService(
            final CacheableResourceService resourceCache,
            final CacheLookupService cacheLookupService,
            final NamespaceIndexerService namespaceIndexerService); }
DefaultNamespaceService implements NamespaceService,
        Destroyable { @Override public void verify(Parameter p) throws NamespaceSyntaxWarning, IndexingFailure, ResourceDownloadError { if (nulls(p, p.getValue())) { throw new InvalidArgument("p", p); } Namespace ns = p.getNamespace(); if (ns == null) { return; } String resourceLocation = ns.getResourceLocation(); if (resourceLocation == null) { throw new InvalidArgument("resourceLocation", resourceLocation); } synchronized (resourceLocation) { if (!isOpen(resourceLocation)) { final String indexPath = doCompile(resourceLocation); openNamespace(resourceLocation, indexPath); } } doVerify(p); } DefaultNamespaceService(
            final CacheableResourceService resourceCache,
            final CacheLookupService cacheLookupService,
            final NamespaceIndexerService namespaceIndexerService); @Override boolean isOpen(String resourceLocation); @Override void compileNamespace(String resourceLocation); @Override void verify(Parameter p); @Override void verify(Statement s); @Override void verify(Document d); @Override String lookup(Parameter p); @Override Set<String> search(String resourceLocation, Pattern pattern); @Override void destroy(); @Override boolean isDestroyed(); boolean isRunning(); void start(); void stop(); }
DefaultNamespaceService implements NamespaceService,
        Destroyable { @Override public void verify(Parameter p) throws NamespaceSyntaxWarning, IndexingFailure, ResourceDownloadError { if (nulls(p, p.getValue())) { throw new InvalidArgument("p", p); } Namespace ns = p.getNamespace(); if (ns == null) { return; } String resourceLocation = ns.getResourceLocation(); if (resourceLocation == null) { throw new InvalidArgument("resourceLocation", resourceLocation); } synchronized (resourceLocation) { if (!isOpen(resourceLocation)) { final String indexPath = doCompile(resourceLocation); openNamespace(resourceLocation, indexPath); } } doVerify(p); } DefaultNamespaceService(
            final CacheableResourceService resourceCache,
            final CacheLookupService cacheLookupService,
            final NamespaceIndexerService namespaceIndexerService); @Override boolean isOpen(String resourceLocation); @Override void compileNamespace(String resourceLocation); @Override void verify(Parameter p); @Override void verify(Statement s); @Override void verify(Document d); @Override String lookup(Parameter p); @Override Set<String> search(String resourceLocation, Pattern pattern); @Override void destroy(); @Override boolean isDestroyed(); boolean isRunning(); void start(); void stop();  }