GZoltar / gzoltar

GZoltar - Java Library for Automatic Debugging http://www.gzoltar.com
Other
77 stars 34 forks source link

Using Gzoltar API #23

Closed PhamAn12 closed 1 year ago

PhamAn12 commented 4 years ago

Hi there, Thanks for your awesome tool and open source! I wanna use some Gzoltar API in my project. My goal is to get all of the line executed the code with an input test case. I used addClassToInstrument(), addTestToExecute(), run() method. Path to class folder is "D:\docu\thsi\projrepare\v1\target\classes". My JUnit test function is MidFunctionTest.java that writes the JUnit to execute MidFunction. The class that I want to instrument line is MyFunction The Something like that :

String classPath = "D:\\docu\\thsi\\projrepare\\v1\\target\\classes";
GZoltar gz = new GZoltar(classPath);
gz.addClassToInstrument("junit.util.MidFunction");
gz.addTestToExecute("junit.util.MidFunctionTest");
gz.run();
List<TestResult> testResults = gz.getTestResults();
for (TestResult tc : testResults) {
      System.out.println(tc.wasSuccessful());
}
System.out.println(gz.getSuspiciousStatements().size());

and that's my hierarchy of my test project s In the snipping code above I get the result 0. Why is that? And how can I get all the lines that execute MidFunction.java with input is the JUnit test in MidFunctest? Any suggestions for me? One more thing I can't access http://gzoltar.com/ or http://gzoltar.org/. Is any site instead?

jose commented 4 years ago

Hi @PhamAn12,

In the snipping code above I get the result 0. Why is that? And how can I get all the lines that execute MidFunction.java with input is the JUnit test in MidFunctest? Any suggestions for me?

First, what version of GZoltar are you using?

One more thing I can't access http://gzoltar.com/ or http://gzoltar.org/. Is any site instead?

Thanks for reporting this. @ruimaranhao, could you please redirect http://gzoltar.com, http://gzoltar.org, http://www.gzoltar.com, and http://www.gzoltar.org to https://gzoltar.github.io?

ruimaranhao commented 4 years ago

Thanks, @PhamAn12 for warning us about the website. It is now up and running.

jose commented 1 year ago

@PhamAn12 I'm closing this issues for now, please re-open it if GZoltar doesn't work as expected on your end.