Re: Issue with Junit5 test framework. Any idea?

2021-04-04 Thread Emmanuel Lécharny
On 04/04/2021 23:17, Emmanuel Lécharny wrote: Hmmm, I think there must be a side effect. The following line : testClass.getField( "service" )... can't return the reference of the service field, which is not present in the LdapConnectionTest class, but is present in the AbstractLdapTestUnit

Re: Issue with Junit5 test framework. Any idea?

2021-04-04 Thread Emmanuel Lécharny
I would add that in my case, when the beforeAll callback is called, we don't have yet an instance of the test class, which leads to a NPE later when we try to set the field's value - which is expected -. FTR here is the extension I'm using: /* * Licensed to the Apache Software Foundation (ASF

Re: Issue with Junit5 test framework. Any idea?

2021-04-04 Thread Emmanuel Lécharny
Hmmm, I think there must be a side effect. The following line : testClass.getField( "service" )... can't return the reference of the service field, which is not present in the LdapConnectionTest class, but is present in the AbstractLdapTestUnit parent class. And getField() does not return fie

Re: Issue with Junit5 test framework. Any idea?

2021-04-04 Thread Stefan Seelmann
Here is a quick and dirty demo which "works on my machine" ;) https://github.com/apache/directory-server/commit/d10cf254dca9317b54dd39489ed249098a984436 On 4/4/21 6:56 PM, Emmanuel Lécharny wrote: > Sadly, that does not work :/ > > The test class is not yet existing when we call testClass.getFie

Re: Issue with Junit5 test framework. Any idea?

2021-04-04 Thread Emmanuel Lécharny
Sadly, that does not work :/ The test class is not yet existing when we call testClass.getField( "service" ).set( null, new DefaultDirectoryService() ) so I get a NPE on the set. There seems to be a internal Junit5 mechanism that allow you to get the field to set but you can't inject some va

Re: Issue with Junit5 test framework. Any idea?

2021-04-04 Thread Emmanuel Lécharny
Ah, cool, have'nt thought about this solution. Will try that ! Thanks Stefan! On 04/04/2021 14:00, Stefan Seelmann wrote: Actually with the BeforeAllCallback we can get the test class from the ExtensionContext and set the static fields via reflection: public class BeforeAllInjector implements

Re: Issue with Junit5 test framework. Any idea?

2021-04-04 Thread Stefan Seelmann
Actually with the BeforeAllCallback we can get the test class from the ExtensionContext and set the static fields via reflection: public class BeforeAllInjector implements BeforeAllCallback { @Override public void beforeAll( ExtensionContext context ) throws Exception { Class t

Re: Issue with Junit5 test framework. Any idea?

2021-04-04 Thread Stefan Seelmann
Instead of BeforeAll it seems we can use TestInstancePostProcessor which postProcessTestInstance() method signature includes the test instance: public class BeforeAllInjector implements TestInstancePostProcessor { @Override public void postProcessTestInstance( Object testInstance, Extensio

Issue with Junit5 test framework. Any idea?

2021-04-04 Thread Emmanuel Lécharny
Hi ! I'm fighting with a piece of our test framework that worked well with Junit4, not so much with Junit5. In Junit4, we were using Rule and ClassRule to declare some DirectoryService used in tests (typically, if we want to test some features, we start with a DS creation that will be visibl

[jira] [Resolved] (DIRAPI-368) StackOverflowError when working with entries with thousands of attributes or values

2021-04-04 Thread Stefan Seelmann (Jira)
[ https://issues.apache.org/jira/browse/DIRAPI-368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stefan Seelmann resolved DIRAPI-368. Resolution: Fixed > StackOverflowError when working with entries with thousands of attribut

[jira] [Commented] (DIRAPI-368) StackOverflowError when working with entries with thousands of attributes or values

2021-04-04 Thread Stefan Seelmann (Jira)
[ https://issues.apache.org/jira/browse/DIRAPI-368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17314439#comment-17314439 ] Stefan Seelmann commented on DIRAPI-368: We can decide to remove the reverse orde

[GitHub] [directory-ldap-api] elecharny commented on pull request #16: DIRAPI-368, DIRSERVER-2340: Fix StackOverflowError

2021-04-04 Thread GitBox
elecharny commented on pull request #16: URL: https://github.com/apache/directory-ldap-api/pull/16#issuecomment-812993575 This is all good to me. I have added some comment in DIRAPI-368, just for the record. Many thanks Stefan. And I think we should cut an API release next wee

[GitHub] [directory-ldap-api] elecharny merged pull request #16: DIRAPI-368, DIRSERVER-2340: Fix StackOverflowError

2021-04-04 Thread GitBox
elecharny merged pull request #16: URL: https://github.com/apache/directory-ldap-api/pull/16 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this servic

[jira] [Commented] (DIRAPI-368) StackOverflowError when working with entries with thousands of attributes or values

2021-04-04 Thread Jira
[ https://issues.apache.org/jira/browse/DIRAPI-368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17314436#comment-17314436 ] Emmanuel Lécharny commented on DIRAPI-368: -- Actually, I don't know why we try to

[jira] [Commented] (DIRSTUDIO-1270) cannot paste new connection in connection pannel anymore

2021-04-04 Thread Jira
[ https://issues.apache.org/jira/browse/DIRSTUDIO-1270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17314434#comment-17314434 ] Schplurtz le Déboulonné commented on DIRSTUDIO-1270: Hi. Sorry fo

[jira] [Commented] (DIRAPI-202) Can't get LdapConnectionTemplate working

2021-04-04 Thread Stefan Seelmann (Jira)
[ https://issues.apache.org/jira/browse/DIRAPI-202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17314433#comment-17314433 ] Stefan Seelmann commented on DIRAPI-202: [~Chris Harris] It's a while since the l