Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ratignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ extras/Test.jtl
lib/aareadme.txt
lib/opt/README.txt
src/licenses/licenses/*/CC0-1.0.txt
src/licenses/licenses/autocomplete/LICENSE.md
#local/**
#reports/**
src/launcher/src/main/resources/org/apache/jmeter/jmeter_as_ascii_art.txt
Expand Down
1 change: 1 addition & 0 deletions src/bom-thirdparty/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies {
api("bsf:bsf:2.4.0")
api("cglib:cglib-nodep:3.3.0")
api("com.fifesoft:rsyntaxtextarea:4.0.1")
api("com.fifesoft:autocomplete:4.0.0")
api("com.github.ben-manes.caffeine:caffeine:3.3.0")
api("com.github.weisj:darklaf-core:3.1.1")
api("com.github.weisj:darklaf-extensions-rsyntaxarea:0.4.1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@

package org.apache.jmeter.assertions;

import org.apache.jmeter.gui.util.JSR223Completion;
import org.apache.jmeter.util.JSR223BeanInfoSupport;

public class JSR223AssertionBeanInfo extends JSR223BeanInfoSupport {

public JSR223AssertionBeanInfo() {
super(JSR223Assertion.class);
super(JSR223Assertion.class, JSR223Completion.Binding.SAMPLE_RESULT, JSR223Completion.Binding.ASSERTION_RESULT);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@

package org.apache.jmeter.visualizers;

import org.apache.jmeter.gui.util.JSR223Completion;
import org.apache.jmeter.util.JSR223BeanInfoSupport;

public class JSR223ListenerBeanInfo extends JSR223BeanInfoSupport {

public JSR223ListenerBeanInfo() {
super(JSR223Listener.class);
super(JSR223Listener.class, JSR223Completion.Binding.SAMPLE_EVENT, JSR223Completion.Binding.LISTENER_SAMPLE_RESULT);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.jmeter.assertions;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assumptions.assumeFalse;

import java.awt.GraphicsEnvironment;

import org.apache.jmeter.test.gui.JSR223GuiCompletionTestSupport;
import org.apache.jmeter.visualizers.JSR223Listener;
import org.junit.jupiter.api.Test;

class JSR223ComponentGuiCompletionTest {

@Test
void completesAssertionBindingThroughTheDisplayedTestBeanEditor() throws Exception {
assumeFalse(GraphicsEnvironment.isHeadless());
JSR223Assertion assertion = new JSR223Assertion();
String script = "AssertionResult.setFailureMe";

JSR223GuiCompletionTestSupport.Result result = JSR223GuiCompletionTestSupport.invoke(
JSR223Assertion.class, assertion, script, script.length(), "AssertionResult.setFailureMessage");

assertTrue(result.completionActionInstalled());
assertTrue(result.completionAccepted());
assertEquals("AssertionResult.setFailureMessage(message)", result.text());
}

@Test
void completesListenerBindingThroughTheDisplayedTestBeanEditor() throws Exception {
assumeFalse(GraphicsEnvironment.isHeadless());
JSR223Listener listener = new JSR223Listener();
String script = "sampleEvent.getThreadG";

JSR223GuiCompletionTestSupport.Result result = JSR223GuiCompletionTestSupport.invoke(
JSR223Listener.class, listener, script, script.length(), "sampleEvent.getThreadGroup");

assertTrue(result.completionActionInstalled());
assertTrue(result.completionAccepted());
assertEquals("sampleEvent.getThreadGroup()", result.text());
}
}
3 changes: 3 additions & 0 deletions src/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ dependencies {
api("com.fifesoft:rsyntaxtextarea") {
because("JSyntaxTextArea extends RSyntaxTextArea")
}
api("com.fifesoft:autocomplete") {
because("JSR223 script editors provide code completion")
}
api("net.sf.jtidy:jtidy") {
because("public static Tidy XPathUtil#makeTidyParser()")
}
Expand Down
Loading
Loading