fail();
}
+
+ public void testDuplicateComponent() {
+ try {
+ Component comp1 = new Application();
+ Component comp2 = new Application();
+ Container system = new Container("top");
+ system.addComponent(comp1).addComponent(comp2);
+ } catch (SystemAssemblyException e) {
+ return;
+ }
+ fail();
+ }
+
+
+ public void testInconsistentHierarchy() {
+ try {
+ Component comp = new Application();
+ Container system = new Container("top").addComponent(comp);
+ Container system2 = new Container("top2").addComponent(comp);
+ } catch (SystemAssemblyException e) {
+ return;
+ }
+ fail();
+ }
public void testCompositeWithExternalDependencesProvided() {
// application 2 will throw an exception while starting
Application application2 = control.createMock(Application.class,
- new ConstructorArgs(Application.class.getConstructor()),
+ new ConstructorArgs(Application.class.getConstructor(String.class), "application2"),
Application.class.getDeclaredMethod("doStart", Scope.class));
application2.doStart(EasyMockMatchers.anyObject(Scope.class));