Hi Emmanuel,

I don’t want this discussion to get in the way of the vote so I’ve renamed it.

There’s a bit more. Now, we must use junit5. Doesn’t seem like too big of a 
deal as it’s backward compatible and in the test scope.

There are two tests that utilize the apacheDS test runner. They both are 
failing after the upgrade. Since I have not been running these not sure if it’s 
a new problem.

I’ll do some investigation and report back here.

Thanks

—
Shawn

> On Oct 16, 2023, at 10:48 PM, Emmanuel Lécharny <[email protected]> wrote:
> 
> Hi Shawn,
> 
> regarding the FrameworkRunner class, it has been removed from ApacheDS code 
> base when we migrated from Junit4 to Junit 5.
> 
> I do think that you need to replace calls to FrameworkRunner by:
> 
> @ExtendWith( ApacheDSTestExtension.class )
> 
> it should do the trick.
> 
> 
> For instance, the AddIT test class for core-integ was:
> 
> /**
> * Test the add operation
> *
> * @author <a href="mailto:[email protected]";>Apache Directory 
> Project</a>
> */
> @RunWith(FrameworkRunner.class)
> @CreateDS(
>    name = "AddITDS",
>        loadedSchemas =
>        { @LoadSchema(name = "nis", enabled = true) },
>    partitions =
>        {
>            @CreatePartition(
>                name = "example",
>                suffix = "dc=example,dc=com",
>                contextEntry = @ContextEntry(
>                    entryLdif =
>                    "dn: dc=example,dc=com\n" +
>                        "dc: example\n" +
>                        "objectClass: top\n" +
>                        "objectClass: domain\n\n"),
>                indexes =
>                    {
>                        @CreateIndex(attribute = "objectClass"),
>                        @CreateIndex(attribute = "sn"),
>                        @CreateIndex(attribute = "cn")
>                })
> 
>    },
>    enableChangeLog = false)
> public class AddIT extends AbstractLdapTestUnit
> {
>   /**
>     * Test an add operation with a value that needs to be normalized
>     */
>    @Test
>    public void testAddNotNormalized() throws Exception
>    {
>        LdapConnection connection = IntegrationUtils.getAdminConnection( 
> getService() );
> 
>        Dn dn = new Dn( "cn=test,ou=system" );
>        Entry entry = new DefaultEntry( dn,
>            "ObjectClass: top",
>            "ObjectClass: person",
>            "sn:  TEST    ",
>            "cn: test" );
> 
>        connection.add( entry );
> 
>        entry = connection.lookup( entry.getDn(), 
> SchemaConstants.ALL_ATTRIBUTES_ARRAY );
>        Entry contextEntry = connection.lookup( "ou=system", 
> SchemaConstants.ALL_ATTRIBUTES_ARRAY );
> 
>        String expectedCsn = entry.get( SchemaConstants.ENTRY_CSN_AT 
> ).getString();
>        String contextCsn = contextEntry.get( SchemaConstants.CONTEXT_CSN_AT 
> ).getString();
>        assertEquals( expectedCsn, contextCsn );
>    }
> 
> 
> 
> ...
> }
> 
> 
> and now is:
> 
> **
> * Test the add operation
> *
> * @author <a href="mailto:[email protected]";>Apache Directory 
> Project</a>
> */
> @ExtendWith( { ApacheDSTestExtension.class } )
> @CreateDS(
>    name = "AddITDS",
>        loadedSchemas =
>        { @LoadSchema(name = "nis", enabled = true) },
>    partitions =
>        {
>            @CreatePartition(
>                name = "example",
>                suffix = "dc=example,dc=com",
>                contextEntry = @ContextEntry(
>                    entryLdif =
>                    "dn: dc=example,dc=com\n" +
>                        "dc: example\n" +
>                        "objectClass: top\n" +
>                        "objectClass: domain\n\n"),
>                indexes =
>                    {
>                        @CreateIndex(attribute = "objectClass"),
>                        @CreateIndex(attribute = "sn"),
>                        @CreateIndex(attribute = "cn")
>                })
> 
>    },
>    enableChangeLog = false)
> public class AddIT extends AbstractLdapTestUnit
> {
>    /**
>     * Test an add operation with a value that needs to be normalized
>     */
>    @Test
>    public void testAddNotNormalized() throws Exception
>    {
>        LdapConnection connection = IntegrationUtils.getAdminConnection( 
> getService() );
> 
>        Dn dn = new Dn( "cn=test,ou=system" );
>        Entry entry = new DefaultEntry( dn,
>            "ObjectClass: top",
>            "ObjectClass: person",
>            "sn:  TEST    ",
>            "cn: test" );
> 
>        connection.add( entry );
> 
>        entry = connection.lookup( entry.getDn(), 
> SchemaConstants.ALL_ATTRIBUTES_ARRAY );
>        Entry contextEntry = connection.lookup( "ou=system", 
> SchemaConstants.ALL_ATTRIBUTES_ARRAY );
> 
>        String expectedCsn = entry.get( SchemaConstants.ENTRY_CSN_AT 
> ).getString();
>        String contextCsn = contextEntry.get( SchemaConstants.CONTEXT_CSN_AT 
> ).getString();
>        assertEquals( expectedCsn, contextCsn );
>    }
> 
> 
> That should not be such a big change.
> 
> 
> On 16/10/2023 19:31, Shawn McKinney wrote:
>>> On Oct 16, 2023, at 9:12 AM, Emmanuel Lécharny <[email protected]> wrote:
>>> 
>>> Hi Colm,
>>> 
>>> just pushed the packages to dist!
>> Hi Emmanuel.
>> I’m still testing. I can build and run tests on Java 17. Can install the 
>> server using the snapshots. Have run fortress core integration tests and 
>> they all pass.
>> To use the latest AM27 in fortress core had to remove these dependencies:
>> apacheds-interceptor-kerberos
>> apacheds-kerberos-codec
>> apacheds-protocol-kerberos
>> From test scope in pom. No problem, Kerb is not supported in the server as 
>> indicated by the issue list.
>> Not sure why it was in fortress core. There are no compile time dependencies 
>> on these packages. Extraneous?
>> In any case, not a server issue.
>> But, there’s also this when I compile fortress core using AM27:
>> ```
>> [ERROR]
>> /opt/fortress/directory-fortress-core/src/test/java/org/apache/directory/fortress/core/impl/apacheds/FortressJUnitApachedsTest.java:[29,46]
>>  cannot find symbol
>>   symbol:   class FrameworkRunner
>>   location: package
>> org.apache.directory.server.core.integ
>> ```
>> Did this package move? We do have a compile dependency in test scope for:
>> org.apache.directory.server.core.integ.FrameworkRunner;
>> Probably not a showstopper for release. Something needs to be worked out in 
>> Fortress going forward.
>> Thanks
>> —
>> Shawn
> 
> -- 
> *Emmanuel Lécharny* P. +33 (0)6 08 33 32 61
> [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to