Name:
PID: (page 1)
$ java Grade "https://github.com/ucsd-cse15l-f22/list-methods-lab3"
Cloning into 'student-submission'...
Finished cloning
error: no source files
....
1) initializationError(org.junit.runner.JUnitCommandLineParseResult)
java.lang.IllegalArgumentException: Could not find class [TestListExamples]
...
What is the symptom? What is the failure-inducing input? What is the bug?
Most importantly, what can we do to gather more information to help us understand the issue? What information can we not see, and how can we make it visible to us?
exec(new String[]{"ls", "*.java"}) vs. exec(new String[]{"bash", "-c", "ls *.java"})
Discuss: Now that we have exec(), do we need bash anymore? Can we just write everything in Java?
Name:
PID: (page 2)
class Handler implements URLHandler {
public String handleRequest(URI url) throws IOException {
if (url.getPath().equals("/grade")) {
String[] parameters = url.getQuery().split("=");
if (parameters[0].equals("repo")) {
String[] cmd = {"bash", "grade.sh", parameters[1]};
String result = ExecHelpers.exec(cmd);
return result;
...
CPATH='.:lib/hamcrest-core-1.3.jar:lib/junit-4.13.2.jar'
rm -rf student-submission
git clone $1 student-submission
echo 'Finished cloning'
cp student-submission/ListExamples.java ./
javac -cp $CPATH *.java
java -cp $CPATH org.junit.runner.JUnitCore TestListExamples
is handled by...
which starts this script...
which clones, compiles, and runs tests, and stores output in the result
which returns the
output shown in the
browser
static String exec(String[] cmd) … {
...
InputStream outputOfBash = p.getInputStream();
return String.format("%s\n", streamToString(outputOfBash));
...
How many total processes do you count as being involved in handling this request?
What is parameters[1] for this request?
grade.sh
GradeServer.java
What methods were waiting for return values on the Java stack while the bash script was running?
GradeServer.java