Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tla2bAST
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
tla2bAST
Commits
72c4f8ba
Commit
72c4f8ba
authored
2 years ago
by
dgelessus
Browse files
Options
Downloads
Patches
Plain Diff
Reduce throws declarations of TestUtil methods
parent
6f191f28
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/tla2b/util/TestUtil.java
+10
-12
10 additions, 12 deletions
src/test/java/de/tla2b/util/TestUtil.java
with
10 additions
and
12 deletions
src/test/java/de/tla2b/util/TestUtil.java
+
10
−
12
View file @
72c4f8ba
...
@@ -6,7 +6,6 @@ import de.be4.classicalb.core.parser.exceptions.BCompoundException;
...
@@ -6,7 +6,6 @@ import de.be4.classicalb.core.parser.exceptions.BCompoundException;
import
de.be4.classicalb.core.parser.node.Node
;
import
de.be4.classicalb.core.parser.node.Node
;
import
de.be4.classicalb.core.parser.node.Start
;
import
de.be4.classicalb.core.parser.node.Start
;
import
de.prob.prolog.output.PrologTermStringOutput
;
import
de.prob.prolog.output.PrologTermStringOutput
;
import
de.tla2b.exceptions.FrontEndException
;
import
de.tla2b.exceptions.TLA2BException
;
import
de.tla2b.exceptions.TLA2BException
;
import
de.tla2b.output.ASTPrettyPrinter
;
import
de.tla2b.output.ASTPrettyPrinter
;
import
de.tla2b.output.Renamer
;
import
de.tla2b.output.Renamer
;
...
@@ -19,12 +18,12 @@ import static org.junit.Assert.assertEquals;
...
@@ -19,12 +18,12 @@ import static org.junit.Assert.assertEquals;
public
class
TestUtil
{
public
class
TestUtil
{
public
static
void
loadTlaFile
(
String
tlaFile
)
throws
Exception
{
public
static
void
loadTlaFile
(
String
tlaFile
)
throws
TLA2B
Exception
{
Translator
t
=
new
Translator
(
tlaFile
);
Translator
t
=
new
Translator
(
tlaFile
);
t
.
translate
();
t
.
translate
();
}
}
public
static
void
runModule
(
String
tlaFile
)
throws
Exception
{
public
static
void
runModule
(
String
tlaFile
)
throws
BCompoundException
,
TLA2B
Exception
{
Translator
t
=
new
Translator
(
tlaFile
);
Translator
t
=
new
Translator
(
tlaFile
);
Start
start
=
t
.
translate
();
Start
start
=
t
.
translate
();
...
@@ -40,7 +39,7 @@ public class TestUtil {
...
@@ -40,7 +39,7 @@ public class TestUtil {
// assertEquals(result, ppResult);
// assertEquals(result, ppResult);
}
}
public
static
void
compareExpr
(
String
bExpr
,
String
tlaExpr
)
throws
Exception
{
public
static
void
compareExpr
(
String
bExpr
,
String
tlaExpr
)
throws
BCompound
Exception
{
ToolIO
.
setMode
(
ToolIO
.
TOOL
);
ToolIO
.
setMode
(
ToolIO
.
TOOL
);
ToolIO
.
reset
();
ToolIO
.
reset
();
Start
resultNode
=
Translator
.
translateTlaExpression
(
tlaExpr
);
Start
resultNode
=
Translator
.
translateTlaExpression
(
tlaExpr
);
...
@@ -53,7 +52,7 @@ public class TestUtil {
...
@@ -53,7 +52,7 @@ public class TestUtil {
assertEquals
(
bAstString
,
result
);
assertEquals
(
bAstString
,
result
);
}
}
public
static
void
compareExprIncludingModel
(
String
bExpr
,
String
tlaExpr
,
String
moduleString
)
throws
Exception
{
public
static
void
compareExprIncludingModel
(
String
bExpr
,
String
tlaExpr
,
String
moduleString
)
throws
BCompoundException
,
TLA2B
Exception
{
Translator
trans
=
new
Translator
(
moduleString
,
null
);
Translator
trans
=
new
Translator
(
moduleString
,
null
);
trans
.
translate
();
trans
.
translate
();
Start
resultNode
=
trans
.
translateExpression
(
tlaExpr
);
Start
resultNode
=
trans
.
translateExpression
(
tlaExpr
);
...
@@ -65,7 +64,7 @@ public class TestUtil {
...
@@ -65,7 +64,7 @@ public class TestUtil {
assertEquals
(
bAstString
,
result
);
assertEquals
(
bAstString
,
result
);
}
}
public
static
void
compare
(
final
String
bMachine
,
final
String
tlaModule
)
throws
Exception
{
public
static
void
compare
(
final
String
bMachine
,
final
String
tlaModule
)
throws
BCompoundException
,
TLA2B
Exception
{
ToolIO
.
setMode
(
ToolIO
.
TOOL
);
ToolIO
.
setMode
(
ToolIO
.
TOOL
);
String
expected
=
getAstStringofBMachineString
(
bMachine
);
String
expected
=
getAstStringofBMachineString
(
bMachine
);
...
@@ -75,7 +74,7 @@ public class TestUtil {
...
@@ -75,7 +74,7 @@ public class TestUtil {
assertEquals
(
expected
,
result
);
assertEquals
(
expected
,
result
);
}
}
public
static
void
compare
(
String
bMachine
,
String
tlaModule
,
String
config
)
throws
Exception
{
public
static
void
compare
(
String
bMachine
,
String
tlaModule
,
String
config
)
throws
BCompoundException
,
TLA2B
Exception
{
ToolIO
.
setMode
(
ToolIO
.
TOOL
);
ToolIO
.
setMode
(
ToolIO
.
TOOL
);
String
expected
=
getAstStringofBMachineString
(
bMachine
);
String
expected
=
getAstStringofBMachineString
(
bMachine
);
...
@@ -92,7 +91,7 @@ public class TestUtil {
...
@@ -92,7 +91,7 @@ public class TestUtil {
return
pout
.
toString
();
return
pout
.
toString
();
}
}
public
static
void
renamerTest
(
String
tlaFile
)
throws
Exception
{
public
static
void
renamerTest
(
String
tlaFile
)
throws
BCompoundException
,
TLA2B
Exception
{
Translator
t
=
new
Translator
(
tlaFile
);
Translator
t
=
new
Translator
(
tlaFile
);
Start
start
=
t
.
translate
();
Start
start
=
t
.
translate
();
Renamer
renamer
=
new
Renamer
(
start
);
Renamer
renamer
=
new
Renamer
(
start
);
...
@@ -102,7 +101,7 @@ public class TestUtil {
...
@@ -102,7 +101,7 @@ public class TestUtil {
parser
.
parse
(
aP
.
getResultString
(),
false
);
parser
.
parse
(
aP
.
getResultString
(),
false
);
}
}
public
static
TestTypeChecker
typeCheckString
(
String
moduleString
)
throws
FrontEndException
,
TLA2BException
{
public
static
TestTypeChecker
typeCheckString
(
String
moduleString
)
throws
TLA2BException
{
ToolIO
.
setMode
(
ToolIO
.
TOOL
);
ToolIO
.
setMode
(
ToolIO
.
TOOL
);
ToolIO
.
reset
();
ToolIO
.
reset
();
TestTypeChecker
testTypeChecker
=
new
TestTypeChecker
();
TestTypeChecker
testTypeChecker
=
new
TestTypeChecker
();
...
@@ -111,8 +110,7 @@ public class TestUtil {
...
@@ -111,8 +110,7 @@ public class TestUtil {
}
}
public
static
TestTypeChecker
typeCheckString
(
String
moduleString
,
String
configString
)
public
static
TestTypeChecker
typeCheckString
(
String
moduleString
,
String
configString
)
throws
TLA2BException
{
throws
FrontEndException
,
TLA2BException
{
ToolIO
.
setMode
(
ToolIO
.
TOOL
);
ToolIO
.
setMode
(
ToolIO
.
TOOL
);
ToolIO
.
reset
();
ToolIO
.
reset
();
TestTypeChecker
testTypeChecker
=
new
TestTypeChecker
();
TestTypeChecker
testTypeChecker
=
new
TestTypeChecker
();
...
@@ -120,7 +118,7 @@ public class TestUtil {
...
@@ -120,7 +118,7 @@ public class TestUtil {
return
testTypeChecker
;
return
testTypeChecker
;
}
}
public
static
TestTypeChecker
typeCheck
(
String
moduleFileName
)
throws
FrontEndException
,
TLA2BException
{
public
static
TestTypeChecker
typeCheck
(
String
moduleFileName
)
throws
TLA2BException
{
ToolIO
.
setMode
(
ToolIO
.
TOOL
);
ToolIO
.
setMode
(
ToolIO
.
TOOL
);
ToolIO
.
reset
();
ToolIO
.
reset
();
moduleFileName
=
moduleFileName
.
replace
(
'/'
,
FileUtil
.
separatorChar
);
moduleFileName
=
moduleFileName
.
replace
(
'/'
,
FileUtil
.
separatorChar
);
...
...
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