Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
2fe8a13f
Commit
2fe8a13f
authored
Jan 25, 2018
by
David Hoksza
Browse files
test with multiple annotators
parent
2083b145
Changes
1
Hide whitespace changes
Inline
Side-by-side
annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/MultipleAnnotatorsTest.java
0 → 100644
View file @
2fe8a13f
package
lcsb.mapviewer.annotation.services.annotators
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
static
org
.
junit
.
Assert
.
fail
;
import
static
org
.
mockito
.
Matchers
.
anyString
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.HashSet
;
import
java.util.Set
;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.mockito.Mockito
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
lcsb.mapviewer.annotation.AnnotationTestFunctions
;
import
lcsb.mapviewer.annotation.cache.WebPageDownloader
;
import
lcsb.mapviewer.annotation.services.ExternalServiceStatusType
;
import
lcsb.mapviewer.common.exception.InvalidArgumentException
;
import
lcsb.mapviewer.model.map.MiriamData
;
import
lcsb.mapviewer.model.map.MiriamType
;
import
lcsb.mapviewer.model.map.species.GenericProtein
;
import
lcsb.mapviewer.model.map.species.Species
;
public
class
MultipleAnnotatorsTest
extends
AnnotationTestFunctions
{
@Autowired
KeggAnnotator
keggAnnotator
;
@Autowired
UniprotAnnotator
uniprotAnnotator
;
@Autowired
HgncAnnotator
hgncAnnotator
;
@Autowired
BiocompendiumAnnotator
biocompendiumAnnotator
;
@Before
public
void
setUp
()
throws
Exception
{
}
@After
public
void
tearDown
()
throws
Exception
{
}
@Test
public
void
testAnnotateUniprotByUniprotAndKegg
()
throws
Exception
{
try
{
Species
protein
=
new
GenericProtein
(
"id"
);
protein
.
setName
(
"bla"
);
protein
.
addMiriamData
(
new
MiriamData
(
MiriamType
.
UNIPROT
,
"P12345"
));
keggAnnotator
.
annotateElement
(
protein
);
uniprotAnnotator
.
annotateElement
(
protein
);
hgncAnnotator
.
annotateElement
(
protein
);
//biocompendiumAnnotator.annotateElement(protein);
int
cntNoAnnotator
=
0
;
for
(
MiriamData
md:
protein
.
getMiriamData
())
{
if
(
md
.
getAnnotator
()
==
null
)
{
cntNoAnnotator
++;
}
}
assertTrue
(
"Wrong number of annotated elements with no information about annotator"
,
cntNoAnnotator
==
1
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
e
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment