You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2023/03/28 23:11:41 UTC

[directory-ldap-api] branch master updated (8fb7a29b5 -> b92982e19)

This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/directory-ldap-api.git


    from 8fb7a29b5 o Fixed a wrongly created upName o Added a test
     new f094f29e4 o Fixed a wrongly created upName o Added a test
     new b92982e19 Merge branch 'master' of https://gitbox.apache.org/repos/asf/directory-ldap-api

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/directory/api/ldap/model/name/background.jpg | Bin 0 -> 82359 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 integ/src/test/resources/org/apache/directory/api/ldap/model/name/background.jpg


[directory-ldap-api] 02/02: Merge branch 'master' of https://gitbox.apache.org/repos/asf/directory-ldap-api

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-ldap-api.git

commit b92982e198c75126a1e22ffa0e6afbd74e470260
Merge: f094f29e4 8fb7a29b5
Author: emmanuel lecharny <el...@apache.org>
AuthorDate: Wed Mar 29 01:11:38 2023 +0200

    Merge branch 'master' of
    https://gitbox.apache.org/repos/asf/directory-ldap-api

 .../apache/directory/api/ldap/model/name/background.jpg | Bin 0 -> 82359 bytes
 .../org/apache/directory/api/ldap/model/name/Dn.java    |   2 +-
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --cc integ/src/test/resources/org/apache/directory/api/ldap/model/name/background.jpg
index 000000000,000000000..0de426cc5
new file mode 100644
Binary files differ


[directory-ldap-api] 01/02: o Fixed a wrongly created upName o Added a test

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-ldap-api.git

commit f094f29e4076d9a80097b94346444737f470e3fd
Author: emmanuel lecharny <el...@apache.org>
AuthorDate: Wed Mar 29 01:10:31 2023 +0200

    o Fixed a wrongly created upName
    o Added a test
---
 .../apache/directory/api/ldap/model/name/Dn.java   |  3 +-
 .../directory/api/ldap/model/name/DnTest.java      | 69 ++++++++++++++++++++++
 2 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Dn.java b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Dn.java
index 40685134a..ffbe894d4 100644
--- a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Dn.java
+++ b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Dn.java
@@ -1003,7 +1003,6 @@ public class Dn implements Iterable<Rdn>, Externalizable
 
         clonedDn.rdns.add( 0, new Rdn( schemaManager, newRdn ) );
         clonedDn.toUpName();
-        clonedDn.upName = newRdn.upName + ',' + upName;
 
         return clonedDn;
     }
@@ -1032,7 +1031,7 @@ public class Dn implements Iterable<Rdn>, Externalizable
             newDn.rdns.add( rdns.get( i ) );
         }
 
-        newDn.upName = removeUpName( rdns.get( 0 ).upName, LEFT );
+        newDn.toUpName();// = removeUpName( rdns.get( 0 ).upName, LEFT );
 
         return newDn;
     }
diff --git a/ldap/model/src/test/java/org/apache/directory/api/ldap/model/name/DnTest.java b/ldap/model/src/test/java/org/apache/directory/api/ldap/model/name/DnTest.java
new file mode 100644
index 000000000..e5bfdccb2
--- /dev/null
+++ b/ldap/model/src/test/java/org/apache/directory/api/ldap/model/name/DnTest.java
@@ -0,0 +1,69 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ * 
+ *    https://www.apache.org/licenses/LICENSE-2.0
+ * 
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ * 
+ */
+package org.apache.directory.api.ldap.model.name;
+
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Iterator;
+
+import org.apache.directory.api.ldap.model.exception.LdapException;
+import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException;
+import org.apache.directory.api.ldap.model.schema.SchemaManager;
+import org.apache.directory.api.util.Strings;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.parallel.Execution;
+import org.junit.jupiter.api.parallel.ExecutionMode;
+
+
+/**
+ * Test the class Dn
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+@Execution(ExecutionMode.CONCURRENT)
+public class DnTest
+{
+    /** A null schemaManager used in tests */
+    SchemaManager schemaManager = null;
+
+
+    @Test
+    public void testAddRdn() throws LdapInvalidDnException
+    {
+        Dn dn = new Dn( "B=b,A=a" );
+        Rdn rdn = new Rdn( "C=c" );
+        
+        dn = dn.add( rdn );
+        
+        assertEquals( "C=c,B=b,A=a", dn.getName() );
+        assertEquals( "c=c,b=b,a=a", dn.getNormName() );
+    }
+}