« Return to Thread: [cargo] r3301 - in core/trunk: api/module/src/test/java/org/codehaus/cargo/module/merge containers/jetty containers/jetty/src/main/java/org/codehaus/cargo/container/jetty containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/internal

[cargo] r3301 - in core/trunk: api/module/src/test/java/org/codehaus/cargo/module/merge containers/jetty containers/jetty/src/main/java/org/codehaus/cargo/container/jetty containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/internal

by alitokmen-2 :: Rate this Message:

| View in Thread

Author: alitokmen
Date: 2012-05-03 15:01:29 -0500 (Thu, 03 May 2012)
New Revision: 3301

Added:
   core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/internal/Jetty7xStandaloneLocalConfigurationCapability.java
Modified:
   core/trunk/api/module/src/test/java/org/codehaus/cargo/module/merge/DocumentMergeTest.java
   core/trunk/containers/jetty/pom.xml
   core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty7xInstalledLocalContainer.java
   core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty7xStandaloneLocalConfiguration.java
   core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty8xInstalledLocalContainer.java
   core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty8xStandaloneLocalConfiguration.java
   core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/JettyFactoryRegistry.java
   core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/internal/JettyStandaloneLocalConfigurationCapability.java
Log:
Fix CARGO-1107: Add datasource support for Jetty containers

Modified: core/trunk/api/module/src/test/java/org/codehaus/cargo/module/merge/DocumentMergeTest.java
===================================================================
--- core/trunk/api/module/src/test/java/org/codehaus/cargo/module/merge/DocumentMergeTest.java 2012-05-02 22:57:25 UTC (rev 3300)
+++ core/trunk/api/module/src/test/java/org/codehaus/cargo/module/merge/DocumentMergeTest.java 2012-05-03 20:01:29 UTC (rev 3301)
@@ -1,85 +1,74 @@
-/*
- * ========================================================================
- *
- * Codehaus CARGO, copyright 2004-2011 Vincent Massol.
- *
- * 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
- *
- *   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.codehaus.cargo.module.merge;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.input.SAXBuilder;
-
-import java.io.StringReader;
-
-/**
- * Test class which verifies that the DocumentMerge class is merging two Document objects correctly.
- *
- * @version $Id: DocumentMergeTest.java 2012-05-02 08:33:00Z $
- */
-public class DocumentMergeTest extends TestCase
-{
-
-    /**
-     * Test to see that two documents are merged correctly.
-     *
-     * @throws Exception If anything goes wrong.
-     */
-    public void testMergeTwoDocuments() throws Exception
-    {
-        SAXBuilder sb = new SAXBuilder();
-        String doc1 = "<topnode><parentnode><value>8</value></parentnode></topnode>";
-        String doc2 = "<topnode><parentnode><value>13</value></parentnode></topnode>";
-        String doc3 = "<topnode><parentnode><value>26</value></parentnode></topnode>";
-
-        // build two different documents
-        Document saxDoc1 = sb.build(new StringReader(doc1));
-        Document saxDoc2 = sb.build(new StringReader(doc2));
-        Document saxDoc3 = sb.build(new StringReader(doc3));
-
-        // add them to DocumentMerger object
-        DocumentMerger merger = new DocumentMerger();
-        merger.addMergeItem(saxDoc1);
-        merger.addMergeItem(saxDoc2);
-        merger.addMergeItem(saxDoc3);
-
-        // perform the merge
-        Document mergedDoc = (Document) merger.performMerge();
-
-        // verify this one Document has both entries
-        Element rootNode = mergedDoc.getRootElement();
-        List<Element> list = rootNode.getChildren("parentnode");
-        for (int i = 0; i < list.size(); i++)
-        {
-            Element node = (Element) list.get(i);
-            if (i == 0)
-            {
-                assertEquals(node.getChildText("value"), "8");
-            }
-            if (i == 1)
-            {
-                assertEquals(node.getChildText("value"), "13");
-            }
-            if (i == 2)
-            {
-                assertEquals(node.getChildText("value"), "26");
-            }
-        }
-    }
-}
+/*
+ * ========================================================================
+ *
+ * Codehaus CARGO, copyright 2004-2011 Vincent Massol.
+ *
+ * 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
+ *
+ *   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.codehaus.cargo.module.merge;
+
+import java.util.List;
+
+import junit.framework.TestCase;
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.input.SAXBuilder;
+
+import java.io.StringReader;
+
+/**
+ * Test class which verifies that the DocumentMerge class is merging two Document objects correctly.
+ *
+ * @version $Id$
+ */
+public class DocumentMergeTest extends TestCase
+{
+
+    /**
+     * Test to see that two documents are merged correctly.
+     *
+     * @throws Exception If anything goes wrong.
+     */
+    public void testMergeTwoDocuments() throws Exception
+    {
+        SAXBuilder sb = new SAXBuilder();
+        String doc1 = "<topnode><parentnode><value>8</value></parentnode></topnode>";
+        String doc2 = "<topnode><parentnode><value>13</value></parentnode></topnode>";
+        String doc3 = "<topnode><parentnode><value>26</value></parentnode></topnode>";
+
+        // build two different documents
+        Document saxDoc1 = sb.build(new StringReader(doc1));
+        Document saxDoc2 = sb.build(new StringReader(doc2));
+        Document saxDoc3 = sb.build(new StringReader(doc3));
+
+        // add them to DocumentMerger object
+        DocumentMerger merger = new DocumentMerger();
+        merger.addMergeItem(saxDoc1);
+        merger.addMergeItem(saxDoc2);
+        merger.addMergeItem(saxDoc3);
+
+        // perform the merge
+        Document mergedDoc = (Document) merger.performMerge();
+
+        // verify this one Document has both entries
+        Element rootNode = mergedDoc.getRootElement();
+        List<Element> list = rootNode.getChildren("parentnode");
+        assertNotNull(list);
+        assertEquals(3, list.size());
+        assertEquals(((Element) list.get(0)).getChildText("value"), "8");
+        assertEquals(((Element) list.get(1)).getChildText("value"), "13");
+        assertEquals(((Element) list.get(2)).getChildText("value"), "26");
+    }
+}


Property changes on: core/trunk/api/module/src/test/java/org/codehaus/cargo/module/merge/DocumentMergeTest.java
___________________________________________________________________
Added: svn:keywords
   + "Author Date Id Revision"
Added: svn:eol-style
   + native

Modified: core/trunk/containers/jetty/pom.xml
===================================================================
--- core/trunk/containers/jetty/pom.xml 2012-05-02 22:57:25 UTC (rev 3300)
+++ core/trunk/containers/jetty/pom.xml 2012-05-03 20:01:29 UTC (rev 3301)
@@ -27,4 +27,33 @@
   <name>Cargo Core Jetty Container</name>
   <packaging>jar</packaging>
   <description>Core API implementation for Jetty containers</description>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>prepare-package</phase>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>c3p0</groupId>
+                  <artifactId>c3p0</artifactId>
+                  <version>0.9.1.1</version>
+                  <outputDirectory>
+                    ${project.build.directory}/classes/org/codehaus/cargo/container/jetty/datasource
+                  </outputDirectory>
+                  <destFileName>c3p0.jar</destFileName>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+            <goals>
+              <goal>copy</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
 </project>

Modified: core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty7xInstalledLocalContainer.java
===================================================================
--- core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty7xInstalledLocalContainer.java 2012-05-02 22:57:25 UTC (rev 3300)
+++ core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty7xInstalledLocalContainer.java 2012-05-03 20:01:29 UTC (rev 3301)
@@ -47,7 +47,7 @@
      * <code>Server</code> option and if the JSP support is here the <code>jsp</code> option.
      * Any options specified here will be appended.
      */
-    protected String defaultFinalOptions = "jmx,resources,websocket,ext";
+    protected String defaultFinalOptions = "jmx,resources,websocket,ext,plus";
 
     /**
      * Capability of the Jetty container.

Modified: core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty7xStandaloneLocalConfiguration.java
===================================================================
--- core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty7xStandaloneLocalConfiguration.java 2012-05-02 22:57:25 UTC (rev 3300)
+++ core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty7xStandaloneLocalConfiguration.java 2012-05-03 20:01:29 UTC (rev 3301)
@@ -19,14 +19,19 @@
  */
 package org.codehaus.cargo.container.jetty;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.HashMap;
 import java.util.Map;
+
 import org.apache.tools.ant.types.FilterChain;
 import org.codehaus.cargo.container.InstalledLocalContainer;
 import org.codehaus.cargo.container.LocalContainer;
 import org.codehaus.cargo.container.configuration.ConfigurationCapability;
+import org.codehaus.cargo.container.configuration.entry.DataSource;
 import org.codehaus.cargo.container.jetty.internal.AbstractJettyStandaloneLocalConfiguration;
-import org.codehaus.cargo.container.jetty.internal.JettyStandaloneLocalConfigurationCapability;
+import org.codehaus.cargo.container.jetty.internal.Jetty7xStandaloneLocalConfigurationCapability;
 import org.codehaus.cargo.container.spi.deployer.AbstractCopyingInstalledLocalDeployer;
 
 /**
@@ -42,7 +47,7 @@
      * Capability of the Jetty 7.x standalone local configuration.
      */
     private static ConfigurationCapability capability =
-        new JettyStandaloneLocalConfigurationCapability();
+        new Jetty7xStandaloneLocalConfigurationCapability();
 
     /**
      * The list of files in which to replace <code>jetty.home</code> with
@@ -109,8 +114,15 @@
         super.doConfigure(container);
 
         String etcDir = getFileHandler().append(getHome(), "etc");
+
         Map<String, String> jettyXmlReplacements = new HashMap<String, String>();
         jettyXmlReplacements.put("<Property", "<SystemProperty");
+
+        if (getDataSources() != null && !getDataSources().isEmpty())
+        {
+            configureDatasource(container, etcDir);
+        }
+
         getFileHandler().replaceInFile(
             getFileHandler().append(etcDir, "jetty.xml"), jettyXmlReplacements, "UTF-8");
     }
@@ -127,6 +139,85 @@
     }
 
     /**
+     * Configure datasource definitions.
+     * @param container Container.
+     * @param etcDir The <code>etc</code> directory of the configuration.
+     * @throws IOException If the pooling component cannot be copied.
+     */
+    protected void configureDatasource(LocalContainer container, String etcDir) throws IOException
+    {
+        StringBuilder sb = new StringBuilder();
+        sb.append("<Call name=\"setAttribute\">\n");
+        sb.append("  <Arg>org.eclipse.jetty.webapp.configuration</Arg>\n");
+        sb.append("  <Arg>\n");
+        sb.append("    <Array type=\"java.lang.String\">\n");
+        sb.append("      <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>\n");
+        sb.append("      <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>\n");
+        sb.append("      <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item>\n");
+        sb.append("      <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item>\n");
+        sb.append("      <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>\n");
+        sb.append("      <Item>org.eclipse.jetty.plus.webapp.PlusConfiguration</Item>\n");
+        sb.append("      <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>\n");
+        sb.append("      <Item>org.eclipse.jetty.webapp.TagLibConfiguration</Item>\n");
+        sb.append("    </Array>\n");
+        sb.append("  </Arg>\n");
+        sb.append("</Call>\n");
+
+        createDatasourceDefinitions(sb, container);
+
+        Map<String, String> jettyXmlReplacements = new HashMap<String, String>();
+        jettyXmlReplacements.put("</Configure>", sb.toString() + "</Configure>");
+        getFileHandler().replaceInFile(
+            getFileHandler().append(etcDir, "jetty.xml"), jettyXmlReplacements, "UTF-8");
+    }
+
+    /**
+     * Creates datasource definitions.
+     * @param sb String buffer to print the definitions into.
+     * @param container Container.
+     * @throws IOException If the pooling component cannot be copied.
+     */
+    protected void createDatasourceDefinitions(StringBuilder sb, LocalContainer container)
+        throws IOException
+    {
+        // Add datasources
+        for (DataSource ds : getDataSources())
+        {
+            sb.append("\n");
+            sb.append("<New id=\"" + ds.getId()
+                + "\" class=\"org.eclipse.jetty.plus.jndi.Resource\">\n");
+            sb.append("  <Arg>" + ds.getJndiLocation() + "</Arg>\n");
+            sb.append("  <Arg>\n");
+            sb.append("    <New class=\"com.mchange.v2.c3p0.ComboPooledDataSource\">\n");
+            sb.append("      <Set name=\"driverClass\">" + ds.getDriverClass() + "</Set>\n");
+            sb.append("      <Set name=\"jdbcUrl\">" + ds.getUrl() + "</Set>\n");
+            sb.append("      <Set name=\"user\">" + ds.getUsername() + "</Set>\n");
+            sb.append("      <Set name=\"password\">" + ds.getPassword() + "</Set>\n");
+            sb.append("    </New>\n");
+            sb.append("  </Arg>\n");
+            sb.append("</New>\n");
+        }
+
+        InputStream c3p0Reader = getClass().getClassLoader().getResourceAsStream(
+            "org/codehaus/cargo/container/jetty/datasource/c3p0.jar");
+        String c3p0File = getFileHandler().append(getHome(), "lib/ext/c3p0.jar");
+        OutputStream c3p0Writer = getFileHandler().getOutputStream(c3p0File);
+        try
+        {
+            getFileHandler().copy(c3p0Reader, c3p0Writer);
+        }
+        finally
+        {
+            c3p0Writer.close();
+            c3p0Writer = null;
+            System.gc();
+        }
+
+        InstalledLocalContainer installedContainer = (InstalledLocalContainer) container;
+        installedContainer.addExtraClasspath(c3p0File);
+    }
+
+    /**
      * {@inheritDoc}
      */
     protected String[] replaceJettyHomeInFiles()
@@ -143,5 +234,4 @@
     {
         return "Jetty 7.x Standalone Configuration";
     }
-
 }

Modified: core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty8xInstalledLocalContainer.java
===================================================================
--- core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty8xInstalledLocalContainer.java 2012-05-02 22:57:25 UTC (rev 3300)
+++ core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty8xInstalledLocalContainer.java 2012-05-03 20:01:29 UTC (rev 3301)
@@ -19,6 +19,9 @@
  */
 package org.codehaus.cargo.container.jetty;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.codehaus.cargo.container.configuration.LocalConfiguration;
 
 /**
@@ -68,22 +71,30 @@
     @Override
     protected String[] getStartArguments()
     {
-        return new String[]
+        List<String> startArguments = new ArrayList<String>();
+
+        startArguments.add("--pre=" + getFileHandler().append(getConfiguration().getHome(),
+                "etc/jetty-logging.xml"));
+        startArguments.add("--pre=" + getFileHandler().append(getConfiguration().getHome(),
+                "etc/jetty.xml"));
+        startArguments.add("--pre=" + getFileHandler().append(getConfiguration().getHome(),
+                "etc/jetty-annotations.xml"));
+        if (getConfiguration().getDataSources() != null
+            && !getConfiguration().getDataSources().isEmpty())
         {
-            "--pre=" + getFileHandler().append(getConfiguration().getHome(),
-                "etc/jetty-logging.xml"),
-            "--pre=" + getFileHandler().append(getConfiguration().getHome(),
-                "etc/jetty.xml"),
-            "--pre=" + getFileHandler().append(getConfiguration().getHome(),
-                "etc/jetty-annotations.xml"),
-            "--pre=" + getFileHandler().append(getConfiguration().getHome(),
-                "etc/jetty-deploy.xml"),
-            "--pre=" + getFileHandler().append(getConfiguration().getHome(),
-                "etc/jetty-webapps.xml"),
-            "--pre=" + getFileHandler().append(getConfiguration().getHome(),
-                "etc/jetty-contexts.xml"),
-            "--pre=" + getFileHandler().append(getConfiguration().getHome(),
-                "etc/jetty-testrealm.xml")
-        };
+            startArguments.add("--pre=" + getFileHandler().append(getConfiguration().getHome(),
+                    "etc/jetty-plus.xml"));
+        }
+        startArguments.add("--pre=" + getFileHandler().append(getConfiguration().getHome(),
+                "etc/jetty-deploy.xml"));
+        startArguments.add("--pre=" + getFileHandler().append(getConfiguration().getHome(),
+                "etc/jetty-webapps.xml"));
+        startArguments.add("--pre=" + getFileHandler().append(getConfiguration().getHome(),
+                "etc/jetty-contexts.xml"));
+        startArguments.add("--pre=" + getFileHandler().append(getConfiguration().getHome(),
+                "etc/jetty-testrealm.xml"));
+
+        String[] startArgumentsArray = new String[startArguments.size()];
+        return startArguments.toArray(startArgumentsArray);
     }
 }

Modified: core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty8xStandaloneLocalConfiguration.java
===================================================================
--- core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty8xStandaloneLocalConfiguration.java 2012-05-02 22:57:25 UTC (rev 3300)
+++ core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/Jetty8xStandaloneLocalConfiguration.java 2012-05-03 20:01:29 UTC (rev 3301)
@@ -19,9 +19,12 @@
  */
 package org.codehaus.cargo.container.jetty;
 
