Skip to main content
summaryrefslogtreecommitdiffstats
blob: 59c072c2fff1aab646be9edca9fe9ecdc2ea4863 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*******************************************************************************
 * Copyright (c) 2010, 2019 IBM Corporation and others.
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jst.jsf.core.tests.project.facet;

import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.List;

import junit.framework.Assert;

import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jst.j2ee.model.IModelProvider;
import org.eclipse.jst.jsf.core.internal.project.facet.JSFUtils;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;

public class TestableJSFUtils extends JSFUtils
{
    private final JSFUtils _delegate;

    public TestableJSFUtils(final JSFUtils jsfUtils,
            final IModelProvider modelProvider)
    {
        super(jsfUtils.getVersion(), modelProvider);
        Assert.assertNotNull(jsfUtils);
        Assert.assertNotNull(modelProvider);
        _delegate = jsfUtils;
    }

    public String getDisplayName_testable(final IDataModel config)
    {
        return super.getDisplayName(config);
    }

    public String getServletClassname_testable(final IDataModel config)
    {
        return super.getServletClassname(config);
    }

    public List<String> getServletMappings_testable(IDataModel config)
    {
        return super.getServletMappings(config);
    }

    public boolean isJSFPage_testable(final IResource resource)
    {
        return super.isJSFPage(resource);
    }

    public boolean isValidKnownExtension_testable(String fileExtension)
    {
        return super.isValidKnownExtension(fileExtension);
    }

    public void printConfigFile_testable(final OutputStream os)
    {
        super.printConfigFile(os);
    }

    @Override
    public void doVersionSpecificConfigFile(PrintWriter pw)
    {
        _delegate.doVersionSpecificConfigFile(pw);
    }

    @Override
    public void updateWebApp(Object webApp, IDataModel config)
    {
        _delegate.updateWebApp(webApp, config);
    }

    @Override
    public void rollbackWebApp(Object webApp)
    {
        _delegate.rollbackWebApp(webApp);
    }

    @Override
    public IPath getFileUrlPath(Object webAppObj, IResource resource,
            IPath existingURL)
    {
        return _delegate.getFileUrlPath(webAppObj, resource, existingURL);
    }
}

Back to the top