Konrad Windszus created SLING-5681:
--------------------------------------

             Summary: Teleporter: Improve mechanism to check if a deployed test 
bundle can be started
                 Key: SLING-5681
                 URL: https://issues.apache.org/jira/browse/SLING-5681
             Project: Sling
          Issue Type: Improvement
          Components: Testing
    Affects Versions: JUnit Tests Teleporter 1.0.6
            Reporter: Konrad Windszus


Currently if a bundle being deployed through the {[ClientSideTeleporter}} 
cannot be started, this is only detected because the Remote JUnit Servlet does 
not return a non 404 status. This should be improved by relying on the 
http://felix.apache.org/documentation/subprojects/apache-felix-web-console/web-console-restful-api.html#bundles-plugin
 and a check on the JSON response.

An error response of e.g. 
{{http://localhost:41005/system/console/bundles/ClientSideTeleporter.14-07-21-.837e5ada-c58a-4653-9087-e1c4aad27e0c:0.json}}
 might look like this

{code}
{
  "status": "Bundle information: 140 bundles in total, 134 bundles active, 5 
bundles active fragments, 1 bundle installed.",
  "s": [
    140,
    134,
    5,
    0,
    1
  ],
  "data": [
    {
      "id": 142,
      "name": 
"ClientSideTeleporter.14-07-21-.837e5ada-c58a-4653-9087-e1c4aad27e0c",
      "fragment": false,
      "stateRaw": 2,
      "state": "Installed",
      "version": "0",
      "symbolicName": 
"ClientSideTeleporter.14-07-21-.837e5ada-c58a-4653-9087-e1c4aad27e0c",
      "category": "",
      "props": [
        {
          "key": "Symbolic Name",
          "value": 
"ClientSideTeleporter.14-07-21-.837e5ada-c58a-4653-9087-e1c4aad27e0c"
        },
        {
          "key": "Version",
          "value": "0"
        },
        {
          "key": "Bundle Location",
          "value": 
"inputstream:ClientSideTeleporter.14-07-21-.837e5ada-c58a-4653-9087-e1c4aad27e0c.jar"
        },
        {
          "key": "Last Modification",
          "value": "Fri Apr 22 14:08:27 CEST 2016"
        },
        {
          "key": "Start Level",
          "value": 20
        },
        {
          "key": "Imported Packages",
          "value": [
            "ERROR: org.apache.sling.junit.rules -- Cannot be resolved",
            "ERROR: org.junit -- Cannot be resolved",
            "org.osgi.service.cm from <a 
href='/system/console/bundles/7'>org.apache.felix.configadmin (7)</a>"
          ]
        },
        {
          "key": "Manifest Headers",
          "value": [
            "Bnd-LastModified: 1461326886812",
            "Built-By: konradwindszus",
            "Bundle-ManifestVersion: 2",
            "Bundle-Name: 
ClientSideTeleporter.14-07-21-.837e5ada-c58a-4653-9087-e1c4aad27e0c",
            "Bundle-SymbolicName: 
ClientSideTeleporter.14-07-21-.837e5ada-c58a-4653-9087-e1c4aad27e0c",
            "Bundle-Version: 0",
            "Created-By: 1.8.0_74 (Oracle Corporation)",
            "Import-Package: org.apache.sling.junit.rules, org.junit, 
org.osgi.service.cm",
            "Manifest-Version: 1.0",
            "Originally-Created-By: pax-tinybundles-2.0.0",
            "Private-Package: org.apache.sling.testing.samples.modulewit",
            "Sling-Test-Regexp: 
org.apache.sling.testing.samples.modulewit.BasicTeleportedIT.*",
            "TinybundlesVersion: pax-tinybundles-2.0.0",
            "Tool: Bnd-2.1.0.20130426-122213"
          ]
        },
        {
          "key": "nfo",
          "value": {}
        }
      ]
    }
  ]
}
{code}

So the {{state}} as well as the {{Imported Packages}} section gives a good 
hint, why a bundle could not be started!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to