seelmann commented on code in PR #34:
URL: https://github.com/apache/directory-studio/pull/34#discussion_r895203617
##########
tests/test.integration.ui/src/main/java/org/apache/directory/studio/test/integration/ui/EntryEditorTest.java:
##########
@@ -567,6 +568,76 @@ public void testTextValueEditor( TestLdapServer server )
throws Exception
}
+ /**
+ * DIRSTUDIO-1298: The RFC 4517 Postal Address value editor en-/decoding
is incomplete
+ */
+ @ParameterizedTest
+ @LdapServersSource
+ public void testAddressValueEditor( TestLdapServer server ) throws
Exception
+ {
+ connectionsViewBot.createTestConnection( server );
+ browserViewBot.selectEntry( path( BJENSEN_DN ) );
+
+ EntryEditorBot entryEditorBot = studioBot.getEntryEditorBot(
BJENSEN_DN.getName() );
+ entryEditorBot.activate();
+ String dn = entryEditorBot.getDnText();
+ assertEquals( "DN: " + BJENSEN_DN.getName(), dn );
+ assertEquals( 8, entryEditorBot.getAttributeValues().size() );
+ assertEquals( "", modificationLogsViewBot.getModificationLogsText() );
+
+ // add postalAddress attribute and verify value is correctly encoded
+ entryEditorBot.activate();
+ NewAttributeWizardBot wizardBot =
entryEditorBot.openNewAttributeWizard();
+ assertTrue( wizardBot.isVisible() );
+ wizardBot.typeAttributeType( "postalAddress" );
+ AddressEditorDialogBot addressEditorDialogBot =
wizardBot.clickFinishButtonExpectingAddressEditor();
+ assertTrue( addressEditorDialogBot.isVisible() );
+ addressEditorDialogBot.setText( "1234 Main St.\nAnytown, CA
12345\nUSA" );
+ addressEditorDialogBot.clickOkButton();
+ assertEquals( 9, entryEditorBot.getAttributeValues().size() );
+ assertTrue(
+ entryEditorBot.getAttributeValues().contains( "postalAddress: 1234
Main St., Anytown, CA 12345, USA" ) );
+ modificationLogsViewBot.waitForText( "add:
postalAddress\npostalAddress: 1234 Main St.$Anytown, CA 12345$USA" );
+
+ // verify value is correctly decoded
+ addressEditorDialogBot =
entryEditorBot.editValueExpectingAddressEditor( "postalAddress",
+ "1234 Main St., Anytown, CA 12345, USA" );
+ assertTrue( addressEditorDialogBot.isVisible() );
+ assertEquals( "1234 Main St.\nAnytown, CA 12345\nUSA",
addressEditorDialogBot.getText() );
+ addressEditorDialogBot.clickCancelButton();
+
+ // edit value with a complex address and verify value is correctly
encoded
+ addressEditorDialogBot =
entryEditorBot.editValueExpectingAddressEditor( "postalAddress",
+ "1234 Main St., Anytown, CA 12345, USA" );
+ assertTrue( addressEditorDialogBot.isVisible() );
+ assertEquals( "1234 Main St.\nAnytown, CA 12345\nUSA",
addressEditorDialogBot.getText() );
+ // TODO: $1,000,000 Sweepstakes
+ addressEditorDialogBot.setText( "1,000,000 Sweepstakes\nPO Box
1000000\nAnytown, CA 12345\nUSA" );
Review Comment:
I followed the pattern from the other tests that test the value editor for
both cases, (1) create a new attribute and (2) edit the existing attribute
value. I tried to clarify that in the updated Javadoc:
https://github.com/apache/directory-studio/pull/38
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]