Author: sebb
Date: Sun Mar 11 12:24:01 2007
New Revision: 516995
URL: http://svn.apache.org/viewvc?view=rev&rev=516995
Log:
Fix tag nesting (hopefully)
Modified:
jakarta/jmeter/branches/rel-2-2/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java
Modified:
jakarta/jmeter/branches/rel-2-2/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java?view=diff&rev=516995&r1=516994&r2=516995
==============================================================================
---
jakarta/jmeter/branches/rel-2-2/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java
(original)
+++
jakarta/jmeter/branches/rel-2-2/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java
Sun Mar 11 12:24:01 2007
@@ -130,11 +130,6 @@
public final static String NEWDN = "newdn"; // $NON-NLS-1$
- // For In build test case using this counter
- // create the new entry in the server
- // private static int counter=0;
-
- // TODO replace these with ThreadLocal
private static Hashtable ldapConnections = new Hashtable();
private static Hashtable ldapContexts = new Hashtable();
@@ -781,21 +776,30 @@
res.sampleEnd();
if (isParseFlag()) {
- xmlBuffer.openTag("searchresult");
- while (srch.hasMore()) {
- SearchResult sr =
(SearchResult) srch.next();
- xmlBuffer.tag("dn",sr.getName()
+ "," +searchBase + "," + getRootdn());
-
xmlBuffer.tag("returnedattr",String.valueOf(sr.getAttributes().size()));
- NamingEnumeration attrlist =
sr.getAttributes().getIDs();
- while (attrlist.hasMore()) {
- String iets = (String)
attrlist.next();
-
xmlBuffer.openTag("attribute");
- xmlBuffer.tag("attributename", iets);
-
xmlBuffer.tag("attributevalue",
-
sr.getAttributes().get(iets).toString().substring(iets.length() + 2));
-
xmlBuffer.closeTag("attribute");
+ try {
+
xmlBuffer.openTag("searchresults");
+ while (srch.hasMore()) {
+ try {
+
xmlBuffer.openTag("searchresult");
+ SearchResult sr
= (SearchResult) srch.next();
+
xmlBuffer.tag("dn",sr.getName() + "," +searchBase + "," + getRootdn());
+
xmlBuffer.tag("returnedattr",String.valueOf(sr.getAttributes().size()));
+
NamingEnumeration attrlist = sr.getAttributes().getIDs();
+ while
(attrlist.hasMore()) {
+ String
iets = (String) attrlist.next();
+
xmlBuffer.openTag("attribute");
+
xmlBuffer.tag("attributename", iets);
+
xmlBuffer.tag("attributevalue",
+
sr.getAttributes().get(iets).toString().substring(iets.length() + 2));
+
xmlBuffer.closeTag("attribute");
+ }
+ } finally {
+
xmlBuffer.closeTag("searchresult");
+ }
}
- }
+ } finally {
+
xmlBuffer.closeTag("searchresults");
+ }
}
}
@@ -813,6 +817,7 @@
}
isSuccessful = false;
} finally {
+ xmlBuffer.closeTag("operation");
xmlBuffer.tag("responsecode",res.getResponseCode());
xmlBuffer.tag("responsemessage",res.getResponseMessage());
res.setResponseData(xmlBuffer.toString().getBytes());
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]