-
Notifications
You must be signed in to change notification settings - Fork 160
Description
In the docker example there is a standard java project which didn't help me follow the example.
Can you please provide a simple java class to follow?
For example, assume we have the following Triangle class in Triangle/src/main/java/org/triangleValidator folder.
How can I use docker to fuzz this class for 2 minutes and start with sample inputs in /corpus/corpusinput.txt and place produced results in /corpus folder?
package org.triangleValidator;
import java.util.Scanner;
public class Triangle
{
public static boolean isValidTriangle(int side1, int side2, int side3) {
// Check if the sum of any two sides is greater than the third side
return (side1 + side2 > side3) && (side1 + side3 > side2) && (side2 + side3 > side1);
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Enter the lengths of 3 sides:");
int side1 = scanner.nextInt();
int side2 = scanner.nextInt();
int side3 = scanner.nextInt();
if (isValidTriangle(side1, side2, side3)) {
System.out.println("Valid triangle!");
} else {
System.out.println("Not a valid triangle!");
}
}
}
Thank you