Skip to Content.
Sympa Menu

notify-dpml - r1942 - in trunk/main/metro/part/src/test: net/dpml/runtime/context org/acme

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1942 - in trunk/main/metro/part/src/test: net/dpml/runtime/context org/acme
  • Date: Mon, 2 Apr 2007 19:02:20 +0200

Author: mcconnell
Date: 2007-04-02 19:02:18 +0200 (Mon, 02 Apr 2007)
New Revision: 1942

Modified:
trunk/main/metro/part/src/test/net/dpml/runtime/context/MapTestCase.java
trunk/main/metro/part/src/test/org/acme/MapWidget.java
Log:
add type constraints

Modified:
trunk/main/metro/part/src/test/net/dpml/runtime/context/MapTestCase.java
===================================================================
--- trunk/main/metro/part/src/test/net/dpml/runtime/context/MapTestCase.java
2007-04-02 16:50:55 UTC (rev 1941)
+++ trunk/main/metro/part/src/test/net/dpml/runtime/context/MapTestCase.java
2007-04-02 17:02:18 UTC (rev 1942)
@@ -36,11 +36,9 @@
{
MapWidget widget =
load( MapWidget.class, "map.xml", "map" );
- Map map = widget.getContext().getDemo();
- int n = map.size();
- String message = (String) map.get( "message" );
- String value = (String) map.get( "foo" );
-
+ Map<String,String> map = widget.getContext().getDemo();
+ String message = map.get( "message" );
+ String value = map.get( "foo" );
assertEquals( "message", "Hello from the map entry", message );
assertEquals( "foo", "bar", value );
}

Modified: trunk/main/metro/part/src/test/org/acme/MapWidget.java
===================================================================
--- trunk/main/metro/part/src/test/org/acme/MapWidget.java 2007-04-02
16:50:55 UTC (rev 1941)
+++ trunk/main/metro/part/src/test/org/acme/MapWidget.java 2007-04-02
17:02:18 UTC (rev 1942)
@@ -30,7 +30,7 @@
{
public interface Context
{
- Map getDemo();
+ Map<String,String> getDemo();
}

private Context m_context;
@@ -43,12 +43,7 @@

public String getMessage()
{
- Object message = m_context.getDemo().get( "message" );
- if( null != message )
- {
- return message.toString();
- }
- return null;
+ return m_context.getDemo().get( "message" );
}

public Context getContext()




  • r1942 - in trunk/main/metro/part/src/test: net/dpml/runtime/context org/acme, mcconnell at BerliOS, 04/02/2007

Archive powered by MHonArc 2.6.24.

Top of Page