Comments (7)
Yep, can confirm, with 0.8.2 everything works fine, thanks a lot.
from archunit.
I've just tried running a JUnit test under Windows 10 with Eclipse Oxygen and I haven't run into that problem.
Are you using ArchUnit 0.8.1 ? I think 0.8.0 had a problem like this if you'd use Windows and Java >= 9.
If you're using 0.8.1 I have to look into it closer, why the error doesn't appear on my Windows box with Eclipse (any information about your setup would be helpful then, for example how System.getProperty("java.class.path")
looks like)
from archunit.
I'm using
- Eclipse Neon
- ArchUnit 0.8.1
- Windows 10
- JDK 8
path looks like this:
C:\projects\workspaces\playfield\dummy\target\test-classes;C:\projects\workspaces\playfield\dummy\target\classes;C:\projects\m2\repository\com\tngtech\archunit\archunit\0.8.1\archunit-0.8.1.jar;C:\projects\m2\repository\org\slf4j\slf4j-api\1.7.7\slf4j-api-1.7.7.jar;C:\projects\m2\repository\junit\junit\4.12\junit-4.12.jar;C:\projects\m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;/C:/Software/eclipse/eclipse-neon-developer/eclipse/configuration/org.eclipse.osgi/432/0/.cp/;/C:/Software/eclipse/eclipse-neon-developer/eclipse/configuration/org.eclipse.osgi/431/0/.cp/
from archunit.
Ah, I see. So from my point of view, this looks like a bug in Eclipse, i.e. Eclipse creates a wrong "java.class.path" system property. I've cross checked
https://docs.oracle.com/javase/8/docs/technotes/tools/windows/classpath.html
where it pretty clearly states, that the classpath should be of the form "C:\foo;C:\bar" and not sth. like "/C:/" so I think Eclipse is at fault here. I've also found another issue with that respect 😉
The combination of some entries of the form "C:..." and some entries of the form "/C:/..." seems strange anyway, I would guess it's some erroneous conversion of URL to path.
Originally I was wondering, if I should add more robustness against wrong classpath entries, or not, and decided against it, since I thought clients should just supply valid classpath properties (which so far seemed to work out within IntelliJ, Maven and Gradle). But I see that this is kind of hard to achieve when running tests within Eclipse, since (as far as I know) control over this part of the supplied classpath is limited.
I'll make this more robust and add error logging instead, if an invalid file path is encountered within the classpath property.
from archunit.
I've looked closer into this, and I could reproduce this issue with Eclipse Neon. It seems to be gone with Eclipse Oxygen, though.
It seems like the JRE itself is resilient enough to parse these types of entries (the respective URLClassLoader
knows these URLs), so I've added a fallback to parse entries of the form "/C:/foo/bar" as well as "C:\foo\bar" (I've also labeled it as a bug now, instead of an enhancement, since the JRE can handle it 😉)
I'll release a new bugfix version soon.
from archunit.
Great thx a lot
from archunit.
It's on Maven Central now: https://search.maven.org/#search%7Cga%7C1%7Carchunit
I'm pretty positive that it solves the problem, since I've tried Eclipse Neon, too, and the problem disappeared with the upgrade, but I'd be happy about a short "works on my machine" from you 😉
from archunit.
Related Issues (20)
- Recommended test for @Transactional does not work in combination with generic interface/super class
- Exception in thread "main" java.lang.IllegalStateException: Never found a JavaCodeUnit that matches supposed origin CodeUnit HOT 5
- Add support to analyse list of classes HOT 1
- Add entry point `onlyClasses` and similar
- Add predicate to find overridden methods
- Enforce ArchTests when module is depended upon HOT 1
- Compatibility issue with logback-classic 1.4.12 HOT 2
- ClassFileImporter fails to load classes with synthetic methods HOT 2
- The tests are running too late HOT 2
- [BUG] Calling getEnclosingClass() on a nested class does provide a JavaClass with no members HOT 2
- fails with Spring Boot Nested Jars HOT 11
- getCallsOfSelf does not return calls made through interface reference HOT 4
- Add method support for function callMethod HOT 2
- Get modifiers of JavaParameter HOT 1
- Layer dependency rule ignores "catch" blocks
- Enum classes not recognized as enums and with with wrong access modifiers HOT 3
- Wrong line numbers and constructor call order
- JavaType#getAllInvolvedRawTypes() throws StackOverflowError with self-referential generic types HOT 2
- @AnalyzeClasses breaks JUnit 5 tag filtering HOT 3
- Is there a way to know if JavaCodeUnit is a switch/case statement? HOT 4
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 archunit.