for (String dir: dirs) {
list.add(this.makeExecution(dir));
}
- } catch (Exception e) {
+ } catch (Exception e) {// NOSONAR
throw new OnapCommandExecutionFailed(e, "Failed to search the executions");
}
Resource[] resources = OnapCommandDiscoveryUtils.findResources(pattern);
if (resources != null && resources.length > 0) { //NOSONAR
for (Resource res : resources) {
- if (res.getFilename().equals(fileName)) {
+ if ((res.getFilename() != null) && (res.getFilename().equals(fileName))) {
return res;
}
}
import org.apache.commons.io.FileUtils;
import org.junit.Test;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertFalse;
public class OnapCommandParameterCacheTest {
@Test
FileUtils.touch(new File("data" + File.separator + "test-profile.json"));
File test_profile = new File("data" + File.separator + "test-profile.json");
FileUtils.touch(test_profile);
- assertNotNull(test_profile.lastModified());
+ assertFalse(0 == test_profile.lastModified());
//assertTrue(OnapCommandProfileStore.getInstance().getProfiles().contains("test"));
// FileUtils.cleanDirectory(new File("data"));
}
Try to add new commands to display different weather details by exploring this site.
Sample usage:
- oclip --product tutorial weather-report --host-url http://api.openweathermap.org --zip-code 637301 --country-code in
+ oclip --product tutorial weather-report --host-url https://api.openweathermap.org --zip-code 637301 --country-code in
info:
product: tutorial
this.getResult().setDebugInfo(pr.toString());
pr.run();
- } catch (Exception e) {
+ } catch (Exception e) {// NOSONAR
throw new OnapCommandExecutionFailed(this.getName(), e);
} finally {
if (stdoutStream != null) {
public static final String HTTP_REQUEST_MANDATORY_PARAMS = "cli.schema.http.request.sections.mandatory";
public static final String HTTP_METHODS = "cli.schema.http.request.method.values";
//http connection
- public static final String SSLCONTEST_TLS = "TLSV1.2";
+ public static final String SSLCONTEST_TLS = "TLSv1.2";
public static final String APPLICATION_JSON = "application/json";
public static final String DEFAULT_PARAMETER_HTTP_FILE_NAME = "default_input_parameters_http.yaml";
public static final String DEAFULT_PARAMETER_USERNAME = "host-username";