You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2009/08/15 19:20:35 UTC
svn commit: r804491 - in /jakarta/jmeter/trunk:
src/core/org/apache/jmeter/testbeans/gui/
src/core/org/apache/jmeter/testelement/
src/functions/org/apache/jmeter/functions/
src/jorphan/org/apache/jorphan/gui/
src/protocol/http/org/apache/jmeter/protoco...
Author: sebb
Date: Sat Aug 15 17:20:34 2009
New Revision: 804491
URL: http://svn.apache.org/viewvc?rev=804491&view=rev
Log:
Fix up some raw types
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java
jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/TestPlan.java
jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/FileRowColContainer.java
jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/AnchorModifier.java
jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ClientPool.java
jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java
jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/MessageAdmin.java
jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/config/gui/LDAPArguments.java
jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/config/gui/LDAPArgumentsPanel.java
jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LdapClient.java
jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java
jakarta/jmeter/trunk/src/reports/org/apache/jmeter/gui/ReportGuiPackage.java
jakarta/jmeter/trunk/src/reports/org/apache/jmeter/gui/util/ReportMenuBar.java
jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/DataSet.java
jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportDragNDrop.java
jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportSave.java
jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/tree/ReportTreeModel.java
jakarta/jmeter/trunk/src/reports/org/apache/jmeter/testelement/JTLData.java
jakarta/jmeter/trunk/src/reports/org/apache/jmeter/testelement/ReportPlan.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/config/TestCVSDataSet.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/control/TestRandomOrderController.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/control/TestSwitchController.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/engine/util/PackageTest.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/engine/util/TestValueReplacer.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/PackageTest.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexlFunction.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/TestRegexFunction.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/TestTimeFunction.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTest.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTestCase.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/NullURLConnection.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/util/TestHTTPFileArgs.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/PackageTest.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/testelement/BarChartTest.java
jakarta/jmeter/trunk/test/src/org/apache/jmeter/testelement/LineGraphTest.java
jakarta/jmeter/trunk/test/src/org/apache/jorphan/collections/PackageTest.java
Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java (original)
+++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java Sat Aug 15 17:20:34 2009
@@ -147,7 +147,7 @@
/**
* The Map we're currently customizing. Set by setObject().
*/
- private Map propertyMap;
+ private Map<String, Object> propertyMap;
public GenericTestBeanCustomizer(){
log.warn("Constructor only intended for use in testing"); // $NON-NLS-1$
@@ -182,7 +182,7 @@
}
PropertyEditor propertyEditor;
- Class editorClass = descriptors[i].getPropertyEditorClass();
+ Class<?> editorClass = descriptors[i].getPropertyEditorClass();
if (log.isDebugEnabled()) {
log.debug("Property " + name + " has editor class " + editorClass);
@@ -199,7 +199,7 @@
throw new Error(e.toString());
}
} else {
- Class c = descriptors[i].getPropertyType();
+ Class<?> c = descriptors[i].getPropertyType();
propertyEditor = PropertyEditorManager.findEditor(c);
}
@@ -307,13 +307,13 @@
editors[i].setValue(value);
}
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jmeter.gui.JMeterGUIComponent#configure(org.apache.jmeter.testelement.TestElement)
+
+ /**
+ * {@inheritDoc}
+ * @param map must be an instance of Map<String, Object>
*/
public void setObject(Object map) {
- propertyMap = (Map) map;
+ propertyMap = (Map<String, Object>) map;
if (propertyMap.size() == 0) {
// Uninitialized -- set it to the defaults:
@@ -508,12 +508,8 @@
/**
* Comparator used to sort properties for presentation in the GUI.
*/
- private class PropertyComparator implements Comparator, Serializable {
- public int compare(Object o1, Object o2) {
- return compare((PropertyDescriptor) o1, (PropertyDescriptor) o2);
- }
-
- private int compare(PropertyDescriptor d1, PropertyDescriptor d2) {
+ private class PropertyComparator implements Comparator<PropertyDescriptor>, Serializable {
+ public int compare(PropertyDescriptor d1, PropertyDescriptor d2) {
int result;
String g1 = group(d1), g2 = group(d2);
Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/TestPlan.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/TestPlan.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/TestPlan.java (original)
+++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/TestPlan.java Sat Aug 15 17:20:34 2009
@@ -55,7 +55,7 @@
private final static String BASEDIR = "basedir";
- private transient List threadGroups = new LinkedList();
+ private transient List<ThreadGroup> threadGroups = new LinkedList<ThreadGroup>();
// Does not appear to be needed
// private transient List configs = new LinkedList();
@@ -96,7 +96,7 @@
// create transient item
private Object readResolve(){
- threadGroups = new LinkedList();
+ threadGroups = new LinkedList<ThreadGroup>();
return this;
}
@@ -135,7 +135,7 @@
return getVariables();
}
- public Map getUserDefinedVariables() {
+ public Map<String, String> getUserDefinedVariables() {
Arguments args = getVariables();
return args.getArgumentsAsMap();
}
Modified: jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/FileRowColContainer.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/FileRowColContainer.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/FileRowColContainer.java (original)
+++ jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/FileRowColContainer.java Sat Aug 15 17:20:34 2009
@@ -38,7 +38,7 @@
private static final Logger log = LoggingManager.getLoggerForClass();
- private final ArrayList fileData; // Lines in the file, split into columns
+ private final ArrayList<ArrayList<String>> fileData; // Lines in the file, split into columns
private final String fileName; // name of the file
@@ -57,7 +57,7 @@
fileName = file;
delimiter = delim;
nextRow = 0;
- fileData = new ArrayList();
+ fileData = new ArrayList<ArrayList<String>>();
load();
}
@@ -66,7 +66,7 @@
fileName = file;
delimiter = DELIMITER;
nextRow = 0;
- fileData = new ArrayList();
+ fileData = new ArrayList<ArrayList<String>>();
load();
}
@@ -113,7 +113,7 @@
*/
public String getColumn(int row, int col) throws IndexOutOfBoundsException {
String colData;
- colData = (String) ((ArrayList) fileData.get(row)).get(col);
+ colData = fileData.get(row).get(col);
log.debug(fileName + "(" + row + "," + col + "): " + colData);
return colData;
}
@@ -142,8 +142,8 @@
* @return an ArrayList of Strings containing one element for each value in
* the line
*/
- private static ArrayList splitLine(String theLine, String delim) {
- ArrayList result = new ArrayList();
+ private static ArrayList<String> splitLine(String theLine, String delim) {
+ ArrayList<String> result = new ArrayList<String>();
StringTokenizer tokener = new StringTokenizer(theLine, delim, true);
/*
* the beginning of the line is a "delimiter" so that ,a,b,c returns ""
Modified: jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java (original)
+++ jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java Sat Aug 15 17:20:34 2009
@@ -30,6 +30,7 @@
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
+import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
@@ -43,7 +44,7 @@
private final JComboBox choiceList;
// Maybe move to vector if MT problems occur
- private final ArrayList mChangeListeners = new ArrayList(3);
+ private final ArrayList<ChangeListener> mChangeListeners = new ArrayList<ChangeListener>(3);
private JButton delete, add;
@@ -90,8 +91,8 @@
init();
}
- public List getComponentList() {
- List comps = new LinkedList();
+ public List<JComponent> getComponentList() {
+ List<JComponent> comps = new LinkedList<JComponent>();
comps.add(mLabel);
comps.add(choiceList);
return comps;
@@ -274,7 +275,7 @@
private void notifyChangeListeners() {
ChangeEvent ce = new ChangeEvent(this);
for (int index = 0; index < mChangeListeners.size(); index++) {
- ((ChangeListener) mChangeListeners.get(index)).stateChanged(ce);
+ mChangeListeners.get(index).stateChanged(ce);
}
}
Modified: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java (original)
+++ jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java Sat Aug 15 17:20:34 2009
@@ -112,7 +112,7 @@
return COLUMN_RESOURCE_NAMES[column];
}
- public Class getColumnClass(int column) {
+ public Class<?> getColumnClass(int column) {
return COLUMN_RESOURCE_NAMES[column].getClass();
}
@@ -124,7 +124,7 @@
return true;
}
- public Class getGuiClass() {
+ public Class<?> getGuiClass() {
return org.apache.jmeter.protocol.http.gui.AuthPanel.class;
}
Modified: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/AnchorModifier.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/AnchorModifier.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/AnchorModifier.java (original)
+++ jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/AnchorModifier.java Sat Aug 15 17:20:34 2009
@@ -73,7 +73,7 @@
sampler = (HTTPSamplerBase) sam;
result = (HTTPSampleResult) res;
}
- List potentialLinks = new ArrayList();
+ List<HTTPSamplerBase> potentialLinks = new ArrayList<HTTPSamplerBase>();
String responseText = ""; // $NON-NLS-1$
responseText = result.getResponseDataAsString();
Document html;
@@ -89,7 +89,7 @@
addFormUrls(html, result, sampler, potentialLinks);
addFramesetUrls(html, result, sampler, potentialLinks);
if (potentialLinks.size() > 0) {
- HTTPSamplerBase url = (HTTPSamplerBase) potentialLinks.get(rand.nextInt(potentialLinks.size()));
+ HTTPSamplerBase url = potentialLinks.get(rand.nextInt(potentialLinks.size()));
if (log.isDebugEnabled()) {
log.debug("Selected: "+url.toString());
}
@@ -117,7 +117,7 @@
if (log.isDebugEnabled()) {
log.debug("Modifying argument: " + arg);
}
- List possibleReplacements = new ArrayList();
+ List<Argument> possibleReplacements = new ArrayList<Argument>();
PropertyIterator iter = args.iterator();
Argument replacementArg;
while (iter.hasNext()) {
@@ -132,7 +132,7 @@
}
if (possibleReplacements.size() > 0) {
- replacementArg = (Argument) possibleReplacements.get(rand.nextInt(possibleReplacements.size()));
+ replacementArg = possibleReplacements.get(rand.nextInt(possibleReplacements.size()));
arg.setName(replacementArg.getName());
arg.setValue(replacementArg.getValue());
if (log.isDebugEnabled()) {
@@ -145,15 +145,16 @@
public void addConfigElement(ConfigElement config) {
}
- private void addFormUrls(Document html, HTTPSampleResult result, HTTPSamplerBase config, List potentialLinks) {
+ private void addFormUrls(Document html, HTTPSampleResult result, HTTPSamplerBase config,
+ List<HTTPSamplerBase> potentialLinks) {
NodeList rootList = html.getChildNodes();
- List urls = new LinkedList();
+ List<HTTPSamplerBase> urls = new LinkedList<HTTPSamplerBase>();
for (int x = 0; x < rootList.getLength(); x++) {
urls.addAll(HtmlParsingUtils.createURLFromForm(rootList.item(x), result.getURL()));
}
- Iterator iter = urls.iterator();
+ Iterator<HTTPSamplerBase> iter = urls.iterator();
while (iter.hasNext()) {
- HTTPSamplerBase newUrl = (HTTPSamplerBase) iter.next();
+ HTTPSamplerBase newUrl = iter.next();
newUrl.setMethod(HTTPConstants.POST);
if (log.isDebugEnabled()) {
log.debug("Potential Form match: " + newUrl.toString());
@@ -165,7 +166,8 @@
}
}
- private void addAnchorUrls(Document html, HTTPSampleResult result, HTTPSamplerBase config, List potentialLinks) {
+ private void addAnchorUrls(Document html, HTTPSampleResult result, HTTPSamplerBase config,
+ List<HTTPSamplerBase> potentialLinks) {
String base = "";
NodeList baseList = html.getElementsByTagName("base"); // $NON-NLS-1$
if (baseList.getLength() > 0) {
@@ -198,8 +200,9 @@
}
}
}
+
private void addFramesetUrls(Document html, HTTPSampleResult result,
- HTTPSamplerBase config, List potentialLinks) {
+ HTTPSamplerBase config, List<HTTPSamplerBase> potentialLinks) {
String base = "";
NodeList baseList = html.getElementsByTagName("base"); // $NON-NLS-1$
if (baseList.getLength() > 0) {
Modified: jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ClientPool.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ClientPool.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ClientPool.java (original)
+++ jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ClientPool.java Sat Aug 15 17:20:34 2009
@@ -32,9 +32,9 @@
*/
public class ClientPool {
- private static final ArrayList clients = new ArrayList();
+ private static final ArrayList<Object> clients = new ArrayList<Object>();
- private static final HashMap client_map = new HashMap();
+ private static final HashMap<Object, Object> client_map = new HashMap<Object, Object>();
/**
* Add a ReceiveClient to the ClientPool. This is so that we can make sure
@@ -75,7 +75,7 @@
* bugs.
*/
public static synchronized void clearClient() {
- Iterator itr = clients.iterator();
+ Iterator<Object> itr = clients.iterator();
while (itr.hasNext()) {
Object client = itr.next();
if (client instanceof ReceiveSubscriber) {
Modified: jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java (original)
+++ jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java Sat Aug 15 17:20:34 2009
@@ -179,12 +179,12 @@
}
private void addJMSProperties(TextMessage msg) throws JMSException {
- Map map = getArguments(JMSSampler.JMS_PROPERTIES).getArgumentsAsMap();
- Iterator argIt = map.entrySet().iterator();
+ Map<String, String> map = getArguments(JMSSampler.JMS_PROPERTIES).getArgumentsAsMap();
+ Iterator<Map.Entry<String, String>> argIt = map.entrySet().iterator();
while (argIt.hasNext()) {
- Map.Entry me = (Map.Entry) argIt.next();
- String name = (String) me.getKey();
- String value = (String) me.getValue();
+ Map.Entry<String, String> me = argIt.next();
+ String name = me.getKey();
+ String value = me.getValue();
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Adding property [" + name + "=" + value + "]");
}
@@ -369,7 +369,7 @@
}
private Context getInitialContext() throws NamingException {
- Hashtable table = new Hashtable();
+ Hashtable<String, String> table = new Hashtable<String, String>();
if (getInitialContextFactory() != null && getInitialContextFactory().trim().length() > 0) {
if (LOGGER.isDebugEnabled()) {
@@ -383,7 +383,7 @@
}
table.put(Context.PROVIDER_URL, getContextProvider());
}
- Map map = getArguments(JMSSampler.JNDI_PROPERTIES).getArgumentsAsMap();
+ Map<String, String> map = getArguments(JMSSampler.JNDI_PROPERTIES).getArgumentsAsMap();
if (LOGGER.isDebugEnabled()) {
if (map.isEmpty()) {
LOGGER.debug("Empty JNDI properties");
@@ -391,9 +391,9 @@
LOGGER.debug("Number of JNDI properties: " + map.size());
}
}
- Iterator it = map.entrySet().iterator();
+ Iterator<Map.Entry<String, String>> it = map.entrySet().iterator();
while (it.hasNext()) {
- Map.Entry me = (Map.Entry) it.next();
+ Map.Entry<String, String> me = it.next();
table.put(me.getKey(), me.getValue());
}
@@ -405,11 +405,11 @@
}
private void printEnvironment(Context context) throws NamingException {
- Hashtable env = context.getEnvironment();
+ Hashtable<?,?> env = context.getEnvironment();
LOGGER.debug("Initial Context Properties");
- Enumeration keys = env.keys();
+ Enumeration<String> keys = (Enumeration<String>) env.keys();
while (keys.hasMoreElements()) {
- String key = (String) keys.nextElement();
+ String key = keys.nextElement();
LOGGER.debug(key + "=" + env.get(key));
}
}
@@ -500,7 +500,7 @@
* @throws NamingException
*/
private String getPrincipal(Context context) throws NamingException{
- Hashtable env = context.getEnvironment();
+ Hashtable<?,?> env = context.getEnvironment();
return (String) env.get("java.naming.security.principal"); // $NON-NLS-1$
}
@@ -512,7 +512,7 @@
* @throws NamingException
*/
private String getCredentials(Context context) throws NamingException{
- Hashtable env = context.getEnvironment();
+ Hashtable<?,?> env = context.getEnvironment();
return (String) env.get("java.naming.security.credentials"); // $NON-NLS-1$
}
Modified: jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/MessageAdmin.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/MessageAdmin.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/MessageAdmin.java (original)
+++ jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/MessageAdmin.java Sat Aug 15 17:20:34 2009
@@ -33,7 +33,7 @@
public class MessageAdmin {
private static final MessageAdmin SINGLETON = new MessageAdmin();
- private Map table = new Hashtable();
+ private Map<String, PlaceHolder> table = new Hashtable<String, PlaceHolder>();
private static final Logger log = LoggingManager.getLoggerForClass();
@@ -55,7 +55,7 @@
}
public void putReply(String id, Message reply) {
- PlaceHolder holder = (PlaceHolder) table.get(id);
+ PlaceHolder holder = table.get(id);
if (log.isDebugEnabled()) {
log.debug("RPL_ID [" + id + "] for holder " + holder);
}
@@ -77,7 +77,7 @@
* @return the received message or <code>null</code>
*/
public Message get(String id) {
- PlaceHolder holder = (PlaceHolder) table.remove(id);
+ PlaceHolder holder = table.remove(id);
if (log.isDebugEnabled()) {
log.debug("GET_ID [" + id + "] for " + holder);
}
Modified: jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/config/gui/LDAPArguments.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/config/gui/LDAPArguments.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/config/gui/LDAPArguments.java (original)
+++ jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/config/gui/LDAPArguments.java Sat Aug 15 17:20:34 2009
@@ -46,7 +46,7 @@
* Create a new Arguments object with no arguments.
*/
public LDAPArguments() {
- setProperty(new CollectionProperty(ARGUMENTS, new ArrayList()));
+ setProperty(new CollectionProperty(ARGUMENTS, new ArrayList<Object>()));
}
/**
@@ -64,7 +64,7 @@
@Override
public void clear() {
super.clear();
- setProperty(new CollectionProperty(ARGUMENTS, new ArrayList()));
+ setProperty(new CollectionProperty(ARGUMENTS, new ArrayList<Object>()));
}
/**
@@ -73,7 +73,7 @@
* @param arguments
* the new arguments
*/
- public void setArguments(List arguments) {
+ public void setArguments(List<Object> arguments) {
setProperty(new CollectionProperty(ARGUMENTS, arguments));
}
@@ -83,9 +83,9 @@
*
* @return a new Map with String keys and values containing the arguments
*/
- public Map getArgumentsAsMap() {
+ public Map<String, String> getArgumentsAsMap() {
PropertyIterator iter = getArguments().iterator();
- Map argMap = new HashMap();
+ Map<String, String> argMap = new HashMap<String, String>();
while (iter.hasNext()) {
LDAPArgument arg = (LDAPArgument) iter.next().getObjectValue();
argMap.put(arg.getName(), arg.getValue());
Modified: jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/config/gui/LDAPArgumentsPanel.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/config/gui/LDAPArgumentsPanel.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/config/gui/LDAPArgumentsPanel.java (original)
+++ jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/config/gui/LDAPArgumentsPanel.java Sat Aug 15 17:20:34 2009
@@ -132,9 +132,9 @@
if (args instanceof LDAPArguments) {
arguments = (LDAPArguments) args;
arguments.clear();
- Iterator modelData = tableModel.iterator();
+ Iterator<LDAPArgument> modelData = tableModel.iterator();
while (modelData.hasNext()) {
- LDAPArgument arg = (LDAPArgument) modelData.next();
+ LDAPArgument arg = modelData.next();
arg.setMetaData("=");
arguments.addArgument(arg);
}
Modified: jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LdapClient.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LdapClient.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LdapClient.java (original)
+++ jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LdapClient.java Sat Aug 15 17:20:34 2009
@@ -55,7 +55,7 @@
*/
public void connect(String host, String port, String rootdn, String username, String password)
throws NamingException {
- Hashtable env = new Hashtable();
+ Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); //$NON-NLS-1$
env.put(Context.PROVIDER_URL, "ldap://" + host + ":" + port + "/" + rootdn); //$NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$
env.put(Context.REFERRAL, "throw"); //$NON-NLS-1$
@@ -94,7 +94,7 @@
null,// attributes (null = all)
false,// return object ?
false);// dereference links?
- NamingEnumeration ne = dirContext.search(searchBase, searchFilter, searchcontrols);
+ NamingEnumeration<?> ne = dirContext.search(searchBase, searchFilter, searchcontrols);
// System.out.println("Loop "+ne.toString()+" "+ne.hasMore());
// while (ne.hasMore()){
// Object tmp = ne.next();
Modified: jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java (original)
+++ jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java Sat Aug 15 17:20:34 2009
@@ -251,7 +251,7 @@
private static final String protoPrefix = "org.apache.jmeter.protocol.tcp.sampler."; //$NON-NLS-1$
- private Class getClass(String className) {
+ private Class<?> getClass(String className) {
Class<?> c = null;
try {
c = Class.forName(className, false, Thread.currentThread().getContextClassLoader());
Modified: jakarta/jmeter/trunk/src/reports/org/apache/jmeter/gui/ReportGuiPackage.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/reports/org/apache/jmeter/gui/ReportGuiPackage.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/reports/org/apache/jmeter/gui/ReportGuiPackage.java (original)
+++ jakarta/jmeter/trunk/src/reports/org/apache/jmeter/gui/ReportGuiPackage.java Sat Aug 15 17:20:34 2009
@@ -68,19 +68,19 @@
* Map from TestElement to JMeterGUIComponent, mapping the nodes in the tree
* to their corresponding GUI components.
*/
- private Map nodesToGui = new HashMap();
+ private Map<TestElement, JMeterGUIComponent> nodesToGui = new HashMap<TestElement, JMeterGUIComponent>();
/**
* Map from Class to JMeterGUIComponent, mapping the Class of a GUI
* component to an instance of that component.
*/
- private Map guis = new HashMap();
+ private Map<Class<?>, JMeterGUIComponent> guis = new HashMap<Class<?>, JMeterGUIComponent>();
/**
* Map from Class to TestBeanGUI, mapping the Class of a TestBean to an
* instance of TestBeanGUI to be used to edit such components.
*/
- private Map testBeanGUIs = new HashMap();
+ private Map<Class<?>, JMeterGUIComponent> testBeanGUIs = new HashMap<Class<?>, JMeterGUIComponent>();
/** The currently selected node in the tree. */
private ReportTreeNode currentNode = null;
@@ -154,13 +154,13 @@
String testClassName = node.getPropertyAsString(TestElement.TEST_CLASS);
String guiClassName = node.getPropertyAsString(TestElement.GUI_CLASS);
try {
- Class testClass;
+ Class<?> testClass;
if (testClassName.equals("")) {
testClass = node.getClass();
} else {
testClass = Class.forName(testClassName);
}
- Class guiClass = null;
+ Class<?> guiClass = null;
if (!guiClassName.equals("")) {
guiClass = Class.forName(guiClassName);
}
@@ -189,9 +189,9 @@
*
* @return the GUI component corresponding to the specified test element
*/
- public JMeterGUIComponent getGui(TestElement node, Class guiClass, Class testClass) {
+ public JMeterGUIComponent getGui(TestElement node, Class<?> guiClass, Class<?> testClass) {
try {
- JMeterGUIComponent comp = (JMeterGUIComponent) nodesToGui.get(node);
+ JMeterGUIComponent comp = nodesToGui.get(node);
if (comp == null) {
comp = getGuiFromCache(guiClass, testClass);
nodesToGui.put(node, comp);
@@ -258,7 +258,7 @@
* this GUI component.
* @return the test element corresponding to the specified GUI class.
*/
- public TestElement createTestElement(Class guiClass, Class testClass) {
+ public TestElement createTestElement(Class<?> guiClass, Class<?> testClass) {
try {
JMeterGUIComponent comp = getGuiFromCache(guiClass, testClass);
comp.clearGui();
@@ -284,7 +284,7 @@
*/
public TestElement createTestElement(String objClass) {
JMeterGUIComponent comp;
- Class c;
+ Class<?> c;
try {
c = Class.forName(objClass);
if (TestBean.class.isAssignableFrom(c)) {
@@ -338,17 +338,17 @@
* @throws ClassNotFoundException
* if the specified GUI class cannot be found
*/
- private JMeterGUIComponent getGuiFromCache(Class guiClass, Class testClass) throws InstantiationException,
+ private JMeterGUIComponent getGuiFromCache(Class<?> guiClass, Class<?> testClass) throws InstantiationException,
IllegalAccessException {
JMeterGUIComponent comp;
if (guiClass == TestBeanGUI.class) {
- comp = (TestBeanGUI) testBeanGUIs.get(testClass);
+ comp = testBeanGUIs.get(testClass);
if (comp == null) {
comp = new TestBeanGUI(testClass);
testBeanGUIs.put(testClass, comp);
}
} else {
- comp = (JMeterGUIComponent) guis.get(guiClass);
+ comp = guis.get(guiClass);
if (comp == null) {
comp = (JMeterGUIComponent) guiClass.newInstance();
if (!(comp instanceof UnsharedComponent)) {
@@ -566,9 +566,9 @@
// Forget about all GUIs we've created so far: we'll need to re-created
// them all!
- guis = new HashMap();
- nodesToGui = new HashMap();
- testBeanGUIs = new HashMap();
+ guis = new HashMap<Class<?>, JMeterGUIComponent>();
+ nodesToGui = new HashMap<TestElement, JMeterGUIComponent>();
+ testBeanGUIs = new HashMap<Class<?>, JMeterGUIComponent>();
// BeanInfo objects also contain locale-sensitive data -- flush them
// away:
Modified: jakarta/jmeter/trunk/src/reports/org/apache/jmeter/gui/util/ReportMenuBar.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/reports/org/apache/jmeter/gui/util/ReportMenuBar.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/reports/org/apache/jmeter/gui/util/ReportMenuBar.java (original)
+++ jakarta/jmeter/trunk/src/reports/org/apache/jmeter/gui/util/ReportMenuBar.java Sat Aug 15 17:20:34 2009
@@ -75,7 +75,7 @@
private JMenuItem remote_start_all;
- private final Collection remote_engine_start;
+ private final Collection<JMenuItem> remote_engine_start;
private JMenuItem run_stop;
@@ -85,7 +85,7 @@
private JMenuItem remote_stop_all;
- private final Collection remote_engine_stop;
+ private final Collection<JMenuItem> remote_engine_stop;
private JMenuItem run_clear;
@@ -109,12 +109,12 @@
private JMenuItem remote_exit_all;
- private final Collection remote_engine_exit;
+ private final Collection<JMenuItem> remote_engine_exit;
public ReportMenuBar() {
- remote_engine_start = new LinkedList();
- remote_engine_stop = new LinkedList();
- remote_engine_exit = new LinkedList();
+ remote_engine_start = new LinkedList<JMenuItem>();
+ remote_engine_stop = new LinkedList<JMenuItem>();
+ remote_engine_exit = new LinkedList<JMenuItem>();
remoteHosts = JOrphanUtils.split(JMeterUtils.getPropDefault("remote_hosts", ""), ",");
if (remoteHosts.length == 1 && remoteHosts[0].equals("")) {
remoteHosts = new String[0];
@@ -409,13 +409,13 @@
public void setRunning(boolean running, String host) {
log.info("setRunning(" + running + "," + host + ")");
- Iterator iter = remote_engine_start.iterator();
- Iterator iter2 = remote_engine_stop.iterator();
- Iterator iter3 = remote_engine_exit.iterator();
+ Iterator<JMenuItem> iter = remote_engine_start.iterator();
+ Iterator<JMenuItem> iter2 = remote_engine_stop.iterator();
+ Iterator<JMenuItem> iter3 = remote_engine_exit.iterator();
while (iter.hasNext() && iter2.hasNext() && iter3.hasNext()) {
- JMenuItem start = (JMenuItem) iter.next();
- JMenuItem stop = (JMenuItem) iter2.next();
- JMenuItem exit = (JMenuItem) iter3.next();
+ JMenuItem start = iter.next();
+ JMenuItem stop = iter2.next();
+ JMenuItem exit = iter3.next();
if (start.getText().equals(host)) {
log.info("Found start host: " + start.getText());
start.setEnabled(!running);
Modified: jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/DataSet.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/DataSet.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/DataSet.java (original)
+++ jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/DataSet.java Sat Aug 15 17:20:34 2009
@@ -86,24 +86,24 @@
* Classes implementing the method should return the URL's in the
* DataSet. It is up to the class to return Strings or URL.
*/
- public Set getURLs();
+ public Set<?> getURLs();
/**
* Classes implementing the method should return instance of
* SamplingStatCalculator.
* @return the set of statistics
*/
- public Set getStats();
+ public Set<SamplingStatCalculator> getStats();
/**
* Return the SamplingStatCalculator for a specific URL.
* @param url
*/
public SamplingStatCalculator getStatistics(String url);
/**
- * Convienance method for getting all the SamplingStatCalculators for
+ * Convienence method for getting all the SamplingStatCalculators for
* a given URL.
* @param urls
*/
- public List getStats(List urls);
+ public List<SamplingStatCalculator> getStats(List urls);
/**
* Classes implementing the method should load the data from
* the target location. It doesn't necessarily have to be a
Modified: jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportDragNDrop.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportDragNDrop.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportDragNDrop.java (original)
+++ jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportDragNDrop.java Sat Aug 15 17:20:34 2009
@@ -72,13 +72,15 @@
} else if (INSERT_BEFORE.equals(action) && canAddTo(parentNode)) {
removeNodesFromParents(draggedNodes);
for (int i = 0; i < draggedNodes.length; i++) {
- int index = parentNode.getIndex(currentNode);
+ @SuppressWarnings("null")
+ int index = parentNode.getIndex(currentNode); // can't be null - this is checked by canAddTo
ReportGuiPackage.getInstance().getTreeModel().insertNodeInto(draggedNodes[i], parentNode, index);
}
} else if (INSERT_AFTER.equals(action) && canAddTo(parentNode)) {
removeNodesFromParents(draggedNodes);
for (int i = 0; i < draggedNodes.length; i++) {
- int index = parentNode.getIndex(currentNode) + 1;
+ @SuppressWarnings("null")
+ int index = parentNode.getIndex(currentNode) + 1; // can't be null - this is checked by canAddTo
ReportGuiPackage.getInstance().getTreeModel().insertNodeInto(draggedNodes[i], parentNode, index);
}
}
Modified: jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportSave.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportSave.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportSave.java (original)
+++ jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportSave.java Sat Aug 15 17:20:34 2009
@@ -126,9 +126,9 @@
}
private void convertSubTree(HashTree tree) {
- Iterator iter = new LinkedList(tree.list()).iterator();
+ Iterator<ReportTreeNode> iter = new LinkedList<ReportTreeNode>(tree.list()).iterator();
while (iter.hasNext()) {
- ReportTreeNode item = (ReportTreeNode) iter.next();
+ ReportTreeNode item = iter.next();
convertSubTree(tree.getTree(item));
TestElement testElement = item.getTestElement();
tree.replace(item, testElement);
Modified: jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/tree/ReportTreeModel.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/tree/ReportTreeModel.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/tree/ReportTreeModel.java (original)
+++ jakarta/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/tree/ReportTreeModel.java Sat Aug 15 17:20:34 2009
@@ -49,8 +49,8 @@
* Returns a list of tree nodes that hold objects of the given class type.
* If none are found, an empty list is returned.
*/
- public List getNodesOfType(Class type) {
- List nodeList = new LinkedList();
+ public List<ReportTreeNode> getNodesOfType(Class<?> type) {
+ List<ReportTreeNode> nodeList = new LinkedList<ReportTreeNode>();
traverseAndFind(type, (ReportTreeNode) this.getRoot(), nodeList);
return nodeList;
}
@@ -68,9 +68,9 @@
*/
public HashTree addSubTree(HashTree subTree, ReportTreeNode current)
throws IllegalUserActionException {
- Iterator iter = subTree.list().iterator();
+ Iterator<TestElement> iter = subTree.list().iterator();
while (iter.hasNext()) {
- TestElement item = (TestElement) iter.next();
+ TestElement item = iter.next();
if (item instanceof ReportPlan) {
current = (ReportTreeNode) ((ReportTreeNode) getRoot())
.getChildAt(0);
@@ -126,13 +126,13 @@
}
}
- private void traverseAndFind(Class type, ReportTreeNode node, List nodeList) {
+ private void traverseAndFind(Class<?> type, ReportTreeNode node, List<ReportTreeNode> nodeList) {
if (type.isInstance(node.getUserObject())) {
nodeList.add(node);
}
- Enumeration enumNode = node.children();
+ Enumeration<ReportTreeNode> enumNode = node.children();
while (enumNode.hasMoreElements()) {
- ReportTreeNode child = (ReportTreeNode) enumNode.nextElement();
+ ReportTreeNode child = enumNode.nextElement();
traverseAndFind(type, child, nodeList);
}
}
@@ -142,9 +142,9 @@
if (userObject == node.getUserObject()) {
return node;
}
- Enumeration enumNode = node.children();
+ Enumeration<ReportTreeNode> enumNode = node.children();
while (enumNode.hasMoreElements()) {
- ReportTreeNode child = (ReportTreeNode) enumNode.nextElement();
+ ReportTreeNode child = enumNode.nextElement();
ReportTreeNode result = traverseAndFind(userObject, child);
if (result != null) {
return result;
@@ -155,9 +155,9 @@
public HashTree getCurrentSubTree(ReportTreeNode node) {
ListedHashTree hashTree = new ListedHashTree(node);
- Enumeration enumNode = node.children();
+ Enumeration<ReportTreeNode> enumNode = node.children();
while (enumNode.hasMoreElements()) {
- ReportTreeNode child = (ReportTreeNode) enumNode.nextElement();
+ ReportTreeNode child = enumNode.nextElement();
hashTree.add(node, getCurrentSubTree(child));
}
return hashTree;
Modified: jakarta/jmeter/trunk/src/reports/org/apache/jmeter/testelement/JTLData.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/reports/org/apache/jmeter/testelement/JTLData.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/reports/org/apache/jmeter/testelement/JTLData.java (original)
+++ jakarta/jmeter/trunk/src/reports/org/apache/jmeter/testelement/JTLData.java Sat Aug 15 17:20:34 2009
@@ -40,7 +40,7 @@
*/
public class JTLData implements Serializable, DataSet {
- protected HashMap data = new HashMap();
+ protected final HashMap<String, SamplingStatCalculator> data = new HashMap<String, SamplingStatCalculator>();
protected String jtl_file = null;
protected long startTimestamp = 0;
protected long endTimestamp = 0;
@@ -57,7 +57,7 @@
* Return a Set of the URLs
* @return set of URLs
*/
- public Set getURLs() {
+ public Set<?> getURLs() {
return this.data.keySet();
}
@@ -65,14 +65,15 @@
* Return a Set of the values
* @return values
*/
- public Set getStats() {
- return this.data.entrySet();
+ public Set<SamplingStatCalculator> getStats() {
+ return (Set<SamplingStatCalculator>) this.data.values();
}
/**
* The purpose of the method is to make it convienant to pass a list
* of the URLs and return a list of the SamplingStatCalculators. If
* no URLs match, the list is empty.
+ * TODO - this method seems to be wrong - it does not agree with the Javadoc
* The SamplingStatCalculators will be returned in the same sequence
* as the url list.
* @param urls
@@ -155,7 +156,7 @@
*/
public SamplingStatCalculator getStatistics(String url) {
if (this.data.containsKey(url)) {
- return (SamplingStatCalculator)this.data.get(url);
+ return this.data.get(url);
} else {
return null;
}
@@ -195,7 +196,7 @@
if (url == null) {
url = sample.getURL().toString();
}
- SamplingStatCalculator row = (SamplingStatCalculator)data.get(url);
+ SamplingStatCalculator row = data.get(url);
if (row == null) {
row = new SamplingStatCalculator();
// just like the aggregate listener, we use the sample label to represent
Modified: jakarta/jmeter/trunk/src/reports/org/apache/jmeter/testelement/ReportPlan.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/reports/org/apache/jmeter/testelement/ReportPlan.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/reports/org/apache/jmeter/testelement/ReportPlan.java (original)
+++ jakarta/jmeter/trunk/src/reports/org/apache/jmeter/testelement/ReportPlan.java Sat Aug 15 17:20:34 2009
@@ -50,11 +50,11 @@
public static final String BASEDIR = "ReportPlan.basedir";
- private transient List reportPages = new LinkedList();
+ private transient List<ThreadGroup> reportPages = new LinkedList<ThreadGroup>();
- private transient List configs = new LinkedList();
+ private transient List<ConfigElement> configs = new LinkedList<ConfigElement>();
- private static final List itemsCanAdd = new LinkedList();
+ private static final List<String> itemsCanAdd = new LinkedList<String>();
private static ReportPlan plan;
@@ -86,7 +86,7 @@
setProperty(BASEDIR, b);
}
- public Map getUserDefinedVariables() {
+ public Map<String, String> getUserDefinedVariables() {
Arguments args = getVariables();
return args.getArgumentsAsMap();
}
@@ -144,7 +144,7 @@
*
* @return the ThreadGroups value
*/
- public Collection getReportPages() {
+ public Collection<ThreadGroup> getReportPages() {
return reportPages;
}
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/config/TestCVSDataSet.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/config/TestCVSDataSet.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/config/TestCVSDataSet.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/config/TestCVSDataSet.java Sat Aug 15 17:20:34 2009
@@ -105,7 +105,7 @@
JMeterVariables threadVars = jmcx.getVariables();
threadVars.put("b", "value");
- CSVDataSetBeanInfo cbi = new CSVDataSetBeanInfo(); // needs to be initialised
+ new CSVDataSetBeanInfo(); // needs to be initialised
CSVDataSet csv0 = initCSV();
CSVDataSet csv1 = initCSV();
assertNull(csv1.getShareMode());
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/control/TestRandomOrderController.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/control/TestRandomOrderController.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/control/TestRandomOrderController.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/control/TestRandomOrderController.java Sat Aug 15 17:20:34 2009
@@ -37,7 +37,7 @@
roc.addTestElement(new TestSampler("two"));
roc.addTestElement(new TestSampler("three"));
TestElement sampler = null;
- List usedSamplers = new ArrayList();
+ List<String> usedSamplers = new ArrayList<String>();
roc.initialize();
while ((sampler = roc.next()) != null) {
String samplerName = sampler.getName();
@@ -59,7 +59,7 @@
RandomOrderController roc = new RandomOrderController();
roc.addTestElement(new TestSampler("zero"));
TestElement sampler = null;
- List usedSamplers = new ArrayList();
+ List<String> usedSamplers = new ArrayList<String>();
roc.initialize();
while ((sampler = roc.next()) != null) {
String samplerName = sampler.getName();
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/control/TestSwitchController.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/control/TestSwitchController.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/control/TestSwitchController.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/control/TestSwitchController.java Sat Aug 15 17:20:34 2009
@@ -252,7 +252,7 @@
*/
public void testFunction() throws Exception {
JMeterContext jmctx = JMeterContextService.getContext();
- Map variables = new HashMap();
+ Map<?, ?> variables = new HashMap<Object, Object>();
ReplaceStringWithFunctions transformer = new ReplaceStringWithFunctions(new CompoundVariable(), variables);
jmctx.setVariables(new JMeterVariables());
JMeterVariables jmvars = jmctx.getVariables();
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/engine/util/PackageTest.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/engine/util/PackageTest.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/engine/util/PackageTest.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/engine/util/PackageTest.java Sat Aug 15 17:20:34 2009
@@ -37,7 +37,7 @@
* as it is needed to resolve the functions.
*/
public class PackageTest extends JMeterTestCase {
- private Map variables;
+ private Map<String, String> variables;
private SampleResult result;
@@ -52,7 +52,7 @@
@Override
public void setUp() {
jmctx = JMeterContextService.getContext();
- variables = new HashMap();
+ variables = new HashMap<String, String>();
variables.put("my_regex", ".*");
variables.put("server", "jakarta.apache.org");
result = new SampleResult();
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/engine/util/TestValueReplacer.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/engine/util/TestValueReplacer.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/engine/util/TestValueReplacer.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/engine/util/TestValueReplacer.java Sat Aug 15 17:20:34 2009
@@ -59,13 +59,13 @@
assertTrue(replacer.containsKey("server"));
TestElement element = new TestPlan();
element.setProperty(new StringProperty("domain", "jakarta.apache.org"));
- List args = new ArrayList();
+ List<Object> args = new ArrayList<Object>();
args.add("username is jack");
args.add("his_password");
element.setProperty(new CollectionProperty("args", args));
replacer.reverseReplace(element);
assertEquals("${server}", element.getPropertyAsString("domain"));
- args = (List) element.getProperty("args").getObjectValue();
+ args = (List<Object>) element.getProperty("args").getObjectValue();
assertEquals("username is ${username}", ((JMeterProperty) args.get(0)).getStringValue());
assertEquals("${password}", ((JMeterProperty) args.get(1)).getStringValue());
}
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/PackageTest.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/PackageTest.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/PackageTest.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/PackageTest.java Sat Aug 15 17:20:34 2009
@@ -64,7 +64,7 @@
// Create the CSVRead function and set its parameters.
private static CSVRead setCSVReadParams(String p1, String p2) throws Exception {
CSVRead cr = new CSVRead();
- Collection parms = new LinkedList();
+ Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
if (p1 != null) {
parms.add(new CompoundVariable(p1));
}
@@ -78,7 +78,7 @@
// Create the StringFromFile function and set its parameters.
private static StringFromFile SFFParams(String p1, String p2, String p3, String p4) throws Exception {
StringFromFile sff = new StringFromFile();
- Collection parms = new LinkedList();
+ Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
if (p1 != null) {
parms.add(new CompoundVariable(p1));
}
@@ -98,7 +98,7 @@
// Create the SplitFile function and set its parameters.
private static SplitFunction SplitParams(String p1, String p2, String p3) throws Exception {
SplitFunction split = new SplitFunction();
- Collection parms = new LinkedList();
+ Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
parms.add(new CompoundVariable(p1));
if (p2 != null) {
parms.add(new CompoundVariable(p2));
@@ -117,8 +117,8 @@
return bsh;
}
- private static Collection MakeParams(String p1, String p2, String p3) {
- Collection parms = new LinkedList();
+ private static Collection<CompoundVariable> MakeParams(String p1, String p2, String p3) {
+ Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
if (p1 != null) {
parms.add(new CompoundVariable(p1));
}
@@ -823,7 +823,7 @@
}
private XPath setupXPath(String file, String expr) throws Exception{
- Collection parms = new LinkedList();
+ Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
parms.add(new CompoundVariable(file));
parms.add(new CompoundVariable(expr));
XPath xp = new XPath();
@@ -835,7 +835,7 @@
public void randomTest1() throws Exception {
Random r = new Random();
- Collection parms = MakeParams("0","10000000000","VAR");
+ Collection<CompoundVariable> parms = MakeParams("0","10000000000","VAR");
r.setParameters(parms);
//String s =
r.execute(null,null);
@@ -848,7 +848,7 @@
vars.put("one","1");
vars.put("two","2");
vars.put("V","A");
- Collection parms;
+ Collection<CompoundVariable> parms;
String s;
parms = MakeParams("V",null,null);
@@ -892,7 +892,7 @@
vars.put("query","select ${column} from ${table}");
vars.put("column","name");
vars.put("table","customers");
- Collection parms;
+ Collection<CompoundVariable> parms;
String s;
parms = MakeParams("${query}",null,null);
@@ -907,7 +907,7 @@
vars.put("query","select ${column} from ${table}");
vars.put("column","name");
vars.put("table","customers");
- Collection parms;
+ Collection<CompoundVariable> parms;
String s;
parms = MakeParams("query",null,null);
@@ -947,7 +947,7 @@
// Perform a sum and check the results
private void checkSum(AbstractFunction func, String value, String [] addends) throws Exception {
- Collection parms = new LinkedList();
+ Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
for (int i=0; i< addends.length; i++){
parms.add(new CompoundVariable(addends[i]));
}
@@ -958,7 +958,7 @@
}
// Perform a sum and check the results
private void checkSumNoVar(AbstractFunction func, String value, String [] addends) throws Exception {
- Collection parms = new LinkedList();
+ Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
for (int i=0; i< addends.length; i++){
parms.add(new CompoundVariable(addends[i]));
}
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexlFunction.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexlFunction.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexlFunction.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/TestJexlFunction.java Sat Aug 15 17:20:34 2009
@@ -33,7 +33,7 @@
SampleResult result;
- Collection params;
+ Collection<CompoundVariable> params;
private JMeterVariables vars;
@@ -53,7 +53,7 @@
vars = new JMeterVariables();
jmctx.setVariables(vars);
jmctx.setPreviousResult(result);
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
}
public void testParameterCount() throws Exception {
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/TestRegexFunction.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/TestRegexFunction.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/TestRegexFunction.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/TestRegexFunction.java Sat Aug 15 17:20:34 2009
@@ -35,7 +35,7 @@
SampleResult result;
- Collection params;
+ Collection<CompoundVariable> params;
private JMeterVariables vars;
@@ -66,7 +66,7 @@
}
public void testVariableExtraction() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
params.add(new CompoundVariable("$2$"));
params.add(new CompoundVariable("2"));
@@ -77,7 +77,7 @@
// Test with output variable name
public void testVariableExtraction1a() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
params.add(new CompoundVariable("$2$")); // template
params.add(new CompoundVariable("2")); // match number
@@ -96,7 +96,7 @@
// Test with empty output variable name
public void testVariableExtraction1b() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
params.add(new CompoundVariable("$2$")); // template
params.add(new CompoundVariable("2")); // match number
@@ -110,7 +110,7 @@
}
public void testVariableExtractionFromVariable() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
params.add(new CompoundVariable("$2$")); // template
params.add(new CompoundVariable("1")); // match number
@@ -129,7 +129,7 @@
}
public void testVariableExtractionFromVariable2() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
params.add(new CompoundVariable("$1$$2$")); // template
params.add(new CompoundVariable("1")); // match number
@@ -148,7 +148,7 @@
}
public void testVariableExtractionFromVariable3() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
params.add(new CompoundVariable("pre$2$post")); // template
params.add(new CompoundVariable("1")); // match number
@@ -167,7 +167,7 @@
}
public void testVariableExtractionFromVariable4() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
params.add(new CompoundVariable("pre$2$")); // template
params.add(new CompoundVariable("1")); // match number
@@ -186,7 +186,7 @@
}
public void testVariableExtractionFromVariable5() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
params.add(new CompoundVariable("$2$post")); // template
params.add(new CompoundVariable("1")); // match number
@@ -205,7 +205,7 @@
}
public void testVariableExtractionFromVariable6() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
params.add(new CompoundVariable("$2$$2$")); // template
params.add(new CompoundVariable("1")); // match number
@@ -224,7 +224,7 @@
}
public void testVariableExtractionFromVariable7() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
params.add(new CompoundVariable("pre$1$mid$2$post")); // template
params.add(new CompoundVariable("1")); // match number
@@ -243,7 +243,7 @@
}
public void testVariableExtractionFromVariable8() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
params.add(new CompoundVariable("pre$1$mid$2$")); // template
params.add(new CompoundVariable("1")); // match number
@@ -262,7 +262,7 @@
}
public void testVariableExtractionFromVariable9() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("(\\d+)\\s+(\\w+)"));
params.add(new CompoundVariable("$1$mid$2$post")); // template
params.add(new CompoundVariable("1")); // match number
@@ -281,7 +281,7 @@
}
public void testVariableExtraction2() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
params.add(new CompoundVariable("$1$"));
params.add(new CompoundVariable("3"));
@@ -291,7 +291,7 @@
}
public void testVariableExtraction5() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
params.add(new CompoundVariable("$1$"));
params.add(new CompoundVariable("ALL"));
@@ -302,7 +302,7 @@
}
public void testVariableExtraction6() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
params.add(new CompoundVariable("$2$"));
params.add(new CompoundVariable("4"));
@@ -314,7 +314,7 @@
}
public void testComma() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("<value,? field=\"(pinposition\\d+)\">(\\d+)</value>"));
params.add(new CompoundVariable("$1$"));
params.add(new CompoundVariable("3"));
@@ -324,7 +324,7 @@
}
public void testVariableExtraction3() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
params.add(new CompoundVariable("_$1$"));
params.add(new CompoundVariable("2"));
@@ -334,7 +334,7 @@
}
public void testVariableExtraction4() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
params.add(new CompoundVariable("$2$, "));
params.add(new CompoundVariable(".333"));
@@ -344,7 +344,7 @@
}
public void testDefaultValue() throws Exception {
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
params.add(new CompoundVariable("<value,, field=\"(pinposition\\d+)\">(\\d+)</value>"));
params.add(new CompoundVariable("$2$, "));
params.add(new CompoundVariable(".333"));
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/TestTimeFunction.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/TestTimeFunction.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/TestTimeFunction.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/functions/TestTimeFunction.java Sat Aug 15 17:20:34 2009
@@ -34,7 +34,7 @@
private SampleResult result;
- private Collection params;
+ private Collection<CompoundVariable> params;
private JMeterVariables vars;
@@ -52,7 +52,7 @@
vars = new JMeterVariables();
jmctx.setVariables(vars);
jmctx.setPreviousResult(result);
- params = new LinkedList();
+ params = new LinkedList<CompoundVariable>();
result = new SampleResult();
variable = new TimeFunction();
}
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTest.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTest.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTest.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTest.java Sat Aug 15 17:20:34 2009
@@ -170,11 +170,11 @@
doc = bldr.build(compref);
Element root = doc.getRootElement();
Element body = root.getChild("body");
- List sections = body.getChildren("section");
+ List<Element> sections = body.getChildren("section");
for (int i = 0; i < sections.size(); i++) {
- List components = ((Element) sections.get(i)).getChildren("component");
+ List<Element> components = sections.get(i).getChildren("component");
for (int j = 0; j < components.size(); j++) {
- Element comp = (Element) components.get(j);
+ Element comp = components.get(j);
String nm=comp.getAttributeValue("name");
if (!nm.equals("SSL Manager")){// Not a true GUI component
guiTitles.put(nm.replace(' ','_'), Boolean.FALSE);
@@ -198,11 +198,11 @@
doc = bldr.build(compref);
Element root = doc.getRootElement();
Element body = root.getChild("body");
- List sections = body.getChildren("section");
+ List<Element> sections = body.getChildren("section");
for (int i = 0; i < sections.size(); i++) {
- List components = ((Element) sections.get(i)).getChildren("component");
+ List<Element> components = sections.get(i).getChildren("component");
for (int j = 0; j < components.size(); j++) {
- Element comp = (Element) components.get(j);
+ Element comp = components.get(j);
guiTags.put(comp.getAttributeValue("tag"), Boolean.FALSE);
}
}
@@ -221,11 +221,11 @@
Element root = doc.getRootElement();
Element body = root.getChild("body");
Element section = body.getChild("section");
- List sections = section.getChildren("subsection");
+ List<Element> sections = section.getChildren("subsection");
for (int i = 0; i < sections.size(); i++) {
- List components = ((Element) sections.get(i)).getChildren("component");
+ List<Element> components = sections.get(i).getChildren("component");
for (int j = 0; j < components.size(); j++) {
- Element comp = (Element) components.get(j);
+ Element comp = components.get(j);
funcTitles.put(comp.getAttributeValue("name"), Boolean.FALSE);
}
}
@@ -267,7 +267,7 @@
*/
private static Test suiteGUIComponents() throws Exception {
TestSuite suite = new TestSuite("GuiComponents");
- Iterator iter = getObjects(JMeterGUIComponent.class).iterator();
+ Iterator<Object> iter = getObjects(JMeterGUIComponent.class).iterator();
while (iter.hasNext()) {
JMeterGUIComponent item = (JMeterGUIComponent) iter.next();
if (item instanceof JMeterTreeNode) {
@@ -295,7 +295,7 @@
*/
private static Test suiteFunctions() throws Exception {
TestSuite suite = new TestSuite("Functions");
- Iterator iter = getObjects(Function.class).iterator();
+ Iterator<Object> iter = getObjects(Function.class).iterator();
while (iter.hasNext()) {
Object item = iter.next();
if (item.getClass().equals(CompoundVariable.class)) {
@@ -314,7 +314,7 @@
*/
private static Test suiteBeanComponents() throws Exception {
TestSuite suite = new TestSuite("BeanComponents");
- Iterator iter = getObjects(TestBean.class).iterator();
+ Iterator<Object> iter = getObjects(TestBean.class).iterator();
while (iter.hasNext()) {
Class<? extends Object> c = iter.next().getClass();
try {
@@ -463,7 +463,7 @@
*/
private static Test suiteSerializableElements() throws Exception {
TestSuite suite = new TestSuite("SerializableElements");
- Iterator iter = getObjects(Serializable.class).iterator();
+ Iterator<Object> iter = getObjects(Serializable.class).iterator();
while (iter.hasNext()) {
Serializable serObj = (Serializable) iter.next();
if (serObj.getClass().getName().endsWith("_Stub")) {
@@ -502,7 +502,7 @@
*/
private static Test suiteTestElements() throws Exception {
TestSuite suite = new TestSuite("TestElements");
- Iterator iter = getObjects(TestElement.class).iterator();
+ Iterator<Object> iter = getObjects(TestElement.class).iterator();
while (iter.hasNext()) {
TestElement item = (TestElement) iter.next();
TestSuite ts = new TestSuite(item.getClass().getName());
@@ -543,12 +543,12 @@
}
}
- private static Collection getObjects(Class<?> extendsClass) throws Exception {
+ private static Collection<Object> getObjects(Class<?> extendsClass) throws Exception {
String exName = extendsClass.getName();
Object myThis = "";
Iterator<String> classes = ClassFinder
.findClassesThatExtend(JMeterUtils.getSearchPaths(), new Class[] { extendsClass }).iterator();
- List objects = new LinkedList();
+ List<Object> objects = new LinkedList<Object>();
String n = "";
boolean caughtError = true;
Throwable caught = null;
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTestCase.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTestCase.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTestCase.java Sat Aug 15 17:20:34 2009
@@ -26,6 +26,7 @@
import junit.framework.TestCase;
+import org.apache.jmeter.engine.util.CompoundVariable;
import org.apache.jmeter.functions.AbstractFunction;
import org.apache.jmeter.functions.InvalidVariableException;
import org.apache.jmeter.util.JMeterUtils;
@@ -125,7 +126,7 @@
protected void checkInvalidParameterCounts(AbstractFunction func, int minimum)
throws Exception {
- Collection parms = new LinkedList();
+ Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
for (int c = 0; c < minimum; c++) {
try {
func.setParameters(parms);
@@ -133,14 +134,14 @@
+ " parameters");
} catch (InvalidVariableException ignored) {
}
- parms.add("");
+ parms.add(new CompoundVariable());
}
func.setParameters(parms);
}
protected void checkInvalidParameterCounts(AbstractFunction func, int min,
int max) throws Exception {
- Collection parms = new LinkedList();
+ Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
for (int count = 0; count < min; count++) {
try {
func.setParameters(parms);
@@ -148,13 +149,13 @@
+ " parameters");
} catch (InvalidVariableException ignored) {
}
- parms.add("");
+ parms.add(new CompoundVariable());
}
for (int count = min; count <= max; count++) {
func.setParameters(parms);
- parms.add("");
+ parms.add(new CompoundVariable());
}
- parms.add("");
+ parms.add(new CompoundVariable());
try {
func.setParameters(parms);
fail("Should have generated InvalidVariableException for " + parms.size()
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/NullURLConnection.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/NullURLConnection.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/NullURLConnection.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/NullURLConnection.java Sat Aug 15 17:20:34 2009
@@ -21,7 +21,6 @@
import java.net.URL;
import java.net.URLConnection;
import java.net.MalformedURLException;
-import java.util.Map;
import java.util.Properties;
/**
@@ -31,7 +30,7 @@
*/
public final class NullURLConnection extends URLConnection {
- private Map data = new Properties();
+ private Properties data = new Properties();
public NullURLConnection() throws MalformedURLException {
this(new URL("http://localhost"));
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java Sat Aug 15 17:20:34 2009
@@ -882,7 +882,7 @@
*/
private static class StubURLConnection extends HttpURLConnection {
private ByteArrayOutputStream output = new ByteArrayOutputStream();
- private Map properties = new HashMap();
+ private Map<String, String> properties = new HashMap<String, String>();
public StubURLConnection(String url) throws MalformedURLException {
super(new URL(url));
@@ -908,7 +908,7 @@
@Override
public String getRequestProperty(String key) {
- return (String) properties.get(key);
+ return properties.get(key);
}
@Override
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java Sat Aug 15 17:20:34 2009
@@ -748,7 +748,7 @@
else {
fail("No header and body section found");
}
- // Check response headers
+ // Check response headers
checkHeaderTypeLength(headersSent, "multipart/form-data" + "; boundary=" + boundaryString, expectedPostBody.length);
// Check post body which was sent to the mirror server, and
// sent back by the mirror server
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/util/TestHTTPFileArgs.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/util/TestHTTPFileArgs.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/util/TestHTTPFileArgs.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/util/TestHTTPFileArgs.java Sat Aug 15 17:20:34 2009
@@ -55,7 +55,7 @@
}
public void testSetHTTPFileArgs() throws Exception {
- List newHTTPFileArgs = new LinkedList();
+ List<HTTPFileArg> newHTTPFileArgs = new LinkedList<HTTPFileArg>();
newHTTPFileArgs.add(new HTTPFileArg("hede"));
HTTPFileArgs files = new HTTPFileArgs();
files.setHTTPFileArgs(newHTTPFileArgs);
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/PackageTest.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/PackageTest.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/PackageTest.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/testbeans/gui/PackageTest.java Sat Aug 15 17:20:34 2009
@@ -56,11 +56,11 @@
private final ResourceBundle defaultBundle;
- private final Class testBeanClass;
+ private final Class<?> testBeanClass;
private final Locale testLocale;
- private PackageTest(Class testBeanClass, Locale locale, ResourceBundle defaultBundle) {
+ private PackageTest(Class<?> testBeanClass, Locale locale, ResourceBundle defaultBundle) {
super(testBeanClass.getName() + " - " + locale.getLanguage() + " - " + locale.getCountry());
this.testBeanClass = testBeanClass;
this.testLocale = locale;
@@ -117,8 +117,8 @@
public void checkNoInventedKeys() {
// Check that all keys in the bundle are also in the default bundle:
- for (Enumeration keys = bundle.getKeys(); keys.hasMoreElements();) {
- String key = (String) keys.nextElement();
+ for (Enumeration<String> keys = bundle.getKeys(); keys.hasMoreElements();) {
+ String key = keys.nextElement();
defaultBundle.getString(key);
// Will throw MissingResourceException if key is not there.
}
@@ -167,14 +167,14 @@
public static Test suite() throws Exception {
TestSuite suite = new TestSuite("Bean Resource Test Suite");
- Iterator iter = ClassFinder.findClassesThatExtend(JMeterUtils.getSearchPaths(), new Class[] { TestBean.class })
+ Iterator<String> iter = ClassFinder.findClassesThatExtend(JMeterUtils.getSearchPaths(), new Class[] { TestBean.class })
.iterator();
boolean errorDetected = false;
JMeterUtils.setLocale(defaultLocale);
while (iter.hasNext()) {
- String className = (String) iter.next();
- Class testBeanClass = Class.forName(className);
+ String className = iter.next();
+ Class<?> testBeanClass = Class.forName(className);
ResourceBundle defaultBundle = null;
try {
defaultBundle = (ResourceBundle) Introspector.getBeanInfo(testBeanClass).getBeanDescriptor().getValue(
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/testelement/BarChartTest.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/testelement/BarChartTest.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/testelement/BarChartTest.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/testelement/BarChartTest.java Sat Aug 15 17:20:34 2009
@@ -19,6 +19,7 @@
import javax.swing.JComponent;
+import org.apache.jmeter.report.DataSet;
import org.apache.jmeter.save.SaveGraphicsService;
import org.apache.jmeter.junit.JMeterTestCase;
import org.apache.jmeter.util.JMeterUtils;
@@ -56,7 +57,7 @@
assertTrue((input.getEndTimestamp() > input.getStartTimestamp()));
assertTrue((input.getURLs().size() > 0));
log.info("URL count=" + input.getURLs().size());
- java.util.ArrayList list = new java.util.ArrayList();
+ java.util.ArrayList<DataSet> list = new java.util.ArrayList<DataSet>();
list.add(input);
list.add(input2);
list.add(input3);
Modified: jakarta/jmeter/trunk/test/src/org/apache/jmeter/testelement/LineGraphTest.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/testelement/LineGraphTest.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jmeter/testelement/LineGraphTest.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jmeter/testelement/LineGraphTest.java Sat Aug 15 17:20:34 2009
@@ -19,6 +19,7 @@
import javax.swing.JComponent;
+import org.apache.jmeter.report.DataSet;
import org.apache.jmeter.save.SaveGraphicsService;
import org.apache.jmeter.junit.JMeterTestCase;
import org.apache.jmeter.util.JMeterUtils;
@@ -56,7 +57,7 @@
assertTrue((input.getEndTimestamp() > input.getStartTimestamp()));
assertTrue((input.getURLs().size() > 0));
log.info("URL count=" + input.getURLs().size());
- java.util.ArrayList list = new java.util.ArrayList();
+ java.util.ArrayList<DataSet> list = new java.util.ArrayList<DataSet>();
list.add(input);
list.add(input2);
list.add(input3);
Modified: jakarta/jmeter/trunk/test/src/org/apache/jorphan/collections/PackageTest.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jorphan/collections/PackageTest.java?rev=804491&r1=804490&r2=804491&view=diff
==============================================================================
--- jakarta/jmeter/trunk/test/src/org/apache/jorphan/collections/PackageTest.java (original)
+++ jakarta/jmeter/trunk/test/src/org/apache/jorphan/collections/PackageTest.java Sat Aug 15 17:20:34 2009
@@ -33,7 +33,7 @@
public void testAdd1() throws Exception {
Logger log = LoggingManager.getLoggerForClass();
- Collection treePath = Arrays.asList(new String[] { "1", "2", "3", "4" });
+ Collection<String> treePath = Arrays.asList(new String[] { "1", "2", "3", "4" });
HashTree tree = new HashTree();
log.debug("treePath = " + treePath);
tree.add(treePath, "value");
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org