Giter Club home page Giter Club logo

Comments (4)

mirkoseifert avatar mirkoseifert commented on August 11, 2024

As I understand there are two issues.

First, the @Category(Runtime.class) annotation does not prevent JUnit from creating an instance of your test class. This is due to the fact that we use a test runner which is bundled with JUnit (org.junit.experimental.categories.Categories). This runner or JUnit itself is causing the call to the constructor. I think you can move the code from the contructor to a setup method to avoid this issue. The alternative would be to use a custom test runner, but that may cause trouble in other scenarios.

Second, tests which are not longer contained in a source folder are still executed. Since JUnitLoop listens to compilation events to determine where to find test classes, classes which are not compiled are not added to the test suite that is executed by JUnitLoop. However, since your class was compiled before it is possible that JUnitLoop does not recognize that the class is not part of a source folder anymore. This is a bug, which needs to be fixed. In the meantime you may delete the project 'JUnitLoop' from your workspace. It will automatically be regenerated by JUnitLoop and not contain the test class anymore.

from junitloop.

willhains avatar willhains commented on August 11, 2024

Ah, I see! Very interesting. I will try deleting the JUnitLoop project and report back here.

With regards to the first issue (constructor calls despite @Category(Runtime.class)), unfortunately I can't modify the constructor code as it comes from a framework. (It's Play Framework's FunctionalTest if you're interested.) Anyway, I guess there's nothing you can do about this in JUnitLoop -- probably should be raised as a bug on JUnit itself though...

from junitloop.

willhains avatar willhains commented on August 11, 2024

Yes, deleting the JUnitLoop project after removing those folders from the build path seems to work around the second issue. Thanks!

from junitloop.

mirkoseifert avatar mirkoseifert commented on August 11, 2024

I agree regarding the issue with the constructor call.

from junitloop.

Related Issues (17)

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.