summaryrefslogtreecommitdiffstats
path: root/auth/cli-editor/src/test
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@ericsson.com>2018-09-13 15:25:32 +0100
committerliamfallon <liam.fallon@ericsson.com>2018-09-13 15:26:47 +0100
commit4cfa2e2d98f6877d54da304ef17f096284430908 (patch)
treec9452d2bf6bb96fae9c1e8e2d8ce8f8d01e69d22 /auth/cli-editor/src/test
parent0e23f7634e1e1fb31454c516974613335fcea1a4 (diff)
Sonar/Checkstyle in service/plugins
Sonar and Checkstyle changes in plugins and services, and knock on changes Issue-ID: POLICY-1034 Change-Id: Iff7df74e54fce2c661dcc2fae75ae93d4cacfe5b Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'auth/cli-editor/src/test')
-rw-r--r--auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCommandLineEditorEventsContext.java (renamed from auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCLIEditorEventsContext.java)54
-rw-r--r--auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCommandLineEditorOptions.java (renamed from auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCLIEditorOptions.java)18
-rw-r--r--auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCommandLineEditorScripting.java (renamed from auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCLIEditorScripting.java)30
-rw-r--r--auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestContextAlbums.java18
-rw-r--r--auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestFileMacro.java18
-rw-r--r--auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestLogicBlock.java32
6 files changed, 104 insertions, 66 deletions
diff --git a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCLIEditorEventsContext.java b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCommandLineEditorEventsContext.java
index bd75ddf76..b0d82b6fa 100644
--- a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCLIEditorEventsContext.java
+++ b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCommandLineEditorEventsContext.java
@@ -36,7 +36,7 @@ import org.onap.policy.apex.model.utilities.TextFileUtils;
/**
* The Class TestCLIEditorEventsContext.
*/
-public class TestCLIEditorEventsContext {
+public class TestCommandLineEditorEventsContext {
// CHECKSTYLE:OFF: MagicNumber
private static final Path SRC_MAIN_FOLDER = Paths.get("src/main/resources/");
@@ -54,7 +54,6 @@ public class TestCLIEditorEventsContext {
private static final String JSON_FILE = FILE_NAME + ".json";
private static final String LOG_FILE = FILE_NAME + ".log";
-
@Rule
public TemporaryFolder temporaryFolder = new TemporaryFolder();
@@ -70,10 +69,11 @@ public class TestCLIEditorEventsContext {
final File tempLogFile = temporaryFolder.newFile(LOG_FILE);
final File tempModelFile = temporaryFolder.newFile(JSON_FILE);
- final String[] cliArgs = new String[] {"-c", APEX_JAVA_POLICY_FILE.toString(), "-l",
- tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath()};
+ final String[] cliArgs = new String[]
+ { "-c", APEX_JAVA_POLICY_FILE.toString(), "-l", tempLogFile.getAbsolutePath(), "-o",
+ tempModelFile.getAbsolutePath() };
- final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(cliArgs);
+ final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(cliArgs);
assertEquals(0, cliEditor.getErrorCount());
// Get the model and log into strings
@@ -100,10 +100,11 @@ public class TestCLIEditorEventsContext {
final File tempLogFile = temporaryFolder.newFile(LOG_FILE);
final File tempModelFile = temporaryFolder.newFile(JSON_FILE);
- final String[] cliArgs = new String[] {"-c", APEX_AVRO_POLICY_FILE.toString(), "-l",
- tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath()};
+ final String[] cliArgs = new String[]
+ { "-c", APEX_AVRO_POLICY_FILE.toString(), "-l", tempLogFile.getAbsolutePath(), "-o",
+ tempModelFile.getAbsolutePath() };
- final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(cliArgs);
+ final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(cliArgs);
assertEquals(0, cliEditor.getErrorCount());
// Get the model and log into strings
@@ -126,14 +127,14 @@ public class TestCLIEditorEventsContext {
final File tempModelFile = temporaryFolder.newFile(JSON_FILE);
final String modelFile = SRC_TEST_FOLDER.resolve("model").resolve("empty_commands.json").toString();
- final String apexPropertiesLocation =
- SRC_MAIN_FOLDER.resolve("etc/editor").resolve("ApexModelProperties.json").toString();
+ final String apexPropertiesLocation = SRC_MAIN_FOLDER.resolve("etc/editor").resolve("ApexModelProperties.json")
+ .toString();
- final String[] cliArgs =
- new String[] {"-c", APEX_AVRO_POLICY_FILE.toString(), "-l", tempLogFile.getAbsolutePath(), "-o",
- tempModelFile.getAbsolutePath(), "-m", modelFile, "-a", apexPropertiesLocation};
+ final String[] cliArgs = new String[]
+ { "-c", APEX_AVRO_POLICY_FILE.toString(), "-l", tempLogFile.getAbsolutePath(), "-o",
+ tempModelFile.getAbsolutePath(), "-m", modelFile, "-a", apexPropertiesLocation };
- final ApexCLIEditorMain objUnderTest = new ApexCLIEditorMain(cliArgs);
+ final ApexCommandLineEditorMain objUnderTest = new ApexCommandLineEditorMain(cliArgs);
assertEquals(1, objUnderTest.getErrorCount());
}
@@ -146,14 +147,23 @@ public class TestCLIEditorEventsContext {
final File modelFile = temporaryFolder.newFile("empty_commands.json");
- final String apexPropertiesLocation =
- SRC_MAIN_FOLDER.resolve("etc/editor").resolve("ApexModelProperties.json").toString();
-
- final String[] cliArgs = new String[] {"-c", APEX_AVRO_POLICY_FILE.toString(), "-l",
- tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath(), "-m", modelFile.getAbsolutePath(),
- "-a", apexPropertiesLocation};
-
- final ApexCLIEditorMain objUnderTest = new ApexCLIEditorMain(cliArgs);
+ final String apexPropertiesLocation = SRC_MAIN_FOLDER.resolve("etc/editor").resolve("ApexModelProperties.json")
+ .toString();
+
+ final String[] cliArgs = new String[] {
+ "-c",
+ APEX_AVRO_POLICY_FILE.toString(),
+ "-l",
+ tempLogFile.getAbsolutePath(),
+ "-o",
+ tempModelFile.getAbsolutePath(),
+ "-m",
+ modelFile.getAbsolutePath(),
+ "-a",
+ apexPropertiesLocation
+ };
+
+ final ApexCommandLineEditorMain objUnderTest = new ApexCommandLineEditorMain(cliArgs);
assertEquals(1, objUnderTest.getErrorCount());
}
diff --git a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCLIEditorOptions.java b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCommandLineEditorOptions.java
index 2056c9239..5ff87c01b 100644
--- a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCLIEditorOptions.java
+++ b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCommandLineEditorOptions.java
@@ -38,7 +38,7 @@ import org.onap.policy.apex.model.utilities.TextFileUtils;
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
-public class TestCLIEditorOptions {
+public class TestCommandLineEditorOptions {
// CHECKSTYLE:OFF: MagicNumber
/**
@@ -55,7 +55,7 @@ public class TestCLIEditorOptions {
final String[] cliArgs = new String[] {"-c", "src/main/resources/examples/scripts/ShellPolicyModel.apex", "-l",
tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath()};
- final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(cliArgs);
+ final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(cliArgs);
assertEquals(0, cliEditor.getErrorCount());
// Get the model and log into strings
@@ -87,7 +87,7 @@ public class TestCLIEditorOptions {
final String[] cliArgs = new String[] {"-c", "src/main/resources/examples/scripts/ShellPolicyModel.apex", "-l",
tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath(), "-nl", "-nm"};
- final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(cliArgs);
+ final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(cliArgs);
assertEquals(0, cliEditor.getErrorCount());
// Get the model and log into strings
@@ -119,7 +119,7 @@ public class TestCLIEditorOptions {
final String[] cliArgs = new String[] {"-c", "src/main/resources/examples/scripts/ShellPolicyModel.apex", "-l",
tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath(), "-nm"};
- final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(cliArgs);
+ final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(cliArgs);
assertEquals(0, cliEditor.getErrorCount());
// Get the model and log into strings
@@ -152,7 +152,7 @@ public class TestCLIEditorOptions {
final String[] cliArgs = new String[] {"-c", "src/main/resources/examples/scripts/ShellPolicyModel.apex", "-l",
tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath(), "-nl"};
- final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(cliArgs);
+ final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(cliArgs);
assertEquals(0, cliEditor.getErrorCount());
// Get the model and log into strings
@@ -184,7 +184,7 @@ public class TestCLIEditorOptions {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
System.setOut(new PrintStream(baos));
- final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(cliArgs);
+ final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(cliArgs);
assertEquals(0, cliEditor.getErrorCount());
// Cursor for log
@@ -208,7 +208,7 @@ public class TestCLIEditorOptions {
final PrintStream stdout = System.out;
System.setOut(new PrintStream(baos));
- final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(cliArgs);
+ final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(cliArgs);
assertEquals(0, cliEditor.getErrorCount());
// Cursor for log
@@ -237,7 +237,7 @@ public class TestCLIEditorOptions {
final String[] cliArgsIn = new String[] {"-c", "src/main/resources/examples/scripts/ShellPolicyModel.apex",
"-l", tempLogFileIn.getAbsolutePath(), "-o", tempModelFileIn.getAbsolutePath()};
- final ApexCLIEditorMain cliEditorIn = new ApexCLIEditorMain(cliArgsIn);
+ final ApexCommandLineEditorMain cliEditorIn = new ApexCommandLineEditorMain(cliArgsIn);
assertEquals(0, cliEditorIn.getErrorCount());
// Get the model and log into strings
@@ -255,7 +255,7 @@ public class TestCLIEditorOptions {
"src/main/resources/examples/scripts/ShellPolicyModelAddSchema.apex", "-l",
tempLogFileOut.getAbsolutePath(), "-o", tempModelFileOut.getAbsolutePath()};
- final ApexCLIEditorMain cliEditorOut = new ApexCLIEditorMain(cliArgsOut);
+ final ApexCommandLineEditorMain cliEditorOut = new ApexCommandLineEditorMain(cliArgsOut);
assertEquals(0, cliEditorOut.getErrorCount());
// Get the model and log into strings
diff --git a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCLIEditorScripting.java b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCommandLineEditorScripting.java
index 44cc5c702..1b49fb362 100644
--- a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCLIEditorScripting.java
+++ b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestCommandLineEditorScripting.java
@@ -41,14 +41,14 @@ import org.onap.policy.common.utils.resources.ResourceUtils;
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
-public class TestCLIEditorScripting {
+public class TestCommandLineEditorScripting {
private File tempModelFile;
private File tempLogFile;
- private String[] sampleLBPolicyArgs;
+ private String[] samplePolicyArgs;
- private String[] sampleLBPolicyMapArgs;
+ private String[] samplePolicyMapArgs;
/**
* Initialise args.
@@ -60,10 +60,10 @@ public class TestCLIEditorScripting {
tempModelFile = File.createTempFile("SampleLBPolicyMap", ".json");
tempLogFile = File.createTempFile("SampleLBPolicyMap", ".log");
- sampleLBPolicyArgs = new String[] {"-c", "src/test/resources/scripts/SampleLBPolicy.apex", "-o",
+ samplePolicyArgs = new String[] {"-c", "src/test/resources/scripts/SampleLBPolicy.apex", "-o",
tempModelFile.getAbsolutePath(), "-l", tempLogFile.getAbsolutePath()};
- sampleLBPolicyMapArgs = new String[] {"-c", "src/test/resources/scripts/SampleLBPolicy_WithMap.apex", "-o",
+ samplePolicyMapArgs = new String[] {"-c", "src/test/resources/scripts/SampleLBPolicy_WithMap.apex", "-o",
tempModelFile.getAbsolutePath(), "-l", tempLogFile.getAbsolutePath()};
}
@@ -83,19 +83,19 @@ public class TestCLIEditorScripting {
* @throws ApexModelException if there is an Apex error
*/
@Test
- public void testSampleLBPolicyScript() throws IOException, ApexModelException {
- final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(sampleLBPolicyArgs);
+ public void testSamplePolicyScript() throws IOException, ApexModelException {
+ final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(samplePolicyArgs);
assertEquals(0, cliEditor.getErrorCount());
// Read the file from disk
final ApexModelReader<AxPolicyModel> modelReader = new ApexModelReader<>(AxPolicyModel.class);
- final URL writtenModelURL = ResourceUtils.getLocalFile(tempModelFile.getCanonicalPath());
- final AxPolicyModel writtenModel = modelReader.read(writtenModelURL.openStream());
+ final URL writtenModelUrl = ResourceUtils.getLocalFile(tempModelFile.getCanonicalPath());
+ final AxPolicyModel writtenModel = modelReader.read(writtenModelUrl.openStream());
- final URL compareModelURL =
+ final URL compareModelUrl =
ResourceUtils.getLocalFile("src/test/resources/compare/FuzzyPolicyModel_Compare.json");
- final AxPolicyModel compareModel = modelReader.read(compareModelURL.openStream());
+ final AxPolicyModel compareModel = modelReader.read(compareModelUrl.openStream());
// Ignore key info UUIDs
writtenModel.getKeyInformation().getKeyInfoMap().clear();
@@ -111,10 +111,10 @@ public class TestCLIEditorScripting {
* @throws ApexModelException if there is an Apex error
*/
@Test
- public void testSampleLBMapPolicyScript() throws IOException, ApexModelException {
+ public void testSampleMapPolicyScript() throws IOException, ApexModelException {
tempModelFile.delete();
- final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(sampleLBPolicyMapArgs);
+ final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(samplePolicyMapArgs);
assertEquals(0, cliEditor.getErrorCount());
assertTrue(tempModelFile.isFile());
@@ -122,8 +122,8 @@ public class TestCLIEditorScripting {
// Read the file from disk
final ApexModelReader<AxPolicyModel> modelReader = new ApexModelReader<>(AxPolicyModel.class);
- final URL writtenModelURL = ResourceUtils.getLocalFile(tempModelFile.getCanonicalPath());
- final AxPolicyModel writtenModel = modelReader.read(writtenModelURL.openStream());
+ final URL writtenModelUrl = ResourceUtils.getLocalFile(tempModelFile.getCanonicalPath());
+ final AxPolicyModel writtenModel = modelReader.read(writtenModelUrl.openStream());
final AxValidationResult validationResult = new AxValidationResult();
writtenModel.validate(validationResult);
diff --git a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestContextAlbums.java b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestContextAlbums.java
index 1b99fce16..a45212007 100644
--- a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestContextAlbums.java
+++ b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestContextAlbums.java
@@ -36,11 +36,19 @@ import org.onap.policy.apex.model.basicmodel.handling.ApexModelReader;
import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
import org.onap.policy.common.utils.resources.ResourceUtils;
+/**
+ * The Class TestContextAlbums.
+ */
public class TestContextAlbums {
private String[] logicBlockArgs;
private File tempModelFile;
+ /**
+ * Creates the temp files.
+ *
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
@Before
public void createTempFiles() throws IOException {
tempModelFile = File.createTempFile("TestPolicyModel", ".json");
@@ -65,20 +73,20 @@ public class TestContextAlbums {
*/
@Test
public void testLogicBlock() throws IOException, ApexModelException {
- final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(logicBlockArgs);
+ final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(logicBlockArgs);
assertEquals(1, cliEditor.getErrorCount());
// Read the file from disk
final ApexModelReader<AxPolicyModel> modelReader = new ApexModelReader<>(AxPolicyModel.class);
modelReader.setValidateFlag(false);
- final URL writtenModelURL = ResourceUtils.getLocalFile(tempModelFile.getCanonicalPath());
- final AxPolicyModel writtenModel = modelReader.read(writtenModelURL.openStream());
+ final URL writtenModelUrl = ResourceUtils.getLocalFile(tempModelFile.getCanonicalPath());
+ final AxPolicyModel writtenModel = modelReader.read(writtenModelUrl.openStream());
assertNotNull(writtenModel);
- final URL compareModelURL =
+ final URL compareModelUrl =
ResourceUtils.getLocalFile("src/test/resources/compare/ContextAlbumsModel_Compare.json");
- final AxPolicyModel compareModel = modelReader.read(compareModelURL.openStream());
+ final AxPolicyModel compareModel = modelReader.read(compareModelUrl.openStream());
// Ignore key info UUIDs
writtenModel.getKeyInformation().getKeyInfoMap().clear();
diff --git a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestFileMacro.java b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestFileMacro.java
index eb2f2a46b..3195bf025 100644
--- a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestFileMacro.java
+++ b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestFileMacro.java
@@ -46,6 +46,11 @@ public class TestFileMacro {
private File tempModelFile;
private File tempLogFile;
+ /**
+ * Creates the temp files.
+ *
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
@Before
public void createTempFiles() throws IOException {
tempModelFile = File.createTempFile("TestPolicyModel", ".json");
@@ -55,6 +60,9 @@ public class TestFileMacro {
tempLogFile.getCanonicalPath(), "-o", tempModelFile.getCanonicalPath(), "-if", "true"};
}
+ /**
+ * Removes the generated models.
+ */
@After
public void removeGeneratedModels() {
tempModelFile.delete();
@@ -68,7 +76,7 @@ public class TestFileMacro {
*/
@Test
public void testLogicBlock() throws IOException, ApexModelException {
- final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(fileMacroArgs);
+ final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(fileMacroArgs);
// We expect eight errors
assertEquals(8, cliEditor.getErrorCount());
@@ -76,12 +84,12 @@ public class TestFileMacro {
final ApexModelReader<AxPolicyModel> modelReader = new ApexModelReader<>(AxPolicyModel.class);
modelReader.setValidateFlag(false);
- final URL writtenModelURL = ResourceUtils.getLocalFile(tempModelFile.getCanonicalPath());
- final AxPolicyModel writtenModel = modelReader.read(writtenModelURL.openStream());
+ final URL writtenModelUrl = ResourceUtils.getLocalFile(tempModelFile.getCanonicalPath());
+ final AxPolicyModel writtenModel = modelReader.read(writtenModelUrl.openStream());
- final URL compareModelURL =
+ final URL compareModelUrl =
ResourceUtils.getLocalFile("src/test/resources/compare/FileMacroModel_Compare.json");
- final AxPolicyModel compareModel = modelReader.read(compareModelURL.openStream());
+ final AxPolicyModel compareModel = modelReader.read(compareModelUrl.openStream());
// Ignore key info UUIDs
writtenModel.getKeyInformation().getKeyInfoMap().clear();
diff --git a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestLogicBlock.java b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestLogicBlock.java
index 591acb29a..1a4f75576 100644
--- a/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestLogicBlock.java
+++ b/auth/cli-editor/src/test/java/org/onap/policy/apex/auth/clieditor/TestLogicBlock.java
@@ -34,6 +34,10 @@ import org.onap.policy.apex.model.basicmodel.handling.ApexModelReader;
import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
import org.onap.policy.common.utils.resources.ResourceUtils;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class TestLogicBlock.
+ */
public class TestLogicBlock {
private String[] logicBlockArgs;
private String[] avroSchemaArgs;
@@ -41,6 +45,11 @@ public class TestLogicBlock {
private File tempLogicModelFile;
private File tempAvroModelFile;
+ /**
+ * Creates the temp files.
+ *
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
@Before
public void createTempFiles() throws IOException {
tempLogicModelFile = File.createTempFile("TestLogicPolicyModel", ".json");
@@ -53,6 +62,9 @@ public class TestLogicBlock {
tempAvroModelFile.getCanonicalPath(), "-nl"};
}
+ /**
+ * Removes the temp files.
+ */
@After
public void removeTempFiles() {
tempLogicModelFile.delete();
@@ -67,18 +79,18 @@ public class TestLogicBlock {
*/
@Test
public void testLogicBlock() throws IOException, ApexModelException {
- new ApexCLIEditorMain(logicBlockArgs);
+ new ApexCommandLineEditorMain(logicBlockArgs);
// Read the file from disk
final ApexModelReader<AxPolicyModel> modelReader = new ApexModelReader<>(AxPolicyModel.class);
modelReader.setValidateFlag(false);
- final URL writtenModelURL = ResourceUtils.getLocalFile(tempLogicModelFile.getCanonicalPath());
- final AxPolicyModel writtenModel = modelReader.read(writtenModelURL.openStream());
+ final URL writtenModelUrl = ResourceUtils.getLocalFile(tempLogicModelFile.getCanonicalPath());
+ final AxPolicyModel writtenModel = modelReader.read(writtenModelUrl.openStream());
- final URL compareModelURL =
+ final URL compareModelUrl =
ResourceUtils.getLocalFile("src/test/resources/compare/LogicBlockModel_Compare.json");
- final AxPolicyModel compareModel = modelReader.read(compareModelURL.openStream());
+ final AxPolicyModel compareModel = modelReader.read(compareModelUrl.openStream());
// Ignore key info UUIDs
writtenModel.getKeyInformation().getKeyInfoMap().clear();
@@ -95,18 +107,18 @@ public class TestLogicBlock {
*/
@Test
public void testAvroSchema() throws IOException, ApexModelException {
- new ApexCLIEditorMain(avroSchemaArgs);
+ new ApexCommandLineEditorMain(avroSchemaArgs);
// Read the file from disk
final ApexModelReader<AxPolicyModel> modelReader = new ApexModelReader<>(AxPolicyModel.class);
modelReader.setValidateFlag(false);
- final URL writtenModelURL = ResourceUtils.getLocalFile(tempAvroModelFile.getCanonicalPath());
- final AxPolicyModel writtenModel = modelReader.read(writtenModelURL.openStream());
+ final URL writtenModelUrl = ResourceUtils.getLocalFile(tempAvroModelFile.getCanonicalPath());
+ final AxPolicyModel writtenModel = modelReader.read(writtenModelUrl.openStream());
- final URL compareModelURL =
+ final URL compareModelUrl =
ResourceUtils.getLocalFile("src/test/resources/compare/AvroSchemaModel_Compare.json");
- final AxPolicyModel compareModel = modelReader.read(compareModelURL.openStream());
+ final AxPolicyModel compareModel = modelReader.read(compareModelUrl.openStream());
// Ignore key info UUIDs
writtenModel.getKeyInformation().getKeyInfoMap().clear();