Hi all,

I'm trying to build WicketStuff 8.0.6 from source and during running
tests I get the following exception:

> -------------------------------------------------------------------------------
> Test set: org.wicketstuff.rest.injection.InjectResourceTest
> -------------------------------------------------------------------------------
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.414 s <<< 
> FAILURE! - in org.wicketstuff.rest.injection.InjectResourceTest
> testInjection(org.wicketstuff.rest.injection.InjectResourceTest)  Time 
> elapsed: 1.357 s  <<< ERROR!
> java.lang.NullPointerException
>         at 
> org.wicketstuff.rest.injection.InjectResourceTest.testInjection(InjectResourceTest.java:59)

The code at that line:

> ResourceReferenceRegistry registry = 
> Application.get().getResourceReferenceRegistry();
> ResourceReference resourceReference = 
> registry.getResourceReference(Application.class, "MountedResource", null, 
> null, null, false, false);
> MountedResource resource = (MountedResource) resourceReference.getResource();

There's no additional logging or message which might help me
understand the purpose of this test and what might be missing why. The
test has been introduced pretty recently before the release of that
version:

https://github.com/wicketstuff/core/commit/12fcca8cd8d214008e4c164cfae76df2c88f9faa

What makes me wonder is using alternatives in providing the resources:

> //apply injection if we are in a container
>                 if (Injector.get() != null) {
>                     Injector.get().inject(resourceInstance);
>         }

https://github.com/wicketstuff/core/commit/12fcca8cd8d214008e4c164cfae76df2c88f9faa#diff-1eb6b497214e19671d478080efcee7bdR96

I would have expected that to be reflected somehow in the test or by
test execution as well, but in the end I'm only guessing about the
purpose etc. of this test anyway.

I'm using Java 8 on Windows 10 1903:

> openjdk version "1.8.0_222"
> OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_222-b10)
> OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.222-b10, mixed mode)

Any idea on how to resolve the problem? Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

Attachment: TEST-org.wicketstuff.rest.injection.InjectResourceTest.xml
Description: XML document

-------------------------------------------------------------------------------
Test set: org.wicketstuff.rest.injection.InjectResourceTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.414 s <<< 
FAILURE! - in org.wicketstuff.rest.injection.InjectResourceTest
testInjection(org.wicketstuff.rest.injection.InjectResourceTest)  Time elapsed: 
1.357 s  <<< ERROR!
java.lang.NullPointerException
        at 
org.wicketstuff.rest.injection.InjectResourceTest.testInjection(InjectResourceTest.java:59)

Reply via email to