* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
* Modifications Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
-import org.onap.policy.apex.auth.clieditor.ApexCommandLineEditorMain;
+import org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain;
import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
import org.onap.policy.apex.service.engine.main.ApexMain;
public class EventAlbumContextTest {
private File tempCommandFile;
private File tempLogFile;
- private File tempModelFile;
+ private File tempPolicyFile;
private String eventContextString;
private String configFile;
private String outputFile;
public void testJavaEventAlbumContextTest() throws IOException, ApexException {
tempCommandFile = tempTestDir.newFile("TestPolicyJavaEventContext.apex");
tempLogFile = tempTestDir.newFile("TestPolicyJavaEventContext.log");
- tempModelFile = tempTestDir.newFile("TestPolicyJavaEventContext.json");
+ tempPolicyFile = tempTestDir.newFile("TestPolicyJavaEventContext.json");
eventContextString = ResourceUtils.getResourceAsString("examples/scripts/TestPolicyJavaEventContext.apex");
public void testAvroEventAlbumContextTest() throws IOException, ApexException {
tempCommandFile = tempTestDir.newFile("TestPolicyAvroEventContext.apex");
tempLogFile = tempTestDir.newFile("TestPolicyAvroEventContext.log");
- tempModelFile = tempTestDir.newFile("TestPolicyAvroEventContext.json");
+ tempPolicyFile = tempTestDir.newFile("TestPolicyAvroEventContext.json");
eventContextString = ResourceUtils.getResourceAsString("examples/scripts/TestPolicyAvroEventContext.apex");
TextFileUtils.putStringAsFile(eventContextString, tempCommandFile);
final String[] cliArgs = new String[] {"-c", tempCommandFile.getCanonicalPath(), "-l",
- tempLogFile.getAbsolutePath(), "-o", tempModelFile.getAbsolutePath()};
+ tempLogFile.getAbsolutePath(), "-ac", configFile, "-t", "src/test/resources/tosca/ToscaTemplate.json",
+ "-ot", tempPolicyFile.getAbsolutePath()};
- new ApexCommandLineEditorMain(cliArgs);
+ new ApexCliToscaEditorMain(cliArgs);
- final String[] args = new String[] {"-m", tempModelFile.getAbsolutePath(), "-c", configFile};
+ final String[] args = new String[] {"-p", tempPolicyFile.getAbsolutePath()};
final ApexMain apexMain = new ApexMain(args);
// The output event will be in this file