use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.
the class DbXrefURLResolverDelegateTest method testUnknownDbNameAndEmptyURL.
@Test(expected = UnresolvedXrefURLException.class)
public void testUnknownDbNameAndEmptyURL() throws Exception {
DbXref xref = createDbXref("babebibobu", "unknownDb", "");
resolver.resolve(xref);
}
use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.
the class DbXrefURLResolverDelegateTest method testResolveWithUrlEncodingShouldNotThrowUnresolvedXrefURLException.
@Test
public void testResolveWithUrlEncodingShouldNotThrowUnresolvedXrefURLException() throws Exception {
DbXref xref = createDbXref("Thymosin_%CE%B11", "UniPathway", "http://en.wikipedia.org/wiki/%s");
// resolver.resolve(xref, "http://en.wikipedia.org/wiki/Thymosin_%CE%B11");
resolver.resolve(xref);
}
use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.
the class DbXrefURLResolverDelegateTest method createDbXref.
public static DbXref createDbXref(String accession, String dbName, String linkURL) {
DbXref xref = new DbXref();
xref.setAccession(accession);
xref.setDatabaseName(dbName);
xref.setLinkUrl(linkURL);
return xref;
}
use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.
the class DbXrefURLResolverDelegateTest method testResolveFMA.
@Test
public void testResolveFMA() throws Exception {
DbXref xref = createDbXref("FMA:62955", "FMA", "http://purl.obolibrary.org/obo/%s");
Assert.assertEquals("http://purl.obolibrary.org/obo/FMA_62955", resolver.resolve(xref));
Assert.assertEquals("http://purl.obolibrary.org/obo/%s", xref.getLinkUrl());
}
use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.
the class DbXrefURLResolverDelegateTest method testResolveHSSP.
@Test
public void testResolveHSSP() throws Exception {
DbXref xref = createDbXref("PS50853", "HSSP", "%s");
Assert.assertEquals("http://ps50853", resolver.resolve(xref));
Assert.assertEquals("http://%s", xref.getLinkUrl());
}
Aggregations