/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2019-2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
import org.junit.Test;
import org.onap.policy.apex.model.basicmodel.handling.ApexModelException;
-import org.onap.policy.apex.model.utilities.TextFileUtils;
+import org.onap.policy.common.utils.resources.TextFileUtils;
/**
* The Class TestCLIEditorOptions.
final File tempModelFile = File.createTempFile("ShellPolicyModel", ".json");
final String[] cliArgs = new String[] {"-c", "src/main/resources/examples/scripts/ShellPolicyModel.apex", "-l",
- tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath()};
+ tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath()};
final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(cliArgs);
assertEquals(0, cliEditor.getErrorCount());
final int modelCharCount = modelString.replaceAll("\\s+", "").length();
assertEquals(1204, logCharCount);
- assertEquals(2924, modelCharCount);
+ assertEquals(2561, modelCharCount);
tempLogFile.delete();
tempModelFile.delete();
final File tempModelFile = File.createTempFile("ShellPolicyModel", ".json");
final String[] cliArgs = new String[] {"-c", "src/main/resources/examples/scripts/ShellPolicyModel.apex", "-l",
- tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath(), "-nl", "-nm"};
+ tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath(), "-nl", "-nm"};
final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(cliArgs);
assertEquals(0, cliEditor.getErrorCount());
final File tempModelFile = File.createTempFile("ShellPolicyModel", ".json");
final String[] cliArgs = new String[] {"-c", "src/main/resources/examples/scripts/ShellPolicyModel.apex", "-l",
- tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath(), "-nm"};
+ tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath(), "-nm"};
final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(cliArgs);
assertEquals(0, cliEditor.getErrorCount());
final File tempModelFile = File.createTempFile("ShellPolicyModel", ".json");
final String[] cliArgs = new String[] {"-c", "src/main/resources/examples/scripts/ShellPolicyModel.apex", "-l",
- tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath(), "-nl"};
+ tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath(), "-nl"};
final ApexCommandLineEditorMain cliEditor = new ApexCommandLineEditorMain(cliArgs);
assertEquals(0, cliEditor.getErrorCount());
final int modelCharCount = modelString.replaceAll("\\s+", "").length();
assertEquals(0, logCharCount);
- assertEquals(2924, modelCharCount);
+ assertEquals(2561, modelCharCount);
tempLogFile.delete();
tempModelFile.delete();
final int tempModelFileInCharCount = tempModelFileInString.replaceAll("\\s+", "").length();
assertEquals(1204, tempLogFileInCharCount);
- assertEquals(2924, tempModelFileInCharCount);
+ assertEquals(2561, tempModelFileInCharCount);
final String[] cliArgsOut = new String[] {"-i", tempModelFileIn.getAbsolutePath(), "-c",
"src/main/resources/examples/scripts/ShellPolicyModelAddSchema.apex", "-l",
final int tempModelFileOutCharCount = tempModelFileOutString.replaceAll("\\s+", "").length();
assertEquals(1154, tempLogFileOutCharCount);
- assertEquals(3356, tempModelFileOutCharCount);
+ assertEquals(2993, tempModelFileOutCharCount);
tempLogFileIn.delete();
tempModelFileIn.delete();