felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r829191 - in /felix/trunk/karaf: ./ admin/ admin/command/ admin/core/ admin/core/src/main/java/org/apache/felix/karaf/admin/internal/ admin/core/src/test/java/org/apache/felix/karaf/admin/internal/ admin/management/
Date Fri, 23 Oct 2009 19:46:30 GMT
Author: gertv
Date: Fri Oct 23 19:46:20 2009
New Revision: 829191

URL: http://svn.apache.org/viewvc?rev=829191&view=rev
Log:
FELIX-1799: Hot-deployment not working on admin:create'd instances

Modified:
    felix/trunk/karaf/   (props changed)
    felix/trunk/karaf/admin/   (props changed)
    felix/trunk/karaf/admin/command/   (props changed)
    felix/trunk/karaf/admin/core/   (props changed)
    felix/trunk/karaf/admin/core/src/main/java/org/apache/felix/karaf/admin/internal/AdminServiceImpl.java
    felix/trunk/karaf/admin/core/src/test/java/org/apache/felix/karaf/admin/internal/AdminServiceImplTest.java
    felix/trunk/karaf/admin/management/   (props changed)

Propchange: felix/trunk/karaf/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Oct 23 19:46:20 2009
@@ -2,6 +2,7 @@
 *.iml
 *.ipr
 *.iws
+.idea
 .classpath
 .project
 .settings

Propchange: felix/trunk/karaf/admin/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Oct 23 19:46:20 2009
@@ -0,0 +1 @@
+*.i??

Propchange: felix/trunk/karaf/admin/command/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Oct 23 19:46:20 2009
@@ -0,0 +1 @@
+*.i??

Propchange: felix/trunk/karaf/admin/core/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Oct 23 19:46:20 2009
@@ -0,0 +1 @@
+*.i??

Modified: felix/trunk/karaf/admin/core/src/main/java/org/apache/felix/karaf/admin/internal/AdminServiceImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/admin/core/src/main/java/org/apache/felix/karaf/admin/internal/AdminServiceImpl.java?rev=829191&r1=829190&r2=829191&view=diff
==============================================================================
--- felix/trunk/karaf/admin/core/src/main/java/org/apache/felix/karaf/admin/internal/AdminServiceImpl.java
(original)
+++ felix/trunk/karaf/admin/core/src/main/java/org/apache/felix/karaf/admin/internal/AdminServiceImpl.java
Fri Oct 23 19:46:20 2009
@@ -140,6 +140,7 @@
 
         copyResourceToDir(karafBase, "etc/config.properties", true);
         copyResourceToDir(karafBase, "etc/java.util.logging.properties", true);
+        copyResourceToDir(karafBase, "etc/org.apache.felix.fileinstall-deploy.cfg", true);
         copyResourceToDir(karafBase, "etc/org.apache.felix.karaf.log.cfg", true);
         copyResourceToDir(karafBase, FEATURES_CFG, true);
         copyResourceToDir(karafBase, "etc/org.apache.felix.karaf.management.cfg", true);

Modified: felix/trunk/karaf/admin/core/src/test/java/org/apache/felix/karaf/admin/internal/AdminServiceImplTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/admin/core/src/test/java/org/apache/felix/karaf/admin/internal/AdminServiceImplTest.java?rev=829191&r1=829190&r2=829191&view=diff
==============================================================================
--- felix/trunk/karaf/admin/core/src/test/java/org/apache/felix/karaf/admin/internal/AdminServiceImplTest.java
(original)
+++ felix/trunk/karaf/admin/core/src/test/java/org/apache/felix/karaf/admin/internal/AdminServiceImplTest.java
Fri Oct 23 19:46:20 2009
@@ -19,16 +19,18 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.Arrays;
 import java.util.Properties;
 
 import junit.framework.TestCase;
-
+import org.apache.felix.karaf.admin.Instance;
 import org.apache.felix.karaf.admin.InstanceSettings;
 
 public class AdminServiceImplTest extends TestCase {
+
     public void testHandleFeatures() throws Exception {
         AdminServiceImpl as = new AdminServiceImpl();
         
@@ -61,4 +63,34 @@
             f.delete();
         }
     }
+
+    /**
+     * Ensure the admin:create generates all the required configuration files
+     * //TODO: fix this test so it can run in an IDE
+     */
+    public void testConfigurationFiles() throws Exception {
+        AdminServiceImpl service = new AdminServiceImpl();
+        service.setStorageLocation(new File("target/instances/" + System.currentTimeMillis()));
+
+        InstanceSettings settings = new InstanceSettings(8122, getName(), null, null);
+        Instance instance = service.createInstance(getName(), settings);
+
+        assertFileExists(instance.getLocation(), "etc/config.properties");
+        assertFileExists(instance.getLocation(), "etc/users.properties");
+        assertFileExists(instance.getLocation(), "etc/startup.properties");
+
+        assertFileExists(instance.getLocation(), "etc/java.util.logging.properties");
+        assertFileExists(instance.getLocation(), "etc/org.apache.felix.karaf.features.cfg");
+        assertFileExists(instance.getLocation(), "etc/org.apache.felix.fileinstall-deploy.cfg");
+        assertFileExists(instance.getLocation(), "etc/org.apache.felix.karaf.log.cfg");
+        assertFileExists(instance.getLocation(), "etc/org.apache.felix.karaf.management.cfg");
+        assertFileExists(instance.getLocation(), "etc/org.ops4j.pax.logging.cfg");
+        assertFileExists(instance.getLocation(), "etc/org.ops4j.pax.url.mvn.cfg");
+    }
+
+    private void assertFileExists(String path, String name) throws IOException {
+        File file = new File(path, name);
+        assertTrue("Expected " + file.getCanonicalPath() + " to exist",
+                   file.exists());
+    }   
 }

Propchange: felix/trunk/karaf/admin/management/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Oct 23 19:46:20 2009
@@ -0,0 +1 @@
+*.i??



Mime
View raw message