Skip to content

Commit

Permalink
1. 优化代码结构
Browse files Browse the repository at this point in the history
2. 增加配置元件 thubbo#43
3. 升级dubbo2.7.3,支持dubbo2.7.x及以下版本
4. 优化性能报告,只统计接口执行耗时 thubbo#81thubbo#76
5. 优化查看结果树 thubbo#78
5.1. 响应数据的字符编码:UTF-8
5.2. 响应数据json格式化
5.3. 响应数据时间格式化
  • Loading branch information
ningyu1 committed Aug 16, 2019
1 parent f5dd835 commit 976387e
Show file tree
Hide file tree
Showing 11 changed files with 1,037 additions and 729 deletions.
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<version>${revision}</version>

<properties>
<revision>2.7.1</revision>
<revision>2.7.3</revision>
<java.version>1.8</java.version>
<java.source.version>1.8</java.source.version>
<java.target.version>1.8</java.target.version>
Expand All @@ -32,6 +32,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<dubbo.version>${revision}</dubbo.version>
<!--<dubbo.version>2.7.2</dubbo.version>-->
<jorphan.version>3.0</jorphan.version>
<avalon.framework.version>4.1.4</avalon.framework.version>
<jmeter.core.version>3.0</jmeter.core.version>
Expand Down

Large diffs are not rendered by default.

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();
}

}
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();
}
}
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();
}
}

0 comments on commit 976387e

Please sign in to comment.