Author: rahul
Date: Wed Jan 9 13:38:45 2008
New Revision: 610579
URL: http://svn.apache.org/viewvc?rev=610579&view=rev
Log:
Improve type safety in tests.
Modified:
commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/env/SimpleContextTest.java
commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/env/jexl/JexlContextTest.java
commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/env/jsp/MockJspContext.java
Modified:
commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/env/SimpleContextTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/env/SimpleContextTest.java?rev=610579&r1=610578&r2=610579&view=diff
==============================================================================
---
commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/env/SimpleContextTest.java
(original)
+++
commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/env/SimpleContextTest.java
Wed Jan 9 13:38:45 2008
@@ -45,7 +45,7 @@
}
public void testHasTrue() {
- Map vars = new HashMap();
+ Map<String, Object> vars = new HashMap<String, Object>();
vars.put("key", "value");
context.setVars(vars);
@@ -54,7 +54,7 @@
}
public void testHasNullParent() {
- Map vars = new HashMap();
+ Map<String, Object> vars = new HashMap<String, Object>();
vars.put("key", "value");
context.setVars(vars);
@@ -63,12 +63,12 @@
}
public void testHasParentWrongKey() {
- Map parentVars = new HashMap();
+ Map<String, Object> parentVars = new HashMap<String, Object>();
parentVars.put("key", "value");
SimpleContext parentContext = new SimpleContext(parentVars);
- Map vars = new HashMap();
+ Map<String, Object> vars = new HashMap<String, Object>();
vars.put("key", "value");
context.setVars(vars);
@@ -78,12 +78,12 @@
}
public void testHasParentCorrectKey() {
- Map parentVars = new HashMap();
+ Map<String, Object> parentVars = new HashMap<String, Object>();
parentVars.put("differentKey", "value");
SimpleContext parentContext = new SimpleContext(parentVars);
- Map vars = new HashMap();
+ Map<String, Object> vars = new HashMap<String, Object>();
vars.put("key", "value");
context.setVars(vars);
@@ -99,7 +99,7 @@
}
public void testGetValue() {
- Map vars = new HashMap();
+ Map<String, Object> vars = new HashMap<String, Object>();
vars.put("key", "value");
context.setVars(vars);
@@ -108,12 +108,12 @@
}
public void testGetParentValue() {
- Map parentVars = new HashMap();
+ Map<String, Object> parentVars = new HashMap<String, Object>();
parentVars.put("differentKey", "differentValue");
SimpleContext parentContext = new SimpleContext(parentVars);
- Map vars = new HashMap();
+ Map<String, Object> vars = new HashMap<String, Object>();
vars.put("key", "value");
context.setVars(vars);
@@ -123,7 +123,7 @@
}
public void testGetParentNull() {
- Map vars = new HashMap();
+ Map<String, Object> vars = new HashMap<String, Object>();
vars.put("key", "value");
context.setVars(vars);
@@ -132,12 +132,12 @@
}
public void testGetParentWrongValue() {
- Map parentVars = new HashMap();
+ Map<String, Object> parentVars = new HashMap<String, Object>();
parentVars.put("differentKey", "differentValue");
SimpleContext parentContext = new SimpleContext(parentVars);
- Map vars = new HashMap();
+ Map<String, Object> vars = new HashMap<String, Object>();
vars.put("key", "value");
context.setVars(vars);
@@ -147,7 +147,7 @@
}
public void testSetVarsChangeValue() {
- Map vars = new HashMap();
+ Map<String, Object> vars = new HashMap<String, Object>();
vars.put("key", "value");
context.setVars(vars);
@@ -158,7 +158,7 @@
}
public void testSetVarsEmpty() {
- Map vars = new HashMap();
+ Map<String, Object> vars = new HashMap<String, Object>();
context.setVars(vars);
context.set("key", "newValue");
@@ -167,12 +167,12 @@
}
public void testSetVarsParent() {
- Map parentVars = new HashMap();
+ Map<String, Object> parentVars = new HashMap<String, Object>();
parentVars.put("differentKey", "differentValue");
SimpleContext parentContext = new SimpleContext(parentVars);
- Map vars = new HashMap();
+ Map<String, Object> vars = new HashMap<String, Object>();
vars.put("key", "value");
context.setVars(vars);
Modified:
commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/env/jexl/JexlContextTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/env/jexl/JexlContextTest.java?rev=610579&r1=610578&r2=610579&view=diff
==============================================================================
---
commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/env/jexl/JexlContextTest.java
(original)
+++
commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/env/jexl/JexlContextTest.java
Wed Jan 9 13:38:45 2008
@@ -48,7 +48,7 @@
}
public void testPrepopulated() {
- Map m = new HashMap();
+ Map<String, Object> m = new HashMap<String, Object>();
m.put("foo", "bar");
JexlContext ctx = new JexlContext(m);
assertNotNull(ctx);
@@ -63,7 +63,7 @@
assertNotNull(ctx);
assertEquals(1, ctx.getVars().size());
assertTrue(ctx.get("_builtin") instanceof Builtin);
- Map m = new HashMap();
+ Map<String, Object> m = new HashMap<String, Object>();
m.put("foo", "bar");
ctx.setVars(m);
assertEquals(2, ctx.getVars().size());
Modified:
commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/env/jsp/MockJspContext.java
URL:
http://svn.apache.org/viewvc/commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/env/jsp/MockJspContext.java?rev=610579&r1=610578&r2=610579&view=diff
==============================================================================
---
commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/env/jsp/MockJspContext.java
(original)
+++
commons/proper/scxml/branches/J5/src/test/java/org/apache/commons/scxml/env/jsp/MockJspContext.java
Wed Jan 9 13:38:45 2008
@@ -30,10 +30,10 @@
*/
public class MockJspContext extends JspContext
implements VariableResolver {
- private Map vars;
+ private Map<String, Object> vars;
public MockJspContext() {
super();
- vars = new HashMap();
+ vars = new HashMap<String, Object>();
}
public void setAttribute(String name, Object value) {
vars.put(name, value);