View | Details | Raw Unified | Return to bug 40381
Collapse All | Expand All

(-)src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java (-4 / +18 lines)
Lines 511-517 Link Here
511
			if ("add".equals(item.getOpcode())) { // $NON-NLS-1$
511
			if ("add".equals(item.getOpcode())) { // $NON-NLS-1$
512
				mods[count] = new ModificationItem(DirContext.ADD_ATTRIBUTE, attr);
512
				mods[count] = new ModificationItem(DirContext.ADD_ATTRIBUTE, attr);
513
			} else {
513
			} else {
514
				if ("delete".equals(item.getOpcode())) { // $NON-NLS-1$
514
				if ("delete".equals(item.getOpcode()) || "remove".equals(item.getOpcode())) { // $NON-NLS-1$
515
					mods[count] = new ModificationItem(DirContext.REMOVE_ATTRIBUTE, attr);
515
					mods[count] = new ModificationItem(DirContext.REMOVE_ATTRIBUTE, attr);
516
				} else {
516
				} else {
517
					mods[count] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, attr);
517
					mods[count] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, attr);
Lines 761-767 Link Here
761
				responseData = responseData + "<newdn>" + getPropertyAsString(NEWDN) + "</newdn></operation>";
761
				responseData = responseData + "<newdn>" + getPropertyAsString(NEWDN) + "</newdn></operation>";
762
				renameTest(temp_client, dirContext, res);
762
				renameTest(temp_client, dirContext, res);
763
			} else if (getPropertyAsString(TEST).equals(SEARCHBASE)) {
763
			} else if (getPropertyAsString(TEST).equals(SEARCHBASE)) {
764
				res.setSamplerData("Search with filter " + getPropertyAsString(SEARCHFILTER));
764
                final String            scopeStr = getPropertyAsString(SCOPE);
765
                final int               scope;
766
767
                res.setSamplerData("Search with filter " + getPropertyAsString(SEARCHFILTER));
765
				responseData = responseData + "<operation><opertype>search</opertype>";
768
				responseData = responseData + "<operation><opertype>search</opertype>";
766
				responseData = responseData + "<searchfilter>" + getPropertyAsString(SEARCHFILTER) + "</searchfilter>";
769
				responseData = responseData + "<searchfilter>" + getPropertyAsString(SEARCHFILTER) + "</searchfilter>";
767
				responseData = responseData + "<searchbase>" + getPropertyAsString(SEARCHBASE) + ","
770
				responseData = responseData + "<searchbase>" + getPropertyAsString(SEARCHBASE) + ","
Lines 771-778 Link Here
771
				responseData = responseData + "<timelimit>" + getPropertyAsString(TIMELIM) + "</timelimit>";
774
				responseData = responseData + "<timelimit>" + getPropertyAsString(TIMELIM) + "</timelimit>";
772
				responseData = responseData + "</operation><searchresult>";
775
				responseData = responseData + "</operation><searchresult>";
773
                res.sampleStart();
776
                res.sampleStart();
777
778
                if ("object".equals(scopeStr))
779
                    scope = SearchControls.OBJECT_SCOPE;
780
                else if ("onelevel".equals(scopeStr))
781
                    scope = SearchControls.ONELEVEL_SCOPE;
782
                else if ("subtree".equals(scopeStr))
783
                    scope = SearchControls.SUBTREE_SCOPE;
784
                else
785
                        // for backwards compatibility
786
                    scope = getPropertyAsInt(SCOPE);
787
774
                NamingEnumeration srch = temp_client.searchTest(dirContext, getPropertyAsString(SEARCHBASE), getPropertyAsString(SEARCHFILTER),
788
                NamingEnumeration srch = temp_client.searchTest(dirContext, getPropertyAsString(SEARCHBASE), getPropertyAsString(SEARCHFILTER),
775
                        getPropertyAsInt(SCOPE), getPropertyAsLong(COUNTLIM), getPropertyAsInt(TIMELIM),
789
                        scope, getPropertyAsLong(COUNTLIM), getPropertyAsInt(TIMELIM),
776
                        getRequestAttributes(getPropertyAsString(ATTRIBS)), getPropertyAsBoolean(RETOBJ),
790
                        getRequestAttributes(getPropertyAsString(ATTRIBS)), getPropertyAsBoolean(RETOBJ),
777
                        getPropertyAsBoolean(DEREF));
791
                        getPropertyAsBoolean(DEREF));
778
                res.sampleEnd();
792
                res.sampleEnd();
Lines 852-855 Link Here
852
	public void testIterationStart(LoopIterationEvent event) {
866
	public void testIterationStart(LoopIterationEvent event) {
853
		// ignored
867
		// ignored
854
	}
868
	}
855
}
869
}

Return to bug 40381