TS 69 Apisupport OSGI

Apisupport OSGI test Specification

Author: Tomas Musil
Version: 1.0
Introduction: This TS should cover most important features of OSGI functionality in Ant area.

Contents


Test suite: Ant OSGi Bundle

Purpose: Test to create OSGi Bundle project archetype and appropriate file templates
Setup:

  1. Create OSGi Bundle
    1. In new project wizard, choose NetBeans Module project (Module)
    2. Fill in some data, and on panel 3, check "Generate OSGi Bundle"
    • EXPECTED RESULT:
      New OSGi Bundle is created with specific icon, otherwise looks just like ordinary Module project.
  2. Check OSGi metadata
    1. Clean and build project
    2. Navigate to Files view
    3. In build folder, find output JAR file (cluster/modules) and open it's manifest
    • EXPECTED RESULT:
      Manifest should contain OSGi metadata (like Bundle-Name, Require-Bundle,...).
  3. Project customizer
    1. Create some package and class in it
    2. Go to project customizer
    3. Change some metadata (add dependency on some module, change version, change name, change JDK, add package as public package)
    • EXPECTED RESULT:
      After clean and build, all changes are reflected in manifest.mf metadata.
  4. Bundle activator
    1. Create from new file template Installer/Activator
    2. type some code into start() method (try to print to stdout c.getBundles().length)
    3. Clean and build project
    4. Verify that activator is registred in manifest.mf in output jar
    5. Run project
    • EXPECTED RESULT:
      NetBeans is started and module is loaded. Check that in output is printed result from start().
  5. Compatibility with NetBeans module system
    1. Create new Action from new file template
    2. This adds dependency to couple NB modules
    3. Build and run project
    • EXPECTED RESULT:
      Action works, which proves OSGi module can depend on NB Modules.

Test suite: Module suite with OSGi Bundle

  1. Module suite with added cluster
    1. Create new module suite
    2. Create new OSGi bundle in it.
    3. Create new module in it.
    4. Go to suite customizer
    5. Check only platform cluster
    6. Invoke Add cluster
    7. Browse for some folder with OSGi bundle(s). You can use e.g. modules in Glassfish installation.
    • EXPECTED RESULT:
      Cluster is successfully added, modules in it can be included/exluded
  2. Add dependency on OSGi Bundle
    1. Create in empty Module in suite some package and class
    2. In project customizer, add this package as public
    3. Invoke Add dependency in empty OSGi bundle in suite and add dependency on this empty module
    4. Use some class from OSGI bundle in module
    • EXPECTED RESULT:
      Code completion should work, suite can be compiled.
  3. Add dependency on Module
    1. Very similar to previous test case, try to add dependency on Module from suite in OSGi bundle in suite.
    • EXPECTED RESULT:
      Code completion should work, suite can be compiled.
  4. Add dependency for Module on Bundle from external cluster
    1. Add dependency on some bundle from externally added cluster and use it in code of Module
    • EXPECTED RESULT:
      Code completion should work, suite can be compiled.
  5. Add dependency for OSGi Bundle on Bundle from external cluster
    1. Add dependency on some bundle from externally added cluster and use it in code of OSGi Bundle
    • EXPECTED RESULT:
      Code completion should work, suite can be compiled.

Test suite: Experimental OSGi Features

Purpose: Some features are experimental, like running platform (IDE) in OSGi container
Setup:

  1. Run in Felix
    1. Create new NetBeans platform app project
    2. Invoke from its popup OSGI > Run in Felix
    • EXPECTED RESULT:
      Platform instance is correctly started.
  2. Debug in Felix
    1. Create some new module to NetBeans platform app project
    2. Create some new OSGi bundle to NetBeans platform app project
    3. Create new bundle activator for OSGi bundle, type some code into start() method and put there breakpoint
    4. Create new module installer for module, type some code into restored() method and put there breakpoint
    5. Invoke from platform app project popup: OSGi > Debug in Felix
    • EXPECTED RESULT:
      Debugger should stop on both breakpoints.
  3. Profile in Felix
    1. Invoke from platform app project popup OSGi > Profile in Felix
    • EXPECTED RESULT:
      You are able to collect e.g. live results from profiler.
  4. Build bundles
    1. Invoke from platform app project popup OSGi > Build Bundles
    • EXPECTED RESULT:
      There are OSGi bundle JAR files in build/osgi folder. Check also that JAR files contain OSGi metadata.
  5. Build bundle repository
    1. Invoke from platform app project popup OSGi > Build Bundle repository
    • EXPECTED RESULT:
      There are OSGi bundle JAR files in build/osgi folder. There is also repository.xml file describing repo.
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo