Search in sources :

Example 21 with DbXref

use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.

the class DbXrefURLResolverDelegateTest method testResolveIFO.

@Test
public void testResolveIFO() throws Exception {
    DbXref xref = createDbXref("IFO1234", "IFO", "whatever/%s");
    Assert.assertEquals("http://cellbank.nibio.go.jp/~cellbank/cgi-bin/search_res_det.cgi?RNO=ifo1234", resolver.resolve(xref));
    Assert.assertEquals("http://cellbank.nibio.go.jp/~cellbank/cgi-bin/search_res_det.cgi?RNO=%s", xref.getLinkUrl());
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) Test(org.junit.Test)

Example 22 with DbXref

use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.

the class DbXrefURLResolverDelegateTest method testResolveUCSC.

@Test
public void testResolveUCSC() throws Exception {
    DbXref xref = createDbXrefWithEntry("NX_Q9UPW6", "uc002uuy.2", "UCSC", "http://www.some.org/this/template/should/be/overriden/%s");
    Assert.assertEquals("https://genome.ucsc.edu/cgi-bin/hgLinkIn?resource=uniprot&id=Q9UPW6", resolver.resolve(xref));
    Assert.assertEquals("https://genome.ucsc.edu/cgi-bin/hgLinkIn?resource=uniprot&id=%u", xref.getLinkUrl());
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) Test(org.junit.Test)

Example 23 with DbXref

use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.

the class DbXrefURLResolverDelegateTest method testResolveCLO.

@Test
public void testResolveCLO() throws Exception {
    DbXref xref = createDbXref("CLO:0000031", "CLO", "purl.obolibrary.org/obo/%s");
    Assert.assertEquals("http://purl.obolibrary.org/obo/CLO_0000031", resolver.resolve(xref));
    Assert.assertEquals("http://purl.obolibrary.org/obo/%s", xref.getLinkUrl());
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) Test(org.junit.Test)

Example 24 with DbXref

use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.

the class DbXrefURLResolverDelegateTest method testResolveWithDefaultResolverUniProt.

@Test
public void testResolveWithDefaultResolverUniProt() throws Exception {
    DbXref xref = createDbXref("Q8ZAF0", "UniProt", "http://www.uniprot.org/uniprot/%s");
    Assert.assertEquals("http://www.uniprot.org/uniprot/Q8ZAF0", resolver.resolve(xref));
    Assert.assertEquals("http://www.uniprot.org/uniprot/%s", xref.getLinkUrl());
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) Test(org.junit.Test)

Example 25 with DbXref

use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.

the class DbXrefURLResolverDelegateTest method testResolveClinvar.

@Test
public void testResolveClinvar() throws Exception {
    DbXref xref = createDbXref("HCFC1", "Clinvar", "url.whatever");
    Assert.assertEquals("http://www.ncbi.nlm.nih.gov/clinvar/?term=HCFC1", resolver.resolve(xref));
    Assert.assertEquals("http://www.ncbi.nlm.nih.gov/clinvar/?term=%s", xref.getLinkUrl());
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) Test(org.junit.Test)

Aggregations

DbXref (org.nextprot.api.core.domain.DbXref)146 Test (org.junit.Test)118 PublicationDbXref (org.nextprot.api.core.domain.PublicationDbXref)12 MapSqlParameterSource (org.springframework.jdbc.core.namedparam.MapSqlParameterSource)7 NamedParameterJdbcTemplate (org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate)7 SqlParameterSource (org.springframework.jdbc.core.namedparam.SqlParameterSource)7 DbXrefConverterTest.createDbXref (org.nextprot.api.core.service.dbxref.conv.DbXrefConverterTest.createDbXref)5 Entry (org.nextprot.api.core.domain.Entry)4 Xref2Annotation (org.nextprot.api.commons.constants.Xref2Annotation)3 AnnotationEvidence (org.nextprot.api.core.domain.annotation.AnnotationEvidence)3 DbXrefURLResolverDelegateTest (org.nextprot.api.core.service.dbxref.resolver.DbXrefURLResolverDelegateTest)3 CoreUnitBaseTest (org.nextprot.api.core.test.base.CoreUnitBaseTest)3 WebIntegrationBaseTest (org.nextprot.api.web.dbunit.base.mvc.WebIntegrationBaseTest)3 ImmutableList (com.google.common.collect.ImmutableList)2 Isoform (org.nextprot.api.core.domain.Isoform)2 Annotation (org.nextprot.api.core.domain.annotation.Annotation)2 PageView (org.nextprot.api.core.domain.ui.page.PageView)2 EnsemblXrefPropertyConverter (org.nextprot.api.core.service.dbxref.conv.EnsemblXrefPropertyConverter)2 Preconditions (com.google.common.base.Preconditions)1 Multimap (com.google.common.collect.Multimap)1