Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/apache/directory-studio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFredrik Roubert <fredrik@roubert.name>2022-06-01 09:28:10 +0300
committerGitHub <noreply@github.com>2022-06-01 09:28:10 +0300
commitc0a21aa5636b2788f657f7526129ad917a296577 (patch)
treea51a7c91494e14cb3efd17071668bdbd5c784ce4 /tests
parent3c6114e5bd4520ce4bed2fc956fe73de2fc20aff (diff)
DIRSTUDIO-1298: Fix the Postal Address value editor en-/decoding. (#33)
Diffstat (limited to 'tests')
-rw-r--r--tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/ValueEditorTest.java15
1 files changed, 15 insertions, 0 deletions
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 ac394d5dc..1c54d2f4c 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
@@ -42,6 +42,7 @@ import org.apache.directory.studio.valueeditors.HexValueEditor;
import org.apache.directory.studio.valueeditors.IValueEditor;
import org.apache.directory.studio.valueeditors.InPlaceTextValueEditor;
import org.apache.directory.studio.valueeditors.TextValueEditor;
+import org.apache.directory.studio.valueeditors.address.AddressValueEditor;
import org.apache.directory.studio.valueeditors.bool.InPlaceBooleanValueEditor;
import org.apache.directory.studio.valueeditors.oid.InPlaceOidValueEditor;
import org.junit.jupiter.params.ParameterizedTest;
@@ -58,6 +59,7 @@ public class ValueEditorTest extends AbstractTestBase
{
private static final String CN = "cn";
+ private static final String POSTAL = "postalAddress";
private static final String USER_PWD = "userPassword";
private static final String EMPTY_STRING = "";
@@ -76,6 +78,9 @@ public class ValueEditorTest extends AbstractTestBase
private static final String NUMERIC_OID = "1.3.6.1.4.1.1466.20037";
private static final String DESCR_OID = "a-zA-Z0-9";
+ private static final String ADDRESS_DISPLAY = "$1,000,000 Sweepstakes, PO Box 1000000, Anytown, CA 12345, USA";
+ private static final String ADDRESS_RAW = "\\241,000,000 Sweepstakes$PO Box 1000000$Anytown, CA 12345$USA";
+
public static Stream<Arguments> data()
{
return Stream.of( new Object[][]
@@ -329,6 +334,16 @@ public class ValueEditorTest extends AbstractTestBase
Data.data().valueEditorClass( HexValueEditor.class ).attribute( USER_PWD ).rawValue( PNG )
.expectedRawValue( PNG ).expectedDisplayValue( "Binary Data (4 Bytes)" )
.expectedHasValue( true ).expectedStringOrBinaryValue( PNG ) },
+
+ /*
+ * AddressValueEditor can handle a multi-line postal address with escaped characters.
+ */
+
+ {
+ "AddressValueEditor - RFC example",
+ Data.data().valueEditorClass( AddressValueEditor.class ).attribute( POSTAL ).rawValue( ADDRESS_RAW )
+ .expectedRawValue( ADDRESS_RAW ).expectedDisplayValue( ADDRESS_DISPLAY )
+ .expectedHasValue( true ).expectedStringOrBinaryValue( ADDRESS_RAW ) },
} ).map( d -> Arguments.arguments( ( String ) d[0], ( Data ) d[1] ) );
}