karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggrzy...@apache.org
Subject [karaf] 03/07: [KARAF-5376] Review BuilderTest
Date Wed, 15 Nov 2017 15:29:00 GMT
This is an automated email from the ASF dual-hosted git repository.

ggrzybek pushed a commit to branch KARAF-5376-overrides_v2
in repository https://gitbox.apache.org/repos/asf/karaf.git

commit 9fca11c47fa81ff51c296d23cf397e3298019c6e
Author: Grzegorz Grzybek <gr.grzybek@gmail.com>
AuthorDate: Tue Nov 7 13:23:17 2017 +0100

    [KARAF-5376] Review BuilderTest
---
 profile/pom.xml                                    |  2 +-
 .../apache/karaf/profile/assembly/BuilderTest.java | 28 ++++++++++++++++++++++
 profile/src/test/resources/log4j.properties        | 26 ++++++++++++++++++++
 3 files changed, 55 insertions(+), 1 deletion(-)

diff --git a/profile/pom.xml b/profile/pom.xml
index c50d3dc..223e522 100644
--- a/profile/pom.xml
+++ b/profile/pom.xml
@@ -134,7 +134,7 @@
 
         <dependency>
             <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-jdk14</artifactId>
+            <artifactId>slf4j-log4j12</artifactId>
             <scope>test</scope>
         </dependency>
 
diff --git a/profile/src/test/java/org/apache/karaf/profile/assembly/BuilderTest.java b/profile/src/test/java/org/apache/karaf/profile/assembly/BuilderTest.java
index 3b82371..8003e56 100644
--- a/profile/src/test/java/org/apache/karaf/profile/assembly/BuilderTest.java
+++ b/profile/src/test/java/org/apache/karaf/profile/assembly/BuilderTest.java
@@ -35,6 +35,34 @@ import static org.hamcrest.MatcherAssert.assertThat;
 public class BuilderTest {
 
     @Test
+    public void testAssemblyGoalLikeBuild() throws Exception {
+        Path workDir = Paths.get("target/assembly");
+        recursiveDelete(workDir);
+
+        // Create dummy etc/config.properties file
+        Path config = workDir.resolve("etc/config.properties");
+        Files.createDirectories(config.getParent());
+        try (BufferedWriter w = Files.newBufferedWriter(config)) {
+            w.write(Constants.FRAMEWORK_SYSTEMPACKAGES + " = org.osgi.dto");
+            w.newLine();
+            w.write(Constants.FRAMEWORK_SYSTEMCAPABILITIES + " = ");
+            w.newLine();
+        }
+
+        Path mvnRepo = Paths.get("target/test-classes/repo");
+        Builder builder = Builder.newInstance();
+        // defaultValue = "${project.build.directory}/assembly"
+        builder.homeDirectory(workDir);
+//                .repositories(Builder.Stage.Startup, true, "mvn:foo/baz/1.0/xml/features")
+
+//                .localRepository(mvnRepo.toString());
+        builder.generateAssembly();
+
+        // org.apache.karaf.tooling.AssemblyMojo.includeBuildOutputDirectory? -
+        // ${project.basedir}/src/main/resources/assembly - copied over assembly (no filtering
- source files)
+    }
+
+    @Test
     public void testCyclicRepos() throws Exception {
         Path workDir = Paths.get("target/distrib");
         recursiveDelete(workDir);
diff --git a/profile/src/test/resources/log4j.properties b/profile/src/test/resources/log4j.properties
new file mode 100644
index 0000000..8c07c5c
--- /dev/null
+++ b/profile/src/test/resources/log4j.properties
@@ -0,0 +1,26 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+#
+# The logging properties used during tests..
+#
+log4j.rootLogger=DEBUG, console
+
+# Console will only display warnnings
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{ISO8601} [%5p] {%t} %C (%F:%L) %m%n

-- 
To stop receiving notification emails like this one, please contact
"commits@karaf.apache.org" <commits@karaf.apache.org>.

Mime
View raw message