From 0e02964d4df506f9337c34f743e3d6c685633aa6 Mon Sep 17 00:00:00 2001
From: ugaston <ugaston@localhost>
Date: Mon, 11 Aug 2008 15:56:31 +0000
Subject: [PATCH] Replication Conflict Test Suite
---
opends/tests/shared/java/ldap/modifyAnAttribute.java | 26 ++++++++++++++++++++------
1 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/opends/tests/shared/java/ldap/modifyAnAttribute.java b/opends/tests/shared/java/ldap/modifyAnAttribute.java
index 1fdda1a..df4f050 100644
--- a/opends/tests/shared/java/ldap/modifyAnAttribute.java
+++ b/opends/tests/shared/java/ldap/modifyAnAttribute.java
@@ -108,7 +108,12 @@
ind1= val1.indexOf(":");
attributeName=val1.substring(0,ind1);
- attributeValue=val1.substring(ind1+1);
+ if (ind1+1 < val1.length()) {
+ // assume empty strings == no specific value
+ attributeValue=val1.substring(ind1+1);
+ } else {
+ attributeValue = null;
+ }
BasicAttribute attrToComplete = null;
@@ -124,20 +129,29 @@
attrToComplete = new BasicAttribute(attributeName);
attributeSet.add(attrToComplete);
}
- attributeValue=attributeValue.replaceAll("QUOT","\\\"");
- attrToComplete.add(attributeValue);
+ if (attributeValue != null) {
+ // as opposed to (attributeValue == null), for example in some
+ // attribute delete operations
+ attributeValue=attributeValue.replaceAll("QUOT","\\\"");
+ attrToComplete.add(attributeValue);
+ }
}
k++;
}
- if ( attributeToModify != null && newAttributeValue != null ) {
+ if ( attributeToModify != null &&
+ ( newAttributeValue != null || changetype.equals("delete") ) ) {
BasicAttribute attrToComplete = null;
attrToComplete = new BasicAttribute(attributeToModify);
attributeSet.add(attrToComplete);
- newAttributeValue=newAttributeValue.replaceAll("QUOT","\\\"");
- attrToComplete.add(newAttributeValue);
+ if (newAttributeValue != null) {
+ // as opposed to (attributeValue == null), for example in some
+ // attribute delete operations
+ newAttributeValue=newAttributeValue.replaceAll("QUOT","\\\"");
+ attrToComplete.add(newAttributeValue);
+ }
}
Iterator it2 = attributeSet.iterator();
--
Gitblit v1.10.0