Giter Site home page Giter Site logo

micwypych / java-with-jpf-example Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 1.6 MB

Java Path Finder and Gradle configuration with simple dining philosopher problem

License: MIT License

Java 100.00%
deadlock-detection java jpf java-pathfinder race-detection race-condition-prevention unit-testing unit-test junit gradle dining-philosophers dining-philosophers-problem

java-with-jpf-example's Introduction

Build Status

java-with-jpf-example

Java Path Finder and Gradle configuration with dining philosopher problem and racer example.

Currently the code works only on Linux with JDK 8 because of the usage of JPF.

please visit WIKI page for instruction how to run the code or investigate travis.yml script in this repository.

After correct setup running ./gradlew test should result with running 4 test of which 1 test fails, cf. the following output:

:compileJava
:processResources NO-SOURCE
:classes
:compileTestJava
Download https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.pom
Download https://jcenter.bintray.com/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom
Download https://jcenter.bintray.com/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom
Download https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.jar
Download https://jcenter.bintray.com/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
:processTestResources NO-SOURCE
:testClasses
:test
RacerTest > testRacer FAILED
    java.lang.AssertionError at RacerTest.java:19
4 tests completed, 1 failed
:test FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///home/travis/build/micwypych/java-with-jpf-example/build/reports/tests/test/index.html
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 17.982 secs
The command "./gradlew test" exited with 1.

It is then recommended to investigate the generated JUnit report of index.html (link is given in the output) in the webbrowser. Especially, the section of Standard Output contains useful info generated by the JPF.

There are currently 4 test in the project:

  • AppTest.testAppHasGreeting - should always pass and if it fails something is wrong with gradle or java
  • RacerTest.testRacer - is failing becase JPF found racing condition, please try to fix it (standard output of the test should help)
  • DiningPhilosophersTest.catchDeadlock - is passing becase JPF is instructed to find deadlock in the system and it succeeds, please try to make this test fail
  • DiningPhilosophersTest.catchDeadlockInInfiniteCase - is passing becase JPF is instructed to find deadlock in the system and it succeeds, please try to make this test fail

If the JPF was not correctly set up prior to runnig the tests then 3 of 4 tests are failing and the standard output and standard error sections of the JUnit report gives you hint about missing java classes

By clicking on the badge at the beggining of this readme you can see the build logs from Travis. One can see the correct build under the Ubuntu only with openjdk8 and oraclejdk8 (then logs contain 4174 lines (not all the lines are immediately loaded by the webpage, so please wait). Versions of jdk above 8 fail to compile and fail to run examples from jpf-core.

java-with-jpf-example's People

Contributors

micwypych avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

mkuzmik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.