Commit patch fixes for:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=283472
https://bugs.eclipse.org/bugs/show_bug.cgi?id=284070
https://bugs.eclipse.org/bugs/show_bug.cgi?id=284208

Includes some JUnit test coverage.
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/META-INF/MANIFEST.MF b/jsf/tests/org.eclipse.jst.jsf.core.tests/META-INF/MANIFEST.MF
index ac6fa40..dec64d8 100644
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/META-INF/MANIFEST.MF
+++ b/jsf/tests/org.eclipse.jst.jsf.core.tests/META-INF/MANIFEST.MF
@@ -29,7 +29,9 @@
  org.eclipse.jst.jsp.core,
  org.eclipse.wst.html.core,
  org.eclipse.ui.ide;bundle-version="3.4.0",
- org.eclipse.jst.common.frameworks;bundle-version="[1.1.0,2.0.0)"
+ org.eclipse.jst.common.frameworks,
+ org.eclipse.jst.common.project.facet.core,
+ org.eclipse.jst.j2ee.core
 Bundle-ActivationPolicy: lazy
 Export-Package: org.eclipse.jst.jsf.core.tests;x-friends:="org.eclipse.jst.jsf.ui.tests,org.eclipse.jst.jsf.context.symbol.tests,org.eclipse.jst.jsf.designtime.tests",
  org.eclipse.jst.jsf.core.tests.appconfig.provider;x-internal:=true,
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/AllTests.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/AllTests.java
index 31513cc..8382d0c 100644
--- a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/AllTests.java
+++ b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/AllTests.java
@@ -14,6 +14,9 @@
 import junit.framework.TestSuite;
 
 import org.eclipse.jst.jsf.core.tests.appconfig.validation.AppConfigValidationUtilTestCase;
+import org.eclipse.jst.jsf.core.tests.facet.JsfLibraryValidatorTest;
+import org.eclipse.jst.jsf.core.tests.facet.VendorSpecificWebXmlConfigurationForJ2EETest;
+import org.eclipse.jst.jsf.core.tests.facet.VendorSpecificWebXmlConfigurationForJavaEETest;
 import org.eclipse.jst.jsf.core.tests.jsflibraryconfig.JSFLibraryConfigDialogSettingDataTestCases;
 import org.eclipse.jst.jsf.core.tests.jsflibraryconfig.JSFLibraryConfigModelTestCases;
 import org.eclipse.jst.jsf.core.tests.jsflibraryconfig.JSFLibraryRegistryUtilTestCases;
@@ -95,6 +98,11 @@
 
         suite.addTestSuite(JSFLibraryReferenceTestCases.class);
         suite.addTestSuite(JSFLibraryServerSuppliedReferenceTestCases.class);
+        
+        // Vendor-specific web.xml configuration tests
+        suite.addTestSuite(VendorSpecificWebXmlConfigurationForJavaEETest.class);
+        suite.addTestSuite(VendorSpecificWebXmlConfigurationForJ2EETest.class);
+        
         //
 		//$JUnit-END$
 		return suite;
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/JsfLibraryValidatorTest.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/JsfLibraryValidatorTest.java
new file mode 100644
index 0000000..886381e
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/JsfLibraryValidatorTest.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2008 Oracle Corporation and others.
+ * 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:
+ *     Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+
+
+package org.eclipse.jst.jsf.core.tests.facet;
+
+
+/**
+ * @author Debajit Adhikary
+ *
+ */
+public class JsfLibraryValidatorTest extends LibraryValidatorTest
+{
+    private static final String CLASS_NAME_IDENTIFYING_IMPLEMENTATION_JAR = "javax/faces/render/RenderKit.class"; //$NON-NLS-1$
+    private static final String JARFILE = "testdata/facet/jars/myfaces-api-1.1.3.jar";  //$NON-NLS-1$
+    private static final String JARFILE_WITHOUT_IMPLEMENTATION_VERSION_ENTRY = "testdata/facet/jars/no-version-entry/myfaces-api-1.1.3.jar"; //$NON-NLS-1$
+    private static final String EXPECTED_LIBRARY_VERSION = "1.1.3"; //$NON-NLS-1$
+
+
+    /**
+     * @param name
+     */
+    public JsfLibraryValidatorTest (final String name)
+    {
+        super(name,
+              CLASS_NAME_IDENTIFYING_IMPLEMENTATION_JAR,
+              JARFILE,
+              JARFILE_WITHOUT_IMPLEMENTATION_VERSION_ENTRY,
+              EXPECTED_LIBRARY_VERSION);
+    }
+}
\ No newline at end of file
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/LibraryValidatorTest.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/LibraryValidatorTest.java
new file mode 100644
index 0000000..b95b55d
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/LibraryValidatorTest.java
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2008 Oracle Corporation and others.
+ * 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:
+ *     Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+
+
+package org.eclipse.jst.jsf.core.tests.facet;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.util.jar.JarFile;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.jst.jsf.core.tests.TestsPlugin;
+import org.osgi.framework.Bundle;
+
+
+/**
+ * @author Debajit Adhikary
+ *
+ */
+public abstract class LibraryValidatorTest extends TestCase
+{
+    private String classNameIdentifyingJarToUse;
+    private String jarPath;
+    private String jarPathWithoutImplementationVersionEntry;
+    private String expectedLibraryVersion;
+    private UserLibraryVersionValidatorProxy validator;
+
+
+    /**
+     * @param name
+     */
+    public LibraryValidatorTest (final String name)
+    {
+        super(name);
+    }
+
+
+    public LibraryValidatorTest (final String name,
+                                 final String classNameIdentifyingJarToUse,
+                                 final String jarPath,
+                                 final String jarPathWithoutImplementationVersionEntry,
+                                 final String expectedLibraryVersion)
+    {
+        super(name);
+
+        this.classNameIdentifyingJarToUse = classNameIdentifyingJarToUse;
+        this.jarPath = jarPath;
+        this.jarPathWithoutImplementationVersionEntry = jarPathWithoutImplementationVersionEntry;
+        this.expectedLibraryVersion = expectedLibraryVersion;
+
+        this.validator = new UserLibraryVersionValidatorProxy(this.classNameIdentifyingJarToUse);
+    }
+
+
+    public void testVersionStringSuffixMatch ()
+    {
+        assertNotNull(validator);
+
+        final IStatus status = validator.validateVersionStrings("1.2", "1.1.2");
+        assertEquals(IStatus.ERROR, status.getSeverity());
+    }
+
+
+    public void testVersionStringPrefixMatch ()
+    {
+        assertNotNull(validator);
+
+        final IStatus status = validator.validateVersionStrings("1.2", "1.2.11");
+        assertEquals(IStatus.OK, status.getSeverity());
+    }
+
+
+    public void testNullLibraryVersionString ()
+    {
+        assertNotNull(validator);
+
+        final IStatus status = validator.validateVersionStrings("1.2", null);
+        assertEquals(IStatus.WARNING, status.getSeverity());
+    }
+
+
+    public void testNullFacetVersionString ()
+    {
+        assertNotNull(validator);
+
+        try
+        {
+            validator.validateVersionStrings(null, "1.0.1.2.11"); // Fails
+        }
+        catch (final IllegalArgumentException e)
+        {
+            assertEquals("Cannot read facet version", e.getLocalizedMessage());
+            return;
+        }
+
+        fail();
+    }
+
+
+    protected File getFileFromPlugin (final String relativePathToFile,
+                                      final Plugin plugin)
+    throws IOException, URISyntaxException
+    {
+        final Bundle bundle = TestsPlugin.getDefault().getBundle();
+
+        final URL bundleUrl = bundle.getEntry(relativePathToFile);
+        assertNotNull(bundleUrl);
+
+        final URL fileUrl = FileLocator.toFileURL(bundleUrl);
+        final File file = new File(fileUrl.getPath());
+        assertTrue(file.exists());
+        return file;
+    }
+
+
+    public void testReadLibraryVersionFromJarWithManifestEntry ()
+    throws IOException, URISyntaxException
+    {
+        final JarFile jarFile = new JarFile(getFileFromPlugin(jarPath, TestsPlugin.getDefault()));
+        assertEquals(expectedLibraryVersion, validator.getLibraryVersion(jarFile)); 
+    }
+
+
+    public void testReadLibraryVersionFromJarWithoutManifestEntry ()
+    throws IOException, URISyntaxException
+    {
+        final JarFile jarFile = new JarFile(getFileFromPlugin(jarPathWithoutImplementationVersionEntry, TestsPlugin.getDefault()));
+        assertNull("Was expecting library-version string to be null", validator.getLibraryVersion(jarFile)); //$NON-NLS-1$
+    }
+}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/UserLibraryVersionValidatorProxy.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/UserLibraryVersionValidatorProxy.java
new file mode 100644
index 0000000..0db8552
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/UserLibraryVersionValidatorProxy.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2008 Oracle Corporation and others.
+ * 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:
+ *     Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+
+
+package org.eclipse.jst.jsf.core.tests.facet;
+
+import java.io.IOException;
+import java.util.jar.JarFile;
+
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jst.jsf.common.facet.libraryprovider.UserLibraryVersionValidator;
+
+
+/**
+ * "Proxy" class for the actual UserLibraryVersionValidator. This is only used so
+ * that the protected methods in UserLibraryVersionValidator can be tested.
+ *
+ * The test-cases have package-level access to these protected methods.
+ *
+ * @author Debajit Adhikary
+ *
+ */
+public class UserLibraryVersionValidatorProxy extends UserLibraryVersionValidator
+{
+    public UserLibraryVersionValidatorProxy (final String classNameIdentifyingJar)
+    {
+        super(classNameIdentifyingJar);
+    }
+
+
+    @Override
+    protected IStatus validateVersionStrings (final String facetVersion, final String libraryVersion)
+    {
+        return super.validateVersionStrings(facetVersion, libraryVersion);
+    }
+
+
+    @Override
+    protected String getLibraryVersion (final JarFile jarFile) throws IOException
+    {
+        return super.getLibraryVersion(jarFile);
+    }
+}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/VendorSpecificWebXmlConfigurationForJ2EETest.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/VendorSpecificWebXmlConfigurationForJ2EETest.java
new file mode 100644
index 0000000..e3379fd
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/VendorSpecificWebXmlConfigurationForJ2EETest.java
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2009 Oracle Corporation and others.
+ * 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:
+ *     Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+
+
+package org.eclipse.jst.jsf.core.tests.facet;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jst.common.project.facet.JavaFacetUtils;
+import org.eclipse.jst.j2ee.common.Description;
+import org.eclipse.jst.j2ee.common.Listener;
+import org.eclipse.jst.j2ee.common.ParamValue;
+import org.eclipse.jst.j2ee.webapplication.Servlet;
+import org.eclipse.jst.j2ee.webapplication.ServletMapping;
+import org.eclipse.jst.j2ee.webapplication.WebApp;
+import org.eclipse.jst.j2ee.webapplication.internal.impl.ServletTypeImpl;
+import org.eclipse.jst.jsf.common.webxml.WebXmlUpdater;
+import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJ2EE;
+import org.eclipse.jst.jsf.test.util.JSFTestUtil;
+import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+
+
+/**
+ * Tests the web.xml updating functionality used for vendor-specific web.xml
+ * configuration
+ *
+ * @author Debajit Adhikary
+ *
+ * @see VendorSpecificWebXmlConfigurationForJavaEETest
+ *
+ */
+public class VendorSpecificWebXmlConfigurationForJ2EETest extends TestCase
+{
+    private static final IProjectFacetVersion WEB_MODULE_VERSION = ProjectFacetsManager.getProjectFacet("jst.web").getVersion("2.4");
+
+    private static final IProjectFacetVersion JAVA_VERSION = JavaFacetUtils.JAVA_50;
+
+    private static final String PROJECT_NAME_PREFIX = "_TEST_PROJECT_NAME_FOR_J2EE";
+    private static final String SERVLET_NAME = "_TEST_SERVLET_NAME";
+    private static final String SERVLET_CLASS_NAME = "_TEST_SERVLET_CLASS_NAME";
+    private static final String SERVLET_LOAD_ON_STARTUP = "1";
+    private static final String SERVLET_URL_PATTERN = "*._TEST_SERVLET_URL_PATTERN";
+    private static final String CONTEXT_PARAM_NAME = "_TEST_CONTEXT_PARAM_NAME";
+    private static final String CONTEXT_PARAM_VALUE = "_TEST_CONTEXT_PARAM_VALUE";
+    private static final String CONTEXT_PARAM_DESCRIPTION = "_TEST_CONTEXT_PARAM_DESCRIPTION";
+    private static final String LISTENER_CLASS = "_TEST_LISTENER_CLASS";
+
+    private final IProject project;
+    private final WebXmlUpdater updater;
+    private final WebApp webapp;
+
+
+    /**
+     * @param name
+     * @throws Exception
+     */
+    public VendorSpecificWebXmlConfigurationForJ2EETest (final String name)
+    throws Exception
+    {
+        super(name);
+
+        this.project = createProject(PROJECT_NAME_PREFIX);
+        this.updater = new WebXmlUpdater(project, null);
+        this.webapp = (WebApp) updater.getProvider().getModelObject();
+    }
+
+
+    private IProject createProject (final String projectName)
+    throws Exception
+    {
+        final WebProjectTestEnvironment testEnv = new WebProjectTestEnvironment(projectName, JAVA_VERSION, WEB_MODULE_VERSION);
+        testEnv.createProject(true);
+        return testEnv.getTestProject();
+    }
+
+
+    public void testAddServlet () throws Exception
+    {
+        final IProject project = createProject(PROJECT_NAME_PREFIX + this.getClass().getName() + getName());
+
+        // Write servlet to web.xml
+        assertFalse(WebXmlUtilsForJ2EE.existsServlet(webapp, SERVLET_NAME, SERVLET_CLASS_NAME));
+        updater.addServlet(SERVLET_NAME, SERVLET_CLASS_NAME, SERVLET_LOAD_ON_STARTUP);
+
+        // Read servlet from web.xml
+        final Servlet servlet = WebXmlUtilsForJ2EE.findServlet(webapp, SERVLET_CLASS_NAME);
+        assertEquals(SERVLET_NAME, servlet.getServletName());
+        assertEquals(SERVLET_CLASS_NAME, ((ServletTypeImpl) servlet.getWebType()).getClassName());
+        assertEquals(Integer.parseInt(SERVLET_LOAD_ON_STARTUP), servlet.getLoadOnStartup().intValue());
+
+        //project.delete(true, new NullProgressMonitor());
+        System.out.println(JSFTestUtil.safeDelete(project, 3, 500));
+    }
+
+
+    public void testAddContextParam () throws Exception
+    {
+        final IProject project = createProject(PROJECT_NAME_PREFIX + this.getClass().getName() + getName());
+
+        // Write param to web.xml
+        assertFalse(WebXmlUtilsForJ2EE.existsContextParam(webapp, CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE));
+        updater.addContextParam(CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE, CONTEXT_PARAM_DESCRIPTION);
+
+        // Read param from web.xml
+        final ParamValue param = WebXmlUtilsForJ2EE.findContextParam(webapp, CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE);
+        assertEquals(CONTEXT_PARAM_NAME, param.getName());
+        assertEquals(CONTEXT_PARAM_VALUE, param.getValue());
+        assertEquals(CONTEXT_PARAM_DESCRIPTION, ((Description) param.getDescriptions().get(0)).getValue());
+
+        project.delete(true, new NullProgressMonitor());
+    }
+
+
+    public void testAddServletMapping () throws Exception
+    {
+        final IProject project = createProject(PROJECT_NAME_PREFIX + this.getClass().getName() + getName());
+
+        // Write servlet-mapping to web.xml
+        assertFalse(WebXmlUtilsForJ2EE.existsServletMapping(webapp, SERVLET_NAME, SERVLET_URL_PATTERN));
+        updater.addServletMapping(SERVLET_NAME, SERVLET_CLASS_NAME, SERVLET_URL_PATTERN);
+
+        // Read from web.xml
+        final ServletMapping mapping = WebXmlUtilsForJ2EE.findServletMapping(webapp, SERVLET_NAME, SERVLET_URL_PATTERN);
+        assertEquals(SERVLET_NAME, mapping.getName());
+        assertEquals(SERVLET_URL_PATTERN, mapping.getUrlPattern());
+
+        project.delete(true, new NullProgressMonitor());
+    }
+
+
+    public void testAddListener () throws Exception
+    {
+        final IProject project = createProject(PROJECT_NAME_PREFIX + this.getClass().getName() + getName());
+
+        // Write to web.xml
+        assertFalse(WebXmlUtilsForJ2EE.existsListener(webapp, LISTENER_CLASS));
+        updater.addListener(LISTENER_CLASS);
+
+        // Read from web.xml
+        final Listener listener = WebXmlUtilsForJ2EE.findListener(webapp, LISTENER_CLASS);
+        assertEquals(LISTENER_CLASS, listener.getListenerClassName());
+
+        project.delete(true, new NullProgressMonitor());
+    }
+}
diff --git a/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/VendorSpecificWebXmlConfigurationForJavaEETest.java b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/VendorSpecificWebXmlConfigurationForJavaEETest.java
new file mode 100644
index 0000000..d5de8cb
--- /dev/null
+++ b/jsf/tests/org.eclipse.jst.jsf.core.tests/src/org/eclipse/jst/jsf/core/tests/facet/VendorSpecificWebXmlConfigurationForJavaEETest.java
@@ -0,0 +1,156 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2009 Oracle Corporation and others.
+ * 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:
+ *     Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+
+
+package org.eclipse.jst.jsf.core.tests.facet;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jst.common.project.facet.JavaFacetUtils;
+import org.eclipse.jst.javaee.core.Description;
+import org.eclipse.jst.javaee.core.Listener;
+import org.eclipse.jst.javaee.core.ParamValue;
+import org.eclipse.jst.javaee.core.UrlPatternType;
+import org.eclipse.jst.javaee.web.Servlet;
+import org.eclipse.jst.javaee.web.ServletMapping;
+import org.eclipse.jst.javaee.web.WebApp;
+import org.eclipse.jst.jsf.common.webxml.WebXmlUpdater;
+import org.eclipse.jst.jsf.common.webxml.WebXmlUtilsForJavaEE;
+import org.eclipse.jst.jsf.test.util.JSFTestUtil;
+import org.eclipse.jst.jsf.test.util.WebProjectTestEnvironment;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+
+
+/**
+ * Tests the web.xml updating functionality used for vendor-specific web.xml
+ * configuration (for Java EE)
+ *
+ * @author Debajit Adhikary
+ *
+ * @see VendorSpecificWebXmlConfigurationForJ2EETest
+ *
+ */
+public class VendorSpecificWebXmlConfigurationForJavaEETest extends TestCase
+{
+    private static final IProjectFacetVersion WEB_MODULE_VERSION = ProjectFacetsManager.getProjectFacet("jst.web").getVersion("2.5");
+
+    private static final IProjectFacetVersion JAVA_VERSION = JavaFacetUtils.JAVA_50;
+
+    private static final String PROJECT_NAME_PREFIX = "_TEST_PROJECT_NAME_FOR_JAVA_EE";
+    private static final String SERVLET_NAME = "_TEST_SERVLET_NAME";
+    private static final String SERVLET_CLASS_NAME = "_TEST_SERVLET_CLASS_NAME";
+    private static final String SERVLET_LOAD_ON_STARTUP = "1";
+    private static final String SERVLET_URL_PATTERN = "*._TEST_SERVLET_URL_PATTERN";
+    private static final String CONTEXT_PARAM_NAME = "_TEST_CONTEXT_PARAM_NAME";
+    private static final String CONTEXT_PARAM_VALUE = "_TEST_CONTEXT_PARAM_VALUE";
+    private static final String CONTEXT_PARAM_DESCRIPTION = "_TEST_CONTEXT_PARAM_DESCRIPTION";
+    private static final String LISTENER_CLASS = "_TEST_LISTENER_CLASS";
+
+    private final IProject project;
+    private final WebXmlUpdater updater;
+    private final WebApp webapp;
+
+
+    /**
+     * @param name
+     * @throws Exception
+     */
+    public VendorSpecificWebXmlConfigurationForJavaEETest (final String name)
+    throws Exception
+    {
+        super(name);
+
+        this.project = createProject(PROJECT_NAME_PREFIX);
+        this.updater = new WebXmlUpdater(project, null);
+        this.webapp = (WebApp) updater.getProvider().getModelObject();
+    }
+
+
+    private IProject createProject (final String projectName)
+    throws Exception
+    {
+        final WebProjectTestEnvironment testEnv = new WebProjectTestEnvironment(projectName, JAVA_VERSION, WEB_MODULE_VERSION);
+        testEnv.createProject(true);
+        return testEnv.getTestProject();
+    }
+
+
+    public void testAddServlet () throws Exception
+    {
+        final IProject project = createProject(PROJECT_NAME_PREFIX + this.getClass().getName() + getName());
+
+        // Write servlet to web.xml
+        updater.addServlet(SERVLET_NAME, SERVLET_CLASS_NAME, SERVLET_LOAD_ON_STARTUP);
+
+        // Read servlet from web.xml
+        final Servlet servlet = WebXmlUtilsForJavaEE.findServlet(SERVLET_CLASS_NAME, webapp);
+        assertEquals(SERVLET_NAME, servlet.getServletName());
+        assertEquals(SERVLET_CLASS_NAME, servlet.getServletClass());
+        assertEquals(SERVLET_LOAD_ON_STARTUP, servlet.getLoadOnStartup().toString());
+
+        //project.delete(true, new NullProgressMonitor());
+        System.out.println(JSFTestUtil.safeDelete(project, 3, 500));
+    }
+
+
+    public void testAddContextParam () throws Exception
+    {
+        final IProject project = createProject(PROJECT_NAME_PREFIX + this.getClass().getName() + getName());
+
+        // Write param to web.xml
+        updater.addServlet(SERVLET_NAME, SERVLET_CLASS_NAME, SERVLET_LOAD_ON_STARTUP);
+        updater.addContextParam(CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE, CONTEXT_PARAM_DESCRIPTION);
+
+        // Read param from web.xml
+        final ParamValue param = WebXmlUtilsForJavaEE.findContextParam(webapp, CONTEXT_PARAM_NAME, CONTEXT_PARAM_VALUE);
+        assertEquals(CONTEXT_PARAM_NAME, param.getParamName());
+        assertEquals(CONTEXT_PARAM_VALUE, param.getParamValue());
+        assertEquals(CONTEXT_PARAM_DESCRIPTION, ((Description) param.getDescriptions().get(0)).getValue());
+
+        project.delete(true, new NullProgressMonitor());
+    }
+
+
+    public void testAddServletMapping () throws Exception
+    {
+        final IProject project = createProject(PROJECT_NAME_PREFIX + this.getClass().getName() + getName());
+
+        // Write servlet-mapping to web.xml
+        updater.addServlet(SERVLET_NAME, SERVLET_CLASS_NAME, SERVLET_LOAD_ON_STARTUP);
+        updater.addServletMapping(SERVLET_NAME, SERVLET_CLASS_NAME, SERVLET_URL_PATTERN);
+
+        // Read from web.xml
+        final ServletMapping mapping = WebXmlUtilsForJavaEE.findServletMapping(webapp, SERVLET_NAME, SERVLET_URL_PATTERN);
+        assertNotNull(mapping);
+        assertEquals(SERVLET_NAME, mapping.getServletName());
+        assertEquals(SERVLET_URL_PATTERN, ((UrlPatternType) mapping.getUrlPatterns().get(0)).getValue());
+
+        project.delete(true, new NullProgressMonitor());
+    }
+
+
+    public void testAddListener () throws Exception
+    {
+        final IProject project = createProject(PROJECT_NAME_PREFIX + this.getClass().getName() + getName());
+
+        // Write to web.xml
+        updater.addListener(LISTENER_CLASS);
+
+        // Read from web.xml
+        final Listener listener = WebXmlUtilsForJavaEE.findListener(webapp, LISTENER_CLASS);
+        assertEquals(LISTENER_CLASS, listener.getListenerClass());
+
+        project.delete(true, new NullProgressMonitor());
+    }
+}