Comments (4)
I have a similar problem with cdi-unit 4.1.0. I have tracked down the problem to the following:
In org.jglue.cdiunit.internal.WeldTestUrlDeployment#cdiClasspathEntries I end up having one entry for the test-classes folder of the current module, namely "file:/C:/Work/.../target/test-classes/" (please notice the upper-case "C" for the drive letter). In org.jglue.cdiunit.internal.WeldTestUrlDeployment:145 the current test class (in your case BookTest) is tested whether it is a CDI class using the org.jglue.cdiunit.internal.WeldTestUrlDeployment#isCdiClass method. Unfortunately in that method at line org.jglue.cdiunit.internal.WeldTestUrlDeployment:461 the returned URL location for the current test class is "file:/c:/Work/.../target/test-classes/". Please notice now the lower-case "c" for the drive letter. Due to this difference, the current test-class is considered as NOT being a CDI class, and is therefore not processed, meaning that the class itself and also nothing from its AdditionalClasses or AdditionalPackages is being added to the CDI bean deployment archive.
@BrynCooke Why is the current test class not directly being considered as a CDI class and processed accordingly? Wouldn't that solve a lot of such issues?
Somewhat related... @BrynCooke Why is the org.jglue.cdiunit.internal.TestConfiguration#additionalClasses always empty? shouldn't it be prefilled with the contents from the AdditionalClasses annotation on the test class?
from cdi-unit.
Same problem here. Tracked it down to surefire maven plugin's handling of class path to test class:
If test class resides on same path as windows temp directory, surefire adresses it with a relative class path (e.g. :/C:/Users/ME/AppData/Local/Temp/surefire849027778679875674/..%5C..%5C..%5C..%5C..%5C..%5Cprojekte%5Ccore-mbus%5Ccore-mbus-impl%5Ctarget%5Ctest-classes/)
Doesn't happen on other drives.
surefire maven plugin also has this covered: use 3.0.0-M2 or following.
from cdi-unit.
Hi,
The symptoms described here are very similar to the symptoms at #151.
The code which you are referencing was recently refactored and is not comparing the URL anymore.
See
Could you please check with cdi-unit built from the master branch?
from cdi-unit.
I am experiencing the exact same error with similar source code but in a Wildfly 26 environment. Not junit test case.
Should this be a different root cause then?
from cdi-unit.
Related Issues (20)
- Cannot inject ContextController HOT 3
- Discover implementation of fields with interface type
- Error message for public rule field should be more helpful
- InRequestScope mentions nonexistent DummyHttpServletRequest
- Move to new group ID: io.github.cdi-unit HOT 1
- Investigate the capabilities of Travis CI to automate the release HOT 1
- Recent builds are failing on TravisCI
- cdi-unit fails to build with JDK 14 HOT 1
- Maven is complaining about malformed projects
- Repository gardening
- Unable to run cdiunit on Zulu JDK 11 HOT 4
- CdiRunner does not unbind the BeanManager in finally HOT 1
- Migrate from TravisCI to GitHub Actions
- Setup release workflow with GitHub Actions HOT 10
- NoClassDefFoundError with JDK 11 HOT 4
- Version for Jakarta EE HOT 29
- Case sensitivity in URL comparison HOT 3
- Question: PowerMock Support?
- Release HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cdi-unit.