mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
parent
abd81474e6
commit
23399e83eb
2 changed files with 16 additions and 6 deletions
|
@ -41,16 +41,15 @@ public class TestProcesses extends BaseTestCase {
|
||||||
private static final String H_EXT = ".h"; //$NON-NLS-1$
|
private static final String H_EXT = ".h"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String PROJECT_TYPE = "org.eclipse.cdt.core.tests.projectType"; //$NON-NLS-1$
|
private static final String PROJECT_TYPE = "org.eclipse.cdt.core.tests.projectType"; //$NON-NLS-1$
|
||||||
|
private IProject project;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
TemplateEngineTestsHelper.turnOffAutoBuild();
|
TemplateEngineTestsHelper.turnOffAutoBuild();
|
||||||
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
|
project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
|
||||||
IPath projectLocation = project.getRawLocation();
|
IPath projectLocation = project.getRawLocation();
|
||||||
|
|
||||||
if (project.exists()) {
|
assertFalse(project.exists());
|
||||||
project.delete(true, true, null);
|
|
||||||
}
|
|
||||||
IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
||||||
IProjectDescription description = workspace.newProjectDescription(project.getName());
|
IProjectDescription description = workspace.newProjectDescription(project.getName());
|
||||||
|
|
||||||
|
@ -65,6 +64,11 @@ public class TestProcesses extends BaseTestCase {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void tearDown() throws Exception {
|
||||||
|
project.delete(true, true, null);
|
||||||
|
}
|
||||||
|
|
||||||
public void testAddFile() {
|
public void testAddFile() {
|
||||||
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*AddFile"); //$NON-NLS-1$
|
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*AddFile"); //$NON-NLS-1$
|
||||||
Map<String, String> valueStore = template.getValueStore();
|
Map<String, String> valueStore = template.getValueStore();
|
||||||
|
|
|
@ -20,6 +20,7 @@ import org.eclipse.cdt.core.dom.IPDOMManager;
|
||||||
import org.eclipse.cdt.core.model.ICProject;
|
import org.eclipse.cdt.core.model.ICProject;
|
||||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||||
import org.eclipse.cdt.core.testplugin.CProjectHelper;
|
import org.eclipse.cdt.core.testplugin.CProjectHelper;
|
||||||
|
import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
|
||||||
import org.eclipse.cdt.internal.ui.CHelpProviderManager;
|
import org.eclipse.cdt.internal.ui.CHelpProviderManager;
|
||||||
import org.eclipse.cdt.internal.ui.text.CHelpBookDescriptor;
|
import org.eclipse.cdt.internal.ui.text.CHelpBookDescriptor;
|
||||||
import org.eclipse.cdt.internal.ui.text.CHelpSettings;
|
import org.eclipse.cdt.internal.ui.text.CHelpSettings;
|
||||||
|
@ -35,14 +36,13 @@ import org.eclipse.core.runtime.Platform;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import junit.framework.TestCase;
|
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* CHelpProvider tests
|
* CHelpProvider tests
|
||||||
*/
|
*/
|
||||||
public class CHelpTest extends TestCase {
|
public class CHelpTest extends BaseTestCase {
|
||||||
public final static String TEST_EXTENSION_ID_PREFIX = "org.eclipse.cdt.ui.tests.chelp.extension"; //$NON-NLS-1$
|
public final static String TEST_EXTENSION_ID_PREFIX = "org.eclipse.cdt.ui.tests.chelp.extension"; //$NON-NLS-1$
|
||||||
private final static String C_PROJECT_NAME = "cHelpTestProject"; //$NON-NLS-1$
|
private final static String C_PROJECT_NAME = "cHelpTestProject"; //$NON-NLS-1$
|
||||||
private final static String CC_PROJECT_NAME = "ccHelpTestProject"; //$NON-NLS-1$
|
private final static String CC_PROJECT_NAME = "ccHelpTestProject"; //$NON-NLS-1$
|
||||||
|
@ -114,6 +114,12 @@ public class CHelpTest extends TestCase {
|
||||||
@Override
|
@Override
|
||||||
protected void tearDown() throws Exception {
|
protected void tearDown() throws Exception {
|
||||||
CHelpTestInfoProvider.fgEnabled = false;
|
CHelpTestInfoProvider.fgEnabled = false;
|
||||||
|
if (fCProject != null) {
|
||||||
|
fCProject.getProject().delete(true, true, null);
|
||||||
|
}
|
||||||
|
if (fCCProject != null) {
|
||||||
|
fCCProject.getProject().delete(true, true, null);
|
||||||
|
}
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue