Search in sources :

Example 1 with DbXref

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

the class DbXrefConverterTest method createDbXref.

public static DbXref createDbXref(String accession, String dbName, String linkURL, String url) {
    DbXref xref = DbXrefURLResolverDelegateTest.createDbXref(accession, dbName, linkURL);
    xref.setUrl(url);
    return xref;
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref)

Example 2 with DbXref

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

the class BgeeXrefURLResolverTest method testResolveBgeeENSG.

// entry/P51610/xref.json
@Test
public void testResolveBgeeENSG() throws Exception {
    String cleanAC = "stage_id=HsapDO:0000083&organ_id=EV:0100046&gene_id=ENSG00000124532&stage_children=on";
    DbXref xref = DbXrefURLResolverDelegateTest.createDbXref(cleanAC, "Bgee", "http://bgee.org/bgee/bgee?page=expression&action=data&%");
    Assert.assertEquals("http://bgee.org/bgee/bgee?page=expression&action=data&" + cleanAC, resolver.resolve(xref));
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) Test(org.junit.Test)

Example 3 with DbXref

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

the class BgeeXrefURLResolverTest method testResolveBgeeNoENSG.

// entry/P51610/xref.json
@Test
public void testResolveBgeeNoENSG() throws Exception {
    DbXref xref = DbXrefURLResolverDelegateTest.createDbXref("P51610", "Bgee", "http://bgee.unil.ch/bgee/bgee?uniprot_id=%s");
    Assert.assertEquals("http://bgee.org/bgee/bgee?uniprot_id=P51610", resolver.resolve(xref));
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) Test(org.junit.Test)

Example 4 with DbXref

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

the class DbXrefURLResolverDelegateTest method testResolveHPASubcellular.

// entry/NX_P51610/xref.json
@Test
public void testResolveHPASubcellular() throws Exception {
    DbXref xref = createDbXref("ENSG00000254647/subcellular", "HPA", "whatever");
    Assert.assertEquals("http://www.proteinatlas.org/ENSG00000254647/subcellular", resolver.resolve(xref));
    Assert.assertEquals("http://www.proteinatlas.org/%s", xref.getLinkUrl());
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) Test(org.junit.Test)

Example 5 with DbXref

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

the class DbXrefURLResolverDelegateTest method testResolveGenevestigator.

@Test
public void testResolveGenevestigator() throws Exception {
    DbXref xref = createDbXref("P01308", "Genevestigator", "whatever");
    Assert.assertEquals("http://genevisible.com/tissues/HS/UniProt/P01308", resolver.resolve(xref));
    Assert.assertEquals("http://genevisible.com/tissues/HS/UniProt/%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