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

lambda parameter name restrictions added

parent 36122b2d
......@@ -172,12 +172,12 @@
<message key="name.invalidPattern"
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<!-- <module name="LambdaParameterName">
<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">
<!-- <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}''."/>
......
......@@ -35,9 +35,9 @@ public class CellDesignerParserForVersion25Test extends CellDesignerTestFunction
@Parameters(name = "{index} : {0}")
public static Collection<Object[]> data() throws IOException {
Collection<Object[]> data = new ArrayList<Object[]>();
Files.walk(Paths.get("testFiles/cd_2.5")).forEach(fPath -> {
if (Files.isRegularFile(fPath)) {
data.add(new Object[] { fPath });
Files.walk(Paths.get("testFiles/cd_2.5")).forEach(filePath -> {
if (Files.isRegularFile(filePath)) {
data.add(new Object[] { filePath });
}
});
return data;
......
......@@ -36,16 +36,16 @@ public class CellDesigner2SbgnmlConversionTest extends SbgnmlTestFunctions {
@Parameters(name = "{index} : {0}")
public static Collection<Object[]> data() throws IOException {
Collection<Object[]> data = new ArrayList<>();
Files.walk(Paths.get("../converter-CellDesigner/testFiles")).forEach(fPath -> {
if (Files.isRegularFile(fPath) && fPath.toString().endsWith(".xml")
&& fPath.toString().indexOf("invalid") == -1) {
Files.walk(Paths.get("../converter-CellDesigner/testFiles")).forEach(filePath -> {
if (Files.isRegularFile(filePath) && filePath.toString().endsWith(".xml")
&& filePath.toString().indexOf("invalid") == -1) {
try {
String tempPath = fPath.toString()
.substring(fPath.toString().indexOf("testFiles") + "testFiles".length() + 1);
String tempPath = filePath.toString()
.substring(filePath.toString().indexOf("testFiles") + "testFiles".length() + 1);
if (!tempPath.contains("_full")) {
String content = FileUtils.readFileToString(fPath.toFile(), StandardCharsets.UTF_8);
String content = FileUtils.readFileToString(filePath.toFile(), StandardCharsets.UTF_8);
if (content.indexOf("xmlns:celldesigner") >= 0) {
data.add(new Object[] { fPath });
data.add(new Object[] { filePath });
}
}
} catch (Exception e) {
......
......@@ -40,9 +40,9 @@ public class SbgnmlSerializationTest extends SbgnmlTestFunctions {
@Parameters(name = "{index} : {0}")
public static Collection<Object[]> data() throws IOException {
Collection<Object[]> data = new ArrayList<Object[]>();
Files.walk(Paths.get("testFiles/CellDesigner-serializable")).forEach(fPath -> {
if (Files.isRegularFile(fPath)) {
data.add(new Object[] { fPath });
Files.walk(Paths.get("testFiles/CellDesigner-serializable")).forEach(filePath -> {
if (Files.isRegularFile(filePath)) {
data.add(new Object[] { filePath });
}
});
return data;
......
......@@ -33,14 +33,14 @@ public class SbgnmlXmlExporterGenericTest extends SbgnmlTestFunctions {
@Parameters(name = "{index} : {0}")
public static Collection<Object[]> data() throws IOException {
Collection<Object[]> data = new ArrayList<Object[]>();
Files.walk(Paths.get("testFiles/sbgnmlParserTestFiles/sbgnmlFiles")).forEach(fPath -> {
if (Files.isRegularFile(fPath) && fPath.toString().endsWith(".sbgn")) {
data.add(new Object[] { fPath});
Files.walk(Paths.get("testFiles/sbgnmlParserTestFiles/sbgnmlFiles")).forEach(filePath -> {
if (Files.isRegularFile(filePath) && filePath.toString().endsWith(".sbgn")) {
data.add(new Object[] { filePath});
}
});
Files.walk(Paths.get("testFiles/sbgnmlCellDesignerInompatible")).forEach(fPath -> {
if (Files.isRegularFile(fPath) && fPath.toString().endsWith(".sbgn")) {
data.add(new Object[] { fPath});
Files.walk(Paths.get("testFiles/sbgnmlCellDesignerInompatible")).forEach(filePath -> {
if (Files.isRegularFile(filePath) && filePath.toString().endsWith(".sbgn")) {
data.add(new Object[] { filePath});
}
});
return data;
......
......@@ -48,10 +48,10 @@ public class SbgnmlXmlParserTest extends SbgnmlTestFunctions {
@Parameters(name = "{index} : {0}")
public static Collection<Object[]> data() throws IOException {
Collection<Object[]> data = new ArrayList<Object[]>();
Files.walk(Paths.get("testFiles/sbgnmlParserTestFiles/sbgnmlFiles")).forEach(fPath -> {
if (Files.isRegularFile(fPath) && fPath.toString().endsWith(".sbgn")
&& !fPath.getFileName().toString().startsWith("ASTHMA")) {
data.add(new Object[] { fPath });
Files.walk(Paths.get("testFiles/sbgnmlParserTestFiles/sbgnmlFiles")).forEach(filePath -> {
if (Files.isRegularFile(filePath) && filePath.toString().endsWith(".sbgn")
&& !filePath.getFileName().toString().startsWith("ASTHMA")) {
data.add(new Object[] { filePath });
}
});
return data;
......
......@@ -39,9 +39,9 @@ public class CellDesignerToMultiExportTest extends SbmlTestFunctions {
@Parameters(name = "{index} : {0}")
public static Collection<Object[]> data() throws IOException {
Collection<Object[]> data = new ArrayList<Object[]>();
Files.walk(Paths.get("testFiles/cd_for_multi")).forEach(fPath -> {
if (Files.isRegularFile(fPath) && fPath.toString().endsWith(".xml")) {
data.add(new Object[] { fPath });
Files.walk(Paths.get("testFiles/cd_for_multi")).forEach(filePath -> {
if (Files.isRegularFile(filePath) && filePath.toString().endsWith(".xml")) {
data.add(new Object[] { filePath });
}
});
return data;
......
......@@ -34,9 +34,9 @@ public class CopasiImportTest extends SbmlTestFunctions {
@Parameters(name = "{index} : {0}")
public static Collection<Object[]> data() throws IOException {
Collection<Object[]> data = new ArrayList<Object[]>();
Files.walk(Paths.get("testFiles/copasi")).forEach(fPath -> {
if (Files.isRegularFile(fPath) && fPath.toString().endsWith(".xml")) {
data.add(new Object[] { fPath });
Files.walk(Paths.get("testFiles/copasi")).forEach(filePath -> {
if (Files.isRegularFile(filePath) && filePath.toString().endsWith(".xml")) {
data.add(new Object[] { filePath });
}
});
return data;
......
......@@ -47,14 +47,14 @@ public class GenericSbmlParserTest extends SbmlTestFunctions {
@Parameters(name = "{index} : {0}")
public static Collection<Object[]> data() throws IOException {
Collection<Object[]> data = new ArrayList<Object[]>();
Files.walk(Paths.get("testFiles/layoutExample")).forEach(fPath -> {
if (Files.isRegularFile(fPath) && fPath.toString().endsWith(".xml")) {
data.add(new Object[] { fPath });
Files.walk(Paths.get("testFiles/layoutExample")).forEach(filePath -> {
if (Files.isRegularFile(filePath) && filePath.toString().endsWith(".xml")) {
data.add(new Object[] { filePath });
}
});
Files.walk(Paths.get("testFiles/invalidButParseable")).forEach(fPath -> {
if (Files.isRegularFile(fPath) && fPath.toString().endsWith(".xml")) {
data.add(new Object[] { fPath });
Files.walk(Paths.get("testFiles/invalidButParseable")).forEach(filePath -> {
if (Files.isRegularFile(filePath) && filePath.toString().endsWith(".xml")) {
data.add(new Object[] { filePath });
}
});
return data;
......
......@@ -42,14 +42,14 @@ public class GenericSbmlToXmlParserTest extends SbmlTestFunctions {
@Parameters(name = "{index} : {0}")
public static Collection<Object[]> data() throws IOException {
Collection<Object[]> data = new ArrayList<Object[]>();
Files.walk(Paths.get("testFiles/layoutExample")).forEach(fPath -> {
if (Files.isRegularFile(fPath) && fPath.toString().endsWith(".xml")) {
data.add(new Object[] { fPath });
Files.walk(Paths.get("testFiles/layoutExample")).forEach(filePath -> {
if (Files.isRegularFile(filePath) && filePath.toString().endsWith(".xml")) {
data.add(new Object[] { filePath });
}
});
Files.walk(Paths.get("testFiles/small")).forEach(fPath -> {
if (Files.isRegularFile(fPath) && fPath.toString().endsWith(".xml")) {
data.add(new Object[] { fPath });
Files.walk(Paths.get("testFiles/small")).forEach(filePath -> {
if (Files.isRegularFile(filePath) && filePath.toString().endsWith(".xml")) {
data.add(new Object[] { filePath });
}
});
return data;
......
......@@ -41,9 +41,9 @@ public class MultiParserTest extends SbmlTestFunctions {
@Parameters(name = "{index} : {0}")
public static Collection<Object[]> data() throws IOException {
Collection<Object[]> data = new ArrayList<Object[]>();
Files.walk(Paths.get("testFiles/multi")).forEach(fPath -> {
if (Files.isRegularFile(fPath) && fPath.toString().endsWith(".xml")) {
data.add(new Object[] { fPath });
Files.walk(Paths.get("testFiles/multi")).forEach(filePath -> {
if (Files.isRegularFile(filePath) && filePath.toString().endsWith(".xml")) {
data.add(new Object[] { filePath });
}
});
return data;
......
......@@ -32,9 +32,9 @@ public class SbmlPareserForInvalidReactionTest extends SbmlTestFunctions {
@Parameters(name = "{index} : {0}")
public static Collection<Object[]> data() throws IOException {
Collection<Object[]> data = new ArrayList<Object[]>();
Files.walk(Paths.get("testFiles/invalidReaction")).forEach(fPath -> {
if (Files.isRegularFile(fPath) && fPath.toString().endsWith(".xml")) {
data.add(new Object[] { fPath });
Files.walk(Paths.get("testFiles/invalidReaction")).forEach(filePath -> {
if (Files.isRegularFile(filePath) && filePath.toString().endsWith(".xml")) {
data.add(new Object[] { filePath });
}
});
return data;
......
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