Commit 83dea760 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

checkstyle with line length and tab

parent 2c649f66
...@@ -47,7 +47,8 @@ public class DrugbankParserTest extends AnnotationTestFunctions { ...@@ -47,7 +47,8 @@ public class DrugbankParserTest extends AnnotationTestFunctions {
assertEquals("Urokinase", test.getName()); assertEquals("Urokinase", test.getName());
assertTrue(test.getBloodBrainBarrier().equalsIgnoreCase("N/A")); assertTrue(test.getBloodBrainBarrier().equalsIgnoreCase("N/A"));
boolean res = test.getDescription().contains( boolean res = test.getDescription().contains(
"Low molecular weight form of human urokinase, that consists of an A chain of 2,000 daltons linked by a sulfhydryl bond to a B chain of 30,400 daltons. Recombinant urokinase plasminogen activator"); "Low molecular weight form of human urokinase, that consists of an A chain of 2,000 daltons linked "
+ "by a sulfhydryl bond to a B chain of 30,400 daltons. Recombinant urokinase plasminogen activator");
assertTrue(res); assertTrue(res);
assertEquals(10, test.getTargets().size()); assertEquals(10, test.getTargets().size());
assertNull(test.getApproved()); assertNull(test.getApproved());
...@@ -105,7 +106,10 @@ public class DrugbankParserTest extends AnnotationTestFunctions { ...@@ -105,7 +106,10 @@ public class DrugbankParserTest extends AnnotationTestFunctions {
assertEquals("Aluminum hydroxide", test.getName()); assertEquals("Aluminum hydroxide", test.getName());
assertEquals("DB06723", test.getSources().get(0).getResource()); assertEquals("DB06723", test.getSources().get(0).getResource());
assertTrue(test.getDescription().contains( assertTrue(test.getDescription().contains(
"Aluminum hydroxide is an inorganic salt used as an antacid. It is a basic compound that acts by neutralizing hydrochloric acid in gastric secretions. Subsequent increases in pH may inhibit the action of pepsin. An increase in bicarbonate ions and prostaglandins may also confer cytoprotective effects.")); "Aluminum hydroxide is an inorganic salt used as an antacid. "
+ "It is a basic compound that acts by neutralizing hydrochloric acid in gastric secretions. "
+ "Subsequent increases in pH may inhibit the action of pepsin. "
+ "An increase in bicarbonate ions and prostaglandins may also confer cytoprotective effects."));
assertEquals(0, test.getTargets().size()); assertEquals(0, test.getTargets().size());
} }
......
This diff is collapsed.
package lcsb.mapviewer.common; package lcsb.mapviewer.common;
import static org.junit.Assert.*; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import java.io.File; import java.io.File;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
...@@ -9,7 +11,9 @@ import java.util.List; ...@@ -9,7 +11,9 @@ import java.util.List;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.junit.*; import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class ConfigurationTest extends CommonTestFunctions { public class ConfigurationTest extends CommonTestFunctions {
......
...@@ -58,8 +58,8 @@ public enum ModifierType { ...@@ -58,8 +58,8 @@ public enum ModifierType {
/** /**
* CellDesigner 2.5 modification type. * CellDesigner 2.5 modification type.
*/ */
TRANSCRIPTIONAL_INHIBITION("TRANSCRIPTIONAL_INHIBITION", Inhibition.class, ArrowType.CROSSBAR, 8.0, ReactionCellDesignerConverter.RECT_SIZE / 2 - 1), TRANSCRIPTIONAL_INHIBITION("TRANSCRIPTIONAL_INHIBITION", Inhibition.class, ArrowType.CROSSBAR, 8.0,
ReactionCellDesignerConverter.RECT_SIZE / 2 - 1),
; ;
......
...@@ -304,7 +304,12 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions { ...@@ -304,7 +304,12 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
speciesAlias.setName("ROS"); speciesAlias.setName("ROS");
RestAnnotationParser rap = new RestAnnotationParser(); RestAnnotationParser rap = new RestAnnotationParser();
rap.processNotes( rap.processNotes(
"Symbol: ROS1\r\nName: c-ros oncogene 1 , receptor tyrosine kinase\r\nDescription: RecName: Full=Proto-oncogene tyrosine-protein kinase ROS; EC=2.7.10.1; AltName: Full=Proto-oncogene c-Ros; AltName: Full=Proto-oncogene c-Ros-1; AltName: Full=Receptor tyrosine kinase c-ros oncogene 1; AltName: Full=c-Ros receptor tyrosine kinase; Flags: Precursor;\r\nPrevious Symbols:\r\nSynonyms: ROS, MCF3", "Symbol: ROS1\r\nName: c-ros oncogene 1 , receptor tyrosine kinase\r\n"
+ "Description: RecName: Full=Proto-oncogene tyrosine-protein kinase ROS; EC=2.7.10.1; "
+ "AltName: Full=Proto-oncogene c-Ros; AltName: Full=Proto-oncogene c-Ros-1; "
+ "AltName: Full=Receptor tyrosine kinase c-ros oncogene 1; "
+ "AltName: Full=c-Ros receptor tyrosine kinase; Flags: Precursor;\r\n"
+ "Previous Symbols:\r\nSynonyms: ROS, MCF3",
speciesAlias); speciesAlias);
model.addElement(speciesAlias); model.addElement(speciesAlias);
...@@ -315,7 +320,11 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions { ...@@ -315,7 +320,11 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
SimpleMolecule speciesAlias2 = createSimpleMolecule(); SimpleMolecule speciesAlias2 = createSimpleMolecule();
speciesAlias2.setName("PDK1"); speciesAlias2.setName("PDK1");
rap.processNotes( rap.processNotes(
"Symbol: ROS1\r\nName: c-ros oncogene 1 , receptor tyrosine kinase\r\nDescription: RecName: Full=Proto-oncogene tyrosine-protein kinase ROS; EC=2.7.10.1; AltName: Full=Proto-oncogene c-Ros; AltName: Full=Proto-oncogene c-Ros-1; AltName: Full=Receptor tyrosine kinase c-ros oncogene 1; AltName: Full=c-Ros receptor tyrosine kinase; Flags: Precursor;\r\nPrevious Symbols:\r\nSynonyms: ROS, MCF3", "Symbol: ROS1\r\nName: c-ros oncogene 1 , receptor tyrosine kinase\r\n"
+ "Description: RecName: Full=Proto-oncogene tyrosine-protein kinase ROS; EC=2.7.10.1; "
+ "AltName: Full=Proto-oncogene c-Ros; AltName: Full=Proto-oncogene c-Ros-1; "
+ "AltName: Full=Receptor tyrosine kinase c-ros oncogene 1; AltName: Full=c-Ros receptor tyrosine kinase; Flags: Precursor;\r\n"
+ "Previous Symbols:\r\nSynonyms: ROS, MCF3",
speciesAlias2); speciesAlias2);
model.addElement(speciesAlias2); model.addElement(speciesAlias2);
...@@ -934,7 +943,8 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions { ...@@ -934,7 +943,8 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
CellDesignerXmlParser parser = new CellDesignerXmlParser(); CellDesignerXmlParser parser = new CellDesignerXmlParser();
Model model = parser.createModel(new ConverterParams().filename("testFiles/orthogonal_reaction_to_phenotype.xml")); Model model = parser.createModel(new ConverterParams().filename("testFiles/orthogonal_reaction_to_phenotype.xml"));
Reaction r = model.getReactionByReactionId("re2"); Reaction r = model.getReactionByReactionId("re2");
assertEquals(r.getReactants().get(0).getLine().getStartPoint().getY(), r.getProducts().get(0).getLine().getStartPoint().getY(), Configuration.EPSILON); assertEquals(r.getReactants().get(0).getLine().getStartPoint().getY(),
r.getProducts().get(0).getLine().getStartPoint().getY(), Configuration.EPSILON);
} }
@Test @Test
...@@ -942,7 +952,8 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions { ...@@ -942,7 +952,8 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
CellDesignerXmlParser parser = new CellDesignerXmlParser(); CellDesignerXmlParser parser = new CellDesignerXmlParser();
Model model = parser.createModel(new ConverterParams().filename("testFiles/orthogonal_reaction_to_drug.xml")); Model model = parser.createModel(new ConverterParams().filename("testFiles/orthogonal_reaction_to_drug.xml"));
Reaction r = model.getReactionByReactionId("re3"); Reaction r = model.getReactionByReactionId("re3");
assertEquals(r.getReactants().get(0).getLine().getStartPoint().getY(), r.getProducts().get(0).getLine().getStartPoint().getY(), Configuration.EPSILON); assertEquals(r.getReactants().get(0).getLine().getStartPoint().getY(),
r.getProducts().get(0).getLine().getStartPoint().getY(), Configuration.EPSILON);
} }
......
...@@ -272,12 +272,12 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions { ...@@ -272,12 +272,12 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
public void testGetNotesWithMissingBody() throws Exception { public void testGetNotesWithMissingBody() throws Exception {
RestAnnotationParser rap = new RestAnnotationParser(); RestAnnotationParser rap = new RestAnnotationParser();
Node node = super.getNodeFromXmlString("<celldesigner:notes>\n" + Node node = super.getNodeFromXmlString("<celldesigner:notes>\n" +
" <html xmlns=\"http://www.w3.org/1999/xhtml\">\n" + " <html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +
" <head>\n" + " <head>\n" +
" <title/>\n" + " <title/>\n" +
" </head>\n" + " </head>\n" +
" </html>\n" + " </html>\n" +
" </celldesigner:notes>"); " </celldesigner:notes>");
String notes = rap.getNotes(node); String notes = rap.getNotes(node);
assertNotNull(notes); assertNotNull(notes);
...@@ -289,11 +289,13 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions { ...@@ -289,11 +289,13 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
Node node = super.getNodeFromXmlString("<notes>\n" + Node node = super.getNodeFromXmlString("<notes>\n" +
"Name: L-cystine\n" + "Name: L-cystine\n" +
"Synonyms: (R,R)-3,3&apos;-dithiobis(2-aminopropanoic acid), (R-(R*,R*))-3,3&apos;-Dithiobis(2-aminopropanoic acid), 3,3&apos;-Dithiobis-L-alanine, beta,beta&apos;-diamino-beta,beta&apos;-dicarboxydiethyl disulfide, beta,beta&apos;-dithiodialanine, bis(beta-amino-beta-carboxyethyl) disulfide, E921, L-alpha-Diamino-beta-dithiolactic acid, L-Cystine, L-Dicysteine, oxidized L-cysteine, Recon metabolite: mma\n" "Synonyms: (R,R)-3,3&apos;-dithiobis(2-aminopropanoic acid), "
+ + "(R-(R*,R*))-3,3&apos;-Dithiobis(2-aminopropanoic acid), "
"Description: VMH database: <a xmlns=\"http://www.w3.org/1999/xhtml\" href=\"http://vmh.uni.lu/#metabolite/mma\">mma</a>\n" + "3,3&apos;-Dithiobis-L-alanine, beta,beta&apos;-diamino-beta,beta&apos;-dicarboxydiethyl disulfide, "
+ + "beta,beta&apos;-dithiodialanine, bis(beta-amino-beta-carboxyethyl) disulfide, E921, "
"SemanticZoomLevelVisibility: 5\n" + + "L-alpha-Diamino-beta-dithiolactic acid, L-Cystine, L-Dicysteine, oxidized L-cysteine, Recon metabolite: mma\n"
+ "Description: VMH database: <a xmlns=\"http://www.w3.org/1999/xhtml\" href=\"http://vmh.uni.lu/#metabolite/mma\">mma</a>\n"
+ "SemanticZoomLevelVisibility: 5\n" +
"Charge: 0\n" + "Charge: 0\n" +
"</notes>\n" + "</notes>\n" +
""); "");
...@@ -356,5 +358,4 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions { ...@@ -356,5 +358,4 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
assertNull(color); assertNull(color);
} }
} }
...@@ -56,7 +56,7 @@ public class ProteinXmlParserTest extends CellDesignerTestFunctions { ...@@ -56,7 +56,7 @@ public class ProteinXmlParserTest extends CellDesignerTestFunctions {
assertEquals("S176 bla bla", protein.getModificationResidues().get(0).getName()); assertEquals("S176 bla bla", protein.getModificationResidues().get(0).getName());
assertEquals("Difference to big", 3.141592653589793, protein.getModificationResidues().get(0).getAngle(), 1e-6); assertEquals("Difference to big", 3.141592653589793, protein.getModificationResidues().get(0).getAngle(), 1e-6);
assertEquals("none", protein.getModificationResidues().get(0).getSide()); assertEquals("none", protein.getModificationResidues().get(0).getSide());
assertTrue(protein.getNotes().contains("UniProtKB P31040 SDHA GO:0005749 GO_REF:0000024")); assertTrue(protein.getNotes().contains("UniProtKB\tP31040\tSDHA\t\tGO:0005749\tGO_REF:0000024"));
} }
@Test @Test
......
package lcsb.mapviewer.converter; package lcsb.mapviewer.converter;
import static org.junit.Assert.*; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipFile; import java.util.zip.ZipFile;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.junit.*; import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.google.common.io.Files; import com.google.common.io.Files;
import lcsb.mapviewer.converter.zip.ImageZipEntryFile; import lcsb.mapviewer.converter.zip.ImageZipEntryFile;
import lcsb.mapviewer.model.map.*; import lcsb.mapviewer.model.map.OverviewImage;
import lcsb.mapviewer.model.map.OverviewLink;
import lcsb.mapviewer.model.map.OverviewModelLink;
import lcsb.mapviewer.model.map.model.Model; import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.model.ModelFullIndexed; import lcsb.mapviewer.model.map.model.ModelFullIndexed;
...@@ -173,8 +183,8 @@ public class OverviewParserTest extends ConverterTestFunctions { ...@@ -173,8 +183,8 @@ public class OverviewParserTest extends ConverterTestFunctions {
*/ */
@Test(expected = InvalidOverviewFile.class) @Test(expected = InvalidOverviewFile.class)
public void testParseInvalidCoordinates() throws Exception { public void testParseInvalidCoordinates() throws Exception {
String invalidCoordinates = "test.png 10,10 100,10 100,100 10,10 main.xml 10,10 3\n" + String invalidCoordinates = "test.png\t10,10 100,10 100,100 10,10\tmain.xml\t10,10\t3\n" +
"test.png 10,10 10,400 400,400 400,10 main.xml 10,10 4"; "test.png\t10,10 10,400 400,400 400,10\tmain.xml\t10,10\t4";
Set<Model> models = createValidTestMapModel(); Set<Model> models = createValidTestMapModel();
List<OverviewImage> images = new ArrayList<OverviewImage>(); List<OverviewImage> images = new ArrayList<OverviewImage>();
...@@ -189,9 +199,9 @@ public class OverviewParserTest extends ConverterTestFunctions { ...@@ -189,9 +199,9 @@ public class OverviewParserTest extends ConverterTestFunctions {
@Test @Test
public void testParseValidCoordinates() throws Exception { public void testParseValidCoordinates() throws Exception {
String invalidCoordinates = "FILE POLYGON LINK_TARGET MODEL_COORDINATES MODEL_ZOOM_LEVEL LINK_TYPE\n" + String invalidCoordinates = "FILE\tPOLYGON\tLINK_TARGET\tMODEL_COORDINATES\tMODEL_ZOOM_LEVEL\tLINK_TYPE\n" +
"test.png 10,10 100,10 100,100 10,10 main.xml 10,10 3 MODEL\n" + "test.png\t10,10 100,10 100,100 10,10\tmain.xml\t10,10\t3\tMODEL\n" +
"test.png 200,200 200,400 400,400 400,200 main.xml 10,10 4 MODEL"; "test.png\t200,200 200,400 400,400 400,200\tmain.xml\t10,10\t4\tMODEL";
Set<Model> models = createValidTestMapModel(); Set<Model> models = createValidTestMapModel();
List<OverviewImage> images = new ArrayList<OverviewImage>(); List<OverviewImage> images = new ArrayList<OverviewImage>();
...@@ -247,7 +257,7 @@ public class OverviewParserTest extends ConverterTestFunctions { ...@@ -247,7 +257,7 @@ public class OverviewParserTest extends ConverterTestFunctions {
oi2.setWidth(1000); oi2.setWidth(1000);
oi2.setHeight(1000); oi2.setHeight(1000);
images.add(oi2); images.add(oi2);
OverviewImage oi3 = new OverviewImage(); OverviewImage oi3 = new OverviewImage();
oi3.setFilename("test2.png"); oi3.setFilename("test2.png");
oi3.setWidth(1000); oi3.setWidth(1000);
......
...@@ -18,7 +18,7 @@ package lcsb.mapviewer.model.graphics; ...@@ -18,7 +18,7 @@ package lcsb.mapviewer.model.graphics;
* *
*/ */
public enum ArrowType { public enum ArrowType {
// CHECKSTYLE:OFF // CHECKSTYLE.OFF
/** /**
* The arrow end that should look as an image bellow. <br/> * The arrow end that should look as an image bellow. <br/>
* <br/> * <br/>
...@@ -104,6 +104,6 @@ public enum ArrowType { ...@@ -104,6 +104,6 @@ public enum ArrowType {
*/ */
NONE NONE
// CHECKSTYLE:ON // CHECKSTYLE.ON
} }
...@@ -37,10 +37,9 @@ public class Plugin implements Serializable { ...@@ -37,10 +37,9 @@ public class Plugin implements Serializable {
return new IntegerComparator().compare(o1.getId(), o2.getId()); return new IntegerComparator().compare(o1.getId(), o2.getId());
} }
}; };
/**
*
*/
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* Unique database identifier. * Unique database identifier.
*/ */
...@@ -71,7 +70,7 @@ public class Plugin implements Serializable { ...@@ -71,7 +70,7 @@ public class Plugin implements Serializable {
*/ */
private boolean isPublic = false; private boolean isPublic = false;
private boolean isDefault= false; private boolean isDefault = false;
/** /**
* List of urls from which plugin can be downloaded. * List of urls from which plugin can be downloaded.
......
...@@ -25,9 +25,6 @@ import lcsb.mapviewer.modelutils.serializer.model.plugin.PluginDataEntrySerializ ...@@ -25,9 +25,6 @@ import lcsb.mapviewer.modelutils.serializer.model.plugin.PluginDataEntrySerializ
@JsonSerialize(using = PluginDataEntrySerializer.class) @JsonSerialize(using = PluginDataEntrySerializer.class)
public class PluginDataEntry implements Serializable { public class PluginDataEntry implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
......
...@@ -113,7 +113,8 @@ public enum ConfigurationElementType { ...@@ -113,7 +113,8 @@ public enum ConfigurationElementType {
* Max number of results in search box. * Max number of results in search box.
*/ */
SEARCH_RESULT_NUMBER( SEARCH_RESULT_NUMBER(
"Max number of results (this value indicates the max number of elements that will be returned from search - not the number of aggregated elements in the search box).", "Max number of results (this value indicates the max number of elements that will be returned from search"
+ " - not the number of aggregated elements in the search box).",
"100", ConfigurationElementEditType.INTEGER, false, ConfigurationElementTypeGroup.POINT_AND_CLICK), "100", ConfigurationElementEditType.INTEGER, false, ConfigurationElementTypeGroup.POINT_AND_CLICK),
/** /**
...@@ -224,7 +225,8 @@ public enum ConfigurationElementType { ...@@ -224,7 +225,8 @@ public enum ConfigurationElementType {
ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS),
GOOGLE_MAPS_API_KEY("By providing this Google Maps Platform API key I declare that I am aware that " GOOGLE_MAPS_API_KEY("By providing this Google Maps Platform API key I declare that I am aware that "
+ "I am a Customer of the Google Maps Platform and I agree to the terms of the <a href=\"https://cloud.google.com/maps-platform/terms/\" target='_blank'>license of Google Maps Platform</a>." + "I am a Customer of the Google Maps Platform and I agree to the terms of the "
+ "<a href=\"https://cloud.google.com/maps-platform/terms/\" target='_blank'>license of Google Maps Platform</a>."
+ "In particular, I warrant that neither any of the maps nor publicly available data overlays " + "In particular, I warrant that neither any of the maps nor publicly available data overlays "
+ "(\"General overlays\") on this MINERVA server contain Protected Health Information (as defined in and subject to HIPAA).", + "(\"General overlays\") on this MINERVA server contain Protected Health Information (as defined in and subject to HIPAA).",
"", ConfigurationElementEditType.STRING, false, ConfigurationElementTypeGroup.SERVER_CONFIGURATION), "", ConfigurationElementEditType.STRING, false, ConfigurationElementTypeGroup.SERVER_CONFIGURATION),
......
...@@ -29,7 +29,7 @@ public class CommentSerializer extends JsonSerializer<Comment> { ...@@ -29,7 +29,7 @@ public class CommentSerializer extends JsonSerializer<Comment> {
private Function<Integer, Reaction> getReaction; private Function<Integer, Reaction> getReaction;
private Function<Integer, Element> getElement; private Function<Integer, Element> getElement;
private PointTransformation pt = new PointTransformation(); private PointTransformation pt = new PointTransformation();
public CommentSerializer(Function<Integer, Reaction> getReaction, Function<Integer, Element> getElement) { public CommentSerializer(Function<Integer, Reaction> getReaction, Function<Integer, Element> getElement) {
...@@ -114,7 +114,20 @@ public class CommentSerializer extends JsonSerializer<Comment> { ...@@ -114,7 +114,20 @@ public class CommentSerializer extends JsonSerializer<Comment> {
} }
public static List<String> availableColumns() { public static List<String> availableColumns() {
return Arrays.asList("title", "icon", "type", "content", "removed", "coord", "modelId", "elementId", "id", "pinned", "email", "owner", "removeReason"); return Arrays.asList(
"title",
"icon",
"type",
"content",
"removed",
"coord",
"modelId",
"elementId",
"id",
"pinned",
"email",
"owner",
"removeReason");
} }
private Object getId(Comment comment) { private Object getId(Comment comment) {
......
...@@ -51,7 +51,8 @@ public class DataOverlayDao extends BaseDao<DataOverlay> { ...@@ -51,7 +51,8 @@ public class DataOverlayDao extends BaseDao<DataOverlay> {
+ " where element.model in :maps and entry.dataOverlay.id = :overlayId " + " where element.model in :maps and entry.dataOverlay.id = :overlayId "
+ " and (lower(element.name) = lower(entry.name) or entry.name ='' or entry.name is null) " + " and (lower(element.name) = lower(entry.name) or entry.name ='' or entry.name is null) "
+ " and (lower(element.model.name) = lower(entry.modelName) or entry.modelName='' or entry.modelName is null) " + " and (lower(element.model.name) = lower(entry.modelName) or entry.modelName='' or entry.modelName is null) "
+ " and (entry_miriam is null or (entry_miriam.dataType = element_miriam.dataType and lower(entry_miriam.resource) = lower(element_miriam.resource)) ) " + " and (entry_miriam is null or "
+ " (entry_miriam.dataType = element_miriam.dataType and lower(entry_miriam.resource) = lower(element_miriam.resource)) ) "
+ " and (compartment is null or" + " and (compartment is null or"
+ " element.compartment.id in (select id from " + Element.class.getSimpleName() + " element.compartment.id in (select id from " + Element.class.getSimpleName()
+ " compartment_element where lower(compartment_element.name) = lower(compartment) and compartment_element.model in :maps)) " + " compartment_element where lower(compartment_element.name) = lower(compartment) and compartment_element.model in :maps)) "
...@@ -96,7 +97,8 @@ public class DataOverlayDao extends BaseDao<DataOverlay> { ...@@ -96,7 +97,8 @@ public class DataOverlayDao extends BaseDao<DataOverlay> {
+ " where reaction.model in :maps and entry.dataOverlay.id = :overlayId " + " where reaction.model in :maps and entry.dataOverlay.id = :overlayId "
+ " and (lower(reaction.name) = lower(entry.name) or entry.name ='' or entry.name is null) " + " and (lower(reaction.name) = lower(entry.name) or entry.name ='' or entry.name is null) "
+ " and (lower(reaction.model.name) = lower(entry.modelName) or entry.modelName='' or entry.modelName is null) " + " and (lower(reaction.model.name) = lower(entry.modelName) or entry.modelName='' or entry.modelName is null) "
+ " and (entry_miriam is null or (entry_miriam.dataType = reaction_miriam.dataType and lower(entry_miriam.resource) = lower(reaction_miriam.resource)) ) " + " and (entry_miriam is null or "
+ " (entry_miriam.dataType = reaction_miriam.dataType and lower(entry_miriam.resource) = lower(reaction_miriam.resource)) ) "
+ " and (lower(reaction.idReaction) = lower(entry.elementId) or entry.elementId='' or entry.elementId is null) "; + " and (lower(reaction.idReaction) = lower(entry.elementId) or entry.elementId='' or entry.elementId is null) ";
if (reactionIdentifiers.size() > 0) { if (reactionIdentifiers.size() > 0) {
queryString += " and (reaction.id in :reactionId) "; queryString += " and (reaction.id in :reactionId) ";
......
...@@ -117,10 +117,11 @@ ...@@ -117,10 +117,11 @@
<surefire-api.version>2.22.2</surefire-api.version> <surefire-api.version>2.22.2</surefire-api.version>
<hsqldb.version>2.5.0</hsqldb.version> <hsqldb.version>2.5.0</hsqldb.version>
<git-commit-id-plugin.version>4.0.4</git-commit-id-plugin.version> <git-commit-id-plugin.version>4.0.4</git-commit-id-plugin.version>
<surefire.rerunFailingTestsCount>4</surefire.rerunFailingTestsCount> <surefire.rerunFailingTestsCount>4</surefire.rerunFailingTestsCount>
<checkstyle.version>3.1.1</checkstyle.version>
</properties> </properties>
<repositories> <repositories>
...@@ -188,6 +189,28 @@ ...@@ -188,6 +189,28 @@
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.version}</version>
<executions>
<execution>
<id>checkstyle</id>
<phase>validate</phase>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<encoding>UTF-8</encoding>
<failsOnError>true</failsOnError>
<consoleOutput>true</consoleOutput>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
......
...@@ -256,7 +256,9 @@ public class ReferenceGenomeController extends BaseController { ...@@ -256,7 +256,9 @@ public class ReferenceGenomeController extends BaseController {
@PreAuthorize("hasAuthority('IS_ADMIN')") @PreAuthorize("hasAuthority('IS_ADMIN')")
@DeleteMapping(value = "/{genomeId}/geneMapping/{mappingId}/") @DeleteMapping(value = "/{genomeId}/geneMapping/{mappingId}/")
public Map<String, Object> removeGeneMapping(@PathVariable(value = "genomeId") Integer genomeId, @PathVariable(value = "mappingId") Integer mappingId) public Map<String, Object> removeGeneMapping(
@PathVariable(value = "genomeId") Integer genomeId,
@PathVariable(value = "mappingId") Integer mappingId)
throws IOException, QueryException { throws IOException, QueryException {
if (genomeId == null) { if (genomeId == null) {
throw new QueryException("Invalid genomeId"); throw new QueryException("Invalid genomeId");
......
...@@ -101,7 +101,8 @@ public class ProjectController extends BaseController { ...@@ -101,7 +101,8 @@ public class ProjectController extends BaseController {
@Autowired @Autowired
public ProjectController(ServletContext context, IUserService userService, IProjectService projectService, public ProjectController(ServletContext context, IUserService userService, IProjectService projectService,
IMeshService meshService, List<Converter> modelConverters, IFileService fileService, IElementService elementService, IReactionService reactionService, IMeshService meshService, List<Converter> modelConverters, IFileService fileService,
IElementService elementService, IReactionService reactionService,