Skip to content

Commit

Permalink
Fixed test compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ctevse committed Sep 21, 2023
1 parent 29d2d0a commit d685990
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ public void CveCrawlControllerTest() throws Exception {
List<String> whiteList = new ArrayList<>();
whiteList.add("https://www.jenkins.io/security/advisory");

CveCrawlController controller = new CveCrawlController();
HashMap<String, Object> vars = new HashMap<>();
vars.put("outputDir", "output/crawlers");
vars.put("crawlerPoliteness", 3000);
vars.put("maxPages", -1);
vars.put("depth", 1);
vars.put("enableReport", false);
vars.put("crawlerNum", 1);
HashMap<String, ArrayList<RawVulnerability>> map = controller.crawl(urls, whiteList, vars);

CveCrawlController controller = new CveCrawlController(urls, whiteList, vars);
HashMap<String, ArrayList<RawVulnerability>> map = controller.crawl();

assertTrue(map.size() > 0);
}
Expand Down
6 changes: 3 additions & 3 deletions patchfinder/src/test/java/messenger/MessengerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void testWaitForProductNameExtractorMessage_ValidMessageReceived() throws
when(connectionMock.createChannel()).thenReturn(channelMock);

// Create a Messenger instance with the mock ConnectionFactory
Messenger messenger = new Messenger("localhost", 5672,"guest", "guest", "PNE_OUT");
Messenger messenger = new Messenger("localhost", "/", 5672,"guest", "guest", "PNE_OUT");
messenger.setFactory(factoryMock);

// Create a message queue and a message to be received
Expand Down Expand Up @@ -116,7 +116,7 @@ public void testMain() {

@Test
public void testParseIds_ValidJsonString() {
Messenger messenger = new Messenger("localhost", 5672,"guest", "guest", "PNE_OUT");
Messenger messenger = new Messenger("localhost", "/", 5672,"guest", "guest", "PNE_OUT");
String jsonString = "[\"id1\",\"id2\",\"id3\"]";
List<String> expectedIds = Arrays.asList("id1", "id2", "id3");

Expand All @@ -127,7 +127,7 @@ public void testParseIds_ValidJsonString() {

@Test
public void testParseIds_InvalidJsonString() {
Messenger messenger = new Messenger("localhost", 5672,"guest", "guest", "PNE_OUT");
Messenger messenger = new Messenger("localhost", "/", 5672,"guest", "guest", "PNE_OUT");
String jsonString = "invalidJsonString";

List<String> actualIds = messenger.parseIds(jsonString);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void testWaitForReconcilerMessage_ValidMessageReceived() throws Exception
when(connectionMock.createChannel()).thenReturn(channelMock);

// Create a Messenger instance with the mock ConnectionFactory
Messenger messenger = new Messenger("localhost", 5672,"guest", "guest", "RECONCILER_OUT", "PNE_OUT");
Messenger messenger = new Messenger("localhost", "/", 5672,"guest", "guest", "RECONCILER_OUT", "PNE_OUT");
messenger.setFactory(factoryMock);

// Create a message queue and a message to be received
Expand Down Expand Up @@ -95,7 +95,7 @@ public void testWaitForReconcilerMessage_ValidMessageReceived() throws Exception

@Test
public void testParseIds_ValidJsonString() {
Messenger messenger = new Messenger("localhost", 5672,"guest", "guest", "RECONCILER_OUT", "PNE_OUT");
Messenger messenger = new Messenger("localhost", "/", 5672,"guest", "guest", "RECONCILER_OUT", "PNE_OUT");
String jsonString = "[\"id1\",\"id2\",\"id3\"]";
List<String> expectedIds = Arrays.asList("id1", "id2", "id3");

Expand All @@ -106,7 +106,7 @@ public void testParseIds_ValidJsonString() {

@Test
public void testParseIds_InvalidJsonString() {
Messenger messenger = new Messenger("localhost", 5672,"guest", "guest", "RECONCILER_OUT", "PNE_OUT");
Messenger messenger = new Messenger("localhost", "/", 5672,"guest", "guest", "RECONCILER_OUT", "PNE_OUT");
String jsonString = "invalidJsonString";

List<String> actualIds = messenger.parseIds(jsonString);
Expand Down Expand Up @@ -178,7 +178,7 @@ public void testSendPatchFinderFinishMessage() throws IOException, TimeoutExcept
@Test
public void testMain(){
//timeout after 15 seconds
Messenger messenger = new Messenger("localhost", 5672,"guest", "guest", "RECONCILER_OUT", "PNE_OUT");
Messenger messenger = new Messenger("localhost", "/", 5672,"guest", "guest", "RECONCILER_OUT", "PNE_OUT");

//create a thread to run the messenger
Thread thread = new Thread(new Runnable() {
Expand Down

0 comments on commit d685990

Please sign in to comment.