Skip to content
Closed
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
26 changes: 26 additions & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,38 @@
<module name="OuterTypeFilename"/>
<module name="UpperEll"/>

<!-- modifiers -->
<!--<module name="ModifierOrder"/>-->
<!--<module name="RedundantModifier"/>-->

<!-- code metrics -->
<!--<module name="BooleanExpressionComplexity"/>-->
<!--<module name="ClassFanOutComplexity"/>-->
<!--<module name="CyclomaticComplexity"/>-->
<!--<module name="NPathComplexity"/>-->

<!-- size -->
<module name="AnonInnerLength">
<property name="max" value="45"/>
</module>
<module name="LineLength">
<!-- TODO: reduce this to 120 -->
<property name="max" value="165"/>
</module>
<!--<module name="MethodCount"/>-->
<!--<module name="MethodLength"/>-->
<!--<module name="ParameterNumber"/>-->

<!-- whitespace -->
<module name="EmptyForInitializerPad"/>
<module name="EmptyForIteratorPad"/>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoLineWrap"/>
<!--<module name="NoWhitespaceAfter"/>-->
<!--<module name="NoWhitespaceBefore"/>-->
<module name="TypecastParenPad"/>

<!--
Allow comment to suppress checkstyle for a single line
e.g. // CHECKSTYLE IGNORE MagicNumber
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,11 @@ public void resolveReplacementSubTree(JMeterTreeNode context) {
traverse(context, nodePathList, 1);
}

if(hasReplacementOccured() && selectedNode == null) {
throw new JMeterStopTestException("ModuleController:"+getName()+" has no selected Controller (did you rename some element in the path to target controller?), test was shutdown as a consequence");
if (hasReplacementOccured() && selectedNode == null) {
throw new JMeterStopTestException(
"ModuleController:" + getName() + " has no selected Controller " +
"(did you rename some element in the path to target controller?), " +
"test was shutdown as a consequence");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ public ModuleControllerGui() {

// this custom TreeSelectionModel forbid the selection of some test elements (test plan, thread group, etc..)
TreeSelectionModel tsm = new DefaultTreeSelectionModel() {

private static final long serialVersionUID = 4062816201792954617L;

private boolean isSelectedPathAllowed(DefaultMutableTreeNode lastSelected) {
Expand All @@ -128,7 +127,6 @@ private boolean isSelectedPathAllowed(DefaultMutableTreeNode lastSelected) {
@Override
public void setSelectionPath(TreePath path) {
DefaultMutableTreeNode lastSelected = (DefaultMutableTreeNode) path.getLastPathComponent();

if (isSelectedPathAllowed(lastSelected)) {
super.setSelectionPath(path);
}
Expand All @@ -137,23 +135,23 @@ public void setSelectionPath(TreePath path) {
@Override
public void setSelectionPaths(TreePath[] pPaths) {
DefaultMutableTreeNode lastSelected = (DefaultMutableTreeNode) pPaths[pPaths.length-1].getLastPathComponent();
if(isSelectedPathAllowed(lastSelected)) {
if (isSelectedPathAllowed(lastSelected)) {
super.setSelectionPaths(pPaths);
}
}

@Override
public void addSelectionPath(TreePath path) {
DefaultMutableTreeNode lastSelected = (DefaultMutableTreeNode) path.getLastPathComponent();
if(isSelectedPathAllowed(lastSelected)) {
if (isSelectedPathAllowed(lastSelected)) {
super.addSelectionPath(path);
}
}

@Override
public void addSelectionPaths(TreePath[] paths) {
DefaultMutableTreeNode lastSelected = (DefaultMutableTreeNode) paths[paths.length-1].getLastPathComponent();
if(isSelectedPathAllowed(lastSelected)) {
if (isSelectedPathAllowed(lastSelected)) {
super.addSelectionPaths(paths);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ public void process() {

if (refNames.length != jsonPathExpressions.length ||
refNames.length != defaultValues.length) {
log.error("Number of JSON Path variables must match number of default values and json-path expressions, check you use separator ';' if you have many values"); // $NON-NLS-1$
log.error("Number of JSON Path variables must match number of default values " +
"and json-path expressions, check you use separator ';' if you have many values");
throw new IllegalArgumentException(JMeterUtils
.getResString("jsonpp_error_number_arguments_mismatch_error")); // $NON-NLS-1$
}
Expand Down
22 changes: 3 additions & 19 deletions src/components/org/apache/jmeter/visualizers/AxisGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import org.slf4j.LoggerFactory;

/**
*
* Axis graph is used by StatGraphVisualizer, which generates bar graphs
* from the statistical data.
*/
Expand All @@ -62,6 +61,7 @@ public class AxisGraph extends JPanel {

private static final String ELLIPSIS = "..."; //$NON-NLS-1$
private static final int ELLIPSIS_LEN = ELLIPSIS.length();
private static final Font FONT_DEFAULT = UIManager.getDefaults().getFont("TextField.font");

protected double[][] data = null;
protected String title;
Expand All @@ -72,34 +72,18 @@ public class AxisGraph extends JPanel {
protected String[] xAxisLabels;
protected int width;
protected int height;

protected String[] legendLabels = { JMeterUtils.getResString("aggregate_graph_legend") }; // $NON-NLS-1$

protected int maxYAxisScale;

protected Font titleFont;

protected Font legendFont;

private static final Font FONT_DEFAULT = UIManager.getDefaults().getFont("TextField.font");

protected Font valueFont = new Font("SansSerif", Font.PLAIN, (int) Math.round(FONT_DEFAULT.getSize() * 0.6));

protected Color[] color = { Color.YELLOW };

protected Color foreColor = Color.BLACK;

protected boolean outlinesBarFlag = false;

protected boolean showGrouping = true;

protected boolean valueOrientation = true;

protected int legendPlacement = LegendAreaProperties.BOTTOM;

/**
*
*/
public AxisGraph() {
super();
}
Expand Down Expand Up @@ -331,7 +315,7 @@ private double findMax(double[][] _data) {
return max;
}

private String squeeze (String input, int _maxLength){
private String squeeze(String input, int _maxLength){
if (input.length()>_maxLength){
return input.substring(0,_maxLength-ELLIPSIS_LEN)+ELLIPSIS;
}
Expand All @@ -344,7 +328,7 @@ private void drawSample(String _title, int _maxLength, String[] _xAxisLabels,
Font legendFont, Graphics g) {
double max = maxYAxisScale > 0 ? maxYAxisScale : findMax(_data); // define max scale y axis
try {
/** These controls are already done in StatGraphVisualizer
/* These controls are already done in StatGraphVisualizer
if (_width == 0) {
_width = 450;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,24 @@ public static String prettyJSON(String json) {
public static String prettyJSON(String json, String tabSeparator) {
StringBuilder pretty = new StringBuilder(json.length() * 2); // Educated guess

final String tab = tabSeparator; // $NON-NLS-1$
StringBuilder index = new StringBuilder();
String nl = ""; // $NON-NLS-1$

Matcher valueOrPair = VALUE_OR_PAIR_PATTERN.matcher(json);

boolean misparse = false;

for (int i = 0; i < json.length(); ) {
for (int i = 0; i < json.length();) {
final char currentChar = json.charAt(i);
if ((currentChar == '{') || (currentChar == '[')) {
pretty.append(nl).append(index).append(currentChar);
i++;
index.append(tab);
index.append(tabSeparator);
misparse = false;
}
else if ((currentChar == '}') || (currentChar == ']')) {
if (index.length() > 0) {
index.delete(0, tab.length());
index.delete(0, tabSeparator.length());
}
pretty.append(nl).append(index).append(currentChar);
i++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class RequestPanel {
*/
public RequestPanel() {
listRequestView = new LinkedList<>();
List<String> classesToAdd = Collections.<String> emptyList();
List<String> classesToAdd = Collections.emptyList();
try {
classesToAdd = JMeterUtils.findClassesThatExtend(RequestView.class);
} catch (IOException e1) {
Expand Down
Loading