text: Details
  - Type:
  Wish
  - Status: Open
  - Priority:
  Major
  - Resolution: Unresolved
  - Affects Version/s: Java-SCA-1.x
  - Fix Version/s: Java-SCA-1.x
  - Component/s: Java SCA Samples
  - Labels:None
  - Environment:All
  - Patch Info:Patch Available
  Description
  It would help with preserving OSGi support if an OSGi sample were run as a matter of course, rather than only by a small number of developers. This wish is to add the smallest sample possible based on existing Tuscany module dependencies.
  Activity
  - All
  - Work Log
  - History
  - Activity
  - Transitions
  Hi Rajini, sorry for taking so long to respond. Please go ahead and check the code in with your update. Changing it to use Felix is fine by me. I tested it with both and there was little discernible difference in performance.
  Thanks, Graham.
  Graham,
  I tried out the test (listed below), using your patch, and it seems to work fine. So if you want, I can check in this code, along with the rest of your patch tonight, and you can continue from there.
  If this is going to be a sample, I think it should use Felix rather than Equinox to avoid both Felix and Equinox being added to the Tuscany distribution (depending on the order in which they appear in tuscany-sca-manifest.jar file, they can result in conflicts when running Tuscany outside OSGi).
  The test that I ran looks like:
  public class CalculatorTestCase {
  private BundleContext bundleContext;
  @Before
  public void setUp() throws Exception {
  String[] equinoxArgs = new String[]{"-clean", "-console", "-configuration", "target/configuration"}
  ;
  bundleContext = EclipseStarter.startup(equinoxArgs, null);
  }
  @After
  public void tearDown() throws Exception {
  if (bundleContext != null){ bundleContext.getBundle().stop(); }
  }
  @Test
  public void runCalculator() throws Exception
  }
  Hi Rajini,
  I think what you're suggesting make sense. I won't be able to look at this until Friday. Thanks for the offer of help, I'll let you know if I need some.
  Regards,
  Graham.
  Graham,
  For some reason, I was expecting this to be an itest, but I notice you intended it to be a sample. That is good, since we currently dont have a sample which runs Tuscany under OSGi. So this module can be a sample as well as a sniff test for OSGi-based Tuscany.
  However, to enable this to be really used as a sample, it might help if code was simplified. Currently it uses the test harness from itest/osgi-tuscany which builds test bundles on-the-fly from the classes in the samples directories. I feel that is too complicated for use in a sample (yes, that is all my fault).
  It would be really nice to have a sample which simply does:
  1. Create an OSGi runtime
  2. Install and start Tuscany OSGi installer bundle
  3. Install and start calculator bundle
  and away it goes and runs the calculator sample on Tuscany inside an OSGi runtime. Step 2 could be replaced later with whatever mechanism we choose to provide for installing Tuscany into OSGi.
  What do you think? I can help with the code if you like (but it will have to wait till the weekend).
  PS: Sorry, I should have noticed that you were referring to this as 'sample' all along.
  - Rajini
  Graham,
  I have attached the patch for the OSGi calculator sample as I have it on my machine. It could help in the discussion on whether this should be a sample or an itest.