Bug 395481 Sets gemini.web bundles autoStart="true" and adds smoke test to verify the access to the admin console of VNF
diff --git a/nano/org.eclipse.virgo.nano.smoketest/src/smokeTest/java/org/eclipse/virgo/nano/smoketest/NanoFullSmokeTests.java b/nano/org.eclipse.virgo.nano.smoketest/src/smokeTest/java/org/eclipse/virgo/nano/smoketest/NanoFullSmokeTests.java
new file mode 100644
index 0000000..6809a67
--- /dev/null
+++ b/nano/org.eclipse.virgo.nano.smoketest/src/smokeTest/java/org/eclipse/virgo/nano/smoketest/NanoFullSmokeTests.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2012 VMware Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VMware Inc. - initial contribution
+ * SAP AG - re-factoring
+ *******************************************************************************/
+
+package org.eclipse.virgo.nano.smoketest;
+
+import static org.apache.http.HttpStatus.SC_OK;
+import static org.apache.http.HttpStatus.SC_UNAUTHORIZED;
+import static org.eclipse.virgo.test.tools.JmxUtils.isDefaultJmxPortAvailable;
+import static org.eclipse.virgo.test.tools.JmxUtils.isKernelStarted;
+import static org.eclipse.virgo.test.tools.JmxUtils.waitForVirgoServerShutdownFully;
+import static org.eclipse.virgo.test.tools.UrlWaitLatch.waitFor;
+import static org.eclipse.virgo.test.tools.VirgoServerShutdownThread.shutdown;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.concurrent.TimeUnit;
+
+import org.eclipse.virgo.test.tools.AbstractSmokeTests;
+import org.eclipse.virgo.test.tools.JmxUtils;
+import org.eclipse.virgo.test.tools.ServerUtils;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class NanoFullSmokeTests extends AbstractSmokeTests {
+
+ private static final String VIRGO_FLAVOR = "nano-full";
+
+ private static final String JAVA_PROFILE_TESTER_1_0_0_JAR = "java.profile.tester_1.0.0.jar";
+
+ @Override
+ protected String getVirgoFlavor() {
+ return VIRGO_FLAVOR;
+ }
+
+ @BeforeClass
+ public static void initJmxConnection() {
+ JmxUtils.virgoHome = ServerUtils.getHome(VIRGO_FLAVOR);
+ }
+
+ @Before
+ public void startServer() throws Exception {
+ // cleanup
+ undeployTestBundles(VIRGO_FLAVOR, JAVA_PROFILE_TESTER_1_0_0_JAR);
+ super.startServer();
+ }
+
+ @Test
+ public void virgoNanoFullShouldBeStarted() throws Exception {
+ assertTrue(isKernelStarted());
+ }
+
+ @Test
+ public void testNanoFullJavaProfileSetCorrectly() throws Exception {
+ assertTrue(isKernelStarted());
+
+ // deploy bundle that should kill the server if the test is successful
+ deployTestBundles(VIRGO_FLAVOR, JAVA_PROFILE_TESTER_1_0_0_JAR);
+
+ // wait for deployment
+ TimeUnit.SECONDS.sleep(10);
+ if (isDefaultJmxPortAvailable()) {
+ // success, we expect the server to be killed with this deployment unit
+ return;
+ }
+
+ // the server is still running - shutdown and fail
+ shutdown(ServerUtils.getBinDir(getVirgoFlavor()));
+ assertTrue(waitForVirgoServerShutdownFully());
+ fail("Virgo java profile not properly set - Nano was supposed to be killed if the test was successful.");
+ }
+
+ @Test
+ @Ignore("Splash is not available in Virgo Nano Full")
+ public void splashScreenShouldBeAccessable() throws Exception {
+ assertEquals(SC_OK, waitFor("http://localhost:8080/"));
+ }
+
+ @Test
+ public void adminScreenShouldBeDeniedWithWrongCredentials() {
+ assertEquals(SC_UNAUTHORIZED, waitFor("http://localhost:8080/admin/content", "foo", "bar"));
+ }
+
+ @Test
+ public void adminScreenShouldBeAccessableWithDefaultCredentials() {
+ assertEquals(SC_OK, waitFor("http://localhost:8080/admin/content", "admin", "admin"));
+ }
+
+}
diff --git a/nano/org.eclipse.virgo.nano.smoketest/src/smokeTest/java/org/eclipse/virgo/nano/smoketest/NanoSmokeTests.java b/nano/org.eclipse.virgo.nano.smoketest/src/smokeTest/java/org/eclipse/virgo/nano/smoketest/NanoSmokeTests.java
index cf59096..1756d93 100644
--- a/nano/org.eclipse.virgo.nano.smoketest/src/smokeTest/java/org/eclipse/virgo/nano/smoketest/NanoSmokeTests.java
+++ b/nano/org.eclipse.virgo.nano.smoketest/src/smokeTest/java/org/eclipse/virgo/nano/smoketest/NanoSmokeTests.java
@@ -82,7 +82,7 @@
}
@Test
- @Ignore
+ @Ignore("Splash is not available in Virgo Nano")
public void splashScreenShouldBeAccessable() throws Exception {
assertEquals(SC_OK, waitFor("http://localhost:8080/"));
}
diff --git a/nano/publish_resources/products/nano-full/nano-full.product b/nano/publish_resources/products/nano-full/nano-full.product
index 4139e1e..8c7099a 100755
--- a/nano/publish_resources/products/nano-full/nano-full.product
+++ b/nano/publish_resources/products/nano-full/nano-full.product
@@ -25,6 +25,9 @@
<plugin id="org.eclipse.virgo.web.enterprise.services.accessor" autoStart="true" startLevel="3" />
<plugin id="osgi.enterprise" autoStart="true"/>
<plugin id="org.eclipse.virgo.web.enterprise.javax.persistence.provider.initializer" autoStart="true"/>
+ <plugin id="org.eclipse.gemini.web.core" autoStart="true" startLevel="4" />
+ <plugin id="org.eclipse.gemini.web.tomcat" autoStart="true" startLevel="4" />
+ <plugin id="org.eclipse.gemini.web.extender" autoStart="true" startLevel="4" />
<property name="equinox.use.ds" value="true"/>
<property name="api.bundles" value="javassist;bundle-version=3.17.1.GA,org.apache.el;bundle-version=7.0.32.v201211081135"/>