Skip to content

added fix for null pointer to parent file #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public static void genTestCase(String name) {
exportSerializable();
try {
hasLoggedError = true;
File logFile = new File((nameOverride == null ? name : nameOverride));
//File logFile = new File((nameOverride == null ? name : nameOverride));
File logFile = new File(System.getProperty("user.dir") + File.separator + (nameOverride == null ? name : nameOverride));
if(!logFile.getParentFile().exists())
logFile.getParentFile().mkdirs();
if(logFile.exists())
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ To run the instrumenter, use the command `java -jar chroniclerj.jar -instrument

It is important that *all* libraries that you plan to deploy with your application are instrumented. We suggest running the instrumenter at the top level folder that you were going to deploy, which might contain several jar files, several class files, etc.

The instrumenter can also be run dynamically at run time with a java agent. This will instrument dynamically generated code that may not be caught with pre instrumentation
This can be done by setting the `JAVA_TOOL_OPTIONS` to something like `-javaagent:/path/to/Chronicler.jar'
If you would like to export a test case even without a crash occurring you would need to set the javaagent as follows: `-javaagent:/path/to/Chronicler.jar=alwaysExport`

### Collecting test cases
Deploy your code as you normally would, but deploy the code that was instrumented and placed in `outputLocationDeploy` rather than your original, uninstrumented code. Make sure that the **ChroniclerJ** jar is in your classpath too.
To include the Chronicler.jar on your classpath when dynamically instrumenting your code be sure to include the `-Xbootclasspath/p:/home/ant/git/ant-muplay/chroniclerj/Code/ChroniclerJ/target/ChroniclerJ-0.43-SNAPSHOT.jar` in the `JAVA_TOOL_OPTIONS` as well as the javaagent flag.

When an uncaught exception ocurrs, **ChroniclerJ** generates a test case. You can manually invoke this process (e.g. from your own exception handler) by calling the method `ChroniclerJExceptionRunner.genTestCase()`. Users are notified that a test case was generated, which is placed in the current working directory and has the name format chroniclerj-crash-*currenttime*.test. The test case file contains all logs necessary to replay the execution.

Expand All @@ -35,6 +40,8 @@ To replay the failed executions, run the command `java -jar chroniclerj.jar -rep
* `testCase` is the test case to run
* `{classpath}` is a space-delimited classpath passed to your program when it starts to replay

To dynamically instrument the code to replay use the `JAVA_TOOL_OPTIONS` flag again, but instead configure it to replay `JAVA_TOOL_OPTIONS=/path/to/chronicler.jar=replay,logFile={logFile.test classpath}

License
------
This software is released under the MIT license.
Expand Down