Commit 6db1fa6f authored by piotr.gawron's avatar piotr.gawron
Browse files

model and db refactoried, almost all test pass

parent e367d4be
......@@ -6,7 +6,6 @@ import java.util.List;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.layout.alias.Alias;
import lcsb.mapviewer.modelutils.map.ElementUtils;
/**
......
......@@ -8,7 +8,6 @@ import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.Alias;
import lcsb.mapviewer.modelutils.map.ElementUtils;
/**
......
......@@ -509,7 +509,7 @@ public class ModelAnnotator {
* @return annotators names for a given class
*/
public Collection<String> getAvailableAnnotatorNames(Class<?> clazz) {
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
for (ElementAnnotator annotator : getAvailableAnnotators(clazz)) {
result.add(annotator.getCommonName());
}
......
......@@ -32,9 +32,6 @@ import lcsb.mapviewer.annotation.services.IExternalService;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
import lcsb.mapviewer.converter.model.celldesigner.annotation.RestAnnotationParser;
import lcsb.mapviewer.converter.model.celldesigner.structure.Gene;
import lcsb.mapviewer.converter.model.celldesigner.structure.Protein;
import lcsb.mapviewer.converter.model.celldesigner.structure.Rna;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
......@@ -360,10 +357,7 @@ public class BiocompendiumAnnotator extends ElementAnnotator implements IExterna
@Override
public void annotateElement(AnnotatedObject element) throws AnnotatorException {
if (((element instanceof Protein && !((Protein) element).isHypothetical()) || //
element instanceof Rna || //
element instanceof Gene)//
) {
if (isAnnotatable(element)) {
String annotationString;
try {
annotationString = getAnnotation(new MiriamData(MiriamType.HGNC_SYMBOL, element.getName()));
......
......@@ -20,12 +20,10 @@ import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
import lcsb.mapviewer.annotation.services.IExternalService;
import lcsb.mapviewer.common.comparator.StringSetComparator;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.converter.model.celldesigner.structure.Chemical;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamRelationType;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.Alias;
import lcsb.mapviewer.model.map.layout.alias.ChemicalAlias;
import lcsb.mapviewer.modelutils.map.ElementUtils;
import uk.ac.ebi.chebi.webapps.chebiWS.client.ChebiWebServiceClient;
......@@ -459,7 +457,7 @@ public class ChebiAnnotator extends ElementAnnotator implements IExternalService
chebi = getChebiElementForChebiId(md);
}
}
ChemicalAlias species = (ChemicalAlias) element;
ChemicalAlias species = (ChemicalAlias) element;
if (chebi != null) {
super.setFullName(species, chebi.getName(), warnPrefix);
......
......@@ -8,7 +8,6 @@ import org.apache.log4j.Logger;
import lcsb.mapviewer.annotation.cache.CachableInterface;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.converter.model.celldesigner.structure.Chemical;
import lcsb.mapviewer.converter.model.celldesigner.structure.Species;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
......@@ -296,7 +295,7 @@ public abstract class ElementAnnotator extends CachableInterface {
}
/**
* Sets {@link Species#charge}.
* Sets {@link SpeciesAlias#charge}.
*
* @param element
* element where annotation should be added
......
......@@ -20,10 +20,6 @@ import lcsb.mapviewer.annotation.services.IExternalService;
import lcsb.mapviewer.annotation.services.WrongResponseCodeIOException;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
import lcsb.mapviewer.converter.model.celldesigner.structure.Gene;
import lcsb.mapviewer.converter.model.celldesigner.structure.GenericProtein;
import lcsb.mapviewer.converter.model.celldesigner.structure.Protein;
import lcsb.mapviewer.converter.model.celldesigner.structure.Rna;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
......@@ -116,7 +112,6 @@ public class EnsemblAnnotator extends ElementAnnotator implements IExternalServi
try {
GenericProteinAlias proteinAlias = new GenericProteinAlias("mock_id");
proteinAlias.addMiriamData(new MiriamData(MiriamType.ENSEMBL, "ENSG00000157764"));
annotateElement(proteinAlias);
......
......@@ -23,7 +23,6 @@ import lcsb.mapviewer.annotation.services.IExternalService;
import lcsb.mapviewer.annotation.services.WrongResponseCodeIOException;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
import lcsb.mapviewer.converter.model.celldesigner.structure.GenericProtein;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamRelationType;
......
......@@ -21,9 +21,6 @@ import lcsb.mapviewer.annotation.services.IExternalService;
import lcsb.mapviewer.annotation.services.MiriamConnector;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
import lcsb.mapviewer.converter.model.celldesigner.structure.Compartment;
import lcsb.mapviewer.converter.model.celldesigner.structure.ComplexSpecies;
import lcsb.mapviewer.converter.model.celldesigner.structure.Phenotype;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamRelationType;
......
......@@ -15,10 +15,6 @@ import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
import lcsb.mapviewer.annotation.services.IExternalService;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.common.exception.InvalidXmlSchemaException;
import lcsb.mapviewer.converter.model.celldesigner.structure.Gene;
import lcsb.mapviewer.converter.model.celldesigner.structure.GenericProtein;
import lcsb.mapviewer.converter.model.celldesigner.structure.Protein;
import lcsb.mapviewer.converter.model.celldesigner.structure.Rna;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamRelationType;
......
......@@ -18,9 +18,6 @@ import lcsb.mapviewer.annotation.services.IExternalService;
import lcsb.mapviewer.common.EventStorageLoggerAppender;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.converter.model.celldesigner.structure.Chemical;
import lcsb.mapviewer.converter.model.celldesigner.structure.Element;
import lcsb.mapviewer.converter.model.celldesigner.structure.SimpleMolecule;
import lcsb.mapviewer.converter.model.celldesigner.structure.Species;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.layout.alias.Alias;
import lcsb.mapviewer.model.map.layout.alias.ChemicalAlias;
......
......@@ -17,9 +17,6 @@ import lcsb.mapviewer.annotation.services.ExternalServiceStatus;
import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
import lcsb.mapviewer.annotation.services.IExternalService;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.converter.model.celldesigner.structure.Gene;
import lcsb.mapviewer.converter.model.celldesigner.structure.Protein;
import lcsb.mapviewer.converter.model.celldesigner.structure.Rna;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
......
......@@ -13,7 +13,6 @@ import org.junit.Before;
import org.junit.Test;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.converter.model.celldesigner.structure.GenericProtein;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
......
......@@ -7,7 +7,6 @@ import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import lcsb.mapviewer.converter.model.celldesigner.structure.GenericProtein;
import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
public class MissingAnnotationTest {
......
......@@ -11,7 +11,6 @@ import org.junit.Before;
import org.junit.Test;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.converter.model.celldesigner.structure.GenericProtein;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
......
......@@ -29,7 +29,6 @@ import lcsb.mapviewer.annotation.services.annotators.AnnotatorException;
import lcsb.mapviewer.annotation.services.annotators.ElementAnnotator;
import lcsb.mapviewer.annotation.services.annotators.ReconAnnotator;
import lcsb.mapviewer.common.IProgressUpdater;
import lcsb.mapviewer.converter.model.celldesigner.structure.GenericProtein;
import lcsb.mapviewer.converter.model.celldesigner.structure.Protein;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
......@@ -114,7 +113,7 @@ public class ModelAnnotatorTest extends AnnotationTestFunctions {
List<ElementAnnotator> annotatorList = new ArrayList<>();
annotatorList.addAll(modelAnnotator.getDefaultAnnotators());
annotators.put(Reaction.class, annotatorList);
annotators.put(Protein.class, new ArrayList<>());
annotators.put(GenericProteinAlias.class, new ArrayList<>());
ReconAnnotator reconMock = Mockito.mock(ReconAnnotator.class);
Mockito.doThrow(new AnnotatorException("")).when(reconMock).annotateElement(any());
......
......@@ -25,13 +25,10 @@ import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
import lcsb.mapviewer.annotation.data.Chebi;
import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.converter.model.celldesigner.structure.Chemical;
import lcsb.mapviewer.converter.model.celldesigner.structure.SimpleMolecule;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamRelationType;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.SimpleMoleculeAlias;
import lcsb.mapviewer.model.map.layout.alias.SpeciesAlias;
import uk.ac.ebi.chebi.webapps.chebiWS.client.ChebiWebServiceClient;
import uk.ac.ebi.chebi.webapps.chebiWS.model.ChebiWebServiceFault_Exception;
import uk.ac.ebi.chebi.webapps.chebiWS.model.DataItem;
......
......@@ -11,8 +11,6 @@ import org.junit.Test;
import lcsb.mapviewer.annotation.AnnotationTestFunctions;
import lcsb.mapviewer.annotation.cache.CachableInterface;
import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
import lcsb.mapviewer.converter.model.celldesigner.structure.GenericProtein;
import lcsb.mapviewer.converter.model.celldesigner.structure.Ion;
import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
import lcsb.mapviewer.model.map.layout.alias.IonAlias;
......@@ -23,7 +21,7 @@ public class ElementAnnotatorTest extends AnnotationTestFunctions {
class EAMock extends ElementAnnotator {
public EAMock() {
super(CachableInterface.class, (Class<? extends AnnotatedObject>[]) new Class<?>[] {}, false);
super(CachableInterface.class, new Class<?>[] {}, false);
}
@Override
......
......@@ -24,8 +24,6 @@ import lcsb.mapviewer.annotation.cache.WebPageDownloader;
import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
import lcsb.mapviewer.annotation.services.WrongResponseCodeIOException;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.converter.model.celldesigner.structure.GenericProtein;
import lcsb.mapviewer.converter.model.celldesigner.structure.Species;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
......
......@@ -28,7 +28,6 @@ import lcsb.mapviewer.annotation.data.EntrezData;
import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
import lcsb.mapviewer.annotation.services.WrongResponseCodeIOException;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.converter.model.celldesigner.structure.GenericProtein;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.layout.alias.GenericProteinAlias;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment