You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by da...@apache.org on 2018/04/27 10:01:50 UTC
[sling-org-apache-sling-feature-modelconverter] 32/40: Split
feature util into io and assembly parts
This is an automated email from the ASF dual-hosted git repository.
davidb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-modelconverter.git
commit 20184eaef362e39140fcef74aff574caf48b5d13
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Apr 17 16:56:40 2018 +0200
Split feature util into io and assembly parts
---
.../modelconverter/impl/FeatureToProvisioning.java | 2 +-
.../modelconverter/impl/ModelConverterTest.java | 55 +++++++++++-----------
2 files changed, 28 insertions(+), 29 deletions(-)
diff --git a/src/main/java/org/apache/sling/feature/modelconverter/impl/FeatureToProvisioning.java b/src/main/java/org/apache/sling/feature/modelconverter/impl/FeatureToProvisioning.java
index fd1d268..eb83353 100644
--- a/src/main/java/org/apache/sling/feature/modelconverter/impl/FeatureToProvisioning.java
+++ b/src/main/java/org/apache/sling/feature/modelconverter/impl/FeatureToProvisioning.java
@@ -62,7 +62,7 @@ public class FeatureToProvisioning {
static final String PROVISIONING_MODEL_NAME_VARIABLE = "provisioning.model.name";
public static void convert(File file, String output, ArtifactManager am) throws IOException {
- org.apache.sling.feature.Feature feature = FeatureUtil.getFeature(file.getAbsolutePath(), am, SubstituteVariables.NONE);
+ org.apache.sling.feature.Feature feature = org.apache.sling.feature.support.io.FeatureUtil.getFeature(file.getAbsolutePath(), am, SubstituteVariables.NONE);
Object featureNameVar = feature.getVariables().remove(PROVISIONING_MODEL_NAME_VARIABLE);
String featureName;
diff --git a/src/test/java/org/apache/sling/feature/modelconverter/impl/ModelConverterTest.java b/src/test/java/org/apache/sling/feature/modelconverter/impl/ModelConverterTest.java
index dfc85ee..87867fb 100644
--- a/src/test/java/org/apache/sling/feature/modelconverter/impl/ModelConverterTest.java
+++ b/src/test/java/org/apache/sling/feature/modelconverter/impl/ModelConverterTest.java
@@ -16,12 +16,34 @@
*/
package org.apache.sling.feature.modelconverter.impl;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
import org.apache.sling.feature.Bundles;
import org.apache.sling.feature.Configurations;
import org.apache.sling.feature.Extension;
import org.apache.sling.feature.ExtensionType;
import org.apache.sling.feature.Extensions;
-import org.apache.sling.feature.support.FeatureUtil;
import org.apache.sling.feature.support.artifact.ArtifactManager;
import org.apache.sling.feature.support.artifact.ArtifactManagerConfig;
import org.apache.sling.feature.support.json.FeatureJSONReader.SubstituteVariables;
@@ -43,29 +65,6 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
public class ModelConverterTest {
private Path tempDir;
private ArtifactManager artifactManager;
@@ -175,8 +174,8 @@ public class ModelConverterTest {
File outFile = files.get(0);
String expectedFile = new File(getClass().getResource(expectedJSON).toURI()).getAbsolutePath();
- org.apache.sling.feature.Feature expected = FeatureUtil.getFeature(expectedFile, artifactManager, SubstituteVariables.NONE);
- org.apache.sling.feature.Feature actual = FeatureUtil.getFeature(outFile.getAbsolutePath(), artifactManager, SubstituteVariables.NONE);
+ org.apache.sling.feature.Feature expected = org.apache.sling.feature.support.io.FeatureUtil.getFeature(expectedFile, artifactManager, SubstituteVariables.NONE);
+ org.apache.sling.feature.Feature actual = org.apache.sling.feature.support.io.FeatureUtil.getFeature(outFile.getAbsolutePath(), artifactManager, SubstituteVariables.NONE);
assertFeaturesEqual(expected, actual);
}
@@ -206,8 +205,8 @@ public class ModelConverterTest {
File outFile = files.get(0);
String expectedFile = new File(getClass().getResource(expectedJSON).toURI()).getAbsolutePath();
- org.apache.sling.feature.Feature expected = FeatureUtil.getFeature(expectedFile, artifactManager, SubstituteVariables.NONE);
- org.apache.sling.feature.Feature actual = FeatureUtil.getFeature(outFile.getAbsolutePath(), artifactManager, SubstituteVariables.NONE);
+ org.apache.sling.feature.Feature expected = org.apache.sling.feature.support.io.FeatureUtil.getFeature(expectedFile, artifactManager, SubstituteVariables.NONE);
+ org.apache.sling.feature.Feature actual = org.apache.sling.feature.support.io.FeatureUtil.getFeature(outFile.getAbsolutePath(), artifactManager, SubstituteVariables.NONE);
assertFeaturesEqual(expected, actual);
}
--
To stop receiving notification emails like this one, please contact
davidb@apache.org.