diff options
author | Harry Terkelsen | 2013-12-10 19:50:16 +0000 |
---|---|---|
committer | Jayaprakash Arthanareeswaran | 2014-01-28 02:44:42 +0000 |
commit | 3c2d97ccc9f1e71661743a661a14d10422de8f35 (patch) | |
tree | 064631c7707576268fd21b96769513de79ee0ce4 /org.eclipse.jdt.apt.tests | |
parent | cb8d9486d5e5f2bb20f5895e1cd434f7838ce4c6 (diff) | |
download | eclipse.jdt.core-3c2d97ccc9f1e71661743a661a14d10422de8f35.tar.gz eclipse.jdt.core-3c2d97ccc9f1e71661743a661a14d10422de8f35.tar.xz eclipse.jdt.core-3c2d97ccc9f1e71661743a661a14d10422de8f35.zip |
Fixes bug 423254 - There is no way to tell if a project's factory path
is different from the workspace default
Change-Id: Ia28cb895a17c327299920d56c65f1db6410218d7
Signed-off-by: Harry Terkelsen <het@google.com>
Diffstat (limited to 'org.eclipse.jdt.apt.tests')
-rw-r--r-- | org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/RegressionTests.java | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/RegressionTests.java b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/RegressionTests.java index 24327cf556..6b968ad865 100644 --- a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/RegressionTests.java +++ b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/RegressionTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 BEA Systems, Inc. + * Copyright (c) 2005, 2014 BEA Systems, Inc. * 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 @@ -7,6 +7,7 @@ * * Contributors: * wharley@bea.com - initial API and implementation + * het@google.com - Bug 423254 - There is no way to tell if a project's factory path is different from the workspace default *******************************************************************************/ package org.eclipse.jdt.apt.tests; @@ -19,7 +20,9 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; import org.eclipse.jdt.apt.core.util.AptConfig; +import org.eclipse.jdt.apt.core.util.IFactoryPath; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.tests.util.Util; @@ -285,5 +288,36 @@ public class RegressionTests extends APTTestBase { } ); } - + + /** + * Tests that a + * {@link AptConfig#hasProjectSpecificFactoryPath(IJavaProject)} checks if + * the project's factory path is equivalent to the default factory path, not + * just that it has created a factory path. + * + * @throws Exception + */ + public void testBugzilla423254() throws Exception { + final String projName = RegressionTests.class.getName() + + "423254.Project"; //$NON-NLS-1$ + IPath projectPath = env.addProject(projName, "1.5"); //$NON-NLS-1$ + env.addExternalJars(projectPath, Util.getJavaClassLibs()); + + env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ + env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ + env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ + + IJavaProject jproj = env.getJavaProject(projName); + assertFalse(AptConfig.hasProjectSpecificFactoryPath(jproj)); + + IFactoryPath fp = AptConfig.getFactoryPath(jproj); + fp.addVarJar(Path.fromOSString("/some_phony.jar")); + AptConfig.setFactoryPath(jproj, fp); + assertTrue(AptConfig.hasProjectSpecificFactoryPath(jproj)); + + fp = AptConfig.getFactoryPath(jproj); + fp.removeVarJar(Path.fromOSString("/some_phony.jar")); + AptConfig.setFactoryPath(jproj, fp); + assertFalse(AptConfig.hasProjectSpecificFactoryPath(jproj)); + } } |