Commit 3bd21931 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '1277-problem-with-identifiers-org-annotations' into 'master'

Resolve "problem with identifiers.org annotations"

Closes #1277

See merge request !1168
parents 02c1436d 5f74ba26
Pipeline #28019 passed with stage
in 11 minutes and 19 seconds
......@@ -33,7 +33,7 @@ public enum MiriamType {
BiGG_COMPARTMENT("BiGG Compartment",
"http://bigg.ucsd.edu/compartments/",
new String[] { "urn:miriam:bigg.compartment" },
new String[] { "urn:miriam:bigg.compartment", "https://identifiers.org/bigg.compartment/" },
new Class<?>[] {},
"MIR:00000555",
new Class<?>[] {},
......@@ -42,7 +42,7 @@ public enum MiriamType {
BiGG_METABOLITE("BiGG Metabolite",
"http://bigg.ucsd.edu/universal/metabolites",
new String[] { "urn:miriam:bigg.metabolite" },
new String[] { "urn:miriam:bigg.metabolite", "https://identifiers.org/bigg.metabolite/" },
new Class<?>[] {}, "MIR:00000556",
new Class<?>[] {},
"bigg.metabolite",
......@@ -50,7 +50,7 @@ public enum MiriamType {
BiGG_REACTIONS("BiGG Reaction",
"http://bigg.ucsd.edu/universal/reactions",
new String[] { "urn:miriam:bigg.reaction" },
new String[] { "urn:miriam:bigg.reaction", "https://identifiers.org/bigg.reaction/" },
new Class<?>[] {}, "MIR:00000557",
new Class<?>[] {},
"bigg.reaction",
......@@ -69,7 +69,7 @@ public enum MiriamType {
*/
BRENDA("BRENDA",
"http://www.brenda-enzymes.org",
new String[] { "urn:miriam:brenda" },
new String[] { "urn:miriam:brenda", "https://identifiers.org/brenda/" },
new Class<?>[] {}, "MIR:00000071",
new Class<?>[] {},
"brenda",
......@@ -91,7 +91,7 @@ public enum MiriamType {
*/
CAZY("CAZy",
"http://commonchemistry.org",
new String[] { "urn:miriam:cazy" },
new String[] { "urn:miriam:cazy", "https://identifiers.org/cazy/" },
new Class<?>[] {}, "MIR:00000195",
new Class<?>[] {},
"cazy",
......@@ -102,7 +102,7 @@ public enum MiriamType {
*/
CCDS("Consensus CDS",
"http://www.ncbi.nlm.nih.gov/CCDS/",
new String[] { "urn:miriam:ccds" },
new String[] { "urn:miriam:ccds", "https://identifiers.org/ccds/" },
new Class<?>[] {}, "MIR:00000375",
new Class<?>[] {},
"ccds",
......@@ -123,7 +123,7 @@ public enum MiriamType {
CHEM_ID_PLUS("ChemIDplus",
"https://chem.nlm.nih.gov/chemidplus/",
new String[] { "urn:miriam:chemidplus" },
new String[] { "urn:miriam:chemidplus", "https://identifiers.org/chemidplus/" },
new Class<?>[] { Chemical.class, Drug.class, }, "MIR:00000096",
new Class<?>[] { Chemical.class },
"chemidplus",
......@@ -135,7 +135,7 @@ public enum MiriamType {
*/
CHEMSPIDER("ChemSpider",
"http://www.chemspider.com//",
new String[] { "urn:miriam:chemspider" },
new String[] { "urn:miriam:chemspider", "https://identifiers.org/chemspider/" },
new Class<?>[] {}, "MIR:00000138",
new Class<?>[] {},
"chemspider",
......@@ -146,7 +146,7 @@ public enum MiriamType {
*/
CHEMBL_COMPOUND("ChEMBL",
"https://www.ebi.ac.uk/chembldb/",
new String[] { "urn:miriam:chembl.compound" },
new String[] { "urn:miriam:chembl.compound", "https://identifiers.org/chembl.compound/" },
new Class<?>[] { Drug.class }, "MIR:00000084",
new Class<?>[] {},
"chembl.compound",
......@@ -157,7 +157,7 @@ public enum MiriamType {
*/
CHEMBL_TARGET("ChEMBL target",
"https://www.ebi.ac.uk/chembldb/",
new String[] { "urn:miriam:chembl.target" },
new String[] { "urn:miriam:chembl.target", "https://identifiers.org/chembl.target/" },
new Class<?>[] { Protein.class, Complex.class }, "MIR:00000085",
new Class<?>[] {},
"chembl.target",
......@@ -165,7 +165,7 @@ public enum MiriamType {
CLINICAL_TRIALS_GOV("ClinicalTrials.gov",
"https://clinicaltrials.gov/",
new String[] { "urn:miriam:clinicaltrials" },
new String[] { "urn:miriam:clinicaltrials", "https://identifiers.org/clinicaltrials/" },
new Class<?>[] {}, "MIR:00000137",
new Class<?>[] {},
"clinicaltrials",
......@@ -199,7 +199,7 @@ public enum MiriamType {
*/
DRUGBANK("DrugBank",
"http://www.drugbank.ca/",
new String[] { "urn:miriam:drugbank" },
new String[] { "urn:miriam:drugbank", "https://identifiers.org/drugbank/" },
new Class<?>[] { Drug.class }, "MIR:00000102",
new Class<?>[] {},
"drugbank",
......@@ -210,7 +210,7 @@ public enum MiriamType {
*/
DRUGBANK_TARGET_V4("DrugBank Target v4",
"http://www.drugbank.ca/targets",
new String[] { "urn:miriam:drugbankv4.target" },
new String[] { "urn:miriam:drugbankv4.target", "https://identifiers.org/drugbankv4.target/" },
new Class<?>[] {}, "MIR:00000528",
new Class<?>[] {},
"drugbankv4.target",
......@@ -229,7 +229,7 @@ public enum MiriamType {
ECOGENE("EcoGene",
"http://ecogene.org/",
new String[] { "urn:miriam:ecogene" },
new String[] { "urn:miriam:ecogene", "https://identifiers.org/ecogene/" },
new Class<?>[] {}, "MIR:00000163",
new Class<?>[] {},
"ecogene",
......@@ -251,7 +251,7 @@ public enum MiriamType {
*/
ENSEMBL_PLANTS("Ensembl Plants",
"http://plants.ensembl.org/",
new String[] { "urn:miriam:ensembl.plant" },
new String[] { "urn:miriam:ensembl.plant", "https://identifiers.org/ensembl.plant/" },
new Class<?>[] {}, "MIR:00000205",
new Class<?>[] {},
"ensembl.plant",
......@@ -278,7 +278,7 @@ public enum MiriamType {
FLYBASE("FlyBase",
"https://www.alliancegenome.org",
new String[] { "urn:miriam:fb", "urn:miriam:flybase" },
new String[] { "urn:miriam:fb", "urn:miriam:flybase", "https://identifiers.org/fb/" },
new Class<?>[] {}, "MIR:00000030",
new Class<?>[] {},
"fb",
......@@ -286,7 +286,7 @@ public enum MiriamType {
GENE_DB("GeneDB",
"https://www.genedb.org/",
new String[] { "urn:miriam:genedb" },
new String[] { "urn:miriam:genedb", "https://identifiers.org/genedb/" },
new Class<?>[] {}, "MIR:00000106",
new Class<?>[] {},
"genedb",
......@@ -309,7 +309,7 @@ public enum MiriamType {
*/
HGNC("HGNC",
"http://www.genenames.org",
new String[] { "urn:miriam:hgnc" },
new String[] { "urn:miriam:hgnc", "https://identifiers.org/hgnc/" },
new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000080",
new Class<?>[] { Protein.class, Gene.class, Rna.class },
"hgnc",
......@@ -320,7 +320,7 @@ public enum MiriamType {
*/
HGNC_SYMBOL("HGNC Symbol",
"http://www.genenames.org",
new String[] { "urn:miriam:hgnc.symbol" },
new String[] { "urn:miriam:hgnc.symbol", "https://identifiers.org/hgnc.symbol/" },
new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000362",
new Class<?>[] { Protein.class, Gene.class, Rna.class },
"hgnc.symbol",
......@@ -331,7 +331,7 @@ public enum MiriamType {
*/
HMDB("HMDB",
"http://www.hmdb.ca/",
"urn:miriam:hmdb",
new String[] { "urn:miriam:hmdb", "https://identifiers.org/hmdb/" },
new Class<?>[] { Chemical.class, Drug.class, }, "MIR:00000051",
new Class<?>[] {},
"hmdb",
......@@ -339,7 +339,7 @@ public enum MiriamType {
INTACT("IntAct",
"https://www.ebi.ac.uk/intact/",
new String[] { "urn:miriam:intact" },
new String[] { "urn:miriam:intact", "https://identifiers.org/intact/" },
new Class<?>[] {}, "MIR:00000010",
new Class<?>[] {},
"intact",
......@@ -399,7 +399,7 @@ public enum MiriamType {
*/
KEGG_ORTHOLOGY("KEGG Orthology",
"http://www.genome.jp/kegg/ko.html",
new String[] { "urn:miriam:kegg.orthology" },
new String[] { "urn:miriam:kegg.orthology", "https://identifiers.org/kegg.orthology/" },
new Class<?>[] {}, "MIR:00000116",
new Class<?>[] {},
"kegg.orthology",
......@@ -429,7 +429,7 @@ public enum MiriamType {
KNAPSACK("KnapSack",
"http://kanaya.aist-nara.ac.jp/KNApSAcK/",
new String[] { "urn:miriam:knapsack" },
new String[] { "urn:miriam:knapsack", "https://identifiers.org/knapsack/" },
new Class<?>[] {}, "MIR:00000271",
new Class<?>[] {},
"knapsack",
......@@ -445,7 +445,7 @@ public enum MiriamType {
LIPID_MAPS("LIPID MAPS",
"http://www.lipidmaps.org",
new String[] { "urn:miriam:lipidmaps" },
new String[] { "urn:miriam:lipidmaps", "https://identifiers.org/lipidmaps/" },
new Class<?>[] {}, "MIR:00000052",
new Class<?>[] {},
"lipidmaps",
......@@ -456,7 +456,7 @@ public enum MiriamType {
*/
MESH_2012("MeSH",
"http://www.nlm.nih.gov/mesh/",
new String[] { "urn:miriam:mesh", "urn:miriam:mesh.2012" },
new String[] { "urn:miriam:mesh", "urn:miriam:mesh.2012", "https://identifiers.org/mesh/" },
new Class<?>[] { Phenotype.class, Compartment.class, Complex.class }, "MIR:00000560",
new Class<?>[] {},
"mesh",
......@@ -467,7 +467,7 @@ public enum MiriamType {
*/
MI_R_BASE_SEQUENCE("miRBase Sequence Database",
"http://www.mirbase.org/",
new String[] { "urn:miriam:mirbase" },
new String[] { "urn:miriam:mirbase", "https://identifiers.org/mirbase/" },
new Class<?>[] {}, "MIR:00000078",
new Class<?>[] {},
"mirbase",
......@@ -478,7 +478,7 @@ public enum MiriamType {
*/
MI_R_BASE_MATURE_SEQUENCE("miRBase Mature Sequence Database",
"http://www.mirbase.org/",
new String[] { "urn:miriam:mirbase.mature" },
new String[] { "urn:miriam:mirbase.mature", "https://identifiers.org/mirbase.mature/" },
new Class<?>[] {}, "MIR:00000235",
new Class<?>[] {},
"mirbase.mature",
......@@ -489,7 +489,7 @@ public enum MiriamType {
*/
MIR_TAR_BASE_MATURE_SEQUENCE("miRTarBase Mature Sequence Database",
"http://mirtarbase.mbc.nctu.edu.tw/",
new String[] { "urn:miriam:mirtarbase" },
new String[] { "urn:miriam:mirtarbase", "https://identifiers.org/mirtarbase/" },
new Class<?>[] {}, "MIR:00000562",
new Class<?>[] {},
"mirtarbase",
......@@ -500,7 +500,7 @@ public enum MiriamType {
*/
MGD("Mouse Genome Database",
"http://www.informatics.jax.org/",
new String[] { "urn:miriam:mgd" },
new String[] { "urn:miriam:mgd", "https://identifiers.org/mgi/" },
new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000037",
new Class<?>[] {},
"",
......@@ -508,7 +508,7 @@ public enum MiriamType {
NCBI_PROTEIN("NCBI Protein",
"https://www.ncbi.nlm.nih.gov/protein",
new String[] { "urn:miriam:ncbiprotein" },
new String[] { "urn:miriam:ncbiprotein", "https://identifiers.org/ncbiprotein/" },
new Class<?>[] {}, "MIR:00000344",
new Class<?>[] {},
"ncbiprotein",
......@@ -538,7 +538,7 @@ public enum MiriamType {
*/
PANTHER("PANTHER Family",
"http://www.pantherdb.org/",
new String[] { "urn:miriam:panther.family", "urn:miriam:panther" },
new String[] { "urn:miriam:panther.family", "urn:miriam:panther", "https://identifiers.org/panther.family/" },
new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000060",
new Class<?>[] {},
"panther.family",
......@@ -546,7 +546,7 @@ public enum MiriamType {
PATO("PATO",
"https://www.ebi.ac.uk/ols/ontologies/pato",
new String[] { "urn:miriam:pato", "urn:miriam:obo.pato" },
new String[] { "urn:miriam:pato", "urn:miriam:obo.pato", "https://identifiers.org/pato/" },
new Class<?>[] {}, "MIR:00000112",
new Class<?>[] {},
"",
......@@ -557,7 +557,7 @@ public enum MiriamType {
*/
PDB("Protein Data Bank",
"http://www.pdbe.org/",
"urn:miriam:pdb",
new String[] { "urn:miriam:pdb", "https://identifiers.org/pdb/" },
new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000020",
new Class<?>[] {},
"pdb",
......@@ -576,7 +576,7 @@ public enum MiriamType {
*/
PFAM("Protein Family Database",
"http://pfam.xfam.org//",
"urn:miriam:pfam",
new String[] { "urn:miriam:pfam", "https://identifiers.org/pfam/" },
new Class<?>[] {}, "MIR:00000028",
new Class<?>[] {},
"pfam",
......@@ -587,7 +587,7 @@ public enum MiriamType {
*/
PHARM("PharmGKB Pathways",
"http://www.pharmgkb.org/",
"urn:miriam:pharmgkb.pathways",
new String[] { "urn:miriam:pharmgkb.pathways", "https://identifiers.org/pharmgkb.pathways/" },
new Class<?>[] {}, "MIR:00000089",
new Class<?>[] {},
"pharmgkb.pathways",
......@@ -598,7 +598,7 @@ public enum MiriamType {
*/
PUBCHEM("PubChem-compound",
"http://pubchem.ncbi.nlm.nih.gov/",
new String[] { "urn:miriam:pubchem.compound" },
new String[] { "urn:miriam:pubchem.compound", "https://identifiers.org/pubchem.compound/" },
new Class<?>[] { Chemical.class }, "MIR:00000034",
new Class<?>[] { Chemical.class },
"pubchem.compound",
......@@ -642,7 +642,7 @@ public enum MiriamType {
*/
REFSEQ("RefSeq",
"http://www.ncbi.nlm.nih.gov/projects/RefSeq/",
"urn:miriam:refseq",
new String[] { "urn:miriam:refseq", "https://identifiers.org/refseq/" },
new Class<?>[] { Protein.class, Gene.class, Rna.class }, "MIR:00000039",
new Class<?>[] {},
"refseq",
......@@ -650,7 +650,7 @@ public enum MiriamType {
RGD("Rat Genome Database",
"http://rgd.mcw.edu/",
"urn:miriam:rgd",
new String[] { "urn:miriam:rgd", "https://identifiers.org/rgd/" },
new Class<?>[] { Reaction.class }, "MIR:00000047",
new Class<?>[] {},
"rgd",
......@@ -661,7 +661,7 @@ public enum MiriamType {
*/
RHEA("Rhea",
"http://www.rhea-db.org/",
"urn:miriam:rhea",
new String[] { "urn:miriam:rhea", "https://identifiers.org/rhea/" },
new Class<?>[] { Reaction.class }, "MIR:00000082",
new Class<?>[] {},
"rhea",
......@@ -680,7 +680,7 @@ public enum MiriamType {
*/
SGD("Saccharomyces Genome Database",
"http://www.yeastgenome.org/",
"urn:miriam:sgd",
new String[] { "urn:miriam:sgd", "https://identifiers.org/sgd/" },
new Class<?>[] {}, "MIR:00000023",
new Class<?>[] {},
"sgd",
......@@ -688,7 +688,7 @@ public enum MiriamType {
SPIKE("SPIKE Map",
"http://www.cs.tau.ac.il/~spike/",
"urn:miriam:spike.map",
new String[] { "urn:miriam:spike.map", "https://identifiers.org/spike.map/" },
new Class<?>[] {}, "MIR:00000321",
new Class<?>[] {},
"spike.map",
......@@ -699,7 +699,7 @@ public enum MiriamType {
*/
STITCH("STITCH",
"http://stitch.embl.de/",
"urn:miriam:stitch",
new String[] { "urn:miriam:stitch", "https://identifiers.org/stitch/" },
new Class<?>[] {}, "MIR:00000266",
new Class<?>[] {},
"stitch",
......@@ -710,7 +710,7 @@ public enum MiriamType {
*/
STRING("STRING",
"http://string-db.org/",
"urn:miriam:string",
new String[] { "urn:miriam:string", "https://identifiers.org/string/" },
new Class<?>[] {}, "MIR:00000265",
new Class<?>[] {},
"string",
......@@ -718,7 +718,7 @@ public enum MiriamType {
SWISS_MODEL("SWISS-MODEL",
"https://swissmodel.expasy.org",
"urn:miriam:swiss-model",
new String[] { "urn:miriam:swiss-model", "https://identifiers.org/swiss-model/" },
new Class<?>[] {}, "MIR:00000231",
new Class<?>[] {},
"swiss-model",
......@@ -732,7 +732,7 @@ public enum MiriamType {
*/
TAIR_LOCUS("TAIR Locus",
"http://arabidopsis.org/index.jsp",
"urn:miriam:tair.locus",
new String[] { "urn:miriam:tair.locus", "https://identifiers.org/tair.locus/" },
new Class<?>[] {}, "MIR:00000050",
new Class<?>[] {},
"tair.locus",
......@@ -755,7 +755,7 @@ public enum MiriamType {
*/
TOXICOGENOMIC_CHEMICAL("Toxicogenomic Chemical",
"http://ctdbase.org/",
"urn:miriam:ctd.chemical",
new String[] { "urn:miriam:ctd.chemical", "https://identifiers.org/ctd.chemical/" },
new Class<?>[] {}, "MIR:00000098",
new Class<?>[] {},
"ctd.chemical",
......@@ -763,7 +763,7 @@ public enum MiriamType {
TTD_Drug("TTD Drug",
"http://bidd.nus.edu.sg/group/ttd/ttd.asp",
"urn:miriam:ttd.drug",
new String[] { "urn:miriam:ttd.drug", "https://identifiers.org/ttd.drug/" },
new Class<?>[] {}, "MIR:00000092",
new Class<?>[] {},
"ttd.drug",
......@@ -774,7 +774,7 @@ public enum MiriamType {
*/
UNIGENE("UniGene",
"http://www.ncbi.nlm.nih.gov/unigene",
"urn:miriam:unigene",
new String[] { "urn:miriam:unigene", "https://identifiers.org/unigene/" },
new Class<?>[] {}, "MIR:00000346",
new Class<?>[] {},
"unigene",
......@@ -796,7 +796,7 @@ public enum MiriamType {
*/
UNIPROT_ISOFORM("UniProt Isoform",
"http://www.uniprot.org/",
"urn:miriam:uniprot.isoform",
new String[] { "urn:miriam:uniprot.isoform", "https://identifiers.org/uniprot.isoform/" },
new Class<?>[] { Protein.class }, "MIR:00000388",
new Class<?>[] {},
"uniprot.isoform",
......@@ -841,7 +841,7 @@ public enum MiriamType {
*/
WIKIDATA("Wikidata",
"https://www.wikidata.org/",
new String[] { "urn:miriam:wikidata" },
new String[] { "urn:miriam:wikidata", "https://identifiers.org/wikidata/" },
new Class<?>[] {}, "MIR:00000549",
new Class<?>[] {},
"wikidata",
......@@ -852,7 +852,7 @@ public enum MiriamType {
*/
WIKIPATHWAYS("WikiPathways",
"http://www.wikipathways.org/",
new String[] { "urn:miriam:wikipathways" },
new String[] { "urn:miriam:wikipathways", "https://identifiers.org/wikipathways/" },
new Class<?>[] {}, "MIR:00000076",
new Class<?>[] {},
"wikipathways",
......@@ -863,7 +863,7 @@ public enum MiriamType {
*/
WIKIPEDIA("Wikipedia (English)",
"http://en.wikipedia.org/wiki/Main_Page",
new String[] { "urn:miriam:wikipedia.en" },
new String[] { "urn:miriam:wikipedia.en", "https://identifiers.org/wikipedia.en/" },
new Class<?>[] {}, "MIR:00000384",
new Class<?>[] {},
"wikipedia.en",
......@@ -874,7 +874,7 @@ public enum MiriamType {
*/
WORM_BASE("WormBase",
"http://wormbase.bio2rdf.org/fct",
new String[] { "urn:miriam:wormbase" },
new String[] { "urn:miriam:wormbase", "https://identifiers.org/wb/" },
new Class<?>[] {}, "MIR:00000027",
new Class<?>[] {},
"wb",
......@@ -882,7 +882,7 @@ public enum MiriamType {
ZFIN("ZFIN Bioentity",
"http://zfin.org",
new String[] { "urn:miriam:zfin" },
new String[] { "urn:miriam:zfin", "https://identifiers.org/zfin/" },
new Class<?>[] {}, "MIR:00000079",
new Class<?>[] {},
"zfin",
......
......@@ -29,6 +29,7 @@ import lcsb.mapviewer.model.map.statistics.AllStatisticsTests;
MiriamDataTest.class,
MiriamRelationTypeTest.class,
MiriamTypeTest.class,
MiriamTypeGenericTest.class,
MiriamTypeNameComparatorTest.class,
OverviewImageComparatorTest.class,
OverviewImageLinkComparatorTest.class,
......
package lcsb.mapviewer.model.map;
import static org.junit.Assert.*;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.*;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import lcsb.mapviewer.ModelTestFunctions;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
@RunWith(Parameterized.class)
public class MiriamTypeGenericTest extends ModelTestFunctions {
Logger logger = LogManager.getLogger();
private MiriamType miriamType;
private boolean deprecated;
public MiriamTypeGenericTest(MiriamType type, boolean deprecated) {
this.miriamType = type;
this.deprecated = deprecated;
}
@Parameters(name = "{0}")
public static Collection<Object[]> data() throws IOException {
List<Object[]> result = new ArrayList<>();
for (MiriamType mt : MiriamType.values()) {
boolean deprecated = false;
try {
Field f = MiriamType.class.getField(mt.name());
if (f.isAnnotationPresent(Deprecated.class))
deprecated = true;
} catch (NoSuchFieldException | SecurityException e) {
}
result.add(new Object[] { mt, deprecated });
}
return result;
}
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
public void testProperties() {
assertNotNull(miriamType.getUris());
assertNotNull(miriamType.getValidClass());
assertNotNull(miriamType.getRequiredClass());
if (!deprecated) {
assertNotNull("No homepage for: " + miriamType, miriamType.getDbHomepage());
}
}
@Test
public void checkUrnExists() {
if (!deprecated) {
boolean urnUriExists = false;
for (String uri : miriamType.getUris()) {
if (uri.toLowerCase().startsWith("urn:")) {
urnUriExists = true;
}
}
assertTrue(urnUriExists);
}
}
@Test
public void identifiersOrgUrnExists() {
if (!deprecated) {
boolean identifiersOrgUriExists = false;
for (String uri : miriamType.getUris()) {
if ((uri.toLowerCase().startsWith("http://identifiers.org/")
|| uri.toLowerCase().startsWith("https://identifiers.org/"))
&& uri.endsWith("/")) {
identifiersOrgUriExists = true;
}
}
assertTrue(identifiersOrgUriExists);
}
}
@Test
public void testGetMiriamByIncompleteUri() throws Exception {
for (String uri : miriamType.getUris()) {
try {
MiriamType.getMiriamByUri(uri);
fail("Exception expected");
} catch (InvalidArgumentException e) {
}
}
}
}
......@@ -105,23 +105,9 @@ public class MiriamTypeTest extends ModelTestFunctions {
MiriamType.getMiriamByUri("invalid_uri");
}
@Test
public void testGetMiriamByIncompleteUri() throws Exception {
for (MiriamType mt : MiriamType.values()) {
for (String uri : mt.getUris()) {
try {
MiriamType.getMiriamByUri(uri);
fail("Exception expected");
} catch (InvalidArgumentException e) {
}
}
}
}
@Test
public void testGetMiriamForDoiUri() {
MiriamData md = MiriamType.getMiriamByUri("urn:miriam:doi:10.1109%2F5.771073");
logger.debug(md);
assertTrue(md.getResource().contains("/"));
}
......