diff options
31 files changed, 137 insertions, 143 deletions
diff --git a/auth/cli-codegen/src/main/java/org/onap/policy/apex/auth/clicodegen/CgStringRenderer.java b/auth/cli-codegen/src/main/java/org/onap/policy/apex/auth/clicodegen/CgStringRenderer.java index 50600f99f..dbf8f3844 100644 --- a/auth/cli-codegen/src/main/java/org/onap/policy/apex/auth/clicodegen/CgStringRenderer.java +++ b/auth/cli-codegen/src/main/java/org/onap/policy/apex/auth/clicodegen/CgStringRenderer.java @@ -35,17 +35,17 @@ public class CgStringRenderer implements AttributeRenderer { /* * (non-Javadoc) - * + * * @see org.stringtemplate.v4.AttributeRenderer#toString(java.lang.Object, java.lang.String, * java.util.Locale) */ @Override - public String toString(final Object o, final String format, final Locale locale) { + public String toString(final Object obj, final String format, final Locale locale) { if ("doQuotes".equals(format)) { - if (o == null) { + if (obj == null) { return null; } - String ret = o.toString(); + String ret = obj.toString(); if (ret.length() == 0) { return "\"\""; } @@ -56,16 +56,16 @@ public class CgStringRenderer implements AttributeRenderer { } if ("doDescription".equals(format)) { - String ret = o.toString(); + String ret = obj.toString(); if (ret.contains("\n") || ret.contains("\"")) { ret = "LS" + "\n" + ret + "\n" + "LE"; } else { - ret = this.toString(o, "doQuotes", locale); + ret = this.toString(obj, "doQuotes", locale); } return ret; } // return the default string renderer if we don't know otherwise - return new StringRenderer().toString(o, format, locale); + return new StringRenderer().toString(obj, format, locale); } } diff --git a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/StErrorListener.java b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/StErrorListener.java index ed703da82..28e32bca6 100644 --- a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/StErrorListener.java +++ b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/StErrorListener.java @@ -39,8 +39,8 @@ public class StErrorListener implements STErrorListener { @Override public void IOError(final STMessage msg) { switch (msg.error) { - default: - this.registerErrors(msg); + default: + this.registerErrors(msg); } } @@ -50,8 +50,8 @@ public class StErrorListener implements STErrorListener { @Override public void compileTimeError(final STMessage msg) { switch (msg.error) { - default: - this.registerErrors(msg); + default: + this.registerErrors(msg); } } @@ -61,8 +61,8 @@ public class StErrorListener implements STErrorListener { @Override public void internalError(final STMessage msg) { switch (msg.error) { - default: - this.registerErrors(msg); + default: + this.registerErrors(msg); } } @@ -72,18 +72,18 @@ public class StErrorListener implements STErrorListener { @Override public void runTimeError(final STMessage msg) { switch (msg.error) { - case NO_SUCH_PROPERTY: - case ARGUMENT_COUNT_MISMATCH: - case ANON_ARGUMENT_MISMATCH: - break; - default: - this.registerErrors(msg); + case NO_SUCH_PROPERTY: + case ARGUMENT_COUNT_MISMATCH: + case ANON_ARGUMENT_MISMATCH: + break; + default: + this.registerErrors(msg); } } /** * Registers an error with the local error listener and increases the error count. - * + * * @param msg error message */ protected void registerErrors(final STMessage msg) { diff --git a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/ApexCLIEditorMain.java b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/ApexCLIEditorMain.java index e484ff03f..c7f7c7bb1 100644 --- a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/ApexCLIEditorMain.java +++ b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/ApexCLIEditorMain.java @@ -152,7 +152,8 @@ public class ApexCLIEditorMain { if (errorCount == 0) { LOGGER.info("Apex CLI editor completed execution"); } else { - LOGGER.error("execution of Apex command line editor failed: {} command execution failure(s) occurred", errorCount); + LOGGER.error("execution of Apex command line editor failed: {} command execution failure(s) occurred", + errorCount); } } catch (final IOException e) { LOGGER.error("execution of Apex command line editor failed: " + e.getMessage()); @@ -160,7 +161,7 @@ public class ApexCLIEditorMain { } /** - * Get the number of errors encountered in command processing + * Get the number of errors encountered in command processing. * * @return the number of errors */ diff --git a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIException.java b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIException.java index 8e1104c3b..94b8c14a6 100644 --- a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIException.java +++ b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIException.java @@ -41,9 +41,9 @@ public class CLIException extends IllegalArgumentException { * Create a CLIException with a message and an exception. * * @param message the message - * @param t the t + * @param th the throwable */ - public CLIException(final String message, final Throwable t) { - super(message, t); + public CLIException(final String message, final Throwable th) { + super(message, th); } } diff --git a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLILineParser.java b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLILineParser.java index bbeface32..70c2f834b 100644 --- a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLILineParser.java +++ b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLILineParser.java @@ -36,9 +36,9 @@ public class CLILineParser { * single words followed by an '=' character Arguments are single words or a block of quoted * text following an '=' character. * - * Format: command [command....] parameter=argument [parameter = argument] + * <p>Format: command [command....] parameter=argument [parameter = argument] * - * Examples entity create name=hello description="description of hello" help entity list + * <p>Examples entity create name=hello description="description of hello" help entity list * * @param line The line to parse * @param logicBlock A block of logic code to be taken literally diff --git a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameterParser.java b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameterParser.java index 382f23fb0..8a0c6eff3 100644 --- a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameterParser.java +++ b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameterParser.java @@ -57,7 +57,8 @@ public class CLIParameterParser { .desc("name of a file containing editor commands to run into the editor").hasArg() .argName("COMMAND_FILE").required(false).type(String.class).build()); options.addOption(Option.builder("l").longOpt("log-file") - .desc("name of a file that will contain command logs from the editor, will log to standard output if not specified or suppressed with \"-nl\" flag") + .desc("name of a file that will contain command logs from the editor, will log to standard output " + + "if not specified or suppressed with \"-nl\" flag") .hasArg().argName("LOG_FILE").required(false).type(String.class).build()); options.addOption(Option.builder("nl").longOpt("no-log") .desc("if specified, no logging or output of commands to standard output or log file is carried out") @@ -74,10 +75,12 @@ public class CLIParameterParser { + "will output model to standard output if not specified or suppressed with \"-nm\" flag") .hasArg().argName("OUTPUT_MODEL_FILE").required(false).type(String.class).build()); options.addOption(Option.builder("if").longOpt("ignore-failures") - .desc("true or false, ignore failures of commands in command files and continue executing the command file") + .desc("true or false, ignore failures of commands in command files and continue executing the " + + "command file") .hasArg().argName("IGNORE_FAILURES_FLAG").required(false).type(Boolean.class).build()); options.addOption(Option.builder("wd").longOpt("working-directory") - .desc("the working directory that is the root for the CLI editor and is the root from which to look for included macro files") + .desc("the working directory that is the root for the CLI editor and is the root from which to " + + "look for included macro files") .hasArg().argName("WORKING_DIRECTORY").required(false).type(String.class).build()); } diff --git a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameters.java b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameters.java index ebaa6c572..24356d128 100644 --- a/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameters.java +++ b/auth/cli-editor/src/main/java/org/onap/policy/apex/auth/clieditor/CLIParameters.java @@ -522,7 +522,7 @@ public class CLIParameters { } /** - * Check if the command failures flag is set + * Check if the command failures flag is set. * * @return true if the command failures flag has been set */ 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/TestCLIEditorOptions.java index 87618e18d..2056c9239 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/TestCLIEditorOptions.java @@ -235,7 +235,7 @@ public class TestCLIEditorOptions { // Generate input model final String[] cliArgsIn = new String[] {"-c", "src/main/resources/examples/scripts/ShellPolicyModel.apex", - "-l", tempLogFileIn.getAbsolutePath(), "-o", tempModelFileIn.getAbsolutePath()}; + "-l", tempLogFileIn.getAbsolutePath(), "-o", tempModelFileIn.getAbsolutePath()}; final ApexCLIEditorMain cliEditorIn = new ApexCLIEditorMain(cliArgsIn); assertEquals(0, cliEditorIn.getErrorCount()); @@ -252,8 +252,8 @@ public class TestCLIEditorOptions { assertEquals(2924, tempModelFileInCharCount); final String[] cliArgsOut = new String[] {"-i", tempModelFileIn.getAbsolutePath(), "-c", - "src/main/resources/examples/scripts/ShellPolicyModelAddSchema.apex", "-l", - tempLogFileOut.getAbsolutePath(), "-o", tempModelFileOut.getAbsolutePath()}; + "src/main/resources/examples/scripts/ShellPolicyModelAddSchema.apex", "-l", + tempLogFileOut.getAbsolutePath(), "-o", tempModelFileOut.getAbsolutePath()}; final ApexCLIEditorMain cliEditorOut = new ApexCLIEditorMain(cliArgsOut); assertEquals(0, cliEditorOut.getErrorCount()); 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 3de41e8d4..1b99fce16 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 @@ -45,13 +45,8 @@ public class TestContextAlbums { public void createTempFiles() throws IOException { tempModelFile = File.createTempFile("TestPolicyModel", ".json"); - logicBlockArgs = new String[] { - "-c", - "src/test/resources/scripts/ContextAlbums.apex", - "-o", - tempModelFile.getAbsolutePath(), - "-nl" - }; + logicBlockArgs = new String[] {"-c", "src/test/resources/scripts/ContextAlbums.apex", "-o", + tempModelFile.getAbsolutePath(), "-nl"}; } /** @@ -81,7 +76,8 @@ public class TestContextAlbums { final AxPolicyModel writtenModel = modelReader.read(writtenModelURL.openStream()); assertNotNull(writtenModel); - final URL compareModelURL = ResourceUtils.getLocalFile("src/test/resources/compare/ContextAlbumsModel_Compare.json"); + final URL compareModelURL = + ResourceUtils.getLocalFile("src/test/resources/compare/ContextAlbumsModel_Compare.json"); final AxPolicyModel compareModel = modelReader.read(compareModelURL.openStream()); // Ignore key info UUIDs 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 6ff85e71c..eb2f2a46b 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 @@ -41,75 +41,65 @@ import org.onap.policy.common.utils.resources.ResourceUtils; * Test FileMacro in the CLI. */ public class TestFileMacro { - private String[] fileMacroArgs; - - private File tempModelFile; - private File tempLogFile; - - @Before - public void createTempFiles() throws IOException { - tempModelFile = File.createTempFile("TestPolicyModel", ".json"); - tempLogFile = File.createTempFile("TestPolicyModel", ".log"); - - fileMacroArgs = new String[] { - "-c", - "src/test/resources/scripts/FileMacro.apex", - "-l", - tempLogFile.getCanonicalPath(), - "-o", - tempModelFile.getCanonicalPath(), - "-if", - "true" - }; - } - - @After - public void removeGeneratedModels() { - tempModelFile.delete(); - } - - /** - * Test logic block macro in CLI scripts. - * - * @throws IOException Signals that an I/O exception has occurred. - * @throws ApexModelException if there is an Apex error - */ - @Test - public void testLogicBlock() throws IOException, ApexModelException { - final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(fileMacroArgs); - // We expect eight errors - assertEquals(8, 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 compareModelURL = ResourceUtils.getLocalFile("src/test/resources/compare/FileMacroModel_Compare.json"); - final AxPolicyModel compareModel = modelReader.read(compareModelURL.openStream()); - - // Ignore key info UUIDs - writtenModel.getKeyInformation().getKeyInfoMap().clear(); - compareModel.getKeyInformation().getKeyInfoMap().clear(); - - assertTrue(writtenModel.equals(compareModel)); - - // The output event is in this file - final File outputLogFile = new File(tempLogFile.getCanonicalPath()); - - final String outputLogString = TextFileUtils - .getTextFileAsString(outputLogFile.getCanonicalPath()) - .replace(Paths.get("").toAbsolutePath().toString() + File.separator, "") - .replaceAll("\\s+", ""); - - // We compare the log to what we expect to get - final String outputLogCompareString = TextFileUtils - .getTextFileAsString("src/test/resources/compare/FileMacro_Compare.log") - .replaceAll("\\s+", ""); - - // Check what we got is what we expected to get - assertEquals(outputLogCompareString, outputLogString); - } + private String[] fileMacroArgs; + + private File tempModelFile; + private File tempLogFile; + + @Before + public void createTempFiles() throws IOException { + tempModelFile = File.createTempFile("TestPolicyModel", ".json"); + tempLogFile = File.createTempFile("TestPolicyModel", ".log"); + + fileMacroArgs = new String[] {"-c", "src/test/resources/scripts/FileMacro.apex", "-l", + tempLogFile.getCanonicalPath(), "-o", tempModelFile.getCanonicalPath(), "-if", "true"}; + } + + @After + public void removeGeneratedModels() { + tempModelFile.delete(); + } + + /** + * Test logic block macro in CLI scripts. + * + * @throws IOException Signals that an I/O exception has occurred. + * @throws ApexModelException if there is an Apex error + */ + @Test + public void testLogicBlock() throws IOException, ApexModelException { + final ApexCLIEditorMain cliEditor = new ApexCLIEditorMain(fileMacroArgs); + // We expect eight errors + assertEquals(8, 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 compareModelURL = + ResourceUtils.getLocalFile("src/test/resources/compare/FileMacroModel_Compare.json"); + final AxPolicyModel compareModel = modelReader.read(compareModelURL.openStream()); + + // Ignore key info UUIDs + writtenModel.getKeyInformation().getKeyInfoMap().clear(); + compareModel.getKeyInformation().getKeyInfoMap().clear(); + + assertTrue(writtenModel.equals(compareModel)); + + // The output event is in this file + final File outputLogFile = new File(tempLogFile.getCanonicalPath()); + + final String outputLogString = TextFileUtils.getTextFileAsString(outputLogFile.getCanonicalPath()) + .replace(Paths.get("").toAbsolutePath().toString() + File.separator, "").replaceAll("\\s+", ""); + + // We compare the log to what we expect to get + final String outputLogCompareString = TextFileUtils + .getTextFileAsString("src/test/resources/compare/FileMacro_Compare.log").replaceAll("\\s+", ""); + + // Check what we got is what we expected to get + assertEquals(outputLogCompareString, outputLogString); + } } diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextBooleanItem.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextBooleanItem.java index 7f019f57c..3afd5c89d 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextBooleanItem.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextBooleanItem.java @@ -32,7 +32,7 @@ public class TestContextBooleanItem implements Serializable { private static final long serialVersionUID = 7241008665286367796L; - private boolean flag = false;; + private boolean flag = false; /** * The Constructor. diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextInstantiation.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextInstantiation.java index 888394be2..b4e9ad37d 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextInstantiation.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextInstantiation.java @@ -273,9 +273,8 @@ public class ContextInstantiation { try { externalContextAlbum.put("TestExternalContextItem00A", null); } catch (final ContextRuntimeException e) { - assertEquals( - "album \"ExternalContextAlbum:0.0.1\" null values are illegal on key \"TestExternalContextItem00A\" for put()", - e.getMessage()); + assertEquals("album \"ExternalContextAlbum:0.0.1\" null values are illegal on key " + + "\"TestExternalContextItem00A\" for put()", e.getMessage()); } assertEquals(tciAA, externalContextItem.getTestExternalContextItem00A()); @@ -302,25 +301,24 @@ public class ContextInstantiation { try { externalContextAlbum.put("TestExternalContextItem00A", null); } catch (final ContextRuntimeException e) { - assert (e.getMessage().equals( - "album \"ExternalContextAlbum:0.0.1\" null values are illegal on key \"TestExternalContextItem00A\" for put()")); + assert (e.getMessage().equals("album \"ExternalContextAlbum:0.0.1\" null values are illegal on key " + + "\"TestExternalContextItem00A\" for put()")); } assertTrue(externalContextAlbum.get(EXTERNAL_CONTEXT).equals(externalContext)); try { externalContextAlbum.put("TestExternalContextItemFFF", null); } catch (final ContextRuntimeException e) { - assert (e.getMessage().equals( - "album \"ExternalContextAlbum:0.0.1\" null values are illegal on key \"TestExternalContextItemFFF\" for put()")); + assert (e.getMessage().equals("album \"ExternalContextAlbum:0.0.1\" null values are illegal on key " + + "\"TestExternalContextItemFFF\" for put()")); } assertEquals(1, externalContextAlbum.size()); try { externalContextAlbum.put("TestExternalContextItemFFF", null); } catch (final ContextRuntimeException e) { - assertEquals( - "album \"ExternalContextAlbum:0.0.1\" null values are illegal on key \"TestExternalContextItemFFF\" for put()", - e.getMessage()); + assertEquals("album \"ExternalContextAlbum:0.0.1\" null values are illegal on key " + + "\"TestExternalContextItemFFF\" for put()", e.getMessage()); } assertEquals(1, externalContextAlbum.size()); diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextUpdate.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextUpdate.java index 33100165b..8f066c8e3 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextUpdate.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextUpdate.java @@ -94,9 +94,9 @@ public class ContextUpdate { longContextAlbum.put(_0, ZERO); fail(EXCEPTION_MESSAGE); } catch (final ContextRuntimeException e) { - assertEquals( - "Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\": LongContextAlbum:0.0.1: object \"zero\" of class \"java.lang.String\" not compatible with class \"java.lang.Long\"", - e.getMessage()); + assertEquals("Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\":" + + " LongContextAlbum:0.0.1: object \"zero\" of class \"java.lang.String\" not compatible with" + + " class \"java.lang.Long\"", e.getMessage()); } try { @@ -104,7 +104,8 @@ public class ContextUpdate { fail(EXCEPTION_MESSAGE); } catch (final ContextRuntimeException e) { assertEquals( - "Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\": LongContextAlbum:0.0.1: object \"\" of class \"java.lang.String\" not compatible with class \"java.lang.Long\"", + "Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\": LongContextAlbum" + + ":0.0.1: object \"\" of class \"java.lang.String\" not compatible with class \"java.lang.Long\"", e.getMessage()); } diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/AlbumModifier.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/AlbumModifier.java index 24e633109..14ceba425 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/AlbumModifier.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/AlbumModifier.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.lock.modifier; import org.onap.policy.apex.context.ContextAlbum; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/LockType.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/LockType.java index 0dd0e7224..c0ac36264 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/LockType.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/LockType.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.lock.modifier; import org.onap.policy.apex.context.ContextRuntimeException; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/NoLockAlbumModifier.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/NoLockAlbumModifier.java index b6ee1b8eb..6c273a0ae 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/NoLockAlbumModifier.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/NoLockAlbumModifier.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.lock.modifier; import java.util.Random; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/ReadLockAlbumModifier.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/ReadLockAlbumModifier.java index 57c6b7524..854179ccd 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/ReadLockAlbumModifier.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/ReadLockAlbumModifier.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.lock.modifier; import java.util.Random; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/SingleValueWriteLockAlbumModifier.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/SingleValueWriteLockAlbumModifier.java index a41de8dd7..959e93c67 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/SingleValueWriteLockAlbumModifier.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/SingleValueWriteLockAlbumModifier.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.lock.modifier; import static org.onap.policy.apex.context.test.utils.Constants.TEST_VALUE; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/WriteLockAlbumModifier.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/WriteLockAlbumModifier.java index 09e280026..d1f5ec17e 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/WriteLockAlbumModifier.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/WriteLockAlbumModifier.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.lock.modifier; import java.util.Random; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java index fc1c830e7..020bc4169 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java @@ -120,8 +120,8 @@ public final class ConcurrentContextJVM { // An even number of arguments greater than 3 if (args.length < 9) { LOGGER.error("invalid arguments: " + Arrays.toString(args)); - LOGGER.error( - "usage: TestConcurrentContextJVM testType jvmNo threadCount threadLoops albumSize lockType [parameterKey parameterJson].... "); + LOGGER.error("usage: TestConcurrentContextJVM testType jvmNo threadCount threadLoops albumSize " + + "lockType [parameterKey parameterJson].... "); return; } diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProvider.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProvider.java index d17f32269..b842f7aca 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProvider.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProvider.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.utils; import java.util.Map; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProviderImpl.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProviderImpl.java index 50429099e..f04cf5b39 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProviderImpl.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProviderImpl.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.utils; import java.util.HashMap; @@ -135,7 +136,7 @@ public class ConfigrationProviderImpl implements ConfigrationProvider { public Map<String, Object> getContextAlbumInitValues() { final Map<String, Object> values = new HashMap<>(); for (int i = 0; i < albumSize; i++) { - values.put(Integer.toString(i), new TestContextLongItem(0l)); + values.put(Integer.toString(i), new TestContextLongItem(0L)); } return values; } diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/Constants.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/Constants.java index 933c68b11..118586437 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/Constants.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/Constants.java @@ -59,7 +59,7 @@ public class Constants { private static final AxArtifactKey KEY3 = new AxArtifactKey("testC-bot", VERSION); private static final AxArtifactKey KEY2 = new AxArtifactKey("testC-next", VERSION); - private static final AxArtifactKey[] USED_ARTIFACT_STACK_ARRAY = new AxArtifactKey[] {KEY, KEY2, KEY3};; + private static final AxArtifactKey[] USED_ARTIFACT_STACK_ARRAY = new AxArtifactKey[] {KEY, KEY2, KEY3}; public static final AxArtifactKey[] getAxArtifactKeyArray() { return USED_ARTIFACT_STACK_ARRAY; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/IntegrationThreadFactory.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/IntegrationThreadFactory.java index b5ea84d2f..d815c6b74 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/IntegrationThreadFactory.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/IntegrationThreadFactory.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.utils; import java.util.concurrent.ThreadFactory; diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/NetworkUtils.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/NetworkUtils.java index 01331f2a7..8d2c89254 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/NetworkUtils.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/NetworkUtils.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.utils; import java.net.InetAddress; @@ -36,7 +37,7 @@ public class NetworkUtils { * function sets the address to be the first non-loopback IPv4 address on a host * * @return Set of IPv4 addresses - * @throws SocketException + * @throws SocketException throw socket exception if error occurs */ public static TreeSet<String> getIPv4NonLoopAddresses() throws SocketException { final TreeSet<String> ipAddressSet = new TreeSet<String>(); diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java index 67bb8878b..ffcbb351c 100644 --- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java +++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.policy.apex.context.test.utils; import java.io.File; diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextAlbumUpdate.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextAlbumUpdate.java index 105b59e8e..5487a0934 100644 --- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextAlbumUpdate.java +++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextAlbumUpdate.java @@ -20,9 +20,7 @@ package org.onap.policy.apex.context.test.distribution; - import java.io.IOException; - import org.junit.After; import org.junit.Test; import org.onap.policy.apex.context.impl.distribution.jvmlocal.JVMLocalDistributor; diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextInstantiation.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextInstantiation.java index 565a39f97..409033ad4 100644 --- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextInstantiation.java +++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextInstantiation.java @@ -20,9 +20,7 @@ package org.onap.policy.apex.context.test.distribution; - import java.io.IOException; - import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestSequentialContextInstantiation.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestSequentialContextInstantiation.java index 28bd7eb01..6e7430756 100644 --- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestSequentialContextInstantiation.java +++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestSequentialContextInstantiation.java @@ -20,9 +20,7 @@ package org.onap.policy.apex.context.test.distribution; - import java.io.IOException; - import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/locking/TestConcurrentContext.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/locking/TestConcurrentContext.java index c29353caf..9d0210e38 100644 --- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/locking/TestConcurrentContext.java +++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/locking/TestConcurrentContext.java @@ -20,7 +20,6 @@ package org.onap.policy.apex.context.test.locking; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -131,7 +130,7 @@ public class TestConcurrentContext { @Override public Map<String, Object> getContextAlbumInitValues() { final Map<String, Object> initValues = super.getContextAlbumInitValues(); - initValues.put(Constants.TEST_VALUE, new TestContextLongItem(0l)); + initValues.put(Constants.TEST_VALUE, new TestContextLongItem(0L)); return initValues; } }; diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java index a05928591..5d41eee85 100644 --- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java +++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java @@ -40,9 +40,9 @@ import org.onap.policy.apex.context.Distributor; import org.onap.policy.apex.context.impl.distribution.DistributorFactory; import org.onap.policy.apex.context.parameters.ContextParameters; import org.onap.policy.apex.context.parameters.PersistorParameters; -import org.onap.policy.apex.context.test.concepts.TestContextLongItem; import org.onap.policy.apex.context.test.concepts.TestContextDateItem; import org.onap.policy.apex.context.test.concepts.TestContextDateLocaleItem; +import org.onap.policy.apex.context.test.concepts.TestContextLongItem; import org.onap.policy.apex.context.test.concepts.TestContextTreeMapItem; import org.onap.policy.apex.context.test.factory.TestContextAlbumFactory; import org.onap.policy.apex.model.basicmodel.concepts.ApexException; @@ -118,7 +118,8 @@ public class TestPersistentContextInstantiation { contextAlbumForMap.putAll(valueMap0); - assertEquals(((TestContextTreeMapItem) contextAlbumForMap.get("TestPolicyContextItem000")).getMapValue().get("key"), + assertEquals( + ((TestContextTreeMapItem) contextAlbumForMap.get("TestPolicyContextItem000")).getMapValue().get("key"), "This is a policy context string"); contextAlbumForMap.flush(); |