You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2021/01/18 21:10:23 UTC
[directory-studio] branch master updated: DIRSTUDIO-1216: allows
relaxed OID syntax with underscore, e.g. for Oracle or DirX
This is an automated email from the ASF dual-hosted git repository.
seelmann pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-studio.git
The following commit(s) were added to refs/heads/master by this push:
new 62f9ea6 DIRSTUDIO-1216: allows relaxed OID syntax with underscore, e.g. for Oracle or DirX
62f9ea6 is described below
commit 62f9ea605190185d84b5e64de96d577d58250dcd
Author: Stefan Seelmann <ma...@stefan-seelmann.de>
AuthorDate: Mon Jan 18 22:10:09 2021 +0100
DIRSTUDIO-1216: allows relaxed OID syntax with underscore, e.g. for Oracle or DirX
---
.../directory/studio/valueeditors/oid/InPlaceOidValueEditor.java | 4 +++-
.../directory/studio/test/integration/ui/ValueEditorTest.java | 6 ++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/oid/InPlaceOidValueEditor.java b/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/oid/InPlaceOidValueEditor.java
index 733127b..0a15acd 100644
--- a/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/oid/InPlaceOidValueEditor.java
+++ b/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/oid/InPlaceOidValueEditor.java
@@ -64,7 +64,9 @@ public class InPlaceOidValueEditor extends AbstractInPlaceStringValueEditor
{
Object rawValue = super.getRawValue( value );
- if ( rawValue instanceof String && OidSyntaxChecker.INSTANCE.isValidSyntax( rawValue ) )
+ // DIRSTUDIO-1216: allows relaxed OID syntax with underscore, e.g. for Oracle or DirX
+ if ( rawValue instanceof String
+ && OidSyntaxChecker.INSTANCE.isValidSyntax( ( ( String ) rawValue ).replace( "_", "-" ) ) )
{
return rawValue;
}
diff --git a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ValueEditorTest.java b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ValueEditorTest.java
index 7aa245f..0896131 100644
--- a/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ValueEditorTest.java
+++ b/tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ValueEditorTest.java
@@ -176,6 +176,12 @@ public class ValueEditorTest
.expectedRawValue( DESCR_OID ).expectedDisplayValue( DESCR_OID ).expectedHasValue( true )
.expectedStringOrBinaryValue( DESCR_OID ) },
+ { "InPlaceOidValueEditor - relaxed descr OID",
+ Data.data().valueEditorClass( InPlaceOidValueEditor.class ).attribute( CN )
+ .rawValue( "orclDBEnterpriseRole_82" ).expectedRawValue( "orclDBEnterpriseRole_82" )
+ .expectedDisplayValue( "orclDBEnterpriseRole_82" ).expectedHasValue( true )
+ .expectedStringOrBinaryValue("orclDBEnterpriseRole_82" ) },
+
{ "InPlaceOidValueEditor - INVALID",
Data.data().valueEditorClass( InPlaceOidValueEditor.class ).attribute( CN ).rawValue( "in valid" )
.expectedRawValue( null ).expectedDisplayValue( IValueEditor.NULL ).expectedHasValue( true )