Author: pmouawad
Date: Sat Dec 31 17:04:31 2016
New Revision: 1776799
URL: http://svn.apache.org/viewvc?rev=1776799&view=rev
Log:
Sonar : fix squid:S00115 "Rename this constant name to match the regular
expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'"
Modified:
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImpl.java
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java
Modified:
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImpl.java
URL:
http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImpl.java?rev=1776799&r1=1776798&r2=1776799&view=diff
==============================================================================
---
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImpl.java
(original)
+++
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImpl.java
Sat Dec 31 17:04:31 2016
@@ -47,11 +47,11 @@ import org.apache.log.Logger;
public class BinaryTCPClientImpl extends AbstractTCPClient {
private static final Logger log = LoggingManager.getLoggerForClass();
- private static final int eomInt =
JMeterUtils.getPropDefault("tcp.BinaryTCPClient.eomByte", 1000); // $NON_NLS-1$
+ private static final int EOM_INT =
JMeterUtils.getPropDefault("tcp.BinaryTCPClient.eomByte", 1000); // $NON_NLS-1$
public BinaryTCPClientImpl() {
super();
- setEolByte(eomInt);
+ setEolByte(EOM_INT);
if (useEolByte) {
log.info("Using eomByte=" + eolByte);
}
Modified:
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java
URL:
http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java?rev=1776799&r1=1776798&r2=1776799&view=diff
==============================================================================
---
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java
(original)
+++
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java
Sat Dec 31 17:04:31 2016
@@ -47,20 +47,20 @@ import org.apache.log.Logger;
public class TCPClientImpl extends AbstractTCPClient {
private static final Logger log = LoggingManager.getLoggerForClass();
- private static final int eolInt =
JMeterUtils.getPropDefault("tcp.eolByte", 1000); // $NON-NLS-1$
- private static final String charset =
JMeterUtils.getPropDefault("tcp.charset", Charset.defaultCharset().name()); //
$NON-NLS-1$
+ private static final int EOL_INT =
JMeterUtils.getPropDefault("tcp.eolByte", 1000); // $NON-NLS-1$
+ private static final String CHARSET =
JMeterUtils.getPropDefault("tcp.charset", Charset.defaultCharset().name()); //
$NON-NLS-1$
// default is not in range of a byte
public TCPClientImpl() {
super();
- setEolByte(eolInt);
+ setEolByte(EOL_INT);
if (useEolByte) {
log.info("Using eolByte=" + eolByte);
}
- setCharset(charset);
+ setCharset(CHARSET);
String configuredCharset = JMeterUtils.getProperty("tcp.charset");
if(StringUtils.isEmpty(configuredCharset)) {
- log.info("Using platform default charset:"+charset);
+ log.info("Using platform default charset:"+CHARSET);
} else {
log.info("Using charset:"+configuredCharset);
}
@@ -74,7 +74,7 @@ public class TCPClientImpl extends Abstr
if(log.isDebugEnabled()) {
log.debug("WriteS: " + showEOL(s));
}
- os.write(s.getBytes(charset));
+ os.write(s.getBytes(CHARSET));
os.flush();
}
@@ -86,7 +86,7 @@ public class TCPClientImpl extends Abstr
byte[] buff = new byte[512];
while(is.read(buff) > 0){
if(log.isDebugEnabled()) {
- log.debug("WriteIS: " + showEOL(new String(buff, charset)));
+ log.debug("WriteIS: " + showEOL(new String(buff, CHARSET)));
}
os.write(buff);
os.flush();
@@ -115,7 +115,7 @@ public class TCPClientImpl extends Abstr
if(log.isDebugEnabled()) {
log.debug("Read: " + w.size() + "\n" + w.toString());
}
- return w.toString(charset);
+ return w.toString(CHARSET);
} catch (IOException e) {
throw new ReadException("Error reading from server, bytes read: "
+ w.size(), e, w.toString());
}
Modified:
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java
URL:
http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java?rev=1776799&r1=1776798&r2=1776799&view=diff
==============================================================================
---
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java
(original)
+++
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java
Sat Dec 31 17:04:31 2016
@@ -104,6 +104,8 @@ public class TCPSampler extends Abstract
private static final Properties STATUS_PROPS = new Properties();
+ private static final String PROTO_PREFIX =
"org.apache.jmeter.protocol.tcp.sampler."; //$NON-NLS-1$
+
private static final boolean HAVE_STATUS_PROPS;
static {
@@ -316,15 +318,13 @@ public class TCPSampler extends Abstract
return ("tcp://" + this.getServer() + ":" +
this.getPort());//$NON-NLS-1$ $NON-NLS-2$
}
- private static final String protoPrefix =
"org.apache.jmeter.protocol.tcp.sampler."; //$NON-NLS-1$
-
private Class<?> getClass(String className) {
Class<?> c = null;
try {
c = Class.forName(className, false,
Thread.currentThread().getContextClassLoader());
} catch (ClassNotFoundException e) {
try {
- c = Class.forName(protoPrefix + className, false,
Thread.currentThread().getContextClassLoader());
+ c = Class.forName(PROTO_PREFIX + className, false,
Thread.currentThread().getContextClassLoader());
} catch (ClassNotFoundException e1) {
log.error("Could not find protocol class '" + className+"'");
//$NON-NLS-1$
}