(no commit message)
[utils] / trunk / system / general / src / test / java / org / wamblee / system / core / Application.java
index c162bb04400523af6b1b4f5c88efb8ad3542d948..5e771b326464676d3729ffed4d2be370ea21f6f2 100644 (file)
@@ -24,13 +24,18 @@ import org.wamblee.system.core.RequiredInterface;
 import org.wamblee.test.EventTracker;
 
 public class Application extends AbstractComponent {
-       public static RequiredInterface[] required(boolean aOptional) {
+       public static RequiredInterface[] required(boolean aOptional, String aPrefix) {
                return
                new RequiredInterface[] { 
-                       new DefaultRequiredInterface("string", String.class, aOptional), 
-                       new DefaultRequiredInterface("integer", Integer.class, aOptional)
+                       new DefaultRequiredInterface(aPrefix + "string", String.class, aOptional), 
+                       new DefaultRequiredInterface(aPrefix + "integer", Integer.class, aOptional)
        };
        }
+       
+       public static RequiredInterface[] required(boolean aOptional) {
+        return required(aOptional, "");
+    }
+    
 
        private EventTracker<String> _tracker;
        private String _string; 
@@ -38,17 +43,20 @@ public class Application extends AbstractComponent {
        private double _random; 
        
        public Application() {
-               super("application", new ProvidedInterface[0], required(false));
-               _random = Math.random();
+           this("application");
        }
        
        public Application(String aName) {
-        super(aName, new ProvidedInterface[0], required(false));
+           this(aName, "");
+    }
+       
+       public Application(String aName, String aPrefix) {
+        super(aName, new ProvidedInterface[0], required(false, aPrefix));
         _random = Math.random();
     }
        
        public Application(boolean aIsOptinal) { 
-               super("application", new ProvidedInterface[0], required(true)); 
+               super("application", new ProvidedInterface[0], required(true, "")); 
        }
        
        public Application(EventTracker<String> aTracker) {