forked from thubbo/jmeter-plugins-for-apache-dubbo
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2. 增加配置元件 thubbo#43 3. 升级dubbo2.7.3,支持dubbo2.7.x及以下版本 4. 优化性能报告,只统计接口执行耗时 thubbo#81,thubbo#76 5. 优化查看结果树 thubbo#78 5.1. 响应数据的字符编码:UTF-8 5.2. 响应数据json格式化 5.3. 响应数据时间格式化
- Loading branch information
Showing
11 changed files
with
1,037 additions
and
729 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
461 changes: 461 additions & 0 deletions
461
src/main/java/io/github/ningyu/jmeter/plugin/dubbo/gui/DubboCommonPanel.java
Large diffs are not rendered by default.
Oops, something went wrong.
105 changes: 105 additions & 0 deletions
105
src/main/java/io/github/ningyu/jmeter/plugin/dubbo/gui/DubboDefaultConfigGui.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
* 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 io.github.ningyu.jmeter.plugin.dubbo.gui; | ||
|
||
import io.github.ningyu.jmeter.plugin.util.Constants; | ||
import org.apache.jmeter.config.ConfigTestElement; | ||
import org.apache.jmeter.config.gui.AbstractConfigGui; | ||
import org.apache.jmeter.gui.util.VerticalPanel; | ||
import org.apache.jmeter.testelement.TestElement; | ||
import org.apache.jorphan.logging.LoggingManager; | ||
import org.apache.log.Logger; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
|
||
/** | ||
* DubboDefaultConfigGui </br> | ||
* invoke sequence**clearGui()->createTestElement()->modifyTestElement()->configure()** | ||
*/ | ||
public class DubboDefaultConfigGui extends AbstractConfigGui { | ||
|
||
private static final Logger log = LoggingManager.getLoggerForClass(); | ||
private static final long serialVersionUID = -4454521491983368380L; | ||
private final DubboDefaultPanel panel; | ||
|
||
public DubboDefaultConfigGui() { | ||
super(); | ||
panel = new DubboDefaultPanel(); | ||
init(); | ||
} | ||
|
||
private void init() { | ||
//所有设置panel,垂直布局 | ||
JPanel settingPanel = new VerticalPanel(5, 0); | ||
settingPanel.setBorder(makeBorder()); | ||
Container container = makeTitlePanel(); | ||
settingPanel.add(container); | ||
//所有设置panel | ||
panel.drawPanel(settingPanel); | ||
//全局布局设置 | ||
setLayout(new BorderLayout(0, 5)); | ||
setBorder(makeBorder()); | ||
add(settingPanel,BorderLayout.CENTER); | ||
} | ||
|
||
@Override | ||
public String getLabelResource() { | ||
return this.getClass().getSimpleName(); | ||
} | ||
|
||
@Override | ||
public void configure(TestElement element) { | ||
super.configure(element); | ||
log.debug("sample赋值给config gui"); | ||
panel.configure(element); | ||
panel.bundleElement(element); | ||
Constants.redundancy(element); | ||
} | ||
|
||
@Override | ||
public TestElement createTestElement() { | ||
log.debug("创建sample对象"); | ||
//创建sample对象 | ||
ConfigTestElement config = new ConfigTestElement(); | ||
modifyTestElement(config); | ||
return config; | ||
} | ||
|
||
@Override | ||
public void modifyTestElement(TestElement element) { | ||
log.debug("gui数据赋值给sample"); | ||
//给sample赋值 | ||
super.configureTestElement(element); | ||
panel.modifyTestElement(element); | ||
panel.bundleElement(element); | ||
Constants.redundancy(element); | ||
} | ||
|
||
@Override | ||
public String getStaticLabel() { | ||
return "Dubbo Defaults"; | ||
} | ||
|
||
@Override | ||
public void clearGui() { | ||
log.debug("清空gui数据"); | ||
super.clearGui(); | ||
panel.clearGui(); | ||
} | ||
|
||
} |
51 changes: 51 additions & 0 deletions
51
src/main/java/io/github/ningyu/jmeter/plugin/dubbo/gui/DubboDefaultPanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* 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 io.github.ningyu.jmeter.plugin.dubbo.gui; | ||
|
||
import org.apache.jmeter.testelement.TestElement; | ||
|
||
import javax.swing.*; | ||
|
||
/** | ||
* DubboDefaultPanel | ||
*/ | ||
public class DubboDefaultPanel extends DubboCommonPanel { | ||
|
||
public void drawPanel(JPanel parent) { | ||
parent.add(drawRegistrySettingsPanel()); | ||
parent.add(drawProtocolSettingsPanel()); | ||
parent.add(drawConsumerSettingsPanel()); | ||
} | ||
|
||
public void configure(TestElement element) { | ||
configureRegistry(element); | ||
configureProtocol(element); | ||
configureConsumer(element); | ||
} | ||
|
||
public void modifyTestElement(TestElement element) { | ||
modifyRegistry(element); | ||
modifyProtocol(element); | ||
modifyConsumer(element); | ||
} | ||
|
||
public void clearGui() { | ||
clearRegistry(); | ||
clearProtocol(); | ||
clearConsumer(); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
src/main/java/io/github/ningyu/jmeter/plugin/dubbo/gui/DubboPanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* 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 io.github.ningyu.jmeter.plugin.dubbo.gui; | ||
|
||
import org.apache.jmeter.testelement.TestElement; | ||
|
||
import javax.swing.*; | ||
|
||
/** | ||
* DubboDefaultPanel | ||
*/ | ||
public class DubboPanel extends DubboDefaultPanel { | ||
|
||
@Override | ||
public void drawPanel(JPanel parent) { | ||
super.drawPanel(parent); | ||
parent.add(drawInterfaceSettingsPanel()); | ||
} | ||
|
||
@Override | ||
public void configure(TestElement element) { | ||
super.configure(element); | ||
configureInterface(element); | ||
} | ||
|
||
@Override | ||
public void modifyTestElement(TestElement element) { | ||
super.modifyTestElement(element); | ||
modifyInterface(element); | ||
} | ||
|
||
@Override | ||
public void clearGui() { | ||
super.clearGui(); | ||
clearInterface(); | ||
} | ||
} |
Oops, something went wrong.