+ assertFalse(env1.getInteger().equals(app.getInteger()));
+ }
+
+ public void testRestrictionWrongComponentNames() {
+ Environment env1 = new Environment("env1");
+ Environment env2 = new Environment("env2");
+ Application app = new Application("app");
+ final Container container = new Container("top").addComponent(env1)
+ .addComponent(env2).addComponent(app);
+ AssertionUtils.assertException(new AssertionUtils.ErroneousCode() {
+ @Override
+ public void run() throws Exception {
+ container.connectRequiredProvided("app2", null, "env1", null);
+ }
+ }, SystemAssemblyException.class);
+ AssertionUtils.assertException(new AssertionUtils.ErroneousCode() {
+ @Override
+ public void run() throws Exception {
+ container.connectRequiredProvided("app", null, "env3", null);
+ }
+ }, SystemAssemblyException.class);
+ }
+
+ public void testRestrictionWrongInterfaceNames() {
+ final Environment env1 = new Environment("env1");
+ Environment env2 = new Environment("env2");
+ final Application app = new Application("app");
+ final Container container = new Container("top").addComponent(env1)
+ .addComponent(env2).addComponent(app);
+ AssertionUtils.assertException(new AssertionUtils.ErroneousCode() {
+ @Override
+ public void run() throws Exception {
+ container.connectRequiredProvided("app", app
+ .getRequiredInterfaces().get(0).getName() +
+ "xxx", "env1", null);
+ }
+ }, SystemAssemblyException.class);
+ AssertionUtils.assertException(new AssertionUtils.ErroneousCode() {
+ @Override
+ public void run() throws Exception {
+ container.connectRequiredProvided("app", null, "env1", env1
+ .getProvidedInterfaces().get(0).getName() +
+ "yyy");
+ }
+ }, SystemAssemblyException.class);