Skip to content

Commit 4fa9555

Browse files
committed
Update README and POM for plugin name change; add model selection feature in UI and service
1 parent 0f462d7 commit 4fa9555

5 files changed

Lines changed: 84 additions & 11 deletions

File tree

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Apache JMeter Copilot Chat Plugin
22

3-
[![Build](https://github.com/brunoborges/jmeter-copilot-chat/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/brunoborges/jmeter-copilot-chat/actions/workflows/build.yml)
3+
[![Build](https://github.com/brunoborges/jmeter-copilot-extension/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/brunoborges/jmeter-copilot-extension/actions/workflows/build.yml)
44
[![Java 17+](https://img.shields.io/badge/Java-17%2B-blue?logo=openjdk&logoColor=white)](https://openjdk.org/)
55
[![Apache JMeter](https://img.shields.io/badge/JMeter-5.6.3%2B-green?logo=apache&logoColor=white)](https://jmeter.apache.org/)
6-
[![License: MIT](https://img.shields.io/github/license/brunoborges/jmeter-copilot)](https://github.com/brunoborges/jmeter-copilot/blob/main/LICENSE)
6+
[![License: MIT](https://img.shields.io/github/license/brunoborges/jmeter-copilot-extension)](https://github.com/brunoborges/jmeter-copilot-extension/blob/main/LICENSE)
77

88
An Apache JMeter plugin that provides a GitHub Copilot Chat experience for generating JMeter test plans through natural language conversation.
99

@@ -32,36 +32,36 @@ Download the latest release and install it to your JMeter installation with a si
3232
Using `JMETER_HOME` environment variable:
3333

3434
```bash
35-
curl -sL $(curl -s https://api.github.com/repos/brunoborges/jmeter-copilot/releases/latest | grep "browser_download_url.*jar" | cut -d '"' -f 4) -o $JMETER_HOME/lib/ext/jmeter-copilot-plugin.jar
35+
curl -sL $(curl -s https://api.github.com/repos/brunoborges/jmeter-copilot-extension/releases/latest | grep "browser_download_url.*jar" | cut -d '"' -f 4) -o $JMETER_HOME/lib/ext/jmeter-copilot-plugin.jar
3636
```
3737

3838
Or specify the JMeter path directly:
3939

4040
```bash
41-
curl -sL $(curl -s https://api.github.com/repos/brunoborges/jmeter-copilot/releases/latest | grep "browser_download_url.*jar" | cut -d '"' -f 4) -o /path/to/jmeter/lib/ext/jmeter-copilot-plugin.jar
41+
curl -sL $(curl -s https://api.github.com/repos/brunoborges/jmeter-copilot-extension/releases/latest | grep "browser_download_url.*jar" | cut -d '"' -f 4) -o /path/to/jmeter/lib/ext/jmeter-copilot-plugin.jar
4242
```
4343

4444
#### Windows (PowerShell)
4545

4646
Using `JMETER_HOME` environment variable:
4747

4848
```powershell
49-
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/brunoborges/jmeter-copilot/releases/latest"
49+
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/brunoborges/jmeter-copilot-extension/releases/latest"
5050
$jarUrl = ($release.assets | Where-Object { $_.name -like "*.jar" }).browser_download_url
5151
Invoke-WebRequest -Uri $jarUrl -OutFile "$env:JMETER_HOME\lib\ext\jmeter-copilot-plugin.jar"
5252
```
5353

5454
Or specify the JMeter path directly:
5555

5656
```powershell
57-
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/brunoborges/jmeter-copilot/releases/latest"
57+
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/brunoborges/jmeter-copilot-extension/releases/latest"
5858
$jarUrl = ($release.assets | Where-Object { $_.name -like "*.jar" }).browser_download_url
5959
Invoke-WebRequest -Uri $jarUrl -OutFile "C:\path\to\jmeter\lib\ext\jmeter-copilot-plugin.jar"
6060
```
6161

6262
### Manual Installation
6363

64-
1. Download the latest JAR from [GitHub Releases](https://github.com/brunoborges/jmeter-copilot/releases/latest)
64+
1. Download the latest JAR from [GitHub Releases](https://github.com/brunoborges/jmeter-copilot-extension/releases/latest)
6565
2. Copy the JAR file to your JMeter `lib/ext` directory
6666
3. Restart JMeter
6767

@@ -118,7 +118,7 @@ mvn install -Pinstall-to-jmeter -Djmeter.home=/path/to/jmeter
118118

119119
The plugin supports multiple AI models through the Copilot SDK:
120120

121-
- `claude-sonnet-4.5` (default)
121+
- `claude-sonnet-4` (default)
122122
- `gpt-4.1`
123123
- `claude-4-opus`
124124
- `gpt-4.1-mini`

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
<description>JMeter plugin that integrates GitHub Copilot Chat for generating test plans</description>
1414

1515
<scm>
16-
<connection>scm:git:https://github.com/brunoborges/jmeter-copilot.git</connection>
17-
<developerConnection>scm:git:https://github.com/brunoborges/jmeter-copilot.git</developerConnection>
18-
<url>https://github.com/brunoborges/jmeter-copilot</url>
16+
<connection>scm:git:https://github.com/brunoborges/jmeter-copilot-extension.git</connection>
17+
<developerConnection>scm:git:https://github.com/brunoborges/jmeter-copilot-extension.git</developerConnection>
18+
<url>https://github.com/brunoborges/jmeter-copilot-extension</url>
1919
<tag>HEAD</tag>
2020
</scm>
2121

src/main/java/org/apache/jmeter/copilot/CopilotChatPanel.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import javax.swing.AbstractAction;
3535
import javax.swing.BorderFactory;
3636
import javax.swing.JButton;
37+
import javax.swing.JComboBox;
3738
import javax.swing.JEditorPane;
3839
import javax.swing.JLabel;
3940
import javax.swing.JMenuItem;
@@ -79,6 +80,7 @@ public class CopilotChatPanel extends JPanel {
7980
private JButton showXmlButton;
8081
private JLabel statusLabel;
8182
private JScrollPane messagesScrollPane;
83+
private JComboBox<String> modelSelector;
8284

8385
// State
8486
private final AtomicBoolean isProcessing = new AtomicBoolean(false);
@@ -142,6 +144,23 @@ private JPanel createHeaderPanel() {
142144
titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD, 16f));
143145
panel.add(titleLabel, BorderLayout.WEST);
144146

147+
// Center panel with model selector
148+
JPanel centerPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0));
149+
JLabel modelLabel = new JLabel("Model:");
150+
centerPanel.add(modelLabel);
151+
152+
modelSelector = new JComboBox<>(CopilotChatService.AVAILABLE_MODELS);
153+
modelSelector.setSelectedItem(chatService.getModel());
154+
modelSelector.setToolTipText("Select AI model");
155+
modelSelector.addActionListener(e -> {
156+
String selectedModel = (String) modelSelector.getSelectedItem();
157+
if (selectedModel != null) {
158+
chatService.setModel(selectedModel);
159+
}
160+
});
161+
centerPanel.add(modelSelector);
162+
panel.add(centerPanel, BorderLayout.CENTER);
163+
145164
// Status and buttons
146165
JPanel rightPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 0));
147166

src/main/java/org/apache/jmeter/copilot/CopilotChatService.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@ JMeter test plans by generating valid JMeter XML (.jmx) format.
8181
private Consumer<String> streamingHandler;
8282
private Consumer<ChatMessage> messageHandler;
8383
private Closeable eventSubscription;
84+
private String model = "claude-sonnet-4"; // Default model
85+
86+
/**
87+
* Available AI models for the Copilot service.
88+
*/
89+
public static final String[] AVAILABLE_MODELS = {
90+
"claude-sonnet-4",
91+
"gpt-4.1",
92+
"claude-4-opus",
93+
"gpt-4.1-mini"
94+
};
8495

8596
/**
8697
* Creates a new CopilotChatService with the default CopilotClient.
@@ -116,13 +127,33 @@ public CompletableFuture<Void> connect() {
116127
private CompletableFuture<CopilotSession> createSession() {
117128
SessionConfig config = new SessionConfig()
118129
.setStreaming(true)
130+
.setModel(model)
119131
.setSystemMessage(new com.github.copilot.sdk.json.SystemMessageConfig()
120132
.setMode(com.github.copilot.sdk.SystemMessageMode.APPEND)
121133
.setContent(JMETER_SYSTEM_PROMPT));
122134

123135
return client.createSession(config);
124136
}
125137

138+
/**
139+
* Sets the AI model to use for the session.
140+
* Must be called before connect() to take effect.
141+
*
142+
* @param model The model name (e.g., "claude-sonnet-4", "gpt-4.1")
143+
*/
144+
public void setModel(String model) {
145+
this.model = model;
146+
}
147+
148+
/**
149+
* Returns the currently configured AI model.
150+
*
151+
* @return The model name
152+
*/
153+
public String getModel() {
154+
return model;
155+
}
156+
126157
private void subscribeToEvents() {
127158
if (session != null) {
128159
eventSubscription = session.on(this::handleEvent);

src/test/java/org/apache/jmeter/copilot/CopilotChatServiceTest.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,27 @@ void shouldReturnConversationHistory() {
210210
assertThat(history).isNotNull();
211211
assertThat(history.size()).isZero();
212212
}
213+
214+
@Test
215+
@DisplayName("should have default model set")
216+
void shouldHaveDefaultModelSet() {
217+
assertThat(service.getModel()).isEqualTo("claude-sonnet-4");
218+
}
219+
220+
@Test
221+
@DisplayName("should allow setting custom model")
222+
void shouldAllowSettingCustomModel() {
223+
service.setModel("gpt-4.1");
224+
225+
assertThat(service.getModel()).isEqualTo("gpt-4.1");
226+
}
227+
228+
@Test
229+
@DisplayName("should provide list of available models")
230+
void shouldProvideListOfAvailableModels() {
231+
assertThat(CopilotChatService.AVAILABLE_MODELS)
232+
.isNotNull()
233+
.isNotEmpty()
234+
.contains("claude-sonnet-4", "gpt-4.1", "claude-4-opus", "gpt-4.1-mini");
235+
}
213236
}

0 commit comments

Comments
 (0)