You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by se...@apache.org on 2013/03/18 00:28:27 UTC
svn commit: r1457590 [1/2] - in /jmeter/trunk/src: core/org/apache/jmeter/
core/org/apache/jmeter/reporters/ core/org/apache/jmeter/samplers/
core/org/apache/jmeter/services/ core/org/apache/jmeter/testbeans/gui/
core/org/apache/jmeter/testelement/ cor...
Author: sebb
Date: Sun Mar 17 23:28:26 2013
New Revision: 1457590
URL: http://svn.apache.org/r1457590
Log:
Tab police - also remove trailing spaces in same files
Modified:
jmeter/trunk/src/core/org/apache/jmeter/NewDriver.java
jmeter/trunk/src/core/org/apache/jmeter/reporters/FileReporter.java
jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java
jmeter/trunk/src/core/org/apache/jmeter/samplers/AbstractSampleSender.java
jmeter/trunk/src/core/org/apache/jmeter/samplers/AsynchSampleSender.java
jmeter/trunk/src/core/org/apache/jmeter/samplers/BatchSampleSender.java
jmeter/trunk/src/core/org/apache/jmeter/samplers/DiskStoreSampleSender.java
jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleSender.java
jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java
jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java
jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractTestElement.java
jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterContextService.java
jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java
jmeter/trunk/src/core/org/apache/jmeter/threads/SamplePackage.java
jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java
jmeter/trunk/src/core/org/apache/jmeter/util/PropertiesBasedPrefixResolver.java
jmeter/trunk/src/core/org/apache/jmeter/util/XPathUtil.java
jmeter/trunk/src/functions/org/apache/jmeter/functions/AbstractHostIPName.java
jmeter/trunk/src/functions/org/apache/jmeter/functions/MachineIP.java
jmeter/trunk/src/functions/org/apache/jmeter/functions/MachineName.java
jmeter/trunk/src/functions/org/apache/jmeter/functions/StringFromFile.java
jmeter/trunk/src/functions/org/apache/jmeter/functions/TestPlanName.java
jmeter/trunk/src/functions/org/apache/jmeter/functions/Uuid.java
jmeter/trunk/src/jorphan/org/apache/jorphan/io/TextFile.java
jmeter/trunk/src/jorphan/org/apache/jorphan/util/HeapDumper.java
jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/HttpDefaultsGui.java
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieHandler.java
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HC3CookieHandler.java
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HeaderManager.java
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/RegExUserParameters.java
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/gui/RegExUserParametersGui.java
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/RegexpHTMLParser.java
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/TCLogParser.java
jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java
jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ReceiveSubscriber.java
jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/SubscriberSampler.java
jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/NativeCommand.java
jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/StreamCopier.java
jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/StreamGobbler.java
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImpl.java
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/LengthPrefixedBinaryTCPClientImpl.java
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/ReadException.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
jmeter/trunk/src/reports/org/apache/jmeter/gui/ReportGuiPackage.java
jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportActionRouter.java
jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportStart.java
jmeter/trunk/src/reports/org/apache/jmeter/report/writers/AbstractReportWriter.java
Modified: jmeter/trunk/src/core/org/apache/jmeter/NewDriver.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/NewDriver.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/NewDriver.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/NewDriver.java Sun Mar 17 23:28:26 2013
@@ -52,7 +52,7 @@ public final class NewDriver {
private static final String jmDir;
static {
- final List<URL> jars = new LinkedList<URL>();
+ final List<URL> jars = new LinkedList<URL>();
final String initial_classpath = System.getProperty(JAVA_CLASS_PATH);
// Find JMeter home dir from the initial classpath
@@ -125,12 +125,12 @@ public final class NewDriver {
// ClassFinder needs the classpath
System.setProperty(JAVA_CLASS_PATH, initial_classpath + classpath.toString());
loader = AccessController.doPrivileged(
- new java.security.PrivilegedAction<DynamicClassLoader>() {
- @Override
+ new java.security.PrivilegedAction<DynamicClassLoader>() {
+ @Override
public DynamicClassLoader run() {
- return new DynamicClassLoader(jars.toArray(new URL[jars.size()]));
- }
- }
+ return new DynamicClassLoader(jars.toArray(new URL[jars.size()]));
+ }
+ }
);
}
Modified: jmeter/trunk/src/core/org/apache/jmeter/reporters/FileReporter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/reporters/FileReporter.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/reporters/FileReporter.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/reporters/FileReporter.java Sun Mar 17 23:28:26 2013
@@ -102,7 +102,7 @@ public class FileReporter extends JPanel
}
}
} finally {
- JOrphanUtils.closeQuietly(reader);
+ JOrphanUtils.closeQuietly(reader);
}
showPanel();
}
Modified: jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java Sun Mar 17 23:28:26 2013
@@ -411,9 +411,9 @@ public class ResultCollector extends Abs
// and create it - if there is one
File pdir = new File(filename).getParentFile();
if (pdir != null) {
- // returns false if directory already exists, so need to check again
+ // returns false if directory already exists, so need to check again
if(pdir.mkdirs()){
- log.info("Folder "+pdir.getAbsolutePath()+" was created");
+ log.info("Folder "+pdir.getAbsolutePath()+" was created");
} // else if might have been created by another process so not a problem
if (!pdir.exists()){
log.warn("Error creating directories for "+pdir.toString());
Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/AbstractSampleSender.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/AbstractSampleSender.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/AbstractSampleSender.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/AbstractSampleSender.java Sun Mar 17 23:28:26 2013
@@ -30,21 +30,21 @@ public abstract class AbstractSampleSend
// [a static field would be recreated on the server, and would pick up the server properties]
private final boolean isClientConfigured = JMeterUtils.getPropDefault("sample_sender_client_configured", true); // $NON-NLS-1$
- /**
- * @return boolean indicates how SampleSender configuration is done, true means use client properties and send to servers, false means use server configurations
- */
- public boolean isClientConfigured() {
- return isClientConfigured;
- }
+ /**
+ * @return boolean indicates how SampleSender configuration is done, true means use client properties and send to servers, false means use server configurations
+ */
+ public boolean isClientConfigured() {
+ return isClientConfigured;
+ }
- /**
- *
- */
- public AbstractSampleSender() {
- super();
- }
+ /**
+ *
+ */
+ public AbstractSampleSender() {
+ super();
+ }
- @Override
+ @Override
public void testEnded() {
// Not used
}
Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/AsynchSampleSender.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/AsynchSampleSender.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/AsynchSampleSender.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/AsynchSampleSender.java Sun Mar 17 23:28:26 2013
@@ -58,7 +58,7 @@ public class AsynchSampleSender extends
* @throws ObjectStreamException
*/
private Object readResolve() throws ObjectStreamException{
- int capacity = getCapacity();
+ int capacity = getCapacity();
log.info("Using batch queue size (asynch.batch.queue.size): " + capacity); // server log file
queue = new ArrayBlockingQueue<SampleEvent>(capacity);
Worker worker = new Worker(queue, listener);
@@ -72,7 +72,7 @@ public class AsynchSampleSender extends
*/
@Deprecated
public AsynchSampleSender(){
- this(null);
+ this(null);
log.warn("Constructor only intended for use in testing"); // $NON-NLS-1$
}
@@ -86,8 +86,8 @@ public class AsynchSampleSender extends
* @return capacity
*/
private int getCapacity() {
- return isClientConfigured() ?
- clientConfiguredCapacity : serverConfiguredCapacity;
+ return isClientConfigured() ?
+ clientConfiguredCapacity : serverConfiguredCapacity;
}
@Override
Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/BatchSampleSender.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/BatchSampleSender.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/BatchSampleSender.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/BatchSampleSender.java Sun Mar 17 23:28:26 2013
@@ -73,7 +73,7 @@ public class BatchSampleSender extends A
*/
@Deprecated
public BatchSampleSender(){
- this(null);
+ this(null);
log.warn("Constructor only intended for use in testing"); // $NON-NLS-1$
}
/**
Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/DiskStoreSampleSender.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/DiskStoreSampleSender.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/DiskStoreSampleSender.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/DiskStoreSampleSender.java Sun Mar 17 23:28:26 2013
@@ -119,7 +119,7 @@ public class DiskStoreSampleSender exten
}
IOUtils.closeQuietly(ois);
if(!temporaryFile.delete()) {
- log.warn("Could not delete file:"+temporaryFile.getAbsolutePath());
+ log.warn("Could not delete file:"+temporaryFile.getAbsolutePath());
}
}
}
Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleSender.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleSender.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleSender.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleSender.java Sun Mar 17 23:28:26 2013
@@ -93,7 +93,7 @@ public class StatisticalSampleSender ext
*/
@Deprecated
public StatisticalSampleSender(){
- this(null);
+ this(null);
log.warn("Constructor only intended for use in testing");
}
@@ -144,7 +144,7 @@ public class StatisticalSampleSender ext
*/
@Override
public void sampleOccurred(SampleEvent e) {
- synchronized (sampleStore) {
+ synchronized (sampleStore) {
// Locate the statistical sample colector
String key = StatisticalSampleResult.getKey(e, keyOnThreadName);
StatisticalSampleResult statResult = sampleTable.get(key);
Modified: jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/services/FileServer.java Sun Mar 17 23:28:26 2013
@@ -85,7 +85,7 @@ public class FileServer {
private final Random random = new Random();
// volatile needed to ensure safe publication
- private volatile String scriptName;
+ private volatile String scriptName;
// Cannot be instantiated
private FileServer() {
@@ -163,20 +163,20 @@ public class FileServer {
log.info("Set new base='"+base+"'");
}
- /**
- * Check if there are entries in use.
- * <p>
- * Caller must ensure that access to the files map is single-threaded as
- * there is a window between checking the files Map and clearing it.
- *
- * @throws IllegalStateException if there are any entries still in use
- */
- private void checkForOpenFiles() throws IllegalStateException {
- if (filesOpen()) { // checks for entries in use
+ /**
+ * Check if there are entries in use.
+ * <p>
+ * Caller must ensure that access to the files map is single-threaded as
+ * there is a window between checking the files Map and clearing it.
+ *
+ * @throws IllegalStateException if there are any entries still in use
+ */
+ private void checkForOpenFiles() throws IllegalStateException {
+ if (filesOpen()) { // checks for entries in use
throw new IllegalStateException("Files are still open, cannot change base directory");
}
files.clear(); // tidy up any unused entries
- }
+ }
public synchronized String getBaseDir() {
return base.getAbsolutePath();
@@ -523,15 +523,15 @@ public class FileServer {
* @return JMX Script name
* @since 2.6
*/
- public String getScriptName() {
- return scriptName;
- }
-
- /**
- * @param scriptName Script name
- * @since 2.6
- */
- public void setScriptName(String scriptName) {
- this.scriptName = scriptName;
- }
+ public String getScriptName() {
+ return scriptName;
+ }
+
+ /**
+ * @param scriptName Script name
+ * @since 2.6
+ */
+ public void setScriptName(String scriptName) {
+ this.scriptName = scriptName;
+ }
}
Modified: jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java Sun Mar 17 23:28:26 2013
@@ -387,7 +387,7 @@ public TestElement createTestElement() {
* @return number of matches
*/
public int setupGuiClasses() {
- return setupGuiClasses(new ArrayList<String>());
+ return setupGuiClasses(new ArrayList<String>());
}
/**
@@ -396,10 +396,10 @@ public TestElement createTestElement() {
* @return number of matches
*/
private int setupGuiClasses(List<String> menuCategories ) {
- int matches = 0;// How many classes can we assign from?
+ int matches = 0;// How many classes can we assign from?
// TODO: there must be a nicer way...
BeanDescriptor bd = beanInfo.getBeanDescriptor();
- if (Assertion.class.isAssignableFrom(testBeanClass)) {
+ if (Assertion.class.isAssignableFrom(testBeanClass)) {
menuCategories.add(MenuFactory.ASSERTIONS);
bd.setValue(TestElement.GUI_CLASS, AbstractAssertionGui.class.getName());
matches++;
@@ -491,20 +491,20 @@ public TestElement createTestElement() {
return beanInfo.getBeanDescriptor().isExpert();
}
- /**
- * Handle Locale Change by reloading BeanInfo
- * @param event {@link LocaleChangeEvent}
- */
- @Override
+ /**
+ * Handle Locale Change by reloading BeanInfo
+ * @param event {@link LocaleChangeEvent}
+ */
+ @Override
public void localeChanged(LocaleChangeEvent event) {
- try {
+ try {
beanInfo = Introspector.getBeanInfo(testBeanClass);
setupGuiClasses();
} catch (IntrospectionException e) {
log.error("Can't get beanInfo for " + testBeanClass.getName(), e);
JMeterUtils.reportErrorToUser("Can't get beanInfo for " + testBeanClass.getName());
}
- }
+ }
/**
* {@inheritDoc}}
Modified: jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractTestElement.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractTestElement.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractTestElement.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testelement/AbstractTestElement.java Sun Mar 17 23:28:26 2013
@@ -285,19 +285,19 @@ public abstract class AbstractTestElemen
* @param clone clone property
*/
protected void addProperty(JMeterProperty property, boolean clone) {
- JMeterProperty propertyToPut = property;
- if(clone) {
- propertyToPut = property.clone();
- }
+ JMeterProperty propertyToPut = property;
+ if(clone) {
+ propertyToPut = property.clone();
+ }
if (isRunningVersion()) {
- setTemporary(propertyToPut);
+ setTemporary(propertyToPut);
} else {
clearTemporary(property);
}
JMeterProperty prop = getProperty(property.getName());
if (prop instanceof NullProperty || (prop instanceof StringProperty && prop.getStringValue().equals(""))) {
- propMap.put(property.getName(), propertyToPut);
+ propMap.put(property.getName(), propertyToPut);
} else {
prop.mergeIn(propertyToPut);
}
@@ -613,18 +613,18 @@ public abstract class AbstractTestElemen
return result;
}
- /**
- * Add to result the values of propertyNames
- * @param result List<String> values of propertyNames
- * @param propertyNames Set<String> properties to extract
- */
- protected final void addPropertiesValues(List<String> result, Set<String> propertyNames) {
- PropertyIterator iterator = propertyIterator();
- while(iterator.hasNext()) {
- JMeterProperty jMeterProperty = iterator.next();
- if(propertyNames.contains(jMeterProperty.getName())) {
- result.add(jMeterProperty.getStringValue());
- }
- }
- }
+ /**
+ * Add to result the values of propertyNames
+ * @param result List<String> values of propertyNames
+ * @param propertyNames Set<String> properties to extract
+ */
+ protected final void addPropertiesValues(List<String> result, Set<String> propertyNames) {
+ PropertyIterator iterator = propertyIterator();
+ while(iterator.hasNext()) {
+ JMeterProperty jMeterProperty = iterator.next();
+ if(propertyNames.contains(jMeterProperty.getName())) {
+ result.add(jMeterProperty.getStringValue());
+ }
+ }
+ }
}
Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterContextService.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterContextService.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterContextService.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterContextService.java Sun Mar 17 23:28:26 2013
@@ -77,8 +77,8 @@ public final class JMeterContextService
* @param context {@link JMeterContext}
*/
public static void replaceContext(JMeterContext context) {
- threadContext.remove();
- threadContext.set(context);
+ threadContext.remove();
+ threadContext.set(context);
}
/**
* Method is called by the JMeterEngine class when a test run is started.
Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java Sun Mar 17 23:28:26 2013
@@ -253,31 +253,31 @@ public class JMeterThread implements Run
while (running) {
Sampler sam = controller.next();
while (running && sam != null) {
- process_sampler(sam, null, threadContext);
- threadContext.cleanAfterSample();
- if(onErrorStartNextLoop || threadContext.isRestartNextLoop()) {
- if(threadContext.isRestartNextLoop()) {
+ process_sampler(sam, null, threadContext);
+ threadContext.cleanAfterSample();
+ if(onErrorStartNextLoop || threadContext.isRestartNextLoop()) {
+ if(threadContext.isRestartNextLoop()) {
triggerEndOfLoopOnParentControllers(sam, threadContext);
sam = null;
threadContext.getVariables().put(LAST_SAMPLE_OK, TRUE);
threadContext.setRestartNextLoop(false);
- } else {
- boolean lastSampleFailed = !TRUE.equals(threadContext.getVariables().get(LAST_SAMPLE_OK));
- if(lastSampleFailed) {
- if(log.isDebugEnabled()) {
- log.debug("StartNextLoop option is on, Last sample failed, starting next loop");
- }
- triggerEndOfLoopOnParentControllers(sam, threadContext);
- sam = null;
- threadContext.getVariables().put(LAST_SAMPLE_OK, TRUE);
- } else {
- sam = controller.next();
- }
- }
- }
- else {
- sam = controller.next();
- }
+ } else {
+ boolean lastSampleFailed = !TRUE.equals(threadContext.getVariables().get(LAST_SAMPLE_OK));
+ if(lastSampleFailed) {
+ if(log.isDebugEnabled()) {
+ log.debug("StartNextLoop option is on, Last sample failed, starting next loop");
+ }
+ triggerEndOfLoopOnParentControllers(sam, threadContext);
+ sam = null;
+ threadContext.getVariables().put(LAST_SAMPLE_OK, TRUE);
+ } else {
+ sam = controller.next();
+ }
+ }
+ }
+ else {
+ sam = controller.next();
+ }
}
if (controller.isDone()) {
running = false;
@@ -333,7 +333,7 @@ public class JMeterThread implements Run
}
testTree.traverse(pathToRootTraverser);
List<Controller> controllersToReinit = pathToRootTraverser.getControllersToRoot();
-
+
// Trigger end of loop condition on all parent controllers of current sampler
for (Iterator<Controller> iterator = controllersToReinit
.iterator(); iterator.hasNext();) {
Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/SamplePackage.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/SamplePackage.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/SamplePackage.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/SamplePackage.java Sun Mar 17 23:28:26 2013
@@ -34,13 +34,13 @@ import org.apache.jmeter.timers.Timer;
* Packages methods related to sample handling.<br/>
* A SamplePackage contains all elements associated to a Sampler:
* <ul>
- * <li>SampleListener(s)</li>
- * <li>Timer(s)</li>
- * <li>Assertion(s)</li>
- * <li>PreProcessor(s)</li>
- * <li>PostProcessor(s)</li>
- * <li>ConfigTestElement(s)</li>
- * <li>Controller(s)</li>
+ * <li>SampleListener(s)</li>
+ * <li>Timer(s)</li>
+ * <li>Assertion(s)</li>
+ * <li>PreProcessor(s)</li>
+ * <li>PostProcessor(s)</li>
+ * <li>ConfigTestElement(s)</li>
+ * <li>Controller(s)</li>
* </ul>
*/
public class SamplePackage {
@@ -114,7 +114,7 @@ public class SamplePackage {
/**
* Recover each member of SamplePackage to the state before the call of setRunningVersion(true)
- * @see TestElement#recoverRunningVersion()
+ * @see TestElement#recoverRunningVersion()
*/
public void recoverRunningVersion() {
recoverRunningVersion(configs);
Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/TestCompiler.java Sun Mar 17 23:28:26 2013
@@ -50,8 +50,8 @@ import org.apache.log.Logger;
/**
* HashTreeTraverser implementation that traverses the Test Tree to build:
* <ul>
- * <li>A map with key Sampler and as value the associated SamplePackage</li>
- * <li>A map with key TransactionController and as value the associated SamplePackage</li>
+ * <li>A map with key Sampler and as value the associated SamplePackage</li>
+ * <li>A map with key TransactionController and as value the associated SamplePackage</li>
* </ul>
*/
public class TestCompiler implements HashTreeTraverser {
Modified: jmeter/trunk/src/core/org/apache/jmeter/util/PropertiesBasedPrefixResolver.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/PropertiesBasedPrefixResolver.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/PropertiesBasedPrefixResolver.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/PropertiesBasedPrefixResolver.java Sun Mar 17 23:28:26 2013
@@ -39,61 +39,61 @@ import org.w3c.dom.Node;
* {@link PrefixResolver} implementation that loads prefix configuration from jmeter property xpath.namespace.config
*/
public class PropertiesBasedPrefixResolver extends PrefixResolverDefault {
- private static final Logger logger = LoggingManager.getLoggerForClass();
- private static final String XPATH_NAMESPACE_CONFIG = "xpath.namespace.config";
- private static final Map<String, String> NAMESPACE_MAP = new HashMap<String, String>();
- static {
- String pathToNamespaceConfig = JMeterUtils.getPropDefault(XPATH_NAMESPACE_CONFIG, "");
- if(!StringUtils.isEmpty(pathToNamespaceConfig)) {
- Properties properties = new Properties();
- InputStream inputStream = null;
- try {
- File pathToNamespaceConfigFile = JMeterUtils.findFile(pathToNamespaceConfig);
- if(!pathToNamespaceConfigFile.exists()) {
- logger.error("Cannot find configured file:'"+
- pathToNamespaceConfig+"' in property:'"+XPATH_NAMESPACE_CONFIG+"', file does not exist");
- } else {
- if(!pathToNamespaceConfigFile.canRead()) {
- logger.error("Cannot read configured file:'"+
- pathToNamespaceConfig+"' in property:'"+XPATH_NAMESPACE_CONFIG+"'");
- } else {
- inputStream = new BufferedInputStream(new FileInputStream(pathToNamespaceConfigFile));
- properties.load(inputStream);
- properties.entrySet();
- for (Map.Entry<Object, Object> entry : properties.entrySet()) {
- NAMESPACE_MAP.put((String) entry.getKey(), (String) entry.getValue());
- }
- logger.info("Read following XPath namespace configuration "+
- NAMESPACE_MAP);
- }
- }
- } catch(IOException e) {
- logger.error("Error loading namespaces from file:'"+
- pathToNamespaceConfig+"', message:"+e.getMessage(),e);
- } finally {
- JOrphanUtils.closeQuietly(inputStream);
- }
- }
- }
- /**
- * @param xpathExpressionContext Node
- */
- public PropertiesBasedPrefixResolver(Node xpathExpressionContext) {
- super(xpathExpressionContext);
- }
+ private static final Logger logger = LoggingManager.getLoggerForClass();
+ private static final String XPATH_NAMESPACE_CONFIG = "xpath.namespace.config";
+ private static final Map<String, String> NAMESPACE_MAP = new HashMap<String, String>();
+ static {
+ String pathToNamespaceConfig = JMeterUtils.getPropDefault(XPATH_NAMESPACE_CONFIG, "");
+ if(!StringUtils.isEmpty(pathToNamespaceConfig)) {
+ Properties properties = new Properties();
+ InputStream inputStream = null;
+ try {
+ File pathToNamespaceConfigFile = JMeterUtils.findFile(pathToNamespaceConfig);
+ if(!pathToNamespaceConfigFile.exists()) {
+ logger.error("Cannot find configured file:'"+
+ pathToNamespaceConfig+"' in property:'"+XPATH_NAMESPACE_CONFIG+"', file does not exist");
+ } else {
+ if(!pathToNamespaceConfigFile.canRead()) {
+ logger.error("Cannot read configured file:'"+
+ pathToNamespaceConfig+"' in property:'"+XPATH_NAMESPACE_CONFIG+"'");
+ } else {
+ inputStream = new BufferedInputStream(new FileInputStream(pathToNamespaceConfigFile));
+ properties.load(inputStream);
+ properties.entrySet();
+ for (Map.Entry<Object, Object> entry : properties.entrySet()) {
+ NAMESPACE_MAP.put((String) entry.getKey(), (String) entry.getValue());
+ }
+ logger.info("Read following XPath namespace configuration "+
+ NAMESPACE_MAP);
+ }
+ }
+ } catch(IOException e) {
+ logger.error("Error loading namespaces from file:'"+
+ pathToNamespaceConfig+"', message:"+e.getMessage(),e);
+ } finally {
+ JOrphanUtils.closeQuietly(inputStream);
+ }
+ }
+ }
+ /**
+ * @param xpathExpressionContext Node
+ */
+ public PropertiesBasedPrefixResolver(Node xpathExpressionContext) {
+ super(xpathExpressionContext);
+ }
- /**
- * Searches prefix in NAMESPACE_MAP, if it fails to find it defaults to parent implementation
- * @param prefix Prefix
- * @param namespaceContext Node
- */
- @Override
- public String getNamespaceForPrefix(String prefix, Node namespaceContext) {
- String namespace = NAMESPACE_MAP.get(prefix);
- if(namespace==null) {
- return super.getNamespaceForPrefix(prefix, namespaceContext);
- } else {
- return namespace;
- }
- }
+ /**
+ * Searches prefix in NAMESPACE_MAP, if it fails to find it defaults to parent implementation
+ * @param prefix Prefix
+ * @param namespaceContext Node
+ */
+ @Override
+ public String getNamespaceForPrefix(String prefix, Node namespaceContext) {
+ String namespace = NAMESPACE_MAP.get(prefix);
+ if(namespace==null) {
+ return super.getNamespaceForPrefix(prefix, namespaceContext);
+ } else {
+ return namespace;
+ }
+ }
}
\ No newline at end of file
Modified: jmeter/trunk/src/core/org/apache/jmeter/util/XPathUtil.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/XPathUtil.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/XPathUtil.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/XPathUtil.java Sun Mar 17 23:28:26 2013
@@ -264,12 +264,12 @@ public class XPathUtil {
}
}
- /**
- * Return value for node
- * @param node Node
- * @return String
- */
- private static String getValueForNode(Node node) {
+ /**
+ * Return value for node
+ * @param node Node
+ * @return String
+ */
+ private static String getValueForNode(Node node) {
StringWriter sw = new StringWriter();
try {
Transformer t = TransformerFactory.newInstance().newTransformer();
@@ -288,23 +288,23 @@ public class XPathUtil {
* @return {@link NodeList}
* @throws TransformerException
*/
- public static NodeList selectNodeList(Document document, String xPathExpression) throws TransformerException {
- XObject xObject = XPathAPI.eval(document, xPathExpression, getPrefixResolver(document));
- return xObject.nodelist();
- }
+ public static NodeList selectNodeList(Document document, String xPathExpression) throws TransformerException {
+ XObject xObject = XPathAPI.eval(document, xPathExpression, getPrefixResolver(document));
+ return xObject.nodelist();
+ }
- /**
- * Put in matchStrings results of evaluation
- * @param document XML document
- * @param xPathQuery XPath Query
- * @param matchStrings List<String> that will be filled
- * @param fragment return fragment
- * @throws TransformerException
- */
- public static void putValuesForXPathInList(Document document,
- String xPathQuery,
- List<String> matchStrings, boolean fragment) throws TransformerException {
- String val = null;
+ /**
+ * Put in matchStrings results of evaluation
+ * @param document XML document
+ * @param xPathQuery XPath Query
+ * @param matchStrings List<String> that will be filled
+ * @param fragment return fragment
+ * @throws TransformerException
+ */
+ public static void putValuesForXPathInList(Document document,
+ String xPathQuery,
+ List<String> matchStrings, boolean fragment) throws TransformerException {
+ String val = null;
XObject xObject = XPathAPI.eval(document, xPathQuery, getPrefixResolver(document));
final int objectType = xObject.getType();
if (objectType == XObject.CLASS_NODESET) {
@@ -337,51 +337,51 @@ public class XPathUtil {
val = xObject.toString();
matchStrings.add(val);
}
- }
+ }
- /**
- *
- * @param document XML Document
- * @return {@link PrefixResolver}
- */
- private static PrefixResolver getPrefixResolver(Document document) {
- PropertiesBasedPrefixResolver propertiesBasedPrefixResolver =
- new PropertiesBasedPrefixResolver(document.getDocumentElement());
- return propertiesBasedPrefixResolver;
- }
+ /**
+ *
+ * @param document XML Document
+ * @return {@link PrefixResolver}
+ */
+ private static PrefixResolver getPrefixResolver(Document document) {
+ PropertiesBasedPrefixResolver propertiesBasedPrefixResolver =
+ new PropertiesBasedPrefixResolver(document.getDocumentElement());
+ return propertiesBasedPrefixResolver;
+ }
- /**
- * Validate xpathString is a valid XPath expression
- * @param document XML Document
- * @param xpathString XPATH String
- * @throws TransformerException if expression fails to evaluate
- */
- public static void validateXPath(Document document, String xpathString) throws TransformerException {
- if (XPathAPI.eval(document, xpathString, getPrefixResolver(document)) == null) {
+ /**
+ * Validate xpathString is a valid XPath expression
+ * @param document XML Document
+ * @param xpathString XPATH String
+ * @throws TransformerException if expression fails to evaluate
+ */
+ public static void validateXPath(Document document, String xpathString) throws TransformerException {
+ if (XPathAPI.eval(document, xpathString, getPrefixResolver(document)) == null) {
// We really should never get here
// because eval will throw an exception
// if xpath is invalid, but whatever, better
// safe
- throw new IllegalArgumentException("xpath eval of '" + xpathString + "' was null");
+ throw new IllegalArgumentException("xpath eval of '" + xpathString + "' was null");
}
- }
-
- /**
- * Fills result
- * @param result {@link AssertionResult}
- * @param doc XML Document
- * @param xPathExpression XPath expression
- * @param isNegated
- */
- public static void computeAssertionResult(AssertionResult result,
- Document doc,
- String xPathExpression,
- boolean isNegated) {
+ }
+
+ /**
+ * Fills result
+ * @param result {@link AssertionResult}
+ * @param doc XML Document
+ * @param xPathExpression XPath expression
+ * @param isNegated
+ */
+ public static void computeAssertionResult(AssertionResult result,
+ Document doc,
+ String xPathExpression,
+ boolean isNegated) {
try {
XObject xObject = XPathAPI.eval(doc, xPathExpression, getPrefixResolver(doc));
switch (xObject.getType()) {
case XObject.CLASS_NODESET:
- NodeList nodeList = xObject.nodelist();
+ NodeList nodeList = xObject.nodelist();
if (nodeList == null || nodeList.getLength() == 0) {
if (log.isDebugEnabled()) {
log.debug(new StringBuilder("nodeList null no match ").append(xPathExpression).toString());
@@ -423,5 +423,5 @@ public class XPathUtil {
.append(xPathExpression)
.toString());
}
- }
+ }
}
\ No newline at end of file
Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/AbstractHostIPName.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/AbstractHostIPName.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/AbstractHostIPName.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/AbstractHostIPName.java Sun Mar 17 23:28:26 2013
@@ -69,7 +69,7 @@ abstract class AbstractHostIPName extend
abstract protected String compute();
- /** {@inheritDoc} */
+ /** {@inheritDoc} */
@Override
public synchronized void setParameters(Collection<CompoundVariable> parameters) throws InvalidVariableException {
checkParameterCount(parameters, 0, 1);
Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/MachineIP.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/MachineIP.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/MachineIP.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/MachineIP.java Sun Mar 17 23:28:26 2013
@@ -31,11 +31,11 @@ public class MachineIP extends AbstractH
public MachineIP() {
}
- @Override
- protected String compute() {
- return JMeterUtils.getLocalHostIP();
- }
-
+ @Override
+ protected String compute() {
+ return JMeterUtils.getLocalHostIP();
+ }
+
/** {@inheritDoc} */
@Override
public String getReferenceKey() {
Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/MachineName.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/MachineName.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/MachineName.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/MachineName.java Sun Mar 17 23:28:26 2013
@@ -31,11 +31,11 @@ public class MachineName extends Abstrac
public MachineName() {
}
- @Override
- protected String compute() {
- return JMeterUtils.getLocalHostName();
- }
-
+ @Override
+ protected String compute() {
+ return JMeterUtils.getLocalHostName();
+ }
+
/** {@inheritDoc} */
@Override
public String getReferenceKey() {
Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/StringFromFile.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/StringFromFile.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/StringFromFile.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/StringFromFile.java Sun Mar 17 23:28:26 2013
@@ -210,7 +210,7 @@ public class StringFromFile extends Abst
public synchronized String execute(SampleResult previousResult, Sampler currentSampler)
throws InvalidVariableException {
String myValue = ERR_IND;
- String myName = "StringFromFile_";//$NON-NLS-1$
+ String myName = "StringFromFile_";//$NON-NLS-1$
if (values.length >= PARAM_NAME) {
myName = ((CompoundVariable) values[PARAM_NAME - 1]).execute().trim();
}
@@ -333,7 +333,7 @@ public class StringFromFile extends Abst
/** {@inheritDoc} */
@Override
public void testEnded(String host) {
- closeFile();
+ closeFile();
}
}
\ No newline at end of file
Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/TestPlanName.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/TestPlanName.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/TestPlanName.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/TestPlanName.java Sun Mar 17 23:28:26 2013
@@ -48,7 +48,7 @@ public class TestPlanName extends Abstra
@Override
public synchronized String execute(SampleResult previousResult, Sampler currentSampler)
throws InvalidVariableException {
- return FileServer.getFileServer().getScriptName();
+ return FileServer.getFileServer().getScriptName();
}
/** {@inheritDoc} */
Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/Uuid.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/functions/org/apache/jmeter/functions/Uuid.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/functions/org/apache/jmeter/functions/Uuid.java (original)
+++ jmeter/trunk/src/functions/org/apache/jmeter/functions/Uuid.java Sun Mar 17 23:28:26 2013
@@ -39,31 +39,31 @@ import java.util.UUID;
*/
public class Uuid extends AbstractFunction {
- private static final List<String> desc = new LinkedList<String>();
+ private static final List<String> desc = new LinkedList<String>();
- private static final String KEY = "__UUID"; //$NON-NLS-1$
+ private static final String KEY = "__UUID"; //$NON-NLS-1$
- public Uuid() {
- }
+ public Uuid() {
+ }
- @Override
- public String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException {
- return UUID.randomUUID().toString();
- }
-
- @Override
- public void setParameters(Collection<CompoundVariable> parameters) throws InvalidVariableException {
- checkParameterCount(parameters, 0, 0);
- }
-
- @Override
- public String getReferenceKey() {
- return KEY;
- }
-
- @Override
- public List<String> getArgumentDesc() {
- return desc;
- }
+ @Override
+ public String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException {
+ return UUID.randomUUID().toString();
+ }
+
+ @Override
+ public void setParameters(Collection<CompoundVariable> parameters) throws InvalidVariableException {
+ checkParameterCount(parameters, 0, 0);
+ }
+
+ @Override
+ public String getReferenceKey() {
+ return KEY;
+ }
+
+ @Override
+ public List<String> getArgumentDesc() {
+ return desc;
+ }
}
Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/io/TextFile.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/io/TextFile.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/io/TextFile.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/io/TextFile.java Sun Mar 17 23:28:26 2013
@@ -174,36 +174,36 @@ public class TextFile extends File {
encoding = string;
}
- /**
- * {@inheritDoc}
- */
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result
- + ((encoding == null) ? 0 : encoding.hashCode());
- return result;
- }
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result
+ + ((encoding == null) ? 0 : encoding.hashCode());
+ return result;
+ }
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!super.equals(obj)) {
- return false;
- }
- if (!(obj instanceof TextFile)) {
- return false;
- }
- TextFile other = (TextFile) obj;
- if (encoding == null) {
- return other.encoding == null;
- }
- return encoding.equals(other.encoding);
- }
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (!(obj instanceof TextFile)) {
+ return false;
+ }
+ TextFile other = (TextFile) obj;
+ if (encoding == null) {
+ return other.encoding == null;
+ }
+ return encoding.equals(other.encoding);
+ }
}
Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/util/HeapDumper.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/util/HeapDumper.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/util/HeapDumper.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/util/HeapDumper.java Sun Mar 17 23:28:26 2013
@@ -161,7 +161,7 @@ public class HeapDumper {
* @throws Exception if the MXBean cannot be found, or if there is a problem during invocation
*/
public static String dumpHeap(File basedir, boolean live) throws Exception {
- SimpleDateFormat timestampFormat = new SimpleDateFormat("yyyyMMdd_hhmmss_SSS");
+ SimpleDateFormat timestampFormat = new SimpleDateFormat("yyyyMMdd_hhmmss_SSS");
String stamp = timestampFormat.format(new Date());
File temp = new File(basedir,"dump_"+stamp+".hprof");
final String path = temp.getPath();
Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java Sun Mar 17 23:28:26 2013
@@ -485,13 +485,13 @@ public final class JOrphanUtils {
for(Map.Entry<Thread, StackTraceElement[]> e : m.entrySet()) {
boolean daemon = e.getKey().isDaemon();
if (includeDaemons || !daemon){
- builder.setLength(0);
- StackTraceElement[] ste = e.getValue();
- for (StackTraceElement stackTraceElement : ste) {
- int lineNumber = stackTraceElement.getLineNumber();
- builder.append(stackTraceElement.getClassName()+"#"+stackTraceElement.getMethodName()+
- (lineNumber >=0 ? " at line:"+ stackTraceElement.getLineNumber() : "")+lineSeparator);
- }
+ builder.setLength(0);
+ StackTraceElement[] ste = e.getValue();
+ for (StackTraceElement stackTraceElement : ste) {
+ int lineNumber = stackTraceElement.getLineNumber();
+ builder.append(stackTraceElement.getClassName()+"#"+stackTraceElement.getMethodName()+
+ (lineNumber >=0 ? " at line:"+ stackTraceElement.getLineNumber() : "")+lineSeparator);
+ }
System.out.println(e.getKey().toString()+((daemon ? " (daemon)" : ""))+", stackTrace:"+ builder.toString());
}
}
Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/HttpDefaultsGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/HttpDefaultsGui.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/HttpDefaultsGui.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/HttpDefaultsGui.java Sun Mar 17 23:28:26 2013
@@ -103,11 +103,11 @@ public class HttpDefaultsGui extends Abs
config.removeProperty(HTTPSamplerBase.CONCURRENT_DWN);
}
if(!StringUtils.isEmpty(concurrentPool.getText())) {
- config.setProperty(new StringProperty(HTTPSamplerBase.CONCURRENT_POOL,
- concurrentPool.getText()));
+ config.setProperty(new StringProperty(HTTPSamplerBase.CONCURRENT_POOL,
+ concurrentPool.getText()));
} else {
- config.setProperty(new StringProperty(HTTPSamplerBase.CONCURRENT_POOL,
- String.valueOf(HTTPSamplerBase.CONCURRENT_POOL_SIZE)));
+ config.setProperty(new StringProperty(HTTPSamplerBase.CONCURRENT_POOL,
+ String.valueOf(HTTPSamplerBase.CONCURRENT_POOL_SIZE)));
}
if (!StringUtils.isEmpty(embeddedRE.getText())) {
config.setProperty(new StringProperty(HTTPSamplerBase.EMBEDDED_URL_RE,
Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieHandler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieHandler.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieHandler.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieHandler.java Sun Mar 17 23:28:26 2013
@@ -27,15 +27,15 @@ import org.apache.jmeter.testelement.pro
*/
public interface CookieHandler {
- /**
- * Add cookie to CookieManager from cookieHeader and URL
- * @param cookieManager CookieManager on which cookies are added
- * @param checkCookies boolean to indicate if cookies must be validated against spec
- * @param cookieHeader String cookie Header
- * @param url URL
- */
- void addCookieFromHeader(CookieManager cookieManager, boolean checkCookies,
- String cookieHeader, URL url);
+ /**
+ * Add cookie to CookieManager from cookieHeader and URL
+ * @param cookieManager CookieManager on which cookies are added
+ * @param checkCookies boolean to indicate if cookies must be validated against spec
+ * @param cookieHeader String cookie Header
+ * @param url URL
+ */
+ void addCookieFromHeader(CookieManager cookieManager, boolean checkCookies,
+ String cookieHeader, URL url);
/**
* Find cookies applicable to the given URL and build the Cookie header from
@@ -45,7 +45,7 @@ public interface CookieHandler {
* URL of the request to which the returned header will be added.
* @return the value string for the cookie header (goes after "Cookie: ").
*/
- String getCookieHeaderForURL(CollectionProperty cookiesCP, URL url,
- boolean allowVariableCookie);
+ String getCookieHeaderForURL(CollectionProperty cookiesCP, URL url,
+ boolean allowVariableCookie);
}
Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java Sun Mar 17 23:28:26 2013
@@ -325,12 +325,12 @@ public class CookieManager extends Confi
* @return the value string for the cookie header (goes after "Cookie: ").
*/
public String getCookieHeaderForURL(URL url) {
- return cookieHandler.getCookieHeaderForURL(getCookies(), url, ALLOW_VARIABLE_COOKIES);
+ return cookieHandler.getCookieHeaderForURL(getCookies(), url, ALLOW_VARIABLE_COOKIES);
}
public void addCookieFromHeader(String cookieHeader, URL url){
- cookieHandler.addCookieFromHeader(this, CHECK_COOKIES, cookieHeader, url);
+ cookieHandler.addCookieFromHeader(this, CHECK_COOKIES, cookieHeader, url);
}
/**
* Check if cookies match, i.e. name, path and domain are equal.
@@ -407,11 +407,11 @@ public class CookieManager extends Confi
}
}
- /**
- * Package protected for tests
- * @return the cookieHandler
- */
- CookieHandler getCookieHandler() {
- return cookieHandler;
- }
+ /**
+ * Package protected for tests
+ * @return the cookieHandler
+ */
+ CookieHandler getCookieHandler() {
+ return cookieHandler;
+ }
}
\ No newline at end of file
Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HC3CookieHandler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HC3CookieHandler.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HC3CookieHandler.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HC3CookieHandler.java Sun Mar 17 23:28:26 2013
@@ -36,20 +36,20 @@ import org.apache.log.Logger;
public class HC3CookieHandler implements CookieHandler {
private static final Logger log = LoggingManager.getLoggerForClass();
- private final transient CookieSpec cookieSpec;
-
- /**
- *
- */
- public HC3CookieHandler(String policy) {
- super();
- this.cookieSpec = CookiePolicy.getCookieSpec(policy);
- }
+ private final transient CookieSpec cookieSpec;
+
+ /**
+ *
+ */
+ public HC3CookieHandler(String policy) {
+ super();
+ this.cookieSpec = CookiePolicy.getCookieSpec(policy);
+ }
/**
* Create an HttpClient cookie from a JMeter cookie
*/
- private org.apache.commons.httpclient.Cookie makeCookie(Cookie jmc){
+ private org.apache.commons.httpclient.Cookie makeCookie(Cookie jmc){
long exp = jmc.getExpiresMillis();
org.apache.commons.httpclient.Cookie ret=
new org.apache.commons.httpclient.Cookie(
@@ -65,17 +65,17 @@ public class HC3CookieHandler implements
ret.setVersion(jmc.getVersion());
return ret;
}
- /**
+ /**
* Get array of valid HttpClient cookies for the URL
*
* @param url the target URL
* @return array of HttpClient cookies
*
*/
- org.apache.commons.httpclient.Cookie[] getCookiesForUrl(
- CollectionProperty cookiesCP,
- URL url,
- boolean allowVariableCookie){
+ org.apache.commons.httpclient.Cookie[] getCookiesForUrl(
+ CollectionProperty cookiesCP,
+ URL url,
+ boolean allowVariableCookie){
org.apache.commons.httpclient.Cookie cookies[]=
new org.apache.commons.httpclient.Cookie[cookiesCP.size()];
int i=0;
@@ -108,11 +108,11 @@ public class HC3CookieHandler implements
*/
@Override
public String getCookieHeaderForURL(
- CollectionProperty cookiesCP,
- URL url,
- boolean allowVariableCookie) {
+ CollectionProperty cookiesCP,
+ URL url,
+ boolean allowVariableCookie) {
org.apache.commons.httpclient.Cookie[] c =
- getCookiesForUrl(cookiesCP, url, allowVariableCookie);
+ getCookiesForUrl(cookiesCP, url, allowVariableCookie);
int count = c.length;
boolean debugEnabled = log.isDebugEnabled();
if (debugEnabled){
@@ -128,12 +128,12 @@ public class HC3CookieHandler implements
return hdr;
}
- /**
- * {@inheritDoc}
- */
+ /**
+ * {@inheritDoc}
+ */
@Override
public void addCookieFromHeader(CookieManager cookieManager,
- boolean checkCookies,String cookieHeader, URL url){
+ boolean checkCookies,String cookieHeader, URL url){
boolean debugEnabled = log.isDebugEnabled();
if (debugEnabled) {
log.debug("Received Cookie: " + cookieHeader + " From: " + url.toExternalForm());
@@ -180,7 +180,7 @@ public class HC3CookieHandler implements
newCookie.setVersion(cookie.getVersion());
cookieManager.add(newCookie); // Has its own debug log; removes matching cookies
} else {
- cookieManager.removeMatchingCookies(newCookie);
+ cookieManager.removeMatchingCookies(newCookie);
if (debugEnabled){
log.debug("Dropping expired Cookie: "+newCookie.toString());
}
Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HeaderManager.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HeaderManager.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HeaderManager.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/HeaderManager.java Sun Mar 17 23:28:26 2013
@@ -206,8 +206,8 @@ public class HeaderManager extends Confi
}
}
for (Integer indice : removeIndices) {
- getHeaders().remove(indice.intValue());
- }
+ getHeaders().remove(indice.intValue());
+ }
}
/**
Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java Sun Mar 17 23:28:26 2013
@@ -123,12 +123,12 @@ public class CookiePanel extends Abstrac
* These are used both for the display, and for setting the policy
*/
private final String[] policies = new String[] {
- "default",
- "compatibility",
- "rfc2109",
- "rfc2965",
- "ignorecookies",
- "netscape"
+ "default",
+ "compatibility",
+ "rfc2109",
+ "rfc2965",
+ "ignorecookies",
+ "netscape"
};
private JLabeledChoice policy;
Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/RegExUserParameters.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/RegExUserParameters.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/RegExUserParameters.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/RegExUserParameters.java Sun Mar 17 23:28:26 2013
@@ -38,7 +38,7 @@ import org.apache.log.Logger;
* Replacement will only occur for parameters in the Sampler that uses this RegEx User Parameters which name matches
*/
public class RegExUserParameters extends AbstractTestElement implements Serializable, PreProcessor {
- private static final String REGEX_GROUP_SUFFIX = "_g";
+ private static final String REGEX_GROUP_SUFFIX = "_g";
private static final String MATCH_NR = "matchNr";
@@ -49,14 +49,14 @@ public class RegExUserParameters extends
private static final Logger log = LoggingManager.getLoggerForClass();
- public static final String REG_EX_REF_NAME = "RegExUserParameters.regex_ref_name";// $NON-NLS-1$
+ public static final String REG_EX_REF_NAME = "RegExUserParameters.regex_ref_name";// $NON-NLS-1$
- public static final String REG_EX_PARAM_NAMES_GR_NR = "RegExUserParameters.param_names_gr_nr";// $NON-NLS-1$
+ public static final String REG_EX_PARAM_NAMES_GR_NR = "RegExUserParameters.param_names_gr_nr";// $NON-NLS-1$
- public static final String REG_EX_PARAM_VALUES_GR_NR = "RegExUserParameters.param_values_gr_nr";// $NON-NLS-1$
+ public static final String REG_EX_PARAM_VALUES_GR_NR = "RegExUserParameters.param_values_gr_nr";// $NON-NLS-1$
@Override
- public void process() {
+ public void process() {
if (log.isDebugEnabled()) {
log.debug(Thread.currentThread().getName() + " Running up named: " + getName());//$NON-NLS-1$
}
@@ -87,40 +87,40 @@ public class RegExUserParameters extends
}
}
}
-
- private Map<String, String> buildParamsMap(){
- String regExRefName = getRegExRefName()+"_";
- String grNames = getRegParamNamesGrNr();
- String grValues = getRegExParamValuesGrNr();
- JMeterVariables jmvars = getThreadContext().getVariables();
- // verify if regex groups exists
- if(jmvars.get(regExRefName + MATCH_NR) == null
- || jmvars.get(regExRefName + 1 + REGEX_GROUP_SUFFIX + grNames) == null
- || jmvars.get(regExRefName + 1 + REGEX_GROUP_SUFFIX + grValues) == null){
- return null;
- }
- int n = Integer.parseInt(jmvars.get(regExRefName + MATCH_NR));
- Map<String, String> map = new HashMap<String, String>(n);
- for(int i=1; i<=n; i++){
- map.put(jmvars.get(regExRefName + i + REGEX_GROUP_SUFFIX + grNames),
- jmvars.get(regExRefName + i + REGEX_GROUP_SUFFIX + grValues));
- }
- return map;
- }
-
- /**
- * A new instance is created for each thread group, and the
- * clone() method is then called to create copies for each thread in a
- * thread group.
- *
- * @see java.lang.Object#clone()
- */
- @Override
- public Object clone() {
- RegExUserParameters up = (RegExUserParameters) super.clone();
- return up;
- }
-
+
+ private Map<String, String> buildParamsMap(){
+ String regExRefName = getRegExRefName()+"_";
+ String grNames = getRegParamNamesGrNr();
+ String grValues = getRegExParamValuesGrNr();
+ JMeterVariables jmvars = getThreadContext().getVariables();
+ // verify if regex groups exists
+ if(jmvars.get(regExRefName + MATCH_NR) == null
+ || jmvars.get(regExRefName + 1 + REGEX_GROUP_SUFFIX + grNames) == null
+ || jmvars.get(regExRefName + 1 + REGEX_GROUP_SUFFIX + grValues) == null){
+ return null;
+ }
+ int n = Integer.parseInt(jmvars.get(regExRefName + MATCH_NR));
+ Map<String, String> map = new HashMap<String, String>(n);
+ for(int i=1; i<=n; i++){
+ map.put(jmvars.get(regExRefName + i + REGEX_GROUP_SUFFIX + grNames),
+ jmvars.get(regExRefName + i + REGEX_GROUP_SUFFIX + grValues));
+ }
+ return map;
+ }
+
+ /**
+ * A new instance is created for each thread group, and the
+ * clone() method is then called to create copies for each thread in a
+ * thread group.
+ *
+ * @see java.lang.Object#clone()
+ */
+ @Override
+ public Object clone() {
+ RegExUserParameters up = (RegExUserParameters) super.clone();
+ return up;
+ }
+
public void setRegExRefName(String str) {
setProperty(REG_EX_REF_NAME, str);
}
Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/gui/RegExUserParametersGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/gui/RegExUserParametersGui.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/gui/RegExUserParametersGui.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/gui/RegExUserParametersGui.java Sun Mar 17 23:28:26 2013
@@ -37,64 +37,64 @@ import org.apache.jorphan.gui.JLabeledTe
* GUI for {@link RegExUserParameters}
*/
public class RegExUserParametersGui extends AbstractPreProcessorGui {
-
- /**
+
+ /**
*
*/
private static final long serialVersionUID = 3080808672311046276L;
- private JLabeledTextField refRegExRefNameField;
-
- private JLabeledTextField paramNamesGrNrField;
-
- private JLabeledTextField paramValuesGrNrField;
-
- public RegExUserParametersGui() {
- super();
- init();
- }
-
- @Override
- public String getLabelResource() {
- return "regex_params_title"; //$NON-NLS-1$
- }
+ private JLabeledTextField refRegExRefNameField;
+
+ private JLabeledTextField paramNamesGrNrField;
+
+ private JLabeledTextField paramValuesGrNrField;
+
+ public RegExUserParametersGui() {
+ super();
+ init();
+ }
+
+ @Override
+ public String getLabelResource() {
+ return "regex_params_title"; //$NON-NLS-1$
+ }
@Override
- public void configure(TestElement el) {
- super.configure(el);
- if (el instanceof RegExUserParameters){
- RegExUserParameters re = (RegExUserParameters) el;
- paramNamesGrNrField.setText(re.getRegParamNamesGrNr());
- paramValuesGrNrField.setText(re.getRegExParamValuesGrNr());
- refRegExRefNameField.setText(re.getRegExRefName());
- }
- }
-
- /**
- * @see org.apache.jmeter.gui.JMeterGUIComponent#createTestElement()
- */
+ public void configure(TestElement el) {
+ super.configure(el);
+ if (el instanceof RegExUserParameters){
+ RegExUserParameters re = (RegExUserParameters) el;
+ paramNamesGrNrField.setText(re.getRegParamNamesGrNr());
+ paramValuesGrNrField.setText(re.getRegExParamValuesGrNr());
+ refRegExRefNameField.setText(re.getRegExRefName());
+ }
+ }
+
+ /**
+ * @see org.apache.jmeter.gui.JMeterGUIComponent#createTestElement()
+ */
@Override
- public TestElement createTestElement() {
- RegExUserParameters regExUserParams = new RegExUserParameters();
- modifyTestElement(regExUserParams);
- return regExUserParams;
- }
-
- /**
- * Modifies a given TestElement to mirror the data in the gui components.
- *
- * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
- */
+ public TestElement createTestElement() {
+ RegExUserParameters regExUserParams = new RegExUserParameters();
+ modifyTestElement(regExUserParams);
+ return regExUserParams;
+ }
+
+ /**
+ * Modifies a given TestElement to mirror the data in the gui components.
+ *
+ * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
+ */
@Override
- public void modifyTestElement(TestElement extractor) {
- super.configureTestElement(extractor);
- if (extractor instanceof RegExUserParameters) {
- RegExUserParameters regExUserParams = (RegExUserParameters) extractor;
- regExUserParams.setRegExRefName(refRegExRefNameField.getText());
- regExUserParams.setRegExParamNamesGrNr(paramNamesGrNrField.getText());
- regExUserParams.setRegExParamValuesGrNr(paramValuesGrNrField.getText());
- }
- }
+ public void modifyTestElement(TestElement extractor) {
+ super.configureTestElement(extractor);
+ if (extractor instanceof RegExUserParameters) {
+ RegExUserParameters regExUserParams = (RegExUserParameters) extractor;
+ regExUserParams.setRegExRefName(refRegExRefNameField.getText());
+ regExUserParams.setRegExParamNamesGrNr(paramNamesGrNrField.getText());
+ regExUserParams.setRegExParamValuesGrNr(paramValuesGrNrField.getText());
+ }
+ }
/**
* Implements JMeterGUIComponent.clearGui
@@ -108,58 +108,58 @@ public class RegExUserParametersGui exte
refRegExRefNameField.setText(""); //$NON-NLS-1$
}
- private void init() {
- setLayout(new BorderLayout());
- setBorder(makeBorder());
-
- Box box = Box.createVerticalBox();
- box.add(makeTitlePanel());
- add(box, BorderLayout.NORTH);
- add(makeParameterPanel(), BorderLayout.CENTER);
- }
-
- private JPanel makeParameterPanel() {
- refRegExRefNameField = new JLabeledTextField(JMeterUtils.getResString("regex_params_ref_name_field")); //$NON-NLS-1$
- paramNamesGrNrField = new JLabeledTextField(JMeterUtils.getResString("regex_params_names_field")); //$NON-NLS-1$
- paramValuesGrNrField = new JLabeledTextField(JMeterUtils.getResString("regex_params_values_field")); //$NON-NLS-1$
-
- JPanel panel = new JPanel(new GridBagLayout());
- GridBagConstraints gbc = new GridBagConstraints();
- initConstraints(gbc);
- addField(panel, refRegExRefNameField, gbc);
- resetContraints(gbc);
- addField(panel, paramNamesGrNrField, gbc);
- resetContraints(gbc);
- gbc.weighty = 1;
- addField(panel, paramValuesGrNrField, gbc);
- return panel;
- }
-
- private void addField(JPanel panel, JLabeledTextField field, GridBagConstraints gbc) {
- List<JComponent> item = field.getComponentList();
- panel.add(item.get(0), gbc.clone());
- gbc.gridx++;
- gbc.weightx = 1;
- gbc.fill=GridBagConstraints.HORIZONTAL;
- panel.add(item.get(1), gbc.clone());
- }
-
- // Next line
- private void resetContraints(GridBagConstraints gbc) {
- gbc.gridx = 0;
- gbc.gridy++;
- gbc.weightx = 0;
+ private void init() {
+ setLayout(new BorderLayout());
+ setBorder(makeBorder());
+
+ Box box = Box.createVerticalBox();
+ box.add(makeTitlePanel());
+ add(box, BorderLayout.NORTH);
+ add(makeParameterPanel(), BorderLayout.CENTER);
+ }
+
+ private JPanel makeParameterPanel() {
+ refRegExRefNameField = new JLabeledTextField(JMeterUtils.getResString("regex_params_ref_name_field")); //$NON-NLS-1$
+ paramNamesGrNrField = new JLabeledTextField(JMeterUtils.getResString("regex_params_names_field")); //$NON-NLS-1$
+ paramValuesGrNrField = new JLabeledTextField(JMeterUtils.getResString("regex_params_values_field")); //$NON-NLS-1$
+
+ JPanel panel = new JPanel(new GridBagLayout());
+ GridBagConstraints gbc = new GridBagConstraints();
+ initConstraints(gbc);
+ addField(panel, refRegExRefNameField, gbc);
+ resetContraints(gbc);
+ addField(panel, paramNamesGrNrField, gbc);
+ resetContraints(gbc);
+ gbc.weighty = 1;
+ addField(panel, paramValuesGrNrField, gbc);
+ return panel;
+ }
+
+ private void addField(JPanel panel, JLabeledTextField field, GridBagConstraints gbc) {
+ List<JComponent> item = field.getComponentList();
+ panel.add(item.get(0), gbc.clone());
+ gbc.gridx++;
+ gbc.weightx = 1;
+ gbc.fill=GridBagConstraints.HORIZONTAL;
+ panel.add(item.get(1), gbc.clone());
+ }
+
+ // Next line
+ private void resetContraints(GridBagConstraints gbc) {
+ gbc.gridx = 0;
+ gbc.gridy++;
+ gbc.weightx = 0;
gbc.fill=GridBagConstraints.NONE;
- }
+ }
- private void initConstraints(GridBagConstraints gbc) {
- gbc.anchor = GridBagConstraints.NORTHWEST;
- gbc.fill = GridBagConstraints.NONE;
- gbc.gridheight = 1;
- gbc.gridwidth = 1;
- gbc.gridx = 0;
- gbc.gridy = 0;
- gbc.weightx = 0;
- gbc.weighty = 0;
- }
+ private void initConstraints(GridBagConstraints gbc) {
+ gbc.anchor = GridBagConstraints.NORTHWEST;
+ gbc.fill = GridBagConstraints.NONE;
+ gbc.gridheight = 1;
+ gbc.gridwidth = 1;
+ gbc.gridx = 0;
+ gbc.gridy = 0;
+ gbc.weightx = 0;
+ gbc.weighty = 0;
+ }
}
Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/RegexpHTMLParser.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/RegexpHTMLParser.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/RegexpHTMLParser.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/parser/RegexpHTMLParser.java Sun Mar 17 23:28:26 2013
@@ -149,57 +149,57 @@ class RegexpHTMLParser extends HTMLParse
Perl5Matcher matcher = null;
try {
matcher = JMeterUtils.getMatcher();
- PatternMatcherInput input = localInput.get();
- // TODO: find a way to avoid the cost of creating a String here --
- // probably a new PatternMatcherInput working on a byte[] would do
- // better.
- input.setInput(new String(html, encoding));
- pattern=JMeterUtils.getPatternCache().getPattern(
- REGEXP,
- Perl5Compiler.CASE_INSENSITIVE_MASK
- | Perl5Compiler.SINGLELINE_MASK
- | Perl5Compiler.READ_ONLY_MASK);
+ PatternMatcherInput input = localInput.get();
+ // TODO: find a way to avoid the cost of creating a String here --
+ // probably a new PatternMatcherInput working on a byte[] would do
+ // better.
+ input.setInput(new String(html, encoding));
+ pattern=JMeterUtils.getPatternCache().getPattern(
+ REGEXP,
+ Perl5Compiler.CASE_INSENSITIVE_MASK
+ | Perl5Compiler.SINGLELINE_MASK
+ | Perl5Compiler.READ_ONLY_MASK);
- while (matcher.contains(input, pattern)) {
- MatchResult match = matcher.getMatch();
- String s;
- if (log.isDebugEnabled()) {
- log.debug("match groups " + match.groups() + " " + match.toString());
- }
- // Check for a BASE HREF:
- for (int g = 1; g <= NUM_BASE_GROUPS && g <= match.groups(); g++) {
- s = match.group(g);
- if (s != null) {
- if (log.isDebugEnabled()) {
- log.debug("new baseUrl: " + s + " - " + baseUrl.toString());
- }
- try {
- baseUrl = ConversionUtils.makeRelativeURL(baseUrl, s);
- } catch (MalformedURLException e) {
- // Doesn't even look like a URL?
- // Maybe it isn't: Ignore the exception.
- if (log.isDebugEnabled()) {
- log.debug("Can't build base URL from RL " + s + " in page " + baseUrl, e);
- }
- }
- }
- }
- for (int g = NUM_BASE_GROUPS + 1; g <= match.groups(); g++) {
- s = match.group(g);
- if (s != null) {
- if (log.isDebugEnabled()) {
- log.debug("group " + g + " - " + match.group(g));
- }
- urls.addURL(s, baseUrl);
- }
- }
- }
- return urls.iterator();
- } catch (UnsupportedEncodingException e) {
- throw new HTMLParseException(e.getMessage(), e);
- } catch (MalformedCachePatternException e) {
- throw new HTMLParseException(e.getMessage(), e);
- } finally {
+ while (matcher.contains(input, pattern)) {
+ MatchResult match = matcher.getMatch();
+ String s;
+ if (log.isDebugEnabled()) {
+ log.debug("match groups " + match.groups() + " " + match.toString());
+ }
+ // Check for a BASE HREF:
+ for (int g = 1; g <= NUM_BASE_GROUPS && g <= match.groups(); g++) {
+ s = match.group(g);
+ if (s != null) {
+ if (log.isDebugEnabled()) {
+ log.debug("new baseUrl: " + s + " - " + baseUrl.toString());
+ }
+ try {
+ baseUrl = ConversionUtils.makeRelativeURL(baseUrl, s);
+ } catch (MalformedURLException e) {
+ // Doesn't even look like a URL?
+ // Maybe it isn't: Ignore the exception.
+ if (log.isDebugEnabled()) {
+ log.debug("Can't build base URL from RL " + s + " in page " + baseUrl, e);
+ }
+ }
+ }
+ }
+ for (int g = NUM_BASE_GROUPS + 1; g <= match.groups(); g++) {
+ s = match.group(g);
+ if (s != null) {
+ if (log.isDebugEnabled()) {
+ log.debug("group " + g + " - " + match.group(g));
+ }
+ urls.addURL(s, baseUrl);
+ }
+ }
+ }
+ return urls.iterator();
+ } catch (UnsupportedEncodingException e) {
+ throw new HTMLParseException(e.getMessage(), e);
+ } catch (MalformedCachePatternException e) {
+ throw new HTMLParseException(e.getMessage(), e);
+ } finally {
JMeterUtils.clearMatcherMemory(matcher, pattern);
}
}
Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java?rev=1457590&r1=1457589&r2=1457590&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java Sun Mar 17 23:28:26 2013
@@ -262,7 +262,7 @@ public class HttpRequestHdr {
}
// Handle IPv6 urls
if(str.startsWith("[")&& str.endsWith("]")) {
- return str.substring(1, str.length()-1);
+ return str.substring(1, str.length()-1);
}
return str;
}