alexruiz / fest-reflect Goto Github PK
View Code? Open in Web Editor NEWFEST Fluent Reflection
Home Page: http://fest.easytesting.org
License: Apache License 2.0
FEST Fluent Reflection
Home Page: http://fest.easytesting.org
License: Apache License 2.0
It looks like http://fest.easytesting.org is now a website with Chinese recipes? ๐
Hi!
I saw in the commit history that there are lot of great changes since the 1.4.1 version. Are you guys plan to release the 2.0 version? This project seems to be a little bit abandoned. :(
For the time being we access nested fields like this :
field("session").ofType(Session.class)
.withinField("clientStatusDao").withinField("notificationService")
.in(businessService)
.set(sessionMock);
And I think it would be lighter/more elegant to be allowed to write :
field("notificationService.clientStatusDao.session").ofType(Session.class)
.in(businessService)
.set(sessionMock);
I've been replacing calls to the java.util.reflect package with equivalent code from fest-reflect, and I had an issue with type("...").load(), which throws a ClassNotFoundException when Class.forName("...") did not.
I thought that type("...").load() was strictly equivalent to Class.forName("..."), minus the checked exceptions. In fact, it is not : Class.forName() uses ClassLoader.getCallerClassLoader to determine the class loader to use, while fest-reflect's Type.load() uses the classloader used to load itself.
In complex cases (maven + ant in my case), fest-reflect's jar is not loaded in the same class loader as the application classes, which causes the problem (and can be fixed with .withClassLoader(getClass().getClassLoader()) in the calling class).
A solution would be to use sun.reflect.Reflection.getCallerClass() to determine the right classloader, but it would add a dependency to a sun package (bad bad bad).
When JEP 176 is available, it should be possible to use this new mechanism to implement a reliable detection of the caller class loader.
In the meantime, the documentation should explicitly mention this classloading issue, as it can be tricky to debug.
Hello
The command: mvn clean install
on the latest branch master does not build
C:\Users\fandre\Documents\git\javacc\fest-reflect>C:\ASF\apache-maven-3.6.1\bin\mvn clean install -U
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< org.easytesting:fest-reflect >--------------------
[INFO] Building FEST-Reflect 2.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from mis-snapshots: http://private.neticoa.fr:50003/repository/mis-snapshots/org/easytesting/fest-util/1.3.0-SNAPSHOT/maven-metadata.xml
Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/org/easytesting/fest-util/1.3.0-SNAPSHOT/maven-metadata.xml
Downloading from mis-snapshots: http://private.neticoa.fr:50003/repository/mis-snapshots/org/easytesting/fest-util/1.3.0-SNAPSHOT/fest-util-1.3.0-SNAPSHOT.pom
Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/org/easytesting/fest-util/1.3.0-SNAPSHOT/fest-util-1.3.0-SNAPSHOT.pom
[WARNING] The POM for org.easytesting:fest-util:jar:1.3.0-SNAPSHOT is missing, no dependency information available
Downloading from releases: http://private.neticoa.fr:50003/repository/public/org/easytesting/fest-test/2.1.2/fest-test-2.1.2.pom
Downloading from mis-releases: http://private.neticoa.fr:50003/repository/mis-releases/org/easytesting/fest-test/2.1.2/fest-test-2.1.2.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/easytesting/fest-test/2.1.2/fest-test-2.1.2.pom
[WARNING] The POM for org.easytesting:fest-test:jar:2.1.2 is missing, no dependency information available
Downloading from mis-snapshots: http://private.neticoa.fr:50003/repository/mis-snapshots/org/easytesting/fest-util/1.3.0-SNAPSHOT/fest-util-1.3.0-SNAPSHOT.jar
Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/org/easytesting/fest-util/1.3.0-SNAPSHOT/fest-util-1.3.0-SNAPSHOT.jar
Downloading from releases: http://private.neticoa.fr:50003/repository/public/org/easytesting/fest-test/2.1.2/fest-test-2.1.2.jar
Downloading from mis-releases: http://private.neticoa.fr:50003/repository/mis-releases/org/easytesting/fest-test/2.1.2/fest-test-2.1.2.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/easytesting/fest-test/2.1.2/fest-test-2.1.2.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.049 s
[INFO] Finished at: 2020-02-04T10:21:25+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project fest-reflect: Could not resolve dependencies for project org.easytesting:fest-reflect:jar:2.0-SNAPSHOT: The following artifacts could not be resolved: org.easytesting:fest-util:jar:1.3.0-SNAPSHOT, org.easytesting:fest-test:jar:2.1.2: Could not find artifact org.easytesting:fest-util:jar:1.3.0-SNAPSHOT in mis-snapshots (http://private.neticoa.fr:50003/repository/mis-snapshots/) -> [Help 1]
[ERROR]
Mapping list elements like so:
assertThat(collection).onProperty("id").containsExactly(...)
May result in an IllegalAccessException if the elements of the collection are package-local (or otherwise restricted). This can even be the case if the collection contains package-local implementations of a public interface, i.e. in situations where a programmatic invocation of the getter works.
Invoking method#setAccessible(true) prior to invocation of the property set/get methods would resolve such issues.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.