Commit ec6e65ca authored by Piotr Gawron's avatar Piotr Gawron
Browse files

field name restrictions added

parent 174c2f98
......@@ -9,31 +9,31 @@ import lcsb.mapviewer.model.map.species.field.Structure;
*
*/
public class PdbBestMappingEntry {
public String chain_id;
public String experimental_method;
public String pdb_id;
public String chainId;
public String experimentalMethod;
public String pdbId;
public int start;
public int end;
public int unp_end;
public int unpEnd;
public double coverage;
public int unp_start;
public int unpStart;
public double resolution;
public int tax_id;
public int taxId;
public Structure convertToStructure() {
Structure s = new Structure();
s.setPdbId(this.pdb_id);
s.setChainId(this.chain_id);
s.setPdbId(this.pdbId);
s.setChainId(this.chainId);
s.setCoverage(this.coverage);
s.setResolution(this.resolution);
s.setStructStart(this.start);
s.setStructEnd(this.end);
s.setUnpStart(this.unp_start);
s.setUnpEnd(this.unp_end);
s.setExperimentalMethod(this.experimental_method);
s.setTaxId(this.tax_id);
s.setUnpStart(this.unpStart);
s.setUnpEnd(this.unpEnd);
s.setExperimentalMethod(this.experimentalMethod);
s.setTaxId(this.taxId);
return s;
}
......
......@@ -7,4 +7,17 @@
<suppressions>
<suppress checks="TypeName"
files="src.main.java.lcsb.mapviewer.persist.migration"/>
<suppress checks="MemberName"
files="lcsb.mapviewer.model.map.OverviewModelLink.java"
lines="46,51"/>
<suppress checks="MemberName"
files="lcsb.mapviewer.services.impl.CustomPasswordEncoder.java"
lines="10"/>
<suppress checks="MemberName"
files="lcsb.mapviewer.wikipathway.model.PathwayElement.java"
lines="39"/>
<suppress checks="MemberName"
files="lcsb.mapviewer.wikipathway.model.Edge.java"
lines="69"/>
</suppressions>
......@@ -162,12 +162,12 @@
<message key="name.invalidPattern"
value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<!-- <module name="MemberName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<module name="MemberName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$|^x$|^y$|^z$"/>
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterName">
<!-- <module name="ParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
......
......@@ -69,13 +69,13 @@ public class CommonXmlParser {
}
private DocumentBuilderFactory dbFactory;
private DocumentBuilder dBuilder;
private DocumentBuilder documentBuilder;
public CommonXmlParser() {
try {
dbFactory = DocumentBuilderFactory.newInstance();
dBuilder = dbFactory.newDocumentBuilder();
dBuilder.setErrorHandler(new ErrorHandler() {
documentBuilder = dbFactory.newDocumentBuilder();
documentBuilder.setErrorHandler(new ErrorHandler() {
@Override
public void warning(SAXParseException e) throws SAXException {
;
......@@ -189,7 +189,7 @@ public class CommonXmlParser {
public String getNotesXmlContent(String notes) {
try {
ByteArrayInputStream bais = new ByteArrayInputStream(("<p>" + notes + "</p>").getBytes());
dBuilder.parse(bais);
documentBuilder.parse(bais);
} catch (Exception e) {
notes = XmlParser.escapeXml(notes);
}
......
......@@ -12,6 +12,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Rule;
import lcsb.mapviewer.common.Configuration;
import lcsb.mapviewer.common.UnitTestFailedWatcher;
import lcsb.mapviewer.converter.ConverterParams;
import lcsb.mapviewer.converter.InvalidInputDataExecption;
......@@ -33,7 +34,8 @@ import lcsb.mapviewer.model.map.species.Protein;
public abstract class CommandTestFunctions {
private static Map<String, Model> models = new HashMap<>();
public double EPSILON = 1e-6;
protected static final double EPSILON = Configuration.EPSILON;
@Rule
public UnitTestFailedWatcher unitTestFailedWatcher = new UnitTestFailedWatcher();
Logger logger = LogManager.getLogger();
......@@ -127,7 +129,7 @@ public abstract class CommandTestFunctions {
return result;
}
int zIndex = 1;
int z = 1;
protected void assignCoordinates(lcsb.mapviewer.model.map.species.Element element) {
assignCoordinates(1, 1, 10, 20, element);
......@@ -137,7 +139,7 @@ public abstract class CommandTestFunctions {
lcsb.mapviewer.model.map.species.Element element) {
element.setX(x);
element.setY(y);
element.setZ(zIndex++);
element.setZ(z++);
element.setWidth(width);
element.setHeight(height);
element.setNameX(x);
......
......@@ -47,7 +47,7 @@ public class DataNode extends GraphicalPathwayElement {
/**
* Align of the description.
*/
private String vAlign;
private String verticalAlign;
/**
* Default constructor.
......@@ -130,19 +130,19 @@ public class DataNode extends GraphicalPathwayElement {
/**
* @return the vAlign
* @see #vAlign
* @see #verticalAlign
*/
public String getvAlign() {
return vAlign;
return verticalAlign;
}
/**
* @param vAlign
* the vAlign to set
* @see #vAlign
* @see #verticalAlign
*/
public void setvAlign(String vAlign) {
this.vAlign = vAlign;
this.verticalAlign = vAlign;
}
/**
......
......@@ -41,7 +41,7 @@ public class Label extends GraphicalPathwayElement {
/**
* How description should be aligned.
*/
private String vAlign;
private String verticalAlign;
private Set<MiriamData> references = new HashSet<>();
......@@ -110,19 +110,19 @@ public class Label extends GraphicalPathwayElement {
/**
* @return the vAlign
* @see #vAlign
* @see #verticalAlign
*/
public String getvAlign() {
return vAlign;
return verticalAlign;
}
/**
* @param vAlign
* the vAlign to set
* @see #vAlign
* @see #verticalAlign
*/
public void setvAlign(String vAlign) {
this.vAlign = vAlign;
this.verticalAlign = vAlign;
}
/**
......
......@@ -49,7 +49,7 @@ public class Shape extends GraphicalPathwayElement {
/**
* Align of the description.
*/
private String vAlign;
private String verticalAlign;
/**
* Rotation of the element.
......@@ -161,19 +161,19 @@ public class Shape extends GraphicalPathwayElement {
/**
* @return the vAlign
* @see #vAlign
* @see #verticalAlign
*/
public String getvAlign() {
return vAlign;
return verticalAlign;
}
/**
* @param vAlign
* the vAlign to set
* @see #vAlign
* @see #verticalAlign
*/
public void setvAlign(String vAlign) {
this.vAlign = vAlign;
this.verticalAlign = vAlign;
}
/**
......
......@@ -303,13 +303,13 @@ public abstract class WikipathwaysTestFunctions {
return model2;
}
int zIndex = 10;
int z = 10;
protected void assignCoordinates(double x, double y, double width, double height,
lcsb.mapviewer.model.map.species.Element element) {
element.setX(x);
element.setY(y);
element.setZ(zIndex++);
element.setZ(z++);
element.setWidth(width);
element.setHeight(height);
element.setNameX(x);
......
......@@ -73,10 +73,12 @@ public abstract class RestTestFunctions {
protected static String ADMIN_BUILT_IN_LOGIN = "admin";
protected static double EPSILON = 1e-6;
private static Map<String, Model> models = new HashMap<>();
@Rule
public UnitTestFailedWatcher unitTestFailedWatcher = new UnitTestFailedWatcher();
public double EPSILON = 1e-6;
@Autowired
protected PasswordEncoder passwordEncoder;
......
......@@ -47,12 +47,15 @@ public abstract class ServiceTestFunctions {
protected static String BUILT_IN_MAP = "empty";
protected static String TEST_PROJECT_ID = "Some_id";
protected static String TEST_PROJECT_ID_2 = "Some_id2";
protected static double EPSILON = 1e-6;
private static Map<String, Model> models = new HashMap<>();
@Rule
public UnitTestFailedWatcher unitTestFailedWatcher = new UnitTestFailedWatcher();
public double EPSILON = 1e-6;
@Autowired
protected IConfigurationService configurationService;
......
......@@ -35,7 +35,6 @@ public class ProjectBackgroundTest extends ServiceTestFunctions {
Project project = null;
Model model = null;
String TEST_PROJECT_ID_2 = "Some_id2";
@Autowired
ProjectBackgroundDao backgroundDao;
......
......@@ -121,7 +121,7 @@ public abstract class ControllerIntegrationTest {
Logger logger = LogManager.getLogger();
@Rule
public JUnitRestDocumentation jUnitRestDocumentation = new JUnitRestDocumentation();
public JUnitRestDocumentation junitRestDocumentation = new JUnitRestDocumentation();
protected static final String BUILT_IN_TEST_ADMIN_PASSWORD = "admin";
protected static final String BUILT_IN_TEST_ADMIN_LOGIN = "admin";
......@@ -194,7 +194,7 @@ public abstract class ControllerIntegrationTest {
mockMvc = MockMvcBuilders.webAppContextSetup(context)
.addFilter(springSecurityFilterChain)
.apply(documentationConfiguration(this.jUnitRestDocumentation)
.apply(documentationConfiguration(this.junitRestDocumentation)
.operationPreprocessors()
.withResponseDefaults(Preprocessors.prettyPrint())
.and()
......@@ -468,12 +468,12 @@ public abstract class ControllerIntegrationTest {
return element;
}
int zIndex = 10;
int z = 10;
private void assignCoordinates(double x, double y, double width, double height, Element protein) {
protein.setX(x);
protein.setY(y);
protein.setZ(zIndex++);
protein.setZ(z++);
protein.setWidth(width);
protein.setHeight(height);
protein.setNameX(x);
......
Markdown is supported
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