package org.sifappscanplugin.sensor; import static org.junit.Assert.assertTrue; import java.util.HashMap; import java.util.Map; import java.util.Properties; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; public class AppScanSourcePluginTest { static AppScanSourcePlugin appScanSourcePlugin; static Map<String, String> parameters; @BeforeClass public static void setUp(){ //Setup any resources you may need for testing. System.out.println("setUp test"); System.out.println("Initializing AppScanSourcePlugin...."); Properties defaultProperties = loadProperties("default.properties"); appScanSourcePlugin = new AppScanSourcePlugin(); parameters = new HashMap<String, String>(); parameters.put("asse.url", "asse.url"); parameters.put("asse.username", "asse.username"); parameters.put("asse.password", "asse.password"); parameters.put("scanWorkspace.dir", "scanWorkspace.dir"); parameters.put("sif.dir", "sif.dir"); parameters.put("application", "application"); parameters.put("paf.file", "paf.file"); parameters.put("assessment.file", "assessment.file"); parameters.put("scan.config", "scan.config"); parameters.put("scanWorkspace.dir", "scanWorkspace.dir"); System.out.println("AppScanSourcePlugin Initialized"); } @Test public void testSense(){ //Test scan System.out.println("testSense"); try { this.appScanSourcePlugin.sense(null, null, parameters); } catch (Exception e) { e.printStackTrace(); } // TODO Verify that either the call to cli_script.txt or the call invoked from cli_script.txt is valid. assertTrue(1 == 1); } @Test public void testPublish(){ //Test publish System.out.println("testPublish"); try { this.appScanSourcePlugin.publish(null, null, parameters); } catch (Exception e) { e.printStackTrace(); } // TODO Verify that either the call to cli_script_ASE.txt or the call invoked from cli_script_ASE.txt is valid. assertTrue(1 == 1); } @AfterClass public static void tearDown() { //Release any resources that need to be released. System.out.println("tearDown"); } private static Properties loadProperties(String propertiesFileName){ System.out.println("Loading Properties from " + propertiesFileName + "...."); Properties props = new Properties(); try{ props.load(AppScanSourcePluginTest.class.getClassLoader().getResourceAsStream(propertiesFileName)); } catch(Exception e){ e.printStackTrace(); } return props; } }