Skip to content

Commit

Permalink
item #10 progress toward preparing batch files for Generator
Browse files Browse the repository at this point in the history
  • Loading branch information
davenicolette committed Jan 1, 2021
1 parent da5beb4 commit 20d23d6
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
1 change: 1 addition & 0 deletions ALLTESTS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TESTSUITE 'GREETING AND FAREWELL (FAREWELL WILL FAIL)' TESTCASE 'IT RETURNS HELLO, WORLD! AS GREETING' MOVE 'GREETING' TO WS-MESSAGE-TYPE PERFORM 2000-SPEAK EXPECT WS-MESSAGE TO BE 'HELLO, WORLD!' TESTCASE 'IT RETURNS GOODBYE, CRUEL WORLD! AS FAREWELL' MOVE 'FAREWELL' TO WS-MESSAGE-TYPE PERFORM 2000-SPEAK EXPECT WS-MESSAGE TO BE 'GOODBYE, CRUEL WORLD!' TESTSUITE 'GREETING AND FAREWELL (FAREWELL WILL FAIL)' TESTCASE 'IT RETURNS HELLO, WORLD! AS GREETING' MOVE 'GREETING' TO WS-MESSAGE-TYPE PERFORM 2000-SPEAK EXPECT WS-MESSAGE TO BE 'HELLO, WORLD!' TESTCASE 'IT RETURNS GOODBYE, CRUEL WORLD! AS FAREWELL' MOVE 'FAREWELL' TO WS-MESSAGE-TYPE PERFORM 2000-SPEAK EXPECT WS-MESSAGE TO BE 'GOODBYE, CRUEL WORLD!'
2 changes: 1 addition & 1 deletion config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ application.copybook.directory = copybooks
application.copybook.filename.suffix = none

# optional override of system default Locale
locale.language = ja
#locale.language = ja
#locale.country =
#locale.variant =

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/neopragma/cobolcheck/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public class Driver implements Constants, StringHelper {
" Default: INFO",
" -t|--test-suite-path absolute-or-relative-path[:absolute-or-relative-path[...]]",
" Location(s) of test suite input file(s) for this run. Values specified here are prefixed",
" to those specified in the config file as test.suite.path (if any)."
" to those specified in the config file as test.suite.path (if any). Globs are supported here",
" but not in the config file."
};

public Driver(
Expand All @@ -73,8 +74,6 @@ void run() {
}

void prepareInputAndOutputFiles() {

//TODO: concatenate test suite files
TestSuiteConcatenator concatenator =
new TestSuiteConcatenator(config, options);
testSuite = concatenator.concatenateTestSuites();
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/com/neopragma/cobolcheck/GetOpt.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ private void processCommandLineArgumentArray(String[] args) {
OptionValue optionValue = new OptionValue();
String lastOption = EMPTY_STRING;
for (String argValue : args) {

System.out.println("argValue: " + argValue);


if (isKey(argValue)) {
if (expectValueNext) throw new CommandLineArgumentException(
messages.get("ERR004", lastOption, argValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class TestSuiteConcatenator implements Constants, StringHelper {
private Config config;
private Messages messages;
private GetOpt options;
private Reader testSuite;
private BufferedReader testSuite;

public TestSuiteConcatenator(Config config, GetOpt options) {
this.config = config;
Expand Down Expand Up @@ -88,17 +88,19 @@ Reader concatenateTestSuites() {
}
String[] testSuitePathList = testSuitePaths.toString().split(COLON);

String line = EMPTY_STRING;
String line;
for (String pathname : testSuitePathList) {
try {
Log.info(messages.get("INF007", pathname, concatenatedTestSuiteFileName));
testSuite = new FileReader(pathname);
} catch (FileNotFoundException testSuiteException) {
testSuite = new BufferedReader(new FileReader(pathname));
while ((line = testSuite.readLine()) != null) {
concatenatedTestSuitesWriter.write(line);
}
} catch (IOException testSuiteNotFound) {
throw new TestSuiteInputFileNotFoundException(
messages.get("ERR011", pathname),
testSuiteException);
testSuiteNotFound);
}

}
FileReader testSuite;
try {
Expand Down
11 changes: 11 additions & 0 deletions testfiles/SECOND-TESTSUITE
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
TESTSUITE 'GREETING AND FAREWELL (FAREWELL WILL FAIL)'

TESTCASE 'IT RETURNS HELLO, WORLD! AS GREETING'
MOVE 'GREETING' TO WS-MESSAGE-TYPE
PERFORM 2000-SPEAK
EXPECT WS-MESSAGE TO BE 'HELLO, WORLD!'

TESTCASE 'IT RETURNS GOODBYE, CRUEL WORLD! AS FAREWELL'
MOVE 'FAREWELL' TO WS-MESSAGE-TYPE
PERFORM 2000-SPEAK
EXPECT WS-MESSAGE TO BE 'GOODBYE, CRUEL WORLD!'

0 comments on commit 20d23d6

Please sign in to comment.