Commit 2055469a authored by Philippe Merle's avatar Philippe Merle
Browse files

Added test code to unbind the 'runnables' reference.

parent 1774b82b
......@@ -30,6 +30,7 @@ package org.ow2.frascati.examples.runners.test;
import org.junit.Test;
import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.api.Interface;
import org.objectweb.fractal.bf.BindingFactory;
import org.objectweb.fractal.util.Fractal;
......@@ -111,8 +112,35 @@ public class RunnerTest
runnable.run();
for(int i=0; i<2; i++) { System.out.println(); }
Fractal.getLifeCycleController(componentRunnerMultiple).stopFc();
// Disconnect the 'runnables' reference of the RunnerMultiple component to the 'Runnable' service of the component A, B, C, and D.
Fractal.getBindingController(componentRunnerMultiple).unbindFc("runnables-A");
Fractal.getBindingController(componentRunnerMultiple).unbindFc("runnables-B");
Fractal.getBindingController(componentRunnerMultiple).unbindFc("runnables-C");
Fractal.getBindingController(componentRunnerMultiple).unbindFc("runnables-D");
Fractal.getBindingController(componentRunnerMultiple).unbindFc("runnables-D-WS-1");
Fractal.getBindingController(componentRunnerMultiple).unbindFc("runnables-D-WS-2");
Fractal.getLifeCycleController(componentRunnerMultiple).startFc();
// RunnerMultiple will be invoked.
runnable.run();
for(int i=0; i<2; i++) { System.out.println(); }
for(Object o : componentRunnerMultiple.getFcInterfaces()) {
Interface fractalInterface = (Interface)o;
System.out.println("* " + fractalInterface.getFcItfName());
}
for(int i=0; i<2; i++) { System.out.println(); }
for(String name : Fractal.getBindingController(componentRunnerMultiple).listFc()) {
System.out.println("* " + name);
}
for(int i=0; i<2; i++) { System.out.println(); }
frascati.close(composite);
frascati.close();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment