mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-21 21:52:10 +02:00
Bug 564002: Restore the default pattern of the surefire-plugin
Sets the pattern to the default of upcoming tycho 2.0 in advance. Signed-off-by: Martin Weber <fifteenknots505@gmail.com> Change-Id: I31b3fc733d0cb888fbf6f566995ce2043f6cd621
This commit is contained in:
parent
a025f75771
commit
9e303185f9
78 changed files with 489 additions and 717 deletions
|
@ -13,14 +13,14 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.autotools.tests;
|
||||
|
||||
import org.eclipse.cdt.autotools.tests.editors.EditorTests;
|
||||
import org.eclipse.cdt.autotools.tests.editors.EditorTestSuite;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Suite;
|
||||
|
||||
/** On Windows requires either Cygwin or MinGW to be in PATH */
|
||||
@RunWith(Suite.class)
|
||||
@Suite.SuiteClasses({ AutotoolsProjectTest0.class, AutotoolsProjectNatureTest.class, AutotoolsProjectTest1.class,
|
||||
AutotoolsProjectTest2.class, AutotoolsVirtualFolderTest.class, AutotoolsEnvironmentVarTest.class,
|
||||
LibtoolGCCBuildCommandParserTest.class, UpdateConfigureTest.class, EditorTests.class })
|
||||
@Suite.SuiteClasses({ AutotoolsProject0Test.class, AutotoolsProjectNatureTest.class, AutotoolsProject1Test.class,
|
||||
AutotoolsProject2Test.class, AutotoolsVirtualFolderTest.class, AutotoolsEnvironmentVarTest.class,
|
||||
LibtoolGCCBuildCommandParserTest.class, UpdateConfigureTest.class, EditorTestSuite.class })
|
||||
public class AutomatedIntegrationSuite {
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.junit.After;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
public class AutotoolsProjectTest0 {
|
||||
public class AutotoolsProject0Test {
|
||||
|
||||
private IProject testProject;
|
||||
|
|
@ -27,7 +27,7 @@ import org.junit.After;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
public class AutotoolsProjectTest1 {
|
||||
public class AutotoolsProject1Test {
|
||||
|
||||
private IProject testProject;
|
||||
|
|
@ -30,7 +30,7 @@ import org.junit.Test;
|
|||
|
||||
// This test verifies an autogen.sh project that builds configure, but
|
||||
// does not run it.
|
||||
public class AutotoolsProjectTest2 {
|
||||
public class AutotoolsProject2Test {
|
||||
|
||||
private IProject testProject;
|
||||
|
|
@ -18,5 +18,5 @@ import org.junit.runners.Suite;
|
|||
|
||||
@RunWith(Suite.class)
|
||||
@Suite.SuiteClasses({ AutomakeColourizationTests.class, AutomakeTextHoverTest.class, AutomakeEditorTests.class })
|
||||
public class EditorTests {
|
||||
public class EditorTestSuite {
|
||||
}
|
|
@ -14,12 +14,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.autotools.ui.tests;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.eclipse.cdt.autotools.ui.tests.autoconf.AutoconfTests;
|
||||
import org.eclipse.cdt.utils.spawner.ProcessFactory;
|
||||
import org.junit.Assume;
|
||||
import org.junit.BeforeClass;
|
||||
import org.eclipse.cdt.autotools.ui.tests.autoconf.AutoconfTestSuite;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Suite;
|
||||
|
||||
|
@ -30,25 +25,9 @@ import org.junit.runners.Suite;
|
|||
* TestToolActions.class,
|
||||
* TestEnvironmentVars.class,
|
||||
* TestMakeTargets.class,
|
||||
* SetConfigurationParameter.class,
|
||||
* SetConfigurationParameterTest.class,
|
||||
*/
|
||||
AutoconfTests.class })
|
||||
AutoconfTestSuite.class })
|
||||
|
||||
public class AutomatedIntegrationSuite {
|
||||
// needed for this class to compile
|
||||
@BeforeClass
|
||||
public static void beforeClassMethod() {
|
||||
// Verify that the necessary binaries are available, and if they are not,
|
||||
// the tests will be ignored.
|
||||
String[] testBinaryCommands = { "libtool --version", "autoconf --version", "automake --version" };
|
||||
try {
|
||||
for (String cmd : testBinaryCommands) {
|
||||
Process process = ProcessFactory.getFactory().exec(cmd);
|
||||
process.destroy();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// If we cannot find any binary, just ignore the tests.
|
||||
Assume.assumeNoException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
|
|||
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.MethodSorters;
|
||||
|
@ -48,9 +49,10 @@ import org.w3c.dom.NamedNodeMap;
|
|||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
@Ignore("Unstable tests exluded from build. See Bug 509248 and Bug 564002")
|
||||
@RunWith(SWTBotJunit4ClassRunner.class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class SetConfigurationParameter extends AbstractTest {
|
||||
public class SetConfigurationParameterTest extends AbstractTest {
|
||||
|
||||
@BeforeClass
|
||||
public static void initClass() {
|
|
@ -29,10 +29,12 @@ import org.eclipse.swtbot.swt.finder.waits.Conditions;
|
|||
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
|
||||
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.MethodSorters;
|
||||
|
||||
@Ignore("Unstable tests exluded from build. See Bug 509248 and Bug 564002")
|
||||
@RunWith(SWTBotJunit4ClassRunner.class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class TestEnvironmentVars extends AbstractTest {
|
||||
|
|
|
@ -29,10 +29,12 @@ import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
|
|||
import org.eclipse.swtbot.swt.finder.waits.Conditions;
|
||||
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.MethodSorters;
|
||||
|
||||
@Ignore("Unstable tests exluded from build. See Bug 509248 and Bug 564002")
|
||||
@RunWith(SWTBotJunit4ClassRunner.class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class TestMakeTargets extends AbstractTest {
|
||||
|
|
|
@ -24,10 +24,12 @@ import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
|
|||
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
|
||||
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.MethodSorters;
|
||||
|
||||
@Ignore("Unstable tests exluded from build. See Bug 509248 and Bug 564002")
|
||||
@RunWith(SWTBotJunit4ClassRunner.class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class TestToolActions extends AbstractTest {
|
||||
|
|
|
@ -18,6 +18,6 @@ import org.junit.runners.Suite;
|
|||
|
||||
@RunWith(Suite.class)
|
||||
@Suite.SuiteClasses({ TestMacroParser.class, TestTokenizer.class, TestShellParser.class })
|
||||
public class AutoconfTests {
|
||||
public class AutoconfTestSuite {
|
||||
|
||||
}
|
|
@ -18,6 +18,7 @@ import static org.junit.Assert.assertFalse;
|
|||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
@ -30,9 +31,12 @@ import org.eclipse.cdt.autotools.ui.editors.parser.AutoconfParser;
|
|||
import org.eclipse.cdt.autotools.ui.editors.parser.IAutoconfErrorHandler;
|
||||
import org.eclipse.cdt.autotools.ui.editors.parser.IAutoconfMacroValidator;
|
||||
import org.eclipse.cdt.autotools.ui.editors.parser.ParseException;
|
||||
import org.eclipse.cdt.utils.spawner.ProcessFactory;
|
||||
import org.eclipse.jface.text.Document;
|
||||
import org.eclipse.jface.text.IDocument;
|
||||
import org.junit.Assume;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
public abstract class BaseParserTest {
|
||||
|
||||
|
@ -42,6 +46,22 @@ public abstract class BaseParserTest {
|
|||
private Set<String> macroNames;
|
||||
private AutoconfMacroDetector macroDetector;
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeClassMethod() {
|
||||
// Verify that the necessary binaries are available, and if they are not,
|
||||
// the tests will be ignored.
|
||||
String[] testBinaryCommands = { "libtool --version", "autoconf --version", "automake --version" };
|
||||
try {
|
||||
for (String cmd : testBinaryCommands) {
|
||||
Process process = ProcessFactory.getFactory().exec(cmd);
|
||||
process.destroy();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// If we cannot find any binary, just ignore the tests.
|
||||
Assume.assumeNoException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
errors = new ArrayList<>();
|
||||
|
|
|
@ -19,6 +19,7 @@ import static org.junit.Assert.assertSame;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -26,8 +27,11 @@ import org.eclipse.cdt.autotools.ui.editors.parser.AutoconfTokenizer;
|
|||
import org.eclipse.cdt.autotools.ui.editors.parser.ITokenConstants;
|
||||
import org.eclipse.cdt.autotools.ui.editors.parser.ParseException;
|
||||
import org.eclipse.cdt.autotools.ui.editors.parser.Token;
|
||||
import org.eclipse.cdt.utils.spawner.ProcessFactory;
|
||||
import org.eclipse.jface.text.Document;
|
||||
import org.eclipse.jface.text.IDocument;
|
||||
import org.junit.Assume;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
|
@ -40,6 +44,22 @@ public class TestTokenizer {
|
|||
|
||||
private ArrayList<ParseException> tokenizerErrors;
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeClassMethod() {
|
||||
// Verify that the necessary binaries are available, and if they are not,
|
||||
// the tests will be ignored.
|
||||
String[] testBinaryCommands = { "libtool --version", "autoconf --version", "automake --version" };
|
||||
try {
|
||||
for (String cmd : testBinaryCommands) {
|
||||
Process process = ProcessFactory.getFactory().exec(cmd);
|
||||
process.destroy();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// If we cannot find any binary, just ignore the tests.
|
||||
Assume.assumeNoException(e);
|
||||
}
|
||||
}
|
||||
|
||||
protected IDocument createDocument(String text) {
|
||||
return new Document(text);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
package org.eclipse.cdt.make.core.tests;
|
||||
|
||||
import org.eclipse.cdt.make.builder.tests.StandardBuildTests;
|
||||
import org.eclipse.cdt.make.scannerdiscovery.ScannerDiscoveryTests;
|
||||
import org.eclipse.cdt.make.scannerdiscovery.ScannerDiscoveryTestSuite;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
|
@ -42,7 +42,7 @@ public class AutomatedIntegrationSuite extends TestSuite {
|
|||
final AutomatedIntegrationSuite suite = new AutomatedIntegrationSuite();
|
||||
|
||||
suite.addTest(StandardBuildTests.suite());
|
||||
suite.addTest(ScannerDiscoveryTests.suite());
|
||||
suite.addTest(ScannerDiscoveryTestSuite.suite());
|
||||
suite.addTest(MakefileReaderProviderTests.suite());
|
||||
return suite;
|
||||
}
|
||||
|
|
|
@ -16,14 +16,14 @@ package org.eclipse.cdt.make.scannerdiscovery;
|
|||
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
public class ScannerDiscoveryTests extends TestSuite {
|
||||
public class ScannerDiscoveryTestSuite extends TestSuite {
|
||||
|
||||
public static TestSuite suite() {
|
||||
return new ScannerDiscoveryTests();
|
||||
return new ScannerDiscoveryTestSuite();
|
||||
}
|
||||
|
||||
public ScannerDiscoveryTests() {
|
||||
super(ScannerDiscoveryTests.class.getName());
|
||||
public ScannerDiscoveryTestSuite() {
|
||||
super(ScannerDiscoveryTestSuite.class.getName());
|
||||
addTestSuite(ScannerConfigDiscoveryTests.class);
|
||||
addTest(GCCScannerInfoConsoleParserTests.suite());
|
||||
addTest(GCCPerFileBOPConsoleParserTests.suite());
|
|
@ -19,12 +19,12 @@ import org.eclipse.cdt.build.core.scannerconfig.tests.CfgScannerConfigProfileMan
|
|||
import org.eclipse.cdt.build.core.scannerconfig.tests.GCCSpecsConsoleParserTest;
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.dom.IPDOMManager;
|
||||
import org.eclipse.cdt.managedbuilder.core.regressions.RegressionTests;
|
||||
import org.eclipse.cdt.managedbuilder.core.regressions.RegressionTestSuite;
|
||||
import org.eclipse.cdt.managedbuilder.core.tests.BuildDescriptionModelTests;
|
||||
import org.eclipse.cdt.managedbuilder.core.tests.BuildSystem40Tests;
|
||||
import org.eclipse.cdt.managedbuilder.core.tests.ManagedBuildCoreTests;
|
||||
import org.eclipse.cdt.managedbuilder.core.tests.ManagedBuildCoreTests20;
|
||||
import org.eclipse.cdt.managedbuilder.core.tests.ManagedBuildCoreTests_SharedToolOptions;
|
||||
import org.eclipse.cdt.managedbuilder.core.tests.ManagedBuildCore20Tests;
|
||||
import org.eclipse.cdt.managedbuilder.core.tests.ManagedBuildCore_SharedToolOptionsTests;
|
||||
import org.eclipse.cdt.managedbuilder.core.tests.ManagedBuildDependencyCalculatorTests;
|
||||
import org.eclipse.cdt.managedbuilder.core.tests.ManagedBuildDependencyLibsTests;
|
||||
import org.eclipse.cdt.managedbuilder.core.tests.ManagedBuildEnvironmentTests;
|
||||
|
@ -39,8 +39,8 @@ import org.eclipse.cdt.managedbuilder.core.tests.OptionCategoryEnablementTests;
|
|||
import org.eclipse.cdt.managedbuilder.core.tests.OptionEnablementTests;
|
||||
import org.eclipse.cdt.managedbuilder.core.tests.PathConverterTest;
|
||||
import org.eclipse.cdt.managedbuilder.core.tests.ResourceBuildCoreTests;
|
||||
import org.eclipse.cdt.managedbuilder.language.settings.providers.tests.AllLanguageSettingsProvidersMBSTests;
|
||||
import org.eclipse.cdt.managedbuilder.templateengine.tests.AllTemplateEngineTests;
|
||||
import org.eclipse.cdt.managedbuilder.language.settings.providers.tests.AllLanguageSettingsProvidersMBSTestSuite;
|
||||
import org.eclipse.cdt.managedbuilder.templateengine.tests.AllTemplateEngineTestSuite;
|
||||
import org.eclipse.cdt.projectmodel.tests.BackwardCompatiblityTests;
|
||||
import org.eclipse.cdt.projectmodel.tests.CProjectDescriptionSerializationTests;
|
||||
import org.eclipse.cdt.projectmodel.tests.OptionStringListValueTests;
|
||||
|
@ -64,18 +64,18 @@ public class AutomatedIntegrationSuite {
|
|||
TestSuite suite = new TestSuite("Test for org.eclipse.cdt.managedbuild.core.tests");
|
||||
//$JUnit-BEGIN$
|
||||
// Preconditions
|
||||
suite.addTestSuite(Preconditions.class);
|
||||
suite.addTestSuite(ManagedBuilderPreconditionsTests.class);
|
||||
|
||||
// build.core.scannerconfig.tests
|
||||
suite.addTest(CfgScannerConfigProfileManagerTests.suite());
|
||||
suite.addTestSuite(GCCSpecsConsoleParserTest.class);
|
||||
|
||||
// language settings providers tests
|
||||
suite.addTest(AllLanguageSettingsProvidersMBSTests.suite());
|
||||
suite.addTest(AllLanguageSettingsProvidersMBSTestSuite.suite());
|
||||
|
||||
// managedbuilder.core.tests
|
||||
suite.addTest(ManagedBuildDependencyLibsTests.suite());
|
||||
suite.addTest(ManagedBuildCoreTests20.suite());
|
||||
suite.addTest(ManagedBuildCore20Tests.suite());
|
||||
suite.addTest(ManagedBuildCoreTests.suite());
|
||||
suite.addTest(ManagedProjectUpdateTests.suite());
|
||||
suite.addTest(ManagedCommandLineGeneratorTest.suite());
|
||||
|
@ -83,7 +83,7 @@ public class AutomatedIntegrationSuite {
|
|||
suite.addTest(ManagedProject21MakefileTests.suite());
|
||||
suite.addTest(ManagedProject30MakefileTests.suite());
|
||||
suite.addTest(BuildSystem40Tests.suite());
|
||||
suite.addTest(ManagedBuildCoreTests_SharedToolOptions.suite());
|
||||
suite.addTest(ManagedBuildCore_SharedToolOptionsTests.suite());
|
||||
suite.addTest(ManagedBuildEnvironmentTests.suite());
|
||||
suite.addTest(ManagedBuildMacrosTests.suite());
|
||||
suite.addTest(ManagedBuildTCSupportedTest.suite());
|
||||
|
@ -95,7 +95,7 @@ public class AutomatedIntegrationSuite {
|
|||
suite.addTest(PathConverterTest.suite());
|
||||
|
||||
// managedbuilder.templateengine.tests
|
||||
suite.addTest(AllTemplateEngineTests.suite());
|
||||
suite.addTest(AllTemplateEngineTestSuite.suite());
|
||||
|
||||
// projectmodel.tests
|
||||
suite.addTest(BackwardCompatiblityTests.suite());
|
||||
|
@ -104,7 +104,7 @@ public class AutomatedIntegrationSuite {
|
|||
suite.addTest(ProjectModelTests.suite());
|
||||
|
||||
// regression tests
|
||||
suite.addTest(RegressionTests.suite());
|
||||
suite.addTest(RegressionTestSuite.suite());
|
||||
|
||||
//$JUnit-END$
|
||||
return suite;
|
||||
|
|
|
@ -26,7 +26,11 @@ import org.eclipse.core.runtime.content.IContentTypeManager;
|
|||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class Preconditions extends TestCase {
|
||||
/**
|
||||
* Check that preconditions for running managed builder tests are in place,
|
||||
* see individual tests in this class for details.
|
||||
*/
|
||||
public class ManagedBuilderPreconditionsTests extends TestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
}
|
|
@ -32,7 +32,7 @@ import org.eclipse.core.runtime.CoreException;
|
|||
* causes the subdir.mk to be regenerated, and associated dervied
|
||||
* files should be deleted.
|
||||
*/
|
||||
public class Bug_303953 extends AbstractBuilderTest {
|
||||
public class Bug_303953Test extends AbstractBuilderTest {
|
||||
|
||||
public void testBuildAfterSourcefileDelete() throws CoreException {
|
||||
setWorkspace("regressions");
|
|
@ -20,22 +20,22 @@ import junit.framework.TestSuite;
|
|||
/**
|
||||
* Regression tests for builder bugs
|
||||
*/
|
||||
public class RegressionTests extends TestCase {
|
||||
public class RegressionTestSuite extends TestCase {
|
||||
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite(RegressionTests.class.getName());
|
||||
TestSuite suite = new TestSuite(RegressionTestSuite.class.getName());
|
||||
|
||||
// Test that common builder does the correct amount of work.
|
||||
suite.addTestSuite(Bug_303953.class);
|
||||
suite.addTestSuite(Bug_303953Test.class);
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
||||
public RegressionTests() {
|
||||
public RegressionTestSuite() {
|
||||
super(null);
|
||||
}
|
||||
|
||||
public RegressionTests(String name) {
|
||||
public RegressionTestSuite(String name) {
|
||||
super(name);
|
||||
}
|
||||
}
|
|
@ -63,7 +63,7 @@ import junit.framework.TestSuite;
|
|||
/*
|
||||
* These tests exercise CDT 2.0 manifest file functionality
|
||||
*/
|
||||
public class ManagedBuildCoreTests20 extends TestCase {
|
||||
public class ManagedBuildCore20Tests extends TestCase {
|
||||
private static final boolean boolVal = true;
|
||||
private static final String testConfigId = "test.config.override";
|
||||
private static final String testConfigName = "Tester";
|
||||
|
@ -78,24 +78,24 @@ public class ManagedBuildCoreTests20 extends TestCase {
|
|||
private static final String anotherStringVal = "thevalue";
|
||||
private static final String subExt = "bus";
|
||||
|
||||
public ManagedBuildCoreTests20(String name) {
|
||||
public ManagedBuildCore20Tests(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite(ManagedBuildCoreTests20.class.getName());
|
||||
TestSuite suite = new TestSuite(ManagedBuildCore20Tests.class.getName());
|
||||
|
||||
// Note that some of the tests are dependent on others so run the suite as a whole
|
||||
suite.addTest(new ManagedBuildCoreTests20("testExtensions"));
|
||||
suite.addTest(new ManagedBuildCoreTests20("testProjectCreation"));
|
||||
suite.addTest(new ManagedBuildCoreTests20("testConfigurations"));
|
||||
suite.addTest(new ManagedBuildCoreTests20("testConfigurationReset"));
|
||||
suite.addTest(new ManagedBuildCoreTests20("testConfigBuildArtifact"));
|
||||
suite.addTest(new ManagedBuildCoreTests20("testMakeCommandManipulation"));
|
||||
suite.addTest(new ManagedBuildCoreTests20("testScannerInfoInterface"));
|
||||
suite.addTest(new ManagedBuildCoreTests20("testProjectRename"));
|
||||
suite.addTest(new ManagedBuildCoreTests20("testErrorParsers"));
|
||||
suite.addTest(new ManagedBuildCoreTests20("cleanup"));
|
||||
suite.addTest(new ManagedBuildCore20Tests("testExtensions"));
|
||||
suite.addTest(new ManagedBuildCore20Tests("testProjectCreation"));
|
||||
suite.addTest(new ManagedBuildCore20Tests("testConfigurations"));
|
||||
suite.addTest(new ManagedBuildCore20Tests("testConfigurationReset"));
|
||||
suite.addTest(new ManagedBuildCore20Tests("testConfigBuildArtifact"));
|
||||
suite.addTest(new ManagedBuildCore20Tests("testMakeCommandManipulation"));
|
||||
suite.addTest(new ManagedBuildCore20Tests("testScannerInfoInterface"));
|
||||
suite.addTest(new ManagedBuildCore20Tests("testProjectRename"));
|
||||
suite.addTest(new ManagedBuildCore20Tests("testErrorParsers"));
|
||||
suite.addTest(new ManagedBuildCore20Tests("cleanup"));
|
||||
|
||||
return suite;
|
||||
}
|
|
@ -56,7 +56,7 @@ import junit.framework.TestSuite;
|
|||
/*
|
||||
* These tests exercise CDT 3.0 shared tool options extensions
|
||||
*/
|
||||
public class ManagedBuildCoreTests_SharedToolOptions extends TestCase {
|
||||
public class ManagedBuildCore_SharedToolOptionsTests extends TestCase {
|
||||
|
||||
class IconComparator {
|
||||
static final int None = 0;
|
||||
|
@ -173,7 +173,7 @@ public class ManagedBuildCoreTests_SharedToolOptions extends TestCase {
|
|||
private IconComparator iconComparator;
|
||||
private ValueHandlerComparator valueHandlerComparator;
|
||||
|
||||
public ManagedBuildCoreTests_SharedToolOptions(String name) {
|
||||
public ManagedBuildCore_SharedToolOptionsTests(String name) {
|
||||
super(name);
|
||||
|
||||
iconComparator = new IconComparator();
|
||||
|
@ -181,12 +181,12 @@ public class ManagedBuildCoreTests_SharedToolOptions extends TestCase {
|
|||
}
|
||||
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite(ManagedBuildCoreTests_SharedToolOptions.class.getName());
|
||||
TestSuite suite = new TestSuite(ManagedBuildCore_SharedToolOptionsTests.class.getName());
|
||||
|
||||
suite.addTest(new ManagedBuildCoreTests_SharedToolOptions("testIcons"));
|
||||
suite.addTest(new ManagedBuildCoreTests_SharedToolOptions("testValueHandlers"));
|
||||
suite.addTest(new ManagedBuildCoreTests_SharedToolOptions("testOptions"));
|
||||
suite.addTest(new ManagedBuildCoreTests_SharedToolOptions("testConfiguration"));
|
||||
suite.addTest(new ManagedBuildCore_SharedToolOptionsTests("testIcons"));
|
||||
suite.addTest(new ManagedBuildCore_SharedToolOptionsTests("testValueHandlers"));
|
||||
suite.addTest(new ManagedBuildCore_SharedToolOptionsTests("testOptions"));
|
||||
suite.addTest(new ManagedBuildCore_SharedToolOptionsTests("testConfiguration"));
|
||||
|
||||
return suite;
|
||||
}
|
|
@ -19,14 +19,14 @@ import junit.framework.TestSuite;
|
|||
/**
|
||||
* Test suite to test language settings providers defined in cdt.managedbuilder.core.
|
||||
*/
|
||||
public class AllLanguageSettingsProvidersMBSTests extends TestSuite {
|
||||
public class AllLanguageSettingsProvidersMBSTestSuite extends TestSuite {
|
||||
|
||||
public static TestSuite suite() {
|
||||
return new AllLanguageSettingsProvidersMBSTests();
|
||||
return new AllLanguageSettingsProvidersMBSTestSuite();
|
||||
}
|
||||
|
||||
public AllLanguageSettingsProvidersMBSTests() {
|
||||
super(AllLanguageSettingsProvidersMBSTests.class.getName());
|
||||
public AllLanguageSettingsProvidersMBSTestSuite() {
|
||||
super(AllLanguageSettingsProvidersMBSTestSuite.class.getName());
|
||||
|
||||
addTestSuite(LanguageSettingsProvidersMBSTest.class);
|
||||
addTestSuite(GCCBuildCommandParserTest.class);
|
|
@ -23,10 +23,10 @@ import junit.framework.TestSuite;
|
|||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class AllTemplateEngineTests extends TestSuite {
|
||||
public class AllTemplateEngineTestSuite extends TestSuite {
|
||||
|
||||
public static void main(String[] args) {
|
||||
junit.textui.TestRunner.run(AllTemplateEngineTests.suite());
|
||||
junit.textui.TestRunner.run(AllTemplateEngineTestSuite.suite());
|
||||
}
|
||||
|
||||
/**
|
|
@ -14,20 +14,4 @@
|
|||
to a maven repo. (The repository version is a different thing) -->
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-test-plugin</packaging>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
<artifactId>tycho-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<includes>
|
||||
<!-- give me back the surefire defaults! -->
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -14,20 +14,4 @@
|
|||
to a maven repo. (The repository version is a different thing) -->
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-test-plugin</packaging>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
<artifactId>tycho-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<includes>
|
||||
<!-- give me back the surefire defaults! -->
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -13,20 +13,4 @@
|
|||
to a maven repo. (The repository version is a different thing) -->
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-test-plugin</packaging>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
<artifactId>tycho-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<includes>
|
||||
<!-- give me back the surefire defaults! -->
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -14,20 +14,4 @@
|
|||
to a maven repo. (The repository version is a different thing) -->
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-test-plugin</packaging>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
<artifactId>tycho-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<includes>
|
||||
<!-- give me back the surefire defaults! -->
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -14,20 +14,4 @@
|
|||
to a maven repo. (The repository version is a different thing) -->
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-test-plugin</packaging>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
<artifactId>tycho-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<includes>
|
||||
<!-- give me back the surefire defaults! -->
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -42,7 +42,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
|
|||
*
|
||||
*/
|
||||
@SuppressWarnings("nls")
|
||||
public class CheckerTestCase extends CodanTestCase {
|
||||
public abstract class CheckerTestCase extends CodanTestCase {
|
||||
protected IMarker[] markers;
|
||||
|
||||
public IMarker checkErrorLine(int i) {
|
||||
|
|
|
@ -44,7 +44,7 @@ import org.eclipse.core.runtime.Plugin;
|
|||
* TODO: add description
|
||||
*/
|
||||
@SuppressWarnings("nls")
|
||||
public class CodanTestCase extends BaseTestCase {
|
||||
public abstract class CodanTestCase extends BaseTestCase {
|
||||
ArrayList<File> tempFiles = new ArrayList<>();
|
||||
protected File tmpDir;
|
||||
protected ICProject cproject;
|
||||
|
|
|
@ -34,7 +34,7 @@ import junit.framework.TestCase;
|
|||
* @author jcamelon
|
||||
*
|
||||
*/
|
||||
public class TranslationUnitBaseTest extends TestCase {
|
||||
public abstract class TranslationUnitBaseTest extends TestCase {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -35,7 +35,7 @@ import junit.framework.TestCase;
|
|||
/**
|
||||
* @author dsteffle
|
||||
*/
|
||||
public class FileBasePluginTestCase extends TestCase {
|
||||
public abstract class FileBasePluginTestCase extends TestCase {
|
||||
static NullProgressMonitor monitor;
|
||||
static IWorkspace workspace;
|
||||
static IProject project;
|
||||
|
|
|
@ -39,7 +39,7 @@ import junit.framework.TestCase;
|
|||
/**
|
||||
* @author dsteffle
|
||||
*/
|
||||
public class DOMFileBasePluginTest extends TestCase {
|
||||
public abstract class DOMFileBasePluginTest extends TestCase {
|
||||
static NullProgressMonitor monitor;
|
||||
static IWorkspace workspace;
|
||||
static IProject project;
|
||||
|
|
|
@ -50,7 +50,7 @@ import org.eclipse.cdt.internal.core.parser.ParserException;
|
|||
import org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor;
|
||||
import org.eclipse.cdt.internal.index.tests.IndexBindingResolutionTestBase;
|
||||
|
||||
public class TestBase extends IndexBindingResolutionTestBase {
|
||||
public abstract class TestBase extends IndexBindingResolutionTestBase {
|
||||
private static final String TEST_CODE = "<testcode>";
|
||||
private static final IParserLogService NULL_LOG = new NullLogService();
|
||||
private static final ScannerInfo SCANNER_INFO = new ScannerInfo(getStdMap());
|
||||
|
|
|
@ -58,7 +58,7 @@ import junit.framework.TestFailure;
|
|||
import junit.framework.TestResult;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
public class BaseTestCase extends TestCase {
|
||||
public abstract class BaseTestCase extends TestCase {
|
||||
private static final String DEFAULT_INDEXER_TIMEOUT_SEC = "10";
|
||||
private static final String INDEXER_TIMEOUT_PROPERTY = "indexer.timeout";
|
||||
/**
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
<argLine>${tycho.testArgLine} ${base.ui.test.vmargs} ${extra.vmargs.indexer.timeout} ${extra.vmargs.displayhelper.timeoutmultipler}</argLine>
|
||||
<appArgLine>-pluginCustomization ${basedir}/../../disable_intro_in_tests.ini</appArgLine>
|
||||
<includes>
|
||||
<!-- Workatound for Bug 565063: test execution outcome is order dependent -->
|
||||
<include>**/AutomatedSuite.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
|
|
|
@ -29,5 +29,5 @@ import org.junit.runners.Suite;
|
|||
TestProcesses.class, TestTemplateEngineBugs.class,
|
||||
|
||||
})
|
||||
public class AllTemplateEngineTests {
|
||||
public class AllTemplateEngineTestSuite {
|
||||
}
|
|
@ -36,7 +36,7 @@ import org.eclipse.ui.PartInitException;
|
|||
* default is "src". To make it read comment from java class, you need to
|
||||
* include this source directory (with test java files) into the build bundle.
|
||||
*/
|
||||
public class AnnotationTestCase extends UITestCaseWithProject {
|
||||
public abstract class AnnotationTestCase extends UITestCaseWithProject {
|
||||
private IAnnotationModel fAnnotationModel;
|
||||
private Object fAnnotationModelLockObject;
|
||||
protected Annotation[] annotations;
|
||||
|
|
|
@ -40,7 +40,7 @@ import org.junit.runners.Suite;
|
|||
org.eclipse.cdt.ui.tests.wizards.classwizard.ClassWizardTestSuite.class,
|
||||
org.eclipse.cdt.ui.tests.wizards.settingswizards.SettingsWizardTestSuite.class,
|
||||
org.eclipse.cdt.ui.tests.misc.MiscTestSuite.class, org.eclipse.cdt.ui.tests.editor.EditorTestSuite.class,
|
||||
org.eclipse.cdt.ui.tests.templateengine.AllTemplateEngineTests.class,
|
||||
org.eclipse.cdt.ui.tests.templateengine.AllTemplateEngineTestSuite.class,
|
||||
|
||||
})
|
||||
public class AutomatedSuite {
|
||||
|
|
|
@ -54,7 +54,7 @@ import org.eclipse.ui.WorkbenchException;
|
|||
import org.eclipse.ui.handlers.IHandlerService;
|
||||
import org.eclipse.ui.internal.WorkbenchPartReference;
|
||||
|
||||
public class BaseUITestCase extends BaseTestCase {
|
||||
public abstract class BaseUITestCase extends BaseTestCase {
|
||||
public BaseUITestCase() {
|
||||
super();
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.eclipse.ui.PartInitException;
|
|||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.ide.IDE;
|
||||
|
||||
public class CallHierarchyBaseTest extends BaseUITestCase {
|
||||
public abstract class CallHierarchyBaseTest extends BaseUITestCase {
|
||||
private static int sProjectCounter = 0;
|
||||
|
||||
protected ICProject fCProject;
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.eclipse.ui.IWorkbenchPage;
|
|||
import org.eclipse.ui.PartInitException;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
public class IncludeBrowserBaseTest extends BaseUITestCase {
|
||||
public abstract class IncludeBrowserBaseTest extends BaseUITestCase {
|
||||
protected static IProgressMonitor NPM = new NullProgressMonitor();
|
||||
|
||||
private ICProject fCProject;
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.eclipse.text.edits.TextEditGroup;
|
|||
/**
|
||||
* @author markus.schorn@windriver.com
|
||||
*/
|
||||
public class RefactoringTests extends BaseTestFramework {
|
||||
public abstract class RefactoringTests extends BaseTestFramework {
|
||||
private int fBufferSize;
|
||||
|
||||
public RefactoringTests() {
|
||||
|
|
|
@ -36,7 +36,7 @@ public class RenameFunctionTests extends RenameTestBase {
|
|||
TestSuite suite = new TestSuite(RenameFunctionTests.class);
|
||||
|
||||
if (cleanup) {
|
||||
suite.addTest(new RefactoringTests("cleanupProject"));
|
||||
// suite.addTest(new RefactoringTests("cleanupProject"));
|
||||
}
|
||||
return suite;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class RenameMacroTests extends RenameTestBase {
|
|||
public static Test suite(boolean cleanup) {
|
||||
TestSuite suite = new TestSuite(RenameMacroTests.class);
|
||||
if (cleanup) {
|
||||
suite.addTest(new RefactoringTests("cleanupProject"));
|
||||
// suite.addTest(new RefactoringTests("cleanupProject"));
|
||||
}
|
||||
return suite;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class RenameTemplatesTests extends RenameTestBase {
|
|||
public static Test suite(boolean cleanup) {
|
||||
TestSuite suite = new TestSuite(RenameTemplatesTests.class);
|
||||
if (cleanup) {
|
||||
suite.addTest(new RefactoringTests("cleanupProject"));
|
||||
// suite.addTest(new RefactoringTests("cleanupProject"));
|
||||
}
|
||||
return suite;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public class RenameTypeTests extends RenameTestBase {
|
|||
public static Test suite(boolean cleanup) {
|
||||
TestSuite suite = new TestSuite(RenameTypeTests.class);
|
||||
if (cleanup) {
|
||||
suite.addTest(new RefactoringTests("cleanupProject"));
|
||||
// suite.addTest(new RefactoringTests("cleanupProject"));
|
||||
}
|
||||
return suite;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public class RenameVariableTests extends RenameTestBase {
|
|||
TestSuite suite = new TestSuite(RenameVariableTests.class);
|
||||
|
||||
if (cleanup) {
|
||||
suite.addTest(new RefactoringTests("cleanupProject"));
|
||||
// suite.addTest(new RefactoringTests("cleanupProject"));
|
||||
}
|
||||
return suite;
|
||||
}
|
||||
|
|
|
@ -1,89 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Institute for Software, HSR Hochschule fuer Technik
|
||||
* Rapperswil, University of applied sciences 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:
|
||||
* Institute for Software - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.ui.tests.refactoring.utils;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.refactoring.utils.IdentifierHelper;
|
||||
import org.eclipse.cdt.internal.ui.refactoring.utils.IdentifierResult;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* @author Thomas Corbat
|
||||
*
|
||||
*/
|
||||
public class CorrectCaseTest extends TestCase {
|
||||
|
||||
public CorrectCaseTest() {
|
||||
super("Check Correct Identifier"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runTest() {
|
||||
IdentifierResult result;
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("A"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("Z"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("a"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("z"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_A"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_Z"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_a"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_z"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("__"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_0"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_9"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("Aaaa"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("Zaaa"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("aaaa"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("zaaa"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_aaa"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Institute for Software, HSR Hochschule fuer Technik
|
||||
* Rapperswil, University of applied sciences 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:
|
||||
* Institute for Software - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.ui.tests.refactoring.utils;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.refactoring.utils.IdentifierHelper;
|
||||
import org.eclipse.cdt.internal.ui.refactoring.utils.IdentifierResult;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* @author Thomas Corbat
|
||||
*
|
||||
*/
|
||||
public class DigitFirstCaseTest extends TestCase {
|
||||
|
||||
public DigitFirstCaseTest() {
|
||||
super("Check Digit First Identifier"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runTest() {
|
||||
IdentifierResult result;
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("0"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.DIGIT_FIRST == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("9"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.DIGIT_FIRST == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("0a"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.DIGIT_FIRST == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("99"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.DIGIT_FIRST == result.getResult());
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Institute for Software, HSR Hochschule fuer Technik
|
||||
* Rapperswil, University of applied sciences 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:
|
||||
* Institute for Software - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.ui.tests.refactoring.utils;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.refactoring.utils.IdentifierHelper;
|
||||
import org.eclipse.cdt.internal.ui.refactoring.utils.IdentifierResult;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* @author Thomas Corbat
|
||||
*
|
||||
*/
|
||||
public class EmptyCaseTest extends TestCase {
|
||||
|
||||
public EmptyCaseTest() {
|
||||
super("Check Empty Identifier"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runTest() {
|
||||
IdentifierResult result;
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName(""); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.EMPTY == result.getResult());
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -11,28 +11,247 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Institute for Software - initial API and implementation
|
||||
* Martin Weber
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.ui.tests.refactoring.utils;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
import org.eclipse.cdt.internal.ui.refactoring.utils.IdentifierHelper;
|
||||
import org.eclipse.cdt.internal.ui.refactoring.utils.IdentifierResult;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* @author Thomas Corbat
|
||||
* @author Martin Weber
|
||||
*/
|
||||
public class IdentifierHelperTest extends TestSuite {
|
||||
public class IdentifierHelperTest extends TestCase {
|
||||
|
||||
public IdentifierHelperTest() {
|
||||
super("Identifier Helper Test"); //$NON-NLS-1$
|
||||
public void testCorrectIdentifierCase() {
|
||||
IdentifierResult result;
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("A"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("Z"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("a"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("z"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_A"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_Z"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_a"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_z"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("__"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_0"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_9"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("Aaaa"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("Zaaa"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("aaaa"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("zaaa"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("_aaa"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.VALID == result.getResult());
|
||||
}
|
||||
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite("Test for Identifier Helper"); //$NON-NLS-1$
|
||||
suite.addTest(new CorrectCaseTest());
|
||||
suite.addTest(new DigitFirstCaseTest());
|
||||
suite.addTest(new EmptyCaseTest());
|
||||
suite.addTest(new IllegalCharCaseTest());
|
||||
suite.addTest(new KeywordCaseTest());
|
||||
return suite;
|
||||
public void testDigitFirst() {
|
||||
IdentifierResult result;
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("0"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.DIGIT_FIRST == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("9"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.DIGIT_FIRST == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("0a"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.DIGIT_FIRST == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("99"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.DIGIT_FIRST == result.getResult());
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
IdentifierResult result;
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName(""); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.EMPTY == result.getResult());
|
||||
}
|
||||
|
||||
public void testIllegalChar() {
|
||||
IdentifierResult result;
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("a~"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.ILLEGAL_CHARACTER == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("a%"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.ILLEGAL_CHARACTER == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("a!"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.ILLEGAL_CHARACTER == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("{}"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.ILLEGAL_CHARACTER == result.getResult());
|
||||
}
|
||||
|
||||
public void testKeyword() {
|
||||
IdentifierResult result;
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("using"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("bitand"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("for"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("const_cast"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("namespace"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("break"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("static_cast"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("false"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("volatile"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("template"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("else"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("dynamic_cast"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("static"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("or"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("not_eq"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("class"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("enum"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("typedef"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("restrict"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("and"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("reinterpret_cast"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("not"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("default"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("explicit"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("sizeof"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("auto"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("case"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("this"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("try"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("friend"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("asm"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("virtual"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("const"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("or_eq"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("catch"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("switch"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("goto"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("while"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("private"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("throw"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("protected"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("struct"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("if"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("extern"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("union"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("typeid"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("noexcept"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("inline"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("compl"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("delete"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("do"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("xor"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("export"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("bitor"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("return"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("true"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("operator"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("register"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("new"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("and_eq"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("typename"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("continue"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("mutable"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("xor_eq"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("public"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Institute for Software, HSR Hochschule fuer Technik
|
||||
* Rapperswil, University of applied sciences 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:
|
||||
* Institute for Software - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.ui.tests.refactoring.utils;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.refactoring.utils.IdentifierHelper;
|
||||
import org.eclipse.cdt.internal.ui.refactoring.utils.IdentifierResult;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* @author Thomas Corbat
|
||||
*
|
||||
*/
|
||||
public class IllegalCharCaseTest extends TestCase {
|
||||
|
||||
public IllegalCharCaseTest() {
|
||||
super("Check Illegal Character Identifier"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runTest() {
|
||||
IdentifierResult result;
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("a~"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.ILLEGAL_CHARACTER == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("a%"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.ILLEGAL_CHARACTER == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("a!"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.ILLEGAL_CHARACTER == result.getResult());
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("{}"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.ILLEGAL_CHARACTER == result.getResult());
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,166 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008, 2012 Institute for Software, HSR Hochschule fuer Technik
|
||||
* Rapperswil, University of applied sciences 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:
|
||||
* Institute for Software - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.ui.tests.refactoring.utils;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.refactoring.utils.IdentifierHelper;
|
||||
import org.eclipse.cdt.internal.ui.refactoring.utils.IdentifierResult;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* @author Thomas Corbat
|
||||
*/
|
||||
public class KeywordCaseTest extends TestCase {
|
||||
|
||||
public KeywordCaseTest() {
|
||||
super("Check Keyword Identifier"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runTest() {
|
||||
IdentifierResult result;
|
||||
|
||||
result = IdentifierHelper.checkIdentifierName("using"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("bitand"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("for"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("const_cast"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("namespace"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("break"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("static_cast"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("false"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("volatile"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("template"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("else"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("dynamic_cast"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("static"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("or"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("not_eq"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("class"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("enum"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("typedef"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("restrict"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("and"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("reinterpret_cast"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("not"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("default"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("explicit"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("sizeof"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("auto"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("case"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("this"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("try"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("friend"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("asm"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("virtual"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("const"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("or_eq"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("catch"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("switch"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("goto"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("while"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("private"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("throw"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("protected"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("struct"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("if"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("extern"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("union"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("typeid"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("noexcept"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("inline"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("compl"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("delete"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("do"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("xor"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("export"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("bitor"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("return"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("true"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("operator"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("register"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("new"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("and_eq"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("typename"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("continue"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("mutable"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("xor_eq"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
result = IdentifierHelper.checkIdentifierName("public"); //$NON-NLS-1$
|
||||
assertTrue(result.getMessage(), IdentifierResult.KEYWORD == result.getResult());
|
||||
}
|
||||
}
|
|
@ -25,7 +25,7 @@ public class UtilTestSuite extends TestSuite {
|
|||
|
||||
public static Test suite() throws Exception {
|
||||
UtilTestSuite suite = new UtilTestSuite();
|
||||
suite.addTest(IdentifierHelperTest.suite());
|
||||
suite.addTestSuite(IdentifierHelperTest.class);
|
||||
suite.addTestSuite(DefinitionFinderTest.class);
|
||||
suite.addTestSuite(PseudoNameGeneratorTest.class);
|
||||
suite.addTestSuite(NameComposerTest.class);
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.eclipse.jface.text.TextUtilities;
|
|||
/**
|
||||
* IAutoEditStrategy related tests
|
||||
*/
|
||||
public class AbstractAutoEditTest extends BaseTestCase {
|
||||
public abstract class AbstractAutoEditTest extends BaseTestCase {
|
||||
|
||||
protected AbstractAutoEditTest(String name) {
|
||||
super(name);
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.text.BreakIterator;
|
|||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class BreakIteratorTest extends TestCase {
|
||||
public abstract class BreakIteratorTest extends TestCase {
|
||||
|
||||
protected BreakIterator fBreakIterator;
|
||||
|
||||
|
|
|
@ -33,12 +33,14 @@ import org.eclipse.core.runtime.CoreException;
|
|||
import org.eclipse.jface.text.BadLocationException;
|
||||
import org.eclipse.jface.text.Document;
|
||||
import org.eclipse.jface.text.IDocument;
|
||||
import org.junit.Ignore;
|
||||
|
||||
import junit.framework.Test;
|
||||
|
||||
/**
|
||||
* Testing the auto indent strategies.
|
||||
*/
|
||||
@Ignore("Some tests fail and this class was not included through AutomatedIntegrationSuite. See bug 564002")
|
||||
public class DefaultCCommentAutoEditStrategyTest extends AbstractAutoEditTest {
|
||||
private HashMap<String, String> fOptions;
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ import org.eclipse.ui.PartInitException;
|
|||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.ide.IDE;
|
||||
|
||||
public class TypeHierarchyBaseTest extends BaseUITestCase {
|
||||
public abstract class TypeHierarchyBaseTest extends BaseUITestCase {
|
||||
protected ICProject fCProject;
|
||||
protected IIndex fIndex;
|
||||
|
||||
|
|
|
@ -37,9 +37,6 @@
|
|||
<application>org.eclipse.cdt.debug.application.app</application>
|
||||
<argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
|
||||
<appArgLine>-pluginCustomization ${basedir}/../../disable_intro_in_tests.ini</appArgLine>
|
||||
<includes>
|
||||
<include>**/AllTests.*</include>
|
||||
</includes>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>org.eclipse.platform.feature.group</artifactId>
|
||||
|
|
|
@ -18,9 +18,7 @@ import static org.junit.Assert.assertTrue;
|
|||
import java.util.Arrays;
|
||||
|
||||
import org.eclipse.cdt.debug.internal.core.model.IRegisterGroupDescriptor;
|
||||
import org.eclipse.cdt.dsf.datamodel.DMContexts;
|
||||
import org.eclipse.cdt.dsf.debug.service.IProcesses.IProcessDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.MIProcesses;
|
||||
import org.eclipse.cdt.dsf.mi.service.MIRegisters.MIRegisterDMC;
|
||||
|
@ -130,72 +128,4 @@ public class GDBRegisterTest extends CommonDsfTest {
|
|||
|
||||
assertTrue(Arrays.equals(expectedRegisterGroups, savedRegisterGroups));
|
||||
}
|
||||
|
||||
/* ----------------- ----------------- */
|
||||
|
||||
/**
|
||||
* Variant of {@link GDBRegisterTest} where register groups are saved without a container id.
|
||||
* This is the default behavior for register group persistence.
|
||||
*/
|
||||
public static class GDBRegisterTest_NoContainerTest extends GDBRegisterTest {
|
||||
|
||||
@Override
|
||||
protected GDBRegisters createGdbRegisters() {
|
||||
return new GDBRegisters(fSession) {
|
||||
@Override
|
||||
protected boolean useProcessIdAsRegisterGroupPersistanceId() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkAfterAdding_GroupA(IMIContainerDMContext containerA, IMIContainerDMContext containerB,
|
||||
MIRegisterGroupDMC registerGroupA) {
|
||||
checkRegisterGroupMemento(containerA, registerGroupA);
|
||||
checkRegisterGroupMemento(containerB, registerGroupA);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkAfterAdding_GroupB(IMIContainerDMContext containerA, IMIContainerDMContext containerB,
|
||||
MIRegisterGroupDMC registerGroupA, MIRegisterGroupDMC registerGroupB) {
|
||||
checkRegisterGroupsMemento(containerA, array(registerGroupA, registerGroupB));
|
||||
checkRegisterGroupsMemento(containerB, array(registerGroupA, registerGroupB));
|
||||
}
|
||||
}
|
||||
|
||||
public static class GDBRegisterTest_WithAlternativeProcessIdTest extends GDBRegisterTest {
|
||||
|
||||
@Override
|
||||
protected GDBRegisters createGdbRegisters() {
|
||||
return new GDBRegisters(fSession) {
|
||||
@Override
|
||||
protected boolean useProcessIdAsRegisterGroupPersistanceId() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPersistenceIdForRegisterGroupContainer(IContainerDMContext contDmc) {
|
||||
return super.getPersistenceIdForRegisterGroupContainer(contDmc) + "XXX";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class GDBRegisterTest_WithContainerDMContextTest extends GDBRegisterTest {
|
||||
|
||||
@Override
|
||||
protected GDBRegisters createGdbRegisters() {
|
||||
return new GDBRegisters(fSession) {
|
||||
@Override
|
||||
protected String getPersistenceIdForRegisterGroupContainer(IContainerDMContext contDmc) {
|
||||
IMIContainerDMContext contextDmc = DMContexts.getAncestorOfType(contDmc,
|
||||
IMIContainerDMContext.class);
|
||||
return contextDmc.getGroupId();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package org.eclipse.cdt.dsf.gdb.service;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.MIRegisters.MIRegisterGroupDMC;
|
||||
|
||||
/**
|
||||
* Variant of {@link GDBRegisterTest} where register groups are saved without a container id.
|
||||
* This is the default behavior for register group persistence.
|
||||
*/
|
||||
public class GDBRegisterTest_NoContainerTest extends GDBRegisterTest {
|
||||
|
||||
@Override
|
||||
protected GDBRegisters createGdbRegisters() {
|
||||
return new GDBRegisters(fSession) {
|
||||
@Override
|
||||
protected boolean useProcessIdAsRegisterGroupPersistanceId() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkAfterAdding_GroupA(IMIContainerDMContext containerA, IMIContainerDMContext containerB,
|
||||
MIRegisterGroupDMC registerGroupA) {
|
||||
checkRegisterGroupMemento(containerA, registerGroupA);
|
||||
checkRegisterGroupMemento(containerB, registerGroupA);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkAfterAdding_GroupB(IMIContainerDMContext containerA, IMIContainerDMContext containerB,
|
||||
MIRegisterGroupDMC registerGroupA, MIRegisterGroupDMC registerGroupB) {
|
||||
checkRegisterGroupsMemento(containerA, array(registerGroupA, registerGroupB));
|
||||
checkRegisterGroupsMemento(containerB, array(registerGroupA, registerGroupB));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package org.eclipse.cdt.dsf.gdb.service;
|
||||
|
||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext;
|
||||
|
||||
public class GDBRegisterTest_WithAlternativeProcessIdTest extends GDBRegisterTest {
|
||||
|
||||
@Override
|
||||
protected GDBRegisters createGdbRegisters() {
|
||||
return new GDBRegisters(fSession) {
|
||||
@Override
|
||||
protected boolean useProcessIdAsRegisterGroupPersistanceId() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPersistenceIdForRegisterGroupContainer(IContainerDMContext contDmc) {
|
||||
return super.getPersistenceIdForRegisterGroupContainer(contDmc) + "XXX";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package org.eclipse.cdt.dsf.gdb.service;
|
||||
|
||||
import org.eclipse.cdt.dsf.datamodel.DMContexts;
|
||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext;
|
||||
|
||||
public class GDBRegisterTest_WithContainerDMContextTest extends GDBRegisterTest {
|
||||
|
||||
@Override
|
||||
protected GDBRegisters createGdbRegisters() {
|
||||
return new GDBRegisters(fSession) {
|
||||
@Override
|
||||
protected String getPersistenceIdForRegisterGroupContainer(IContainerDMContext contDmc) {
|
||||
IMIContainerDMContext contextDmc = DMContexts.getAncestorOfType(contDmc, IMIContainerDMContext.class);
|
||||
return contextDmc.getGroupId();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -14,9 +14,9 @@
|
|||
package org.eclipse.cdt.dsf.gdb.tests;
|
||||
|
||||
import org.eclipse.cdt.dsf.gdb.service.GDBRegisterTest;
|
||||
import org.eclipse.cdt.dsf.gdb.service.GDBRegisterTest.GDBRegisterTest_NoContainerTest;
|
||||
import org.eclipse.cdt.dsf.gdb.service.GDBRegisterTest.GDBRegisterTest_WithAlternativeProcessIdTest;
|
||||
import org.eclipse.cdt.dsf.gdb.service.GDBRegisterTest.GDBRegisterTest_WithContainerDMContextTest;
|
||||
import org.eclipse.cdt.dsf.gdb.service.GDBRegisterTest_NoContainerTest;
|
||||
import org.eclipse.cdt.dsf.gdb.service.GDBRegisterTest_WithAlternativeProcessIdTest;
|
||||
import org.eclipse.cdt.dsf.gdb.service.GDBRegisterTest_WithContainerDMContextTest;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.TestMIBreakInsertCommand;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.TestMICommandConstructCommand;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.TestMIGDBSetSysroot;
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
<packaging>eclipse-test-plugin</packaging>
|
||||
|
||||
<properties>
|
||||
<dsf.gdb.tests.gdbTestSuite>AutomatedSuite.java</dsf.gdb.tests.gdbTestSuite>
|
||||
<dsf.gdb.tests.timeout.multiplier>1</dsf.gdb.tests.timeout.multiplier>
|
||||
<skipTests>${dsf-gdb.skip.tests}</skipTests>
|
||||
</properties>
|
||||
|
@ -59,9 +58,6 @@
|
|||
<useUIHarness>false</useUIHarness>
|
||||
<argLine>${tycho.testArgLine} ${base.ui.test.vmargs} -ea -Xms256m -Xmx512m -Dcdt.tests.dsf.gdb.path=${dsf.gdb.tests.gdbPath} -Ddsf.gdb.tests.timeout.multiplier=${dsf.gdb.tests.timeout.multiplier} -Dcdt.tests.dsf.gdb.versions=${cdt.tests.dsf.gdb.versions}</argLine>
|
||||
<appArgLine>-debug ./dsf.debug.options -pluginCustomization ${basedir}/../../disable_intro_in_tests.ini</appArgLine>
|
||||
<includes>
|
||||
<include>**/${dsf.gdb.tests.gdbTestSuite}</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
<packaging>eclipse-test-plugin</packaging>
|
||||
|
||||
<properties>
|
||||
<dsf.gdb.tests.gdbTestSuite>AutomatedSuite.java</dsf.gdb.tests.gdbTestSuite>
|
||||
<dsf.gdb.tests.timeout.multiplier>1</dsf.gdb.tests.timeout.multiplier>
|
||||
<skipTests>${dsf-gdb.skip.tests}</skipTests>
|
||||
</properties>
|
||||
|
@ -59,9 +58,6 @@
|
|||
<useUIHarness>false</useUIHarness>
|
||||
<argLine>${tycho.testArgLine} ${base.ui.test.vmargs} -ea -Xms256m -Xmx512m -Dcdt.tests.dsf.gdb.path=${dsf.gdb.tests.gdbPath} -Ddsf.gdb.tests.timeout.multiplier=${dsf.gdb.tests.timeout.multiplier} -Dcdt.tests.dsf.gdb.versions=${cdt.tests.dsf.gdb.versions}</argLine>
|
||||
<appArgLine>-debug ./dsf.debug.options -pluginCustomization ${basedir}/../../disable_intro_in_tests.ini</appArgLine>
|
||||
<includes>
|
||||
<include>**/${dsf.gdb.tests.gdbTestSuite}</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
|
|
@ -24,9 +24,6 @@
|
|||
<!-- Default configuration, UI tests may have to override these -->
|
||||
<useUIHarness>true</useUIHarness>
|
||||
<useUIThread>false</useUIThread>
|
||||
<includes>
|
||||
<include>**/AutomatedIntegrationSuite.*</include>
|
||||
</includes>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<type>p2-installable-unit</type>
|
||||
|
|
|
@ -44,9 +44,6 @@
|
|||
<useUIThread>false</useUIThread>
|
||||
<argLine>${tycho.testArgLine} ${base.test.vmargs}</argLine> -->
|
||||
<!-- endif -->
|
||||
<includes>
|
||||
<include>**/*Test.*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
|
11
pom.xml
11
pom.xml
|
@ -867,12 +867,17 @@
|
|||
<artifactId>tycho-surefire-plugin</artifactId>
|
||||
<version>${tycho-version}</version>
|
||||
<configuration>
|
||||
<!-- This includes block can be safely deleted once a tycho version never than 1.7 is in use. -->
|
||||
<!-- NOTE: The following is the default include pattern of tycho 2.0 -->
|
||||
<includes>
|
||||
<include>**/Test*.java</include>
|
||||
<include>**/*Test.java</include>
|
||||
<include>**/*Tests.java</include>
|
||||
<include>**/*TestCase.java</include>
|
||||
</includes>
|
||||
<!-- Default configuration, UI tests may have to override these -->
|
||||
<useUIHarness>false</useUIHarness>
|
||||
<useUIThread>false</useUIThread>
|
||||
<includes>
|
||||
<include>**/AutomatedIntegrationSuite.*</include>
|
||||
</includes>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<type>p2-installable-unit</type>
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.eclipse.core.runtime.CoreException;
|
|||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
|
||||
public class BaseQtTestCase extends BaseTestCase {
|
||||
public abstract class BaseQtTestCase extends BaseTestCase {
|
||||
|
||||
// TODO There is a problem with the unit test framework where it sometimes will not wait
|
||||
// long enough for the index to be updated. For now mask this problem by stopping
|
||||
|
|
|
@ -20,17 +20,17 @@ import junit.framework.TestSuite;
|
|||
* Terminal emulator test cases.
|
||||
* Runs in emulator package to allow access to default visible items.
|
||||
*/
|
||||
public class AllTests extends TestCase {
|
||||
public AllTests() {
|
||||
public class AllTestSuite extends TestCase {
|
||||
public AllTestSuite() {
|
||||
super(null);
|
||||
}
|
||||
|
||||
public AllTests(String name) {
|
||||
public AllTestSuite(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite(AllTests.class.getName());
|
||||
TestSuite suite = new TestSuite(AllTestSuite.class.getName());
|
||||
suite.addTestSuite(VT100EmulatorBackendTest.class);
|
||||
return suite;
|
||||
}
|
|
@ -20,21 +20,21 @@ import junit.framework.TestSuite;
|
|||
* Internal Terminal Model test cases.
|
||||
* Runs in internal model package to allow access to default visible items.
|
||||
*/
|
||||
public class AllTests extends TestCase {
|
||||
public AllTests() {
|
||||
public class AllTestSuite extends TestCase {
|
||||
public AllTestSuite() {
|
||||
super(null);
|
||||
}
|
||||
|
||||
public AllTests(String name) {
|
||||
public AllTestSuite(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite(AllTests.class.getName());
|
||||
TestSuite suite = new TestSuite(AllTestSuite.class.getName());
|
||||
suite.addTestSuite(SnapshotChangesTest.class);
|
||||
suite.addTestSuite(SynchronizedTerminalTextDataTest.class);
|
||||
suite.addTestSuite(TerminalTextDataFastScrollTest.class);
|
||||
suite.addTestSuite(TerminalTextDataFastScrollTestMaxHeigth.class);
|
||||
suite.addTestSuite(TerminalTextDataFastScrollMaxHeightTest.class);
|
||||
suite.addTestSuite(TerminalTextDataPerformanceTest.class);
|
||||
suite.addTestSuite(TerminalTextDataSnapshotTest.class);
|
||||
suite.addTestSuite(TerminalTextDataSnapshotWindowTest.class);
|
|
@ -12,7 +12,7 @@ package org.eclipse.tm.internal.terminal.model;
|
|||
|
||||
import org.eclipse.tm.terminal.model.ITerminalTextData;
|
||||
|
||||
public class TerminalTextDataFastScrollTestMaxHeigth extends AbstractITerminalTextDataTest {
|
||||
public class TerminalTextDataFastScrollMaxHeightTest extends AbstractITerminalTextDataTest {
|
||||
@Override
|
||||
protected ITerminalTextData makeITerminalTextData() {
|
||||
return new TerminalTextDataFastScroll(1);
|
|
@ -21,17 +21,17 @@ import junit.framework.TestSuite;
|
|||
* Public Terminal Model test cases.
|
||||
* Runs in internal model package to allow access to default visible items.
|
||||
*/
|
||||
public class AllTests extends TestCase {
|
||||
public AllTests() {
|
||||
public class AllTestSuite extends TestCase {
|
||||
public AllTestSuite() {
|
||||
super(null);
|
||||
}
|
||||
|
||||
public AllTests(String name) {
|
||||
public AllTestSuite(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite(AllTests.class.getName());
|
||||
TestSuite suite = new TestSuite(AllTestSuite.class.getName());
|
||||
suite.addTest(new JUnit4TestAdapter(TerminalColorUITest.class));
|
||||
suite.addTestSuite(StyleTest.class);
|
||||
return suite;
|
|
@ -14,7 +14,7 @@ import org.junit.runner.RunWith;
|
|||
import org.junit.runners.Suite;
|
||||
|
||||
@RunWith(Suite.class)
|
||||
@Suite.SuiteClasses({ AutomatedPluginTests.class, AutomatedTests.class })
|
||||
@Suite.SuiteClasses({ AutomatedPluginTestSuite.class, AutomatedTestSuite.class })
|
||||
public class AutomatedIntegrationSuite {
|
||||
|
||||
}
|
||||
|
|
|
@ -20,19 +20,19 @@ import junit.framework.TestSuite;
|
|||
/**
|
||||
* Master Test Suite to run all Terminal plug-in tests.
|
||||
*/
|
||||
public class AutomatedPluginTests extends TestCase {
|
||||
public class AutomatedPluginTestSuite extends TestCase {
|
||||
/**
|
||||
* Call each AllTests class from each of the test packages.
|
||||
* Call each AllTestSuite class from each of the test packages.
|
||||
*/
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite(AutomatedPluginTests.class.getName());
|
||||
TestSuite suite = new TestSuite(AutomatedPluginTestSuite.class.getName());
|
||||
//These tests require Eclipse Platform to be up
|
||||
suite.addTestSuite(org.eclipse.tm.internal.terminal.connector.TerminalConnectorPluginTest.class);
|
||||
suite.addTestSuite(org.eclipse.tm.internal.terminal.connector.TerminalConnectorFactoryTest.class);
|
||||
|
||||
//These tests must run as plain JUnit because they require access
|
||||
//to "package" protected methods
|
||||
//suite.addTest(AutomatedTests.suite());
|
||||
//suite.addTest(AutomatedTestSuite.suite());
|
||||
return suite;
|
||||
}
|
||||
|
|
@ -19,26 +19,26 @@ import junit.framework.TestSuite;
|
|||
/**
|
||||
* Master test suite to run all terminal unit tests.
|
||||
*/
|
||||
public class AutomatedTests extends TestCase {
|
||||
public class AutomatedTestSuite extends TestCase {
|
||||
|
||||
public static final String PI_TERMINAL_TESTS = "org.eclipse.tm.terminal.test"; //$NON-NLS-1$
|
||||
|
||||
public AutomatedTests() {
|
||||
public AutomatedTestSuite() {
|
||||
super(null);
|
||||
}
|
||||
|
||||
public AutomatedTests(String name) {
|
||||
public AutomatedTestSuite(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call each AllTests class from each of the test packages.
|
||||
* Call each AllTestSuite class from each of the test packages.
|
||||
*/
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite(AutomatedTests.class.getName());
|
||||
suite.addTest(org.eclipse.tm.internal.terminal.emulator.AllTests.suite());
|
||||
suite.addTest(org.eclipse.tm.internal.terminal.model.AllTests.suite());
|
||||
suite.addTest(org.eclipse.tm.terminal.model.AllTests.suite());
|
||||
TestSuite suite = new TestSuite(AutomatedTestSuite.class.getName());
|
||||
suite.addTest(org.eclipse.tm.internal.terminal.emulator.AllTestSuite.suite());
|
||||
suite.addTest(org.eclipse.tm.internal.terminal.model.AllTestSuite.suite());
|
||||
suite.addTest(org.eclipse.tm.terminal.model.AllTestSuite.suite());
|
||||
suite.addTestSuite(org.eclipse.tm.internal.terminal.connector.TerminalConnectorTest.class);
|
||||
suite.addTestSuite(org.eclipse.tm.internal.terminal.connector.TerminalToRemoteInjectionOutputStreamTest.class);
|
||||
return suite;
|
Loading…
Add table
Reference in a new issue