-import org.codehaus.cargo.container.configuration.ConfigurationCapability;
-import org.codehaus.cargo.container.jetty.internal.JettyStandaloneLocalConfigurationCapability;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
 
+import org.codehaus.cargo.container.LocalContainer;
+
 /**
  * Jetty 8.x standalone
  * {@link org.codehaus.cargo.container.spi.configuration.ContainerConfiguration} implementation.
@@ -31,12 +34,6 @@
 public class Jetty8xStandaloneLocalConfiguration extends Jetty7xStandaloneLocalConfiguration
 {
     /**
-     * Capability of the Jetty 8.x standalone local configuration.
-     */
-    private static ConfigurationCapability capability =
-        new JettyStandaloneLocalConfigurationCapability();
-
-    /**
      * {@inheritDoc}
      * @see Jetty7xStandaloneLocalConfiguration#Jetty7xStandaloneLocalConfiguration(String)
      */
@@ -47,11 +44,17 @@
 
     /**
      * {@inheritDoc}
-     * @see org.codehaus.cargo.container.configuration.Configuration#getCapability()
      */
-    public ConfigurationCapability getCapability()
+    @Override
+    protected void configureDatasource(LocalContainer container, String etcDir) throws IOException
     {
-        return capability;
+        StringBuilder sb = new StringBuilder();
+        createDatasourceDefinitions(sb, container);
+
+        Map<String, String> jettyXmlReplacements = new HashMap<String, String>();
+        jettyXmlReplacements.put("</Configure>", sb.toString() + "</Configure>");
+        getFileHandler().replaceInFile(
+            getFileHandler().append(etcDir, "jetty-plus.xml"), jettyXmlReplacements, "UTF-8");
     }
 
     /**

Modified: core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/JettyFactoryRegistry.java
===================================================================
--- core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/JettyFactoryRegistry.java 2012-05-02 22:57:25 UTC (rev 3300)
+++ core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/JettyFactoryRegistry.java 2012-05-03 20:01:29 UTC (rev 3301)
@@ -25,6 +25,7 @@
 import org.codehaus.cargo.container.internal.ServletContainerCapability;
 import org.codehaus.cargo.container.jetty.internal.Jetty4xEmbeddedStandaloneLocalConfigurationCapability;
 import org.codehaus.cargo.container.jetty.internal.Jetty6xEmbeddedStandaloneLocalConfigurationCapability;
+import org.codehaus.cargo.container.jetty.internal.Jetty7xStandaloneLocalConfigurationCapability;
 import org.codehaus.cargo.container.jetty.internal.JettyExistingLocalConfigurationCapability;
 import org.codehaus.cargo.container.jetty.internal.JettyRuntimeConfigurationCapability;
 import org.codehaus.cargo.container.jetty.internal.JettyStandaloneLocalConfigurationCapability;
@@ -89,7 +90,7 @@
             Jetty6xEmbeddedStandaloneLocalConfigurationCapability.class);
         configurationCapabilityFactory.registerConfigurationCapability("jetty7x",
             ContainerType.INSTALLED, ConfigurationType.STANDALONE,
-            JettyStandaloneLocalConfigurationCapability.class);
+            Jetty7xStandaloneLocalConfigurationCapability.class);
         configurationCapabilityFactory.registerConfigurationCapability("jetty7x",
             ContainerType.INSTALLED, ConfigurationType.EXISTING,
             JettyExistingLocalConfigurationCapability.class);
@@ -102,7 +103,7 @@
             Jetty6xEmbeddedStandaloneLocalConfigurationCapability.class);
         configurationCapabilityFactory.registerConfigurationCapability("jetty8x",
             ContainerType.INSTALLED, ConfigurationType.STANDALONE,
-            JettyStandaloneLocalConfigurationCapability.class);
+            Jetty7xStandaloneLocalConfigurationCapability.class);
         configurationCapabilityFactory.registerConfigurationCapability("jetty8x",
             ContainerType.INSTALLED, ConfigurationType.EXISTING,
             JettyExistingLocalConfigurationCapability.class);

Copied: core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/internal/Jetty7xStandaloneLocalConfigurationCapability.java (from rev 3297, core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/internal/JettyStandaloneLocalConfigurationCapability.java)
===================================================================
--- core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/internal/Jetty7xStandaloneLocalConfigurationCapability.java                        (rev 0)
+++ core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/internal/Jetty7xStandaloneLocalConfigurationCapability.java 2012-05-03 20:01:29 UTC (rev 3301)
@@ -0,0 +1,43 @@
+/*
+ * ========================================================================
+ *
+ * Codehaus CARGO, copyright 2004-2011 Vincent Massol.
+ *
+ * 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
+ *
+ *   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.codehaus.cargo.container.jetty.internal;
+
+import org.codehaus.cargo.container.property.DatasourcePropertySet;
+
+/**
+ * Capabilities of the Jetty 7.x and onward's
+ * {@link org.codehaus.cargo.container.jetty.internal.AbstractJettyStandaloneLocalConfiguration}
+ * configuration for installed containers.
+ *
+ * @version $Id$
+ */
+public class Jetty7xStandaloneLocalConfigurationCapability extends
+    JettyStandaloneLocalConfigurationCapability
+{
+    /**
+     * Initialize the configuration-specific supports Map.
+     */
+    public Jetty7xStandaloneLocalConfigurationCapability()
+    {
+        super();
+
+        this.supportsMap.put(DatasourcePropertySet.DATASOURCE, Boolean.TRUE);
+    }
+}

Modified: core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/internal/JettyStandaloneLocalConfigurationCapability.java
===================================================================
--- core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/internal/JettyStandaloneLocalConfigurationCapability.java 2012-05-02 22:57:25 UTC (rev 3300)
+++ core/trunk/containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/internal/JettyStandaloneLocalConfigurationCapability.java 2012-05-03 20:01:29 UTC (rev 3301)
@@ -40,7 +40,7 @@
     /**
      * Configuration-specific supports Map.
      */
-    private Map<String, Boolean> supportsMap;
+    protected Map<String, Boolean> supportsMap;
 
     /**
      * Initialize the configuration-specific supports Map.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: [cargo] r3301 - in core/trunk: api/module/src/test/java/org/codehaus/cargo/module/merge containers/jetty containers/jetty/src/main/java/org/codehaus/cargo/container/jetty containers/jetty/src/main/java/org/codehaus/cargo/container/jetty/internal