You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2019/02/13 12:57:06 UTC

[karaf] branch master updated: [KARAF-6155] Add a simple itest starting using Equinox as framework

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

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/master by this push:
     new 737f53f  [KARAF-6155] Add a simple itest starting using Equinox as framework
     new d9d90ed  Merge pull request #767 from jbonofre/KARAF-6155
737f53f is described below

commit 737f53f23fcacfa5c7850d5deb41a6e44d3cd1cd
Author: Jean-Baptiste Onofré <jb...@apache.org>
AuthorDate: Wed Feb 13 12:13:01 2019 +0100

    [KARAF-6155] Add a simple itest starting using Equinox as framework
---
 .../java/org/apache/karaf/itests/BundleTest.java   |  9 ++--
 .../java/org/apache/karaf/itests/EquinoxTest.java  | 48 ++++++++++++++++++++++
 .../test/java/org/apache/karaf/itests/XATest.java  | 10 +++--
 3 files changed, 60 insertions(+), 7 deletions(-)

diff --git a/itests/test/src/test/java/org/apache/karaf/itests/BundleTest.java b/itests/test/src/test/java/org/apache/karaf/itests/BundleTest.java
index ac00881..d61769d 100644
--- a/itests/test/src/test/java/org/apache/karaf/itests/BundleTest.java
+++ b/itests/test/src/test/java/org/apache/karaf/itests/BundleTest.java
@@ -1,7 +1,10 @@
 /*
- * Licensed 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
+ * 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
  *
diff --git a/itests/test/src/test/java/org/apache/karaf/itests/EquinoxTest.java b/itests/test/src/test/java/org/apache/karaf/itests/EquinoxTest.java
new file mode 100644
index 0000000..4b18ce5
--- /dev/null
+++ b/itests/test/src/test/java/org/apache/karaf/itests/EquinoxTest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+package org.apache.karaf.itests;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.karaf.options.KarafDistributionOption;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class EquinoxTest extends KarafTestSupport {
+
+    @Configuration
+    public Option[] config() {
+        List<Option> config = new LinkedList<>(Arrays.asList(super.config()));
+        config.add(KarafDistributionOption.editConfigurationFilePut("etc/config.properties", "karaf.framework", "equinox"));
+        return config.toArray(new Option[config.size()]);
+    }
+
+    @Test
+    public void simpleTest() throws Exception {
+        assertContains("org.eclipse.osgi", executeCommand("info"));
+    }
+
+}
diff --git a/itests/test/src/test/java/org/apache/karaf/itests/XATest.java b/itests/test/src/test/java/org/apache/karaf/itests/XATest.java
index 4854ab1..1c14c55 100644
--- a/itests/test/src/test/java/org/apache/karaf/itests/XATest.java
+++ b/itests/test/src/test/java/org/apache/karaf/itests/XATest.java
@@ -1,7 +1,10 @@
 /*
- * Licensed 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
+ * 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
  *
@@ -14,7 +17,6 @@
 package org.apache.karaf.itests;
 
 import org.apache.karaf.features.FeaturesService;
-import org.apache.karaf.itests.KarafTestSupport;
 import org.apache.karaf.itests.util.RunIfRule;
 import org.junit.Rule;
 import org.junit.Test;