Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tlc4b
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
tlc4b
Commits
4028db4f
Commit
4028db4f
authored
10 months ago
by
dgelessus
Browse files
Options
Downloads
Patches
Plain Diff
Simplify file name filtering in AbstractParseMachineTest
parent
88804102
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/de/tlc4b/util/AbstractParseMachineTest.java
+3
-17
3 additions, 17 deletions
src/test/java/de/tlc4b/util/AbstractParseMachineTest.java
with
3 additions
and
17 deletions
src/test/java/de/tlc4b/util/AbstractParseMachineTest.java
+
3
−
17
View file @
4028db4f
package
de.tlc4b.util
;
package
de.tlc4b.util
;
import
java.io.File
;
import
java.io.File
;
import
java.io.FilenameFilter
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
@@ -10,23 +9,10 @@ import de.tlc4b.tlc.TLCResults.TLCResult;
...
@@ -10,23 +9,10 @@ import de.tlc4b.tlc.TLCResults.TLCResult;
import
de.tlc4b.util.PolySuite.Configuration
;
import
de.tlc4b.util.PolySuite.Configuration
;
public
abstract
class
AbstractParseMachineTest
{
public
abstract
class
AbstractParseMachineTest
{
private
static
final
String
MCH_SUFFIX
=
".mch"
;
private
static
final
class
MachineFilenameFilter
implements
FilenameFilter
{
private
static
final
String
[]
MACHINE_SUFFIX
=
{
".mch"
};
public
boolean
accept
(
final
File
dir
,
final
String
name
)
{
for
(
String
machineSuffix
:
MACHINE_SUFFIX
)
{
if
(
name
.
endsWith
(
machineSuffix
))
{
return
true
;
}
}
return
false
;
}
}
protected
static
File
[]
getMachines
(
String
path
)
{
protected
static
File
[]
getMachines
(
String
path
)
{
final
File
dir
=
new
File
(
path
);
return
new
File
(
path
).
listFiles
((
dir
,
name
)
->
name
.
endsWith
(
MCH_SUFFIX
));
return
dir
.
listFiles
(
new
MachineFilenameFilter
());
}
}
protected
static
File
[]
getMachinesRecursively
(
String
path
,
ArrayList
<
String
>
ignoreList
)
{
protected
static
File
[]
getMachinesRecursively
(
String
path
,
ArrayList
<
String
>
ignoreList
)
{
...
@@ -60,7 +46,7 @@ public abstract class AbstractParseMachineTest {
...
@@ -60,7 +46,7 @@ public abstract class AbstractParseMachineTest {
}
else
{
}
else
{
String
name
=
f
.
getName
();
String
name
=
f
.
getName
();
if
(
name
.
endsWith
(
".mch"
))
{
if
(
name
.
endsWith
(
MCH_SUFFIX
))
{
files
.
add
(
f
);
files
.
add
(
f
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment