This is an automated email from the ASF dual-hosted git repository.

pauls pushed a commit to branch SLING-8633
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-modelconverter.git

commit b5bcd2b25c0881e96d1303639ba8886c171360ec
Author: Karl Pauls <karlpa...@gmail.com>
AuthorDate: Thu Aug 15 11:57:57 2019 +0200

    SLING-8633: Use start-order instead of start-level
---
 .../modelconverter/FeatureToProvisioning.java      | 13 +++++---
 .../modelconverter/ProvisioningToFeature.java      |  2 +-
 src/test/resources/boot.json                       | 36 +++++++++++-----------
 src/test/resources/boot_gav.json                   | 36 +++++++++++-----------
 src/test/resources/launchpad.json                  |  4 +--
 src/test/resources/oak.json                        | 20 ++++++------
 src/test/resources/repoinit.json                   |  6 ++--
 src/test/resources/simple.json                     |  2 +-
 src/test/resources/simple2.json                    |  2 +-
 9 files changed, 62 insertions(+), 59 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/feature/modelconverter/FeatureToProvisioning.java
 
b/src/main/java/org/apache/sling/feature/modelconverter/FeatureToProvisioning.java
index 6cca47d..6c70a0c 100644
--- 
a/src/main/java/org/apache/sling/feature/modelconverter/FeatureToProvisioning.java
+++ 
b/src/main/java/org/apache/sling/feature/modelconverter/FeatureToProvisioning.java
@@ -162,7 +162,8 @@ public class FeatureToProvisioning {
                 bundleRunModes = getRunModes(bundle);
             }
 
-            int startLevel;
+            int startLevel = bundle.getStartOrder();
+
             String sl = bundle.getMetadata().get("start-level");
             // special handling for :boot or :launchpad
             if ( sl != null && sl.startsWith(":") ) {
@@ -178,10 +179,12 @@ public class FeatureToProvisioning {
                 }
                 
addFeat.getOrCreateRunMode(null).getOrCreateArtifactGroup(0).add(newBundle);
             } else {
-                if (sl != null) {
-                    startLevel = Integer.parseInt(sl);
-                } else {
-                    startLevel = 20;
+                if (startLevel == 0) {
+                    if (sl != null) {
+                        startLevel = Integer.parseInt(sl);
+                    } else {
+                        startLevel = 20;
+                    }
                 }
 
                 
f.getOrCreateRunMode(bundleRunModes).getOrCreateArtifactGroup(startLevel).add(newBundle);
diff --git 
a/src/main/java/org/apache/sling/feature/modelconverter/ProvisioningToFeature.java
 
b/src/main/java/org/apache/sling/feature/modelconverter/ProvisioningToFeature.java
index cb68d9e..896e970 100644
--- 
a/src/main/java/org/apache/sling/feature/modelconverter/ProvisioningToFeature.java
+++ 
b/src/main/java/org/apache/sling/feature/modelconverter/ProvisioningToFeature.java
@@ -385,7 +385,7 @@ public class ProvisioningToFeature {
                                 startLevel = 20;
                             }
                         }
-                        newArtifact.getMetadata().put("start-level", 
String.valueOf(startLevel));
+                        newArtifact.getMetadata().put("start-order", 
String.valueOf(startLevel));
 
                         bundles.add(newArtifact);
                     }
diff --git a/src/test/resources/boot.json b/src/test/resources/boot.json
index 6111623..fe3a48f 100644
--- a/src/test/resources/boot.json
+++ b/src/test/resources/boot.json
@@ -12,75 +12,75 @@
     "bundles": [
         {
             "id": "org.slf4j/slf4j-api/1.7.25",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.sling/org.apache.sling.commons.log/5.1.0",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.sling/org.apache.sling.commons.logservice/1.0.6",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.slf4j/jcl-over-slf4j/1.7.25",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.slf4j/log4j-over-slf4j/1.7.25",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.sling/org.apache.sling.settings/1.3.8",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.sling/org.apache.sling.fragment.xml/1.0.2",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": 
"org.apache.sling/org.apache.sling.fragment.transaction/1.0.0",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.sling/org.apache.sling.javax.activation/0.1.0",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.sling/org.apache.sling.fragment.ws/1.0.2",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": 
"org.apache.sling/org.apache.sling.launchpad.installer/1.2.2",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.sling/org.apache.sling.installer.core/3.8.12",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": 
"org.apache.sling/org.apache.sling.installer.provider.file/1.1.0",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": 
"org.apache.sling/org.apache.sling.installer.factory.configuration/1.1.2",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.felix/org.apache.felix.configadmin/1.8.16",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.felix/org.apache.felix.eventadmin/1.4.10",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.aries/org.apache.aries.util/1.1.3",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.geronimo.specs/geronimo-atinject_1.0_spec/1.0",
-            "start-level": 1
+            "start-order": 1
         }],
         
     "framework-properties": {
diff --git a/src/test/resources/boot_gav.json b/src/test/resources/boot_gav.json
index a399637..bd0a7d1 100644
--- a/src/test/resources/boot_gav.json
+++ b/src/test/resources/boot_gav.json
@@ -12,75 +12,75 @@
     "bundles": [
         {
             "id": "org.slf4j/slf4j-api/1.7.25",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.sling/org.apache.sling.commons.log/5.1.0",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.sling/org.apache.sling.commons.logservice/1.0.6",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.slf4j/jcl-over-slf4j/1.7.25",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.slf4j/log4j-over-slf4j/1.7.25",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.sling/org.apache.sling.settings/1.3.8",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.sling/org.apache.sling.fragment.xml/1.0.2",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": 
"org.apache.sling/org.apache.sling.fragment.transaction/1.0.0",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.sling/org.apache.sling.javax.activation/0.1.0",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.sling/org.apache.sling.fragment.ws/1.0.2",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": 
"org.apache.sling/org.apache.sling.launchpad.installer/1.2.2",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.sling/org.apache.sling.installer.core/3.8.12",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": 
"org.apache.sling/org.apache.sling.installer.provider.file/1.1.0",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": 
"org.apache.sling/org.apache.sling.installer.factory.configuration/1.1.2",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.felix/org.apache.felix.configadmin/1.8.16",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.felix/org.apache.felix.eventadmin/1.4.10",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.aries/org.apache.aries.util/1.1.3",
-            "start-level": 1
+            "start-order": 1
         },
         {
             "id": "org.apache.geronimo.specs/geronimo-atinject_1.0_spec/1.0",
-            "start-level": 1
+            "start-order": 1
         }],
         
     "framework-properties": {
diff --git a/src/test/resources/launchpad.json 
b/src/test/resources/launchpad.json
index d9e7193..85b822f 100644
--- a/src/test/resources/launchpad.json
+++ b/src/test/resources/launchpad.json
@@ -6,12 +6,12 @@
   "bundles":[
     {
       "id":"org.apache.sling:org.apache.sling.launchpad.base:5.6.10-2.6.26",
-      "start-level":"20"
+      "start-order":"20"
     },
     {
       "id":"org.apache.sling:org.apache.sling.commons.osgi:2.4.0",
       "run-modes":":something",
-      "start-level":"20"
+      "start-order":"20"
     }
   ],
   "configurations":{
diff --git a/src/test/resources/oak.json b/src/test/resources/oak.json
index c5aad76..c31a077 100644
--- a/src/test/resources/oak.json
+++ b/src/test/resources/oak.json
@@ -8,46 +8,46 @@
     "bundles": [
         {
             "id": "org.apache.felix/org.apache.felix.jaas/1.0.2",
-            "start-level": 10
+            "start-order": 10
         },
         {
             "id": "org.apache.jackrabbit/oak-core/1.6.8",
-            "start-level": 15
+            "start-order": 15
         },
         {
             "id": "org.apache.jackrabbit/oak-commons/1.6.8",
-            "start-level": 15
+            "start-order": 15
         },
         {
             "id": "org.apache.jackrabbit/oak-lucene/1.6.8",
-            "start-level": 15
+            "start-order": 15
         },
         {
             "id": "org.apache.jackrabbit/oak-blob/1.6.8",
-            "start-level": 15
+            "start-order": 15
         },
         {
             "id": "org.apache.jackrabbit/oak-jcr/1.6.8",
-            "start-level": 15
+            "start-order": 15
         },
         {
             "id": "org.apache.jackrabbit/oak-segment-tar/1.6.8",
-            "start-level": 15,
+            "start-order": 15,
             "run-modes": "oak_tar"
         },
         {
             "id": "org.mongodb/mongo-java-driver/3.4.1",
-            "start-level": 15,
+            "start-order": 15,
             "run-modes": "oak_mongo"
         },
         {
             "id": "com.h2database/h2-mvstore/1.4.196",
-            "start-level": 15,
+            "start-order": 15,
             "run-modes": "oak_mongo"
         },
         {
             "id": "org.apache.sling/org.apache.sling.jcr.oak.server/1.1.4",
-            "start-level": 16
+            "start-order": 16
         }
     ],
     "configurations": {
diff --git a/src/test/resources/repoinit.json b/src/test/resources/repoinit.json
index 24e6ae4..9c0216d 100644
--- a/src/test/resources/repoinit.json
+++ b/src/test/resources/repoinit.json
@@ -5,15 +5,15 @@
     "bundles": [
         {
             "id": "org.apache.sling/org.apache.sling.repoinit.parser/1.2.0",
-            "start-level": 20
+            "start-order": 20
         },
         {
             "id": "org.apache.sling/org.apache.sling.jcr.repoinit/1.1.6",
-            "start-level": 20
+            "start-order": 20
         },
         {
             "id": "org.apache.sling/org.apache.sling.provisioning.model/1.8.4",
-            "start-level": 20
+            "start-order": 20
         }
     ],
     "configurations": {
diff --git a/src/test/resources/simple.json b/src/test/resources/simple.json
index 4cc130a..a0422a0 100644
--- a/src/test/resources/simple.json
+++ b/src/test/resources/simple.json
@@ -3,7 +3,7 @@
   "bundles":[
     {
       "id":"org.apache.aries:org.apache.aries.util:1.1.3",
-      "start-level":"20"
+      "start-order":"20"
     }
   ]
 }
diff --git a/src/test/resources/simple2.json b/src/test/resources/simple2.json
index d324a3f..952d2a1 100644
--- a/src/test/resources/simple2.json
+++ b/src/test/resources/simple2.json
@@ -6,7 +6,7 @@
   "bundles":[
     {
       "id":"org.apache.aries:org.apache.aries.util:1.1.3",
-      "start-level":"20"
+      "start-order":"20"
     }
   ]
 }

Reply via email to