blob: d0dbb0d053c1921f575c4e7b52edbb72a7f4de17 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2007, 2011 IBM 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:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jst.jsp.core.tests.util;
import java.io.IOException;
import junit.framework.Test;
import junit.framework.TestCase;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
import org.eclipse.jst.jsp.core.internal.util.FacetModuleCoreSupport;
import org.eclipse.jst.jsp.core.tests.taglibindex.BundleResourceUtil;
public class FMCSTests extends TestCase {
public FMCSTests(String name) {
super(name);
}
public FMCSTests() {
super();
}
public static Test suite() {
return new FMCSTests();
}
private IProject createProject(String name) throws CoreException {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
if (!project.exists())
// Create new project
project = BundleResourceUtil.createSimpleProject(name, null, null);
else if (!project.isAccessible())
project.open(null);
return project;
}
public void testFacetModuleAbstractionWithWebFragment() throws IOException, CoreException {
IProject bd1 = createProject("BugDemo1");
IProject bd2 = createProject("BugDemo2");
BundleResourceUtil.copyBundleZippedEntriesIntoWorkspace("/testfiles/jsp_include_false_error.zip", Path.ROOT);
bd1.refreshLocal(IResource.DEPTH_INFINITE, null);
bd2.refreshLocal(IResource.DEPTH_INFINITE, null);
assertEquals("/BugDemo2/src/META-INF/resources/referenced.jsp", "" + FacetModuleCoreSupport.resolve(new Path("BugDemo1/WebContent/index.jsp"), "referenced.jsp"));
}
}