Commit b8137f18 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch 'master' into frontend-refactor

Conflicts:
	annotation/src/main/java/lcsb/mapviewer/annotation/cache/XmlSerializer.java
	annotation/src/main/java/lcsb/mapviewer/annotation/services/MeSHParser.java
	pathvisio/testFiles/wikipathways/gstp.gpml
	web/src/main/webapp/resources/js/Functions.js
parents 2d873f8a 63c2e991
minerva (10.0.5) stable; urgency=medium
* Bug fix: interacting drugs can be found for RNAs
* Bug fix: error handling improved on map upload
-- Piotr Gawron <piotr.gawron@uni.lu> Tue, 31 Jan 2017 12:00:00 +0200
minerva (10.0.4) stable; urgency=medium
* Bug fix: overlays colors are centered in white (not black)
* Bug fix: export to CellDesigner fixed
* Bug fix: DrugBank connector updated due to change in DrugBank website
-- Piotr Gawron <piotr.gawron@uni.lu> Thu, 29 Dec 2016 17:01:16 +0200
minerva (10.0.3) stable; urgency=medium minerva (10.0.3) stable; urgency=medium
* Bug fix: login cannot contain whitespace * Bug fix: login cannot contain whitespace
...@@ -8,7 +23,7 @@ minerva (10.0.3) stable; urgency=medium ...@@ -8,7 +23,7 @@ minerva (10.0.3) stable; urgency=medium
* Bug fix: link to submap from comment panel * Bug fix: link to submap from comment panel
* Overlay coloring can be defined in Configuration * Overlay coloring can be defined in Configuration
-- Piotr Gawron <piotr.gawron@uni.lu> Thu, 10 Oct 2016 10:01:16 +0200 -- Piotr Gawron <piotr.gawron@uni.lu> Thu, 15 Dec 2016 15:01:16 +0200
minerva (10.0.2) stable; urgency=medium minerva (10.0.2) stable; urgency=medium
......
...@@ -837,6 +837,13 @@ public class BigFileCache { ...@@ -837,6 +837,13 @@ public class BigFileCache {
*/ */
public boolean isCached(String sourceUrl) { public boolean isCached(String sourceUrl) {
BigFileEntry entry = bigFileEntryDao.getByUrl(sourceUrl); BigFileEntry entry = bigFileEntryDao.getByUrl(sourceUrl);
if (entry != null) {
File f = new File(Configuration.getWebAppDir() + entry.getLocalPath());
if (!f.exists()) {
logger.warn("File is supposed to be cached but it's not there... " + sourceUrl);
return false;
}
}
return entry != null; return entry != null;
} }
......
...@@ -53,7 +53,7 @@ public class XmlSerializer<T> { ...@@ -53,7 +53,7 @@ public class XmlSerializer<T> {
jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
jaxbUnmarshaller = jaxbContext.createUnmarshaller(); jaxbUnmarshaller = jaxbContext.createUnmarshaller();
} catch (JAXBException e) { } catch (JAXBException e) {
throw new SerializationException(); throw new SerializationException(e);
} }
} }
...@@ -73,6 +73,8 @@ public class XmlSerializer<T> { ...@@ -73,6 +73,8 @@ public class XmlSerializer<T> {
jaxbMarshaller.marshal(object, sw); jaxbMarshaller.marshal(object, sw);
} catch (JAXBException e) { } catch (JAXBException e) {
throw new SerializationException(e); throw new SerializationException(e);
} catch (Exception e) {
throw new SerializationException(e);
} }
return sw.toString(); return sw.toString();
} }
......
...@@ -496,10 +496,18 @@ public class ChEMBLParser extends DrugAnnotation implements IExternalService { ...@@ -496,10 +496,18 @@ public class ChEMBLParser extends DrugAnnotation implements IExternalService {
Document document = getXmlDocumentFromString(content); Document document = getXmlDocumentFromString(content);
Node response = getNode("response", document); Node response = getNode("response", document);
if (response == null) {
throw new DrugSearchException("Invalid source XML for drug: " + drugId);
}
Node moleculesNode = getNode("molecules", response); Node moleculesNode = getNode("molecules", response);
if (moleculesNode == null) {
throw new DrugSearchException("Invalid source XML for drug: " + drugId);
}
Node moleculeNode = getNode("molecule", moleculesNode); Node moleculeNode = getNode("molecule", moleculesNode);
if (moleculeNode == null) {
throw new DrugSearchException("Invalid source XML for drug: " + drugId);
}
return parseDrug(moleculeNode); return parseDrug(moleculeNode);
} catch (IOException e) { } catch (IOException e) {
throw new DrugSearchException("Problem with accessing external database for id: " + drugId, e); throw new DrugSearchException("Problem with accessing external database for id: " + drugId, e);
} catch (InvalidXmlSchemaException e) { } catch (InvalidXmlSchemaException e) {
......
...@@ -572,7 +572,7 @@ public class DrugbankHTMLParser extends DrugAnnotation implements IExternalServi ...@@ -572,7 +572,7 @@ public class DrugbankHTMLParser extends DrugAnnotation implements IExternalServi
int id = page.indexOf("<th>DrugBank ID</th>"); int id = page.indexOf("<th>DrugBank ID</th>");
if (id < 0) { if (id < 0) {
throw new InvalidArgumentException("Problematic web page"); throw new DrugSearchException("Problematic web page for target: " + drugbankTarget + "(" + hgncTarget + ")");
} }
int i = page.indexOf("/polypeptides/"); int i = page.indexOf("/polypeptides/");
......
...@@ -2,8 +2,6 @@ package lcsb.mapviewer.annotation.services; ...@@ -2,8 +2,6 @@ package lcsb.mapviewer.annotation.services;
import java.io.IOException; import java.io.IOException;
import javax.sql.rowset.serial.SerialException;
import org.apache.commons.lang3.SerializationException; import org.apache.commons.lang3.SerializationException;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.w3c.dom.Node; import org.w3c.dom.Node;
......
...@@ -54,7 +54,7 @@ public class PubmedParser extends CachableInterface implements IExternalService ...@@ -54,7 +54,7 @@ public class PubmedParser extends CachableInterface implements IExternalService
/** /**
* Version of the remote API thnat is supported by this connecting class. * Version of the remote API thnat is supported by this connecting class.
*/ */
static final String SUPPORTED_VERSION = "4.5.3"; static final String SUPPORTED_VERSION = "4.5.3.2";
/** /**
* Connector used for accessing data from miriam registry. * Connector used for accessing data from miriam registry.
...@@ -258,6 +258,7 @@ public class PubmedParser extends CachableInterface implements IExternalService ...@@ -258,6 +258,7 @@ public class PubmedParser extends CachableInterface implements IExternalService
try { try {
Article art = getPubmedArticleById(SERVICE_STATUS_PUBMED_ID); Article art = getPubmedArticleById(SERVICE_STATUS_PUBMED_ID);
if (!getApiVersion().equals(SUPPORTED_VERSION)) { if (!getApiVersion().equals(SUPPORTED_VERSION)) {
logger.debug("New europepmc API version: " + getApiVersion());
status.setStatus(ExternalServiceStatusType.CHANGED); status.setStatus(ExternalServiceStatusType.CHANGED);
} else if (art == null) { } else if (art == null) {
status.setStatus(ExternalServiceStatusType.DOWN); status.setStatus(ExternalServiceStatusType.DOWN);
......
package lcsb.mapviewer.annotation.services.annotators; package lcsb.mapviewer.annotation.services.annotators;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
...@@ -176,6 +178,28 @@ public abstract class ElementAnnotator extends CachableInterface { ...@@ -176,6 +178,28 @@ public abstract class ElementAnnotator extends CachableInterface {
} }
} }
/**
* Sets synonyms to the element.
*
* @param element
* element where we change data
* @param synonyms
* new synonyms list
* @param prefix
* prefix used in warnings
*/
protected void setSynonyms(AnnotatedObject element, Collection<String> synonyms, String prefix) {
if (element.getSynonyms() == null || element.getSynonyms().size() == 0) {
List<String> sortedSynonyms = new ArrayList<>();
sortedSynonyms.addAll(synonyms);
Collections.sort(sortedSynonyms);
element.setSynonyms(sortedSynonyms);
} else {
logger.warn(prefix + "Synonyms don't match: \"" + synonyms + "\", \"" + element.getSynonyms() + "\"");
}
}
/** /**
* Sets name to the element. * Sets name to the element.
* *
......
package lcsb.mapviewer.annotation.services.annotators; package lcsb.mapviewer.annotation.services.annotators;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.List;
import java.util.Set; import java.util.Set;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
...@@ -44,7 +41,7 @@ public class EnsemblAnnotator extends ElementAnnotator implements IExternalServi ...@@ -44,7 +41,7 @@ public class EnsemblAnnotator extends ElementAnnotator implements IExternalServi
/** /**
* Version of the rest API that is supported by this annotator. * Version of the rest API that is supported by this annotator.
*/ */
static final String SUPPORTED_VERSION = "4.7"; static final String SUPPORTED_VERSION = "4.8";
/** /**
* Url address of ensembl restfull service. * Url address of ensembl restfull service.
...@@ -252,10 +249,7 @@ public class EnsemblAnnotator extends ElementAnnotator implements IExternalServi ...@@ -252,10 +249,7 @@ public class EnsemblAnnotator extends ElementAnnotator implements IExternalServi
} }
} }
if (synonyms.size() > 0) { if (synonyms.size() > 0) {
List<String> sortedSynonyms = new ArrayList<String>(); setSynonyms(annotatedObject, synonyms, prefix);
sortedSynonyms.addAll(synonyms);
Collections.sort(sortedSynonyms);
annotatedObject.setSynonyms(sortedSynonyms);
} }
} catch (WrongResponseCodeIOException e) { } catch (WrongResponseCodeIOException e) {
logger.warn(prefix + "Cannot find information for ensembl: " + entrezMiriamData.getResource()); logger.warn(prefix + "Cannot find information for ensembl: " + entrezMiriamData.getResource());
......
...@@ -189,7 +189,7 @@ public class EntrezAnnotator extends ElementAnnotator implements IExternalServic ...@@ -189,7 +189,7 @@ public class EntrezAnnotator extends ElementAnnotator implements IExternalServic
setFullName((Element) element, data.getFullName(), prefix); setFullName((Element) element, data.getFullName(), prefix);
element.addMiriamData(data.getMiriamData()); element.addMiriamData(data.getMiriamData());
element.setSynonyms(data.getSynonyms()); setSynonyms(element, data.getSynonyms(), prefix);
setDescription(element, data.getDescription()); setDescription(element, data.getDescription());
} }
......
...@@ -208,7 +208,7 @@ public class HgncAnnotator extends ElementAnnotator implements IExternalService ...@@ -208,7 +208,7 @@ public class HgncAnnotator extends ElementAnnotator implements IExternalService
} }
((Element) element).setFormerSymbols(strings); ((Element) element).setFormerSymbols(strings);
} else if (type.equals("alias_symbol")) { } else if (type.equals("alias_symbol")) {
List<String> strings = new ArrayList<String>(); List<String> strings = new ArrayList<>();
NodeList sublist = node.getChildNodes(); NodeList sublist = node.getChildNodes();
for (int j = 0; j < sublist.getLength(); j++) { for (int j = 0; j < sublist.getLength(); j++) {
Node subnode = sublist.item(j); Node subnode = sublist.item(j);
...@@ -216,7 +216,7 @@ public class HgncAnnotator extends ElementAnnotator implements IExternalService ...@@ -216,7 +216,7 @@ public class HgncAnnotator extends ElementAnnotator implements IExternalService
strings.add(getNodeValue(subnode)); strings.add(getNodeValue(subnode));
} }
} }
element.setSynonyms(strings); setSynonyms(element, strings, prefix);
} else if (type.equals("uniprot_ids")) { } else if (type.equals("uniprot_ids")) {
NodeList sublist = node.getChildNodes(); NodeList sublist = node.getChildNodes();
for (int j = 0; j < sublist.getLength(); j++) { for (int j = 0; j < sublist.getLength(); j++) {
......
package lcsb.mapviewer.annotation.services.annotators; package lcsb.mapviewer.annotation.services.annotators;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry; import java.util.Map.Entry;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
...@@ -208,6 +210,12 @@ public class ReconAnnotator extends ElementAnnotator implements IExternalService ...@@ -208,6 +210,12 @@ public class ReconAnnotator extends ElementAnnotator implements IExternalService
} }
} else if (key.equals("keggId")) { } else if (key.equals("keggId")) {
addKeggMiriam(annotatedObject, value, prefix); addKeggMiriam(annotatedObject, value, prefix);
} else if (key.equals("fullName")) {
if (annotatedObject instanceof Element) {
setFullName((Element) annotatedObject, value, prefix);
} else {
unknown = true;
}
} else if (key.equals("keggorthology")) { } else if (key.equals("keggorthology")) {
addKeggMiriam(annotatedObject, value, prefix); addKeggMiriam(annotatedObject, value, prefix);
} else if (key.equals("pubChemId")) { } else if (key.equals("pubChemId")) {
...@@ -216,6 +224,12 @@ public class ReconAnnotator extends ElementAnnotator implements IExternalService ...@@ -216,6 +224,12 @@ public class ReconAnnotator extends ElementAnnotator implements IExternalService
addHmdbMiriam(annotatedObject, value); addHmdbMiriam(annotatedObject, value);
} else if (key.equals("cog")) { } else if (key.equals("cog")) {
addCogMiriam(annotatedObject, value); addCogMiriam(annotatedObject, value);
} else if (key.equals("synonyms")) {
List<String> synonyms = new ArrayList<>();
for (String str : value.split(",")) {
synonyms.add(str);
}
setSynonyms(annotatedObject, synonyms, prefix);
} else if (key.equals("pdmapName")) { } else if (key.equals("pdmapName")) {
// for now we skip it... // for now we skip it...
continue; continue;
......
...@@ -72,8 +72,11 @@ public class ChEMBLParserTest extends AnnotationTestFunctions { ...@@ -72,8 +72,11 @@ public class ChEMBLParserTest extends AnnotationTestFunctions {
assertEquals("CABOZANTINIB", drug.getName()); assertEquals("CABOZANTINIB", drug.getName());
assertNull(drug.getDescription()); assertNull(drug.getDescription());
assertEquals(2, drug.getTargets().size()); assertEquals(2, drug.getTargets().size());
logger.debug(drug.getSynonyms()); List<String> lowerCaseSynonyms = new ArrayList<>();
assertTrue(drug.getSynonyms().contains("Cabozantinib")); for (String s: drug.getSynonyms()) {
lowerCaseSynonyms.add(s.toLowerCase());
}
assertTrue(lowerCaseSynonyms.contains("cabozantinib"));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -51,11 +51,11 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions { ...@@ -51,11 +51,11 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions {
drugBankHTMLParser.setCache(cache); drugBankHTMLParser.setCache(cache);
} }
@Test @Test
public void test1FindDrug() throws Exception { public void test1FindDrug() throws Exception {
try { try {
Drug test = drugBankHTMLParser.findDrug("Urokinase"); Drug test = drugBankHTMLParser.findDrug("Urokinase");
assertNotNull(test);
assertEquals(MiriamType.DRUGBANK, test.getSources().get(0).getDataType()); assertEquals(MiriamType.DRUGBANK, test.getSources().get(0).getDataType());
assertEquals("DB00013", test.getSources().get(0).getResource()); assertEquals("DB00013", test.getSources().get(0).getResource());
assertEquals("Urokinase", test.getName()); assertEquals("Urokinase", test.getName());
...@@ -73,8 +73,8 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions { ...@@ -73,8 +73,8 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions {
@Test @Test
public void test2FindDrug() throws Exception { public void test2FindDrug() throws Exception {
try { try {
Drug test = drugBankHTMLParser.findDrug("diazoxide"); Drug test = drugBankHTMLParser.findDrug("diazoxide");
assertNotNull(test);
assertEquals("Diazoxide", test.getName()); assertEquals("Diazoxide", test.getName());
assertEquals("DB01119", test.getSources().get(0).getResource()); assertEquals("DB01119", test.getSources().get(0).getResource());
assertTrue(test.getBloodBrainBarrier().equalsIgnoreCase("YES")); assertTrue(test.getBloodBrainBarrier().equalsIgnoreCase("YES"));
...@@ -91,17 +91,17 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions { ...@@ -91,17 +91,17 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions {
@Test @Test
public void test3FindDrug() throws Exception { public void test3FindDrug() throws Exception {
try { try {
// finding synonym // finding synonym
Drug test = drugBankHTMLParser.findDrug("Rapamycin"); Drug rapamycinDrug = drugBankHTMLParser.findDrug("Rapamycin");
assertEquals("Sirolimus", test.getName()); assertNotNull(rapamycinDrug);
assertEquals("DB00877", test.getSources().get(0).getResource()); assertEquals("Sirolimus", rapamycinDrug.getName());
assertTrue(test.getBloodBrainBarrier().equalsIgnoreCase("NO")); assertEquals("DB00877", rapamycinDrug.getSources().get(0).getResource());
boolean res = test.getDescription().contains( assertTrue(rapamycinDrug.getBloodBrainBarrier().equalsIgnoreCase("NO"));
boolean res = rapamycinDrug.getDescription().contains(
"A macrolide compound obtained from Streptomyces hygroscopicus that acts by selectively blocking the transcriptional activation of cytokines thereby inhibiting cytokine production. It is bioactive only when bound to immunophilins. Sirolimus is a potent immunosuppressant and possesses both antifungal and antineoplastic properties. [PubChem]"); "A macrolide compound obtained from Streptomyces hygroscopicus that acts by selectively blocking the transcriptional activation of cytokines thereby inhibiting cytokine production. It is bioactive only when bound to immunophilins. Sirolimus is a potent immunosuppressant and possesses both antifungal and antineoplastic properties. [PubChem]");
assertTrue(res); assertTrue(res);
assertEquals(3, test.getTargets().size()); assertEquals(3, rapamycinDrug.getTargets().size());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -114,6 +114,7 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions { ...@@ -114,6 +114,7 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions {
try { try {
Drug test = drugBankHTMLParser.findDrug("Methylamine"); Drug test = drugBankHTMLParser.findDrug("Methylamine");
assertNotNull(test);
assertEquals("Methylamine", test.getName()); assertEquals("Methylamine", test.getName());
assertEquals("DB01828", test.getSources().get(0).getResource()); assertEquals("DB01828", test.getSources().get(0).getResource());
assertEquals(null, test.getDescription()); assertEquals(null, test.getDescription());
...@@ -135,15 +136,15 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions { ...@@ -135,15 +136,15 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions {
@Test @Test
public void test5FindDrug() throws Exception { public void test5FindDrug() throws Exception {
try { try {
Drug test = drugBankHTMLParser.findDrug("Amantadine"); Drug amantadineDrug = drugBankHTMLParser.findDrug("Amantadine");
assertEquals("Amantadine", test.getName()); assertNotNull(amantadineDrug);
assertEquals("DB00915", test.getSources().get(0).getResource()); assertEquals("Amantadine", amantadineDrug.getName());
boolean res = test.getDescription().contains( assertEquals("DB00915", amantadineDrug.getSources().get(0).getResource());
boolean res = amantadineDrug.getDescription().contains(
"An antiviral that is used in the prophylactic or symptomatic treatment of influenza A. It is also used as an antiparkinsonian agent, to treat extrapyramidal reactions, and for postherpetic neuralgia. The mechanisms of its effects in movement disorders are not well understood but probably reflect an increase in synthesis and release of dopamine, with perhaps some inhibition of dopamine uptake. [PubChem]"); "An antiviral that is used in the prophylactic or symptomatic treatment of influenza A. It is also used as an antiparkinsonian agent, to treat extrapyramidal reactions, and for postherpetic neuralgia. The mechanisms of its effects in movement disorders are not well understood but probably reflect an increase in synthesis and release of dopamine, with perhaps some inhibition of dopamine uptake. [PubChem]");
assertTrue(res); assertTrue(res);
assertEquals(3, test.getTargets().size()); assertEquals(3, amantadineDrug.getTargets().size());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -153,7 +154,6 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions { ...@@ -153,7 +154,6 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions {
@Test @Test
public void test6FindDrug() throws Exception { public void test6FindDrug() throws Exception {
try { try {
Drug test = drugBankHTMLParser.findDrug("qwertyuiop"); Drug test = drugBankHTMLParser.findDrug("qwertyuiop");
assertEquals(null, test); assertEquals(null, test);
...@@ -166,8 +166,8 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions { ...@@ -166,8 +166,8 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions {
@Test @Test
public void test7FindDrug() throws Exception { public void test7FindDrug() throws Exception {
try { try {
Drug test = drugBankHTMLParser.findDrug("Aluminum hydroxide"); Drug test = drugBankHTMLParser.findDrug("Aluminum hydroxide");
assertNotNull(test);
assertEquals("Aluminum hydroxide", test.getName()); assertEquals("Aluminum hydroxide", test.getName());
assertEquals("DB06723", test.getSources().get(0).getResource()); assertEquals("DB06723", test.getSources().get(0).getResource());
assertTrue( assertTrue(
...@@ -421,9 +421,9 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions { ...@@ -421,9 +421,9 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions {
@Test @Test
public void testFindIbuprofen() throws Exception { public void testFindIbuprofen() throws Exception {
try { try {
Drug test = drugBankHTMLParser.findDrug("Ibuprofen"); Drug test = drugBankHTMLParser.findDrug("Ibuprofen");
assertNotNull(test);
assertEquals("Ibuprofen", test.getName()); assertEquals("Ibuprofen", test.getName());
assertEquals("DB01050", test.getSources().get(0).getResource()); assertEquals("DB01050", test.getSources().get(0).getResource());
assertNotNull(test.getDescription()); assertNotNull(test.getDescription());
...@@ -440,6 +440,7 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions { ...@@ -440,6 +440,7 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions {
try { try {
Drug test = drugBankHTMLParser.findDrug("Dopamine"); Drug test = drugBankHTMLParser.findDrug("Dopamine");
assertNotNull(test);
for (Target target : test.getTargets()) { for (Target target : test.getTargets()) {
assertFalse(target.getName().contains("Details")); assertFalse(target.getName().contains("Details"));
} }
...@@ -451,10 +452,10 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions { ...@@ -451,10 +452,10 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions {
@Test @Test
public void testFindGadobutrol() throws Exception { public void testFindGadobutrol() throws Exception {
try { try {
Drug test = drugBankHTMLParser.findDrug("Gadobutrol"); Drug gadobutrolDrug = drugBankHTMLParser.findDrug("Gadobutrol");
assertTrue(test.getBloodBrainBarrier().equalsIgnoreCase("NO")); assertNotNull(gadobutrolDrug);
assertTrue(gadobutrolDrug.getBloodBrainBarrier().equalsIgnoreCase("NO"));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw e; throw e;
...@@ -466,6 +467,7 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions { ...@@ -466,6 +467,7 @@ public class DrugbankHTMLParserTest extends AnnotationTestFunctions {
try { try {