Implemented optinality of interfaces.
[utils] / system / general / src / test / java / org / wamblee / system / core / Application.java
index 938f2bd1d50e7e969d46e71d97b778f81a3573ee..16d1f36f0187b273810ae010dfaa8f77fb994b1c 100644 (file)
@@ -24,18 +24,22 @@ import org.wamblee.system.core.RequiredInterface;
 import org.wamblee.test.EventTracker;
 
 public class Application extends AbstractComponent {
-       private static RequiredInterface[] required() {
+       public static RequiredInterface[] required(boolean aOptional) {
                return
                new RequiredInterface[] { 
-                       new DefaultRequiredInterface("datasource", DataSource.class), 
-                       new DefaultRequiredInterface("integer", Integer.class)
+                       new DefaultRequiredInterface("datasource", DataSource.class, aOptional), 
+                       new DefaultRequiredInterface("integer", Integer.class, aOptional)
        };
        }
 
        private EventTracker<String> _tracker;
        
        public Application() {
-               super("application", new ProvidedInterface[0], required()); 
+               super("application", new ProvidedInterface[0], required(false)); 
+       }
+       
+       public Application(boolean aIsOptinal) { 
+               super("application", new ProvidedInterface[0], required(true)); 
        }
        
        public Application(EventTracker<String> aTracker) {