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 {
assertEquals("Urokinase", test.getName());
assertTrue(test.getBloodBrainBarrier().equalsIgnoreCase("N/A"));
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);
assertEquals(10, test.getTargets().size());
assertNull(test.getApproved());
......@@ -105,7 +106,10 @@ public class DrugbankParserTest extends AnnotationTestFunctions {
assertEquals("Aluminum hydroxide", test.getName());
assertEquals("DB06723", test.getSources().get(0).getResource());
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());
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
Checkstyle-Configuration: MapViewer checkstyle
Description: none
-->
<module name="Checker">
<property name="severity" value="warning"/>
<module name="TreeWalker">
<property name="tabWidth" value="4"/>
<module name="FileContentsHolder"/>
<module name="JavadocMethod">
<property name="suppressLoadErrors" value="true"/>
</module>
<module name="JavadocType"/>
<module name="JavadocVariable"/>
<module name="JavadocStyle"/>
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<module name="AvoidStarImport"/>
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="LineLength">
<property name="max" value="160"/>
<property name="tabWidth" value="2"/>
</module>
<module name="MethodLength"/>
<module name="EmptyForIteratorPad"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter">
<property name="tokens" value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS"/>
</module>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>
<module name="AvoidInlineConditionals"/>
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="HiddenField">
<property name="severity" value="ignore"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="MagicNumber">
<property name="ignoreNumbers" value="-1, 0, 1, 2,10,100,1000"/>
</module>
<module name="MissingSwitchDefault"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="DesignForExtension">
<property name="severity" value="ignore"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module>
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier"/>
<module name="ArrayTypeStyle"/>
<module name="FinalParameters">
<property name="severity" value="ignore"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
Modified version of the Googles checkstyle (version 8.29):
https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-8.29/src/main/resources/google_checks.xml
-->
<module name = "Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="error"/>
<property name="fileExtensions" value="java, properties, xml"/>
<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<module name="TodoComment">
<property name="severity" value="ignore"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
<module name="SuppressionFilter">
<property name="file" value="${org.checkstyle.google.suppressionfilter.config}"
default="checkstyle-suppressions.xml" />
<property name="optional" value="true"/>
</module>
<module name="UpperEll"/>
<module name="ParameterNumber">
<property name="max" value="9"/>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.org/config_whitespace.html -->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="MagicNumber">
<property name="ignoreNumbers" value="-1, 0, 1, 2,10, 100, 1000"/>
<module name="LineLength">
<property name="fileExtensions" value="java"/>
<property name="max" value="150"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://|data:image/png;base64"/>
</module>
</module>
<module name="JavadocPackage"/>
<module name="NewlineAtEndOfFile">
<property name="severity" value="ignore"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module>
<module name="Translation"/>
<module name="FileLength"/>
<module name="FileTabCharacter">
<property name="severity" value="ignore"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module>
<module name="RegexpSingleline">
<property name="severity" value="ignore"/>
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing spaces."/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module>
<module name="SuppressionCommentFilter"/>
<module name="TreeWalker">
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE.OFF"/>
<property name="onCommentFormat" value="CHECKSTYLE.ON"/>
<property name="checkFormat" value="$1"/>
</module>
<!-- <module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format"
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message"
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
</module>
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<module name="AvoidStarImport">
<property name="excludes" value="org.junit.jupiter.api.Assertions.*"/>
</module>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap">
<property name="tokens" value="PACKAGE_DEF, IMPORT, STATIC_IMPORT"/>
</module>
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="NeedBraces">
<property name="tokens"
value="LITERAL_DO, LITERAL_ELSE, LITERAL_FOR, LITERAL_IF, LITERAL_WHILE"/>
</module>
<module name="LeftCurly">
<property name="tokens"
value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF,
INTERFACE_DEF, LAMBDA, LITERAL_CASE, LITERAL_CATCH, LITERAL_DEFAULT,
LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF,
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF,
OBJBLOCK, STATIC_INIT"/>
</module>
<module name="RightCurly">
<property name="id" value="RightCurlySame"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE,
LITERAL_DO"/>
</module>
<module name="RightCurly">
<property name="id" value="RightCurlyAlone"/>
<property name="option" value="alone"/>
<property name="tokens"
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
INSTANCE_INIT, ANNOTATION_DEF, ENUM_DEF"/>
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<property name="tokens"
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR,
BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAMBDA, LAND,
LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY,
LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED,
LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN,
NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR,
SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/>
<message key="ws.notFollowed"
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block filterLeaf (4.1.3)"/>
<message key="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module>
<module name="OneStatementPerLine"/>
<module name="MultipleVariableDeclarations"/>
<module name="ArrayTypeStyle"/>
<module name="MissingSwitchDefault"/>
<module name="FallThrough"/>
<module name="UpperEll"/>
<module name="ModifierOrder"/>
<module name="EmptyLineSeparator">
<property name="tokens"
value="PACKAGE_DEF, IMPORT, STATIC_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
STATIC_INIT, INSTANCE_INIT, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
<property name="allowNoEmptyLineBetweenFields" value="true"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapDot"/>
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapComma"/>
<property name="tokens" value="COMMA"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapEllipsis"/>
<property name="tokens" value="ELLIPSIS"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapArrayDeclarator"/>
<property name="tokens" value="ARRAY_DECLARATOR"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapMethodRef"/>
<property name="tokens" value="METHOD_REF"/>
<property name="option" value="nl"/>
</module>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypeName">
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF"/>
<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]*$"/>
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<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}''."/>
</module>
<module name="LambdaParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Lambda parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="CatchParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LocalVariableName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="NoFinalizer"/>
<module name="FinalParameters"/>
<module name="GenericWhitespace">
<message key="ws.followed"
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module>
<module name="Indentation">
<property name="basicOffset" value="2"/>
<property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="2"/>
<property name="throwsIndent" value="4"/>
<property name="lineWrappingIndentation" value="4"/>
<property name="arrayInitIndent" value="2"/>
</module>
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal" value="false"/>
<property name="allowedAbbreviationLength" value="1"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, ANNOTATION_FIELD_DEF,
PARAMETER_DEF, VARIABLE_DEF, METHOD_DEF"/>
</module>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="VariableDeclarationUsageDistance"/>
<module name="CustomImportOrder">
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="true"/>
<property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE"/>
<property name="tokens" value="IMPORT, STATIC_IMPORT, PACKAGE_DEF"/>
</module>
<module name="MethodParamPad">
<property name="tokens"
value="CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF,
SUPER_CTOR_CALL, ENUM_CONSTANT_DEF"/>
</module>
<module name="NoWhitespaceBefore">
<property name="tokens"
value="COMMA, SEMI, POST_INC, POST_DEC, DOT, ELLIPSIS, METHOD_REF"/>
<property name="allowLineBreaks" value="true"/>
</module>
<module name="ParenPad">
<property name="tokens"
value="ANNOTATION, ANNOTATION_FIELD_DEF, CTOR_CALL, CTOR_DEF, DOT, ENUM_CONSTANT_DEF,
EXPR, LITERAL_CATCH, LITERAL_DO, LITERAL_FOR, LITERAL_IF, LITERAL_NEW,
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_WHILE, METHOD_CALL,
METHOD_DEF, QUESTION, RESOURCE_SPECIFICATION, SUPER_CTOR_CALL, LAMBDA"/>
</module>
<module name="OperatorWrap">
<property name="option" value="NL"/>
<property name="tokens"
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR,
LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
</module>
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationMostCases"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
</module>
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationVariables"/>
<property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
<module name="InvalidJavadocPosition"/>
<module name="JavadocTagContinuationIndentation"/>
<module name="SummaryJavadoc">
<property name="forbiddenSummaryFragments"
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module>
<module name="JavadocParagraph"/>
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="SingleLineJavadoc">
<property name="ignoreInlineTags" value="false"/>
</module>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected"/>
</module>
<module name="CommentsIndentation">
<property name="tokens" value="SINGLE_LINE_COMMENT, BLOCK_COMMENT_BEGIN"/>
</module>
<module name="SuppressionXpathFilter">
<property name="file" value="${org.checkstyle.google.suppressionxpathfilter.config}"
default="checkstyle-xpath-suppressions.xml" />
<property name="optional" value="true"/>
</module>
<module name="VisibilityModifier">
<property name="protectedAllowed" value="true"/>
</module> -->
</module>
</module>
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.lang.reflect.Constructor;
......@@ -9,7 +11,9 @@ import java.util.List;
import org.apache.logging.log4j.LogManager;
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 {
......
......@@ -58,8 +58,8 @@ public enum ModifierType {
/**
* 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 {
speciesAlias.setName("ROS");
RestAnnotationParser rap = new RestAnnotationParser();
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);
model.addElement(speciesAlias);
......@@ -315,7 +320,11 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
SimpleMolecule speciesAlias2 = createSimpleMolecule();
speciesAlias2.setName("PDK1");
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);
model.addElement(speciesAlias2);
......@@ -934,7 +943,8 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
CellDesignerXmlParser parser = new CellDesignerXmlParser();
Model model = parser.createModel(new ConverterParams().filename("testFiles/orthogonal_reaction_to_phenotype.xml"));
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
......@@ -942,7 +952,8 @@ public class CellDesignerXmlParserTest extends CellDesignerTestFunctions {
CellDesignerXmlParser parser = new CellDesignerXmlParser();
Model model = parser.createModel(new ConverterParams().filename("testFiles/orthogonal_reaction_to_drug.xml"));
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 {
public void testGetNotesWithMissingBody() throws Exception {
RestAnnotationParser rap = new RestAnnotationParser();
Node node = super.getNodeFromXmlString("<celldesigner:notes>\n" +
" <html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +
" <head>\n" +
" <title/>\n" +
" </head>\n" +
" </html>\n" +
Node node = super.getNodeFromXmlString("<celldesigner:notes>\n" +
" <html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +
" <head>\n" +
" <title/>\n" +
" </head>\n" +
" </html>\n" +
" </celldesigner:notes>");
String notes = rap.getNotes(node);
assertNotNull(notes);
......@@ -289,11 +289,13 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
Node node = super.getNodeFromXmlString("<notes>\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"
+
"Description: VMH database: <a xmlns=\"http://www.w3.org/1999/xhtml\" href=\"http://vmh.uni.lu/#metabolite/mma\">mma</a>\n"
+
"SemanticZoomLevelVisibility: 5\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"
+ "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" +
"</notes>\n" +
"");
......@@ -356,5 +358,4 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
assertNull(color);
}
}
......@@ -56,7 +56,7 @@ public class ProteinXmlParserTest extends CellDesignerTestFunctions {
assertEquals("S176 bla bla", protein.getModificationResidues().get(0).getName());
assertEquals("Difference to big", 3.141592653589793, protein.getModificationResidues().get(0).getAngle(), 1e-6);
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
......
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.io.File;
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.ZipFile;
import org.apache.commons.io.FileUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.*;