mirror of
https://github.com/eclipse-cdt/cdt
synced 2024-10-28 03:59:40 +01:00
Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
Change-Id: I7dbdfe98795242a3c96a3ed87532a993dd7db685 Signed-off-by: Alvaro Sanchez-Leon <alvsan09@gmail.com> Reviewed-on: https://git.eclipse.org/r/28602 Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com> Tested-by: Hudson CI
This commit is contained in:
parent
3936530e86
commit
4ec3cdbbe7
46 changed files with 831 additions and 590 deletions
7
dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/.classpath
Normal file
7
dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/.classpath
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/.project
Normal file
28
dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.eclipse.cdt.dsf.gdb.tests</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,70 @@
|
|||
#Tue Jun 24 11:05:41 PDT 2008
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
|
||||
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
|
||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
||||
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
|
||||
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.nullReference=error
|
||||
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
|
||||
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
|
||||
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedImport=error
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
@ -0,0 +1,8 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: DSF-GDB test fragment
|
||||
Bundle-SymbolicName: org.eclipse.cdt.dsf.gdb.tests;singleton:=true
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Fragment-Host: org.eclipse.cdt.dsf.gdb
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Require-Bundle: org.junit;bundle-version="4.8.1"
|
24
dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/about.html
Normal file
24
dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/about.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head><body lang="EN-US">
|
||||
<h2>About This Content</h2>
|
||||
|
||||
<p>May 14, 2008</p>
|
||||
<h3>License</h3>
|
||||
|
||||
<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
|
||||
indicated below, the Content is provided to you under the terms and conditions of the
|
||||
Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
|
||||
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
|
||||
For purposes of the EPL, "Program" will mean the Content.</p>
|
||||
|
||||
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
|
||||
being redistributed by another party ("Redistributor") and different terms and conditions may
|
||||
apply to your use of any object code in the Content. Check the Redistributor's license that was
|
||||
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
|
||||
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
|
||||
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
|
||||
|
||||
</body></html>
|
16
dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/build.properties
Normal file
16
dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/build.properties
Normal file
|
@ -0,0 +1,16 @@
|
|||
###############################################################################
|
||||
# Copyright (c) 2014 Ericsson AB and others.
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are made available under the terms of the Eclipse Public License v1.0
|
||||
# which accompanies this distribution, and is available at
|
||||
# http://www.eclipse.org/legal/epl-v10.html
|
||||
#
|
||||
# Contributors:
|
||||
# Alvaro Sanchez-Leon (Ericsson) - initial Version
|
||||
###############################################################################
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
about.html
|
||||
src.includes = about.html
|
58
dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/pom.xml
Normal file
58
dsf-gdb/org.eclipse.cdt.dsf.gdb.tests/pom.xml
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.eclipse.cdt</groupId>
|
||||
<artifactId>cdt-parent</artifactId>
|
||||
<version>8.4.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<artifactId>org.eclipse.cdt.dsf.gdb.tests</artifactId>
|
||||
<packaging>eclipse-test-plugin</packaging>
|
||||
|
||||
<!-- Uncommenting this is useful when the repo is built first then you want to run tests on this plugin only -->
|
||||
<!--
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>cdt.repo</id>
|
||||
<url>file:/${basedir}/../../releng/org.eclipse.cdt.repo/target/repository</url>
|
||||
<layout>p2</layout>
|
||||
</repository>
|
||||
</repositories>
|
||||
-->
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
<artifactId>tycho-surefire-plugin</artifactId>
|
||||
<version>${tycho-version}</version>
|
||||
<configuration>
|
||||
<useUIHarness>false</useUIHarness>
|
||||
<argLine>${base.ui.test.vmargs} -ea -Xms256m -Xmx512m -XX:MaxPermSize=256M</argLine>
|
||||
<includes>
|
||||
<include>**/AllTests.*</include>
|
||||
</includes>
|
||||
<testFailureIgnore>true</testFailureIgnore>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>org.eclipse.platform.feature.group</artifactId>
|
||||
<version>3.7.0</version>
|
||||
<type>p2-installable-unit</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>org.eclipse.cdt.feature.group</artifactId>
|
||||
<version>8.2.0.${buildQualifier}</version>
|
||||
<type>p2-installable-unit</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,33 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Ericsson AB and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Initial Implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.gdb.tests;
|
||||
|
||||
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.output.MIStringHandlerTests;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIThreadTests;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Suite;
|
||||
import org.junit.runners.Suite.SuiteClasses;
|
||||
|
||||
@RunWith(Suite.class)
|
||||
|
||||
// Add additional test case classes below
|
||||
@SuiteClasses({MIThreadTests.class,
|
||||
TestMIBreakInsertCommand.class,
|
||||
TestMICommandConstructCommand.class,
|
||||
LaunchUtilsTest.class,
|
||||
MIStringHandlerTests.class,
|
||||
ProcStatParserTest.class
|
||||
})
|
||||
public class AllTests {
|
||||
// Often overriding BeforeClass method here
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010, 2013 Ericsson and others.
|
||||
* Copyright (c) 2010, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,8 +7,9 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Marc-Andre Laperle - Added test for the gdb version string converter
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests;
|
||||
package org.eclipse.cdt.dsf.gdb.tests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2013 Ericsson
|
||||
* Copyright (c) 2013, 2014 Ericsson
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,8 +7,9 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Marc Dumais (Ericsson) - Initial API and implementation (Bug 396268)
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests;
|
||||
package org.eclipse.cdt.dsf.gdb.tests;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008, 2012 Ericsson and others.
|
||||
* Copyright (c) 2008, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -8,6 +8,7 @@
|
|||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Marc Khouzam (Ericsson) - Fix NPE (bug 369583)
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.mi.service.command.commands;
|
||||
|
||||
|
@ -16,9 +17,9 @@ import static org.junit.Assert.assertEquals;
|
|||
import org.eclipse.cdt.dsf.concurrent.DefaultDsfExecutor;
|
||||
import org.eclipse.cdt.dsf.datamodel.IDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext;
|
||||
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
||||
import org.eclipse.cdt.dsf.gdb.service.command.GDBControlDMContext;
|
||||
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
|
@ -43,7 +44,7 @@ public class TestMIBreakInsertCommand {
|
|||
private DsfSession session = null;
|
||||
|
||||
public TestContext() {
|
||||
session = DsfSession.startSession(new DefaultDsfExecutor(TestsPlugin.PLUGIN_ID), TestsPlugin.PLUGIN_ID);
|
||||
session = DsfSession.startSession(new DefaultDsfExecutor(GdbPlugin.PLUGIN_ID), GdbPlugin.PLUGIN_ID);
|
||||
}
|
||||
|
||||
@Override
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008, 2012 Ericsson and others.
|
||||
* Copyright (c) 2008, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -8,6 +8,7 @@
|
|||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Marc Khouzam (Ericsson) - Fix NPE (bug 369583)
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.mi.service.command.commands;
|
||||
|
||||
|
@ -16,11 +17,10 @@ import static org.junit.Assert.assertEquals;
|
|||
import org.eclipse.cdt.dsf.concurrent.DefaultDsfExecutor;
|
||||
import org.eclipse.cdt.dsf.datamodel.IDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext;
|
||||
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
||||
import org.eclipse.cdt.dsf.gdb.service.command.GDBControlDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.MICommand;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
|
||||
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
|
@ -56,7 +56,7 @@ public class TestMICommandConstructCommand {
|
|||
private DsfSession session = null;
|
||||
|
||||
public TestContext() {
|
||||
session = DsfSession.startSession(new DefaultDsfExecutor(TestsPlugin.PLUGIN_ID), TestsPlugin.PLUGIN_ID);
|
||||
session = DsfSession.startSession(new DefaultDsfExecutor(GdbPlugin.PLUGIN_ID), GdbPlugin.PLUGIN_ID);
|
||||
}
|
||||
|
||||
@Override
|
|
@ -1,424 +1,425 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012 Mathias Kunter and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Mathias Kunter - Initial Implementation (Bug 307311)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.mi.service.command.output;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.text.ParseException;
|
||||
|
||||
import junit.framework.JUnit4TestAdapter;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class MIStringHandlerTests {
|
||||
@Test
|
||||
public void testTranscodeString() {
|
||||
// Test transcoding of an empty string.
|
||||
assertEquals(MIStringHandler.transcodeString(""), ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test transcoding of an ASCII string.
|
||||
assertEquals(MIStringHandler.transcodeString("ASCII"), "ASCII"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test transcoding of Latin-1 strings.
|
||||
assertEquals(MIStringHandler.transcodeString("\344"), "\344"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("abc\344"), "abc\344"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("\344abc"), "\344abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("abc\344def"), "abc\344def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("abc\ndef\344ghi\tjkl"), "abc\ndef\344ghi\tjkl"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test transcoding of UTF-8 strings.
|
||||
assertEquals(MIStringHandler.transcodeString("\303\244"), "\344"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("abc\303\244"), "abc\344"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("\303\244abc"), "\344abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("abc\303\244def"), "abc\344def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("abc\ndef\303\244ghi\tjkl"), "abc\ndef\344ghi\tjkl"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test transcoding of a string with unsupported encoding (here: UTF-16).
|
||||
assertEquals(MIStringHandler.transcodeString("\u3090"), "\u3090"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEscapeString() {
|
||||
// Test escaping of an empty string.
|
||||
assertEquals(MIStringHandler.escapeString(""), ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of a plain text string.
|
||||
assertEquals(MIStringHandler.escapeString("abc"), "abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of strings which contain special chars.
|
||||
assertEquals(MIStringHandler.escapeString("\n"), "\\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\n\b"), "\\n\\b"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\0\1\2\3\4\5\6\7\10\11\12\13\14\15\16\17"), "\\0\\001\\002\\003\\004\\005\\006\\a\\b\\t\\n\\v\\f\\r\\016\\017"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\33"), "\\e"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\\", true), "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\\", false), "\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("'\t\\", true), "\\'\\t\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("'\t\\", false), "'\\t\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of strings which contain non-printable characters up to 0x7F.
|
||||
assertEquals(MIStringHandler.escapeString("\0"), "\\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\177"), "\\177"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\177"), "abc\\177"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\177abc"), "\\177abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\177def"), "abc\\177def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of strings which contain non-printable characters up to 0xFF.
|
||||
assertEquals(MIStringHandler.escapeString("\230"), "\\230"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\230"), "abc\\230"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\230abc"), "\\230abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\230def"), "abc\\230def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of strings which contain non-printable characters up to 0xFFFF.
|
||||
assertEquals(MIStringHandler.escapeString("\ud800"), "\\ud800"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\ud800"), "abc\\ud800"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\ud800abc"), "\\ud800abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\ud800def"), "abc\\ud800def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of strings which contain non-printable characters up to 0x10FFFF.
|
||||
assertEquals(MIStringHandler.escapeString("\udbff\udfff"), "\\U0010ffff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\udbff\udfff"), "abc\\U0010ffff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\udbff\udfffabc"), "\\U0010ffffabc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\udbff\udfffdef"), "abc\\U0010ffffdef"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of a string which contains all sorts of non-printable characters.
|
||||
assertEquals(MIStringHandler.escapeString("abc\n\tdef\\ghi\njkl\177\230\n\ud800\udbff\udfff?mno\"", true), "abc\\n\\tdef\\\\ghi\\njkl\\177\\230\\n\\ud800\\U0010ffff\\?mno\\\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\n\tdef\\ghi\njkl\177\230\n\ud800\udbff\udfff?mno\"", false), "abc\\n\\tdef\\ghi\\njkl\\177\\230\\n\\ud800\\U0010ffff?mno\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of an ill-formed UTF-16 Java string.
|
||||
assertEquals(MIStringHandler.escapeString("abc\udbff"), "abc\\udbff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsSpecialChar() {
|
||||
// Testing non-special chars.
|
||||
assertEquals(MIStringHandler.isSpecialChar('i'), false);
|
||||
assertEquals(MIStringHandler.isSpecialChar('w'), false);
|
||||
|
||||
// Testing special chars.
|
||||
assertEquals(MIStringHandler.isSpecialChar('a'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('b'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('e'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('E'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('f'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('n'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('r'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('t'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('v'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('\''), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('"'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('\\'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('?'), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsSpecialCodePoint() {
|
||||
// Testing non-special Unicode code points.
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x69), false); // 'i' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x77), false); // 'w' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x61), false); // 'a' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x6E), false); // 'n' character
|
||||
|
||||
// Testing special Unicode code points.
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x07), true); // 'a' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x08), true); // 'b' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x1B), true); // 'e' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x1B), true); // 'E' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x0C), true); // 'f' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x0A), true); // 'n' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x0D), true); // 'r' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x09), true); // 't' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x0B), true); // 'v' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x27), true); // '\'' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x22), true); // '"' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x5C), true); // '\\' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x3F), true); // '?' character
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseSpecialChar() {
|
||||
// Testing non-special chars. This actually should throw ParseExceptions.
|
||||
try {
|
||||
MIStringHandler.parseSpecialChar('i');
|
||||
fail("No parsing exception thrown.");
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
|
||||
try {
|
||||
MIStringHandler.parseSpecialChar('w');
|
||||
fail("No parsing exception thrown.");
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
|
||||
try {
|
||||
// Testing special chars.
|
||||
assertEquals(MIStringHandler.parseSpecialChar('a'), 0x07);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('b'), 0x08);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('e'), 0x1B);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('E'), 0x1B);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('f'), 0x0C);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('n'), 0x0A);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('r'), 0x0D);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('t'), 0x09);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('v'), 0x0B);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('\''), 0x27);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('"'), 0x22);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('\\'), 0x5C);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('?'), 0x3F);
|
||||
|
||||
} catch (ParseException e) {
|
||||
fail("Parsing exception thrown."); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseSpecialCodePoint() {
|
||||
try {
|
||||
// Testing non-special Unicode code points. This actually should throw ParseExceptions.
|
||||
try {
|
||||
MIStringHandler.parseSpecialCodePoint(0x69);
|
||||
fail("No parsing exception thrown.");
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
|
||||
try {
|
||||
MIStringHandler.parseSpecialCodePoint(0x77);
|
||||
fail("No parsing exception thrown.");
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
|
||||
// Testing special Unicode code points.
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x07), 'a');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x08), 'b');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x1B), 'e');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x0C), 'f');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x0A), 'n');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x0D), 'r');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x09), 't');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x0B), 'v');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x27), '\'');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x22), '"');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x5C), '\\');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x3F), '?');
|
||||
|
||||
} catch (ParseException e) {
|
||||
fail("Parsing exception thrown."); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseString() {
|
||||
// Test parsing of an empty string.
|
||||
assertEquals(MIStringHandler.parseString(""), ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString(""), ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of a plain text string.
|
||||
assertEquals(MIStringHandler.parseString("abc"), "abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain valid special char escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\n"), "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\\\"), "\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\'\\t\\\\"), "'\t\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain invalid special char escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\w"), "\\w"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\"), "\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\"), "abc\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\www"), "\\www"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\www"), "abc\\www"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\'\\z\\\\"), "'\\z\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\'\\z\\"), "'\\z\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain valid octal escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\141\\142\\143"), "abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\141\\142\\143\\0"), "abc\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\141\\142\\143\\12"), "abc\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\141\\\\142\\143\\\\"), "a\\142c\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\12"), "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\012"), "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("'\\011\\"), "'\t\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\177"), "\177"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\377"), "\377"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\3777"), "\3777"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\177"), "abc\177"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\177abc"), "\177abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\177def"), "abc\177def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\0"), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\1"), "\001"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\1a"), "\001a"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\18"), "\0018"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\01"), "\001"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\01a"), "\001a"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\001"), "\001"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\001a"), "\001a"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\0011"), "\0011"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\0011a"), "\0011a"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\1111"), "\1111"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain invalid octal escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\400"), "\\400"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\4000"), "\\4000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\8"), "\\8"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\90"), "\\90"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\ 0"), "\\ 0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\141\\142\\143\\"), "abc\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain valid hexadecimal escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\x0"), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\xa"), "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\xa0"), "\240"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\xag"), "\ng"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x0a"), "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x0a0"), "\240"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x0ag"), "\ng"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x00a"), "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x00a0"), "\240"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x00ag"), "\ng"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x000a"), "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x000a0"), "\n0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x000ag"), "\ng"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x0000a"), "\0a"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x0000a0"), "\0a0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x0000ag"), "\0ag"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\x20def"), "abc\u20def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\x20def\\xa"), "abc\u20def\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\x20ghi"), "abc ghi"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\x20ghi\\xa"), "abc ghi\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain invalid hexadecimal escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\x"), "\\x"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\x"), "abc\\x"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\xwww"), "\\xwww"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x\\"), "\\x\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x 0"), "\\x 0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x\\0"), "\\x\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain valid short Unicode escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\u0000"), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u000f"), "\017"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u00ff"), "\377"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u0fff"), "\u0fff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\uffff"), "\uffff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain invalid short Unicode escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\u"), "\\u"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\u"), "abc\\u"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\uwww"), "\\uwww"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u\\"), "\\u\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u 0"), "\\u 0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u\\0"), "\\u\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u0"), "\\u0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u00"), "\\u00"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u000"), "\\u000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u000g"), "\\u000g"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\ug"), "\\ug"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain valid long Unicode escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\U00000000"), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0000000f"), "\017"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U000000ff"), "\377"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U00000fff"), "\u0fff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0000ffff"), "\uffff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U000fffff"), "\udbbf\udfff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0010ffff"), "\udbff\udfff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain invalid long Unicode escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\U"), "\\U"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\U"), "abc\\U"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\Uwww"), "\\Uwww"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U\\"), "\\U\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U 0"), "\\U 0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U\\0"), "\\U\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0"), "\\U0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U00"), "\\U00"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U000"), "\\U000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0000"), "\\U0000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U00000"), "\\U00000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U000000"), "\\U000000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0000000"), "\\U0000000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0000000g"), "\\U0000000g"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U00110000"), "\\U00110000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U00f00000"), "\\U00f00000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0f000000"), "\\U0f000000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\Uf0000000"), "\\Uf0000000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\Uffffffff"), "\\Uffffffff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\Ufffffff"), "\\Ufffffff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\Ug"), "\\Ug"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTranslateCString() {
|
||||
// Test translating an empty string.
|
||||
assertEquals(MIStringHandler.translateCString("", false), ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("", true), ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test translating a plain text string.
|
||||
assertEquals(MIStringHandler.translateCString("abc", false), "abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc", true), "abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test translating strings which contain special chars and / or escaped special chars.
|
||||
assertEquals(MIStringHandler.translateCString("\t", true), "\\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\t", false), "\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\t", true), "\\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\t", false), "\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\t\\t", true), "\\t\\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\t\\t", false), "\t\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\t\t", true), "\\t\\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\t\t", false), "\t\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("'\"", true), "'\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("'\"", false), "'\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\'\\\"", true), "\\'\\\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\'\\\"", false), "'\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("'\\\"", true), "'\\\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("'\\\"", false), "'\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\'\"", true), "\\'\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\'\"", false), "'\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test translating strings which contain hexadecimal escape notations.
|
||||
assertEquals(MIStringHandler.translateCString("\\x0000", true), "\\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\x0000", false), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\x31\\x32\\x33www", true), "abc123www"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\x0031\\x0032\\x0033www", true), "abc123www"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test translating strings which contain octal escape notations.
|
||||
assertEquals(MIStringHandler.translateCString("\\000", true), "\\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\000", false), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\0", true), "\\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\0", false), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\222def", true), "abc\\222def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\222def", false), "abc\222def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\303def", true), "abc\303def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\303def", false), "abc\303def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\303\\244def", true), "abc\344def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\"def", true), "abc\"def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\"def", false), "abc\"def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc'def", true), "abc'def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc'def", false), "abc'def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\\"def", true), "abc\\\"def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\\"def", false), "abc\"def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\'def", true), "abc\\'def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\'def", false), "abc'def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test translating strings which contain short Unicode escape notations.
|
||||
assertEquals(MIStringHandler.translateCString("\\u0000", true), "\\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\u0000", false), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\u0031\\u0032\\u0033def", true), "abc123def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test translating strings which contain long Unicode escape notations.
|
||||
assertEquals(MIStringHandler.translateCString("\\U00000000", true), "\\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\U00000000", false), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\U00000031\\U00000032\\U00000033def", true), "abc123def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
public static junit.framework.Test suite() {
|
||||
return new JUnit4TestAdapter(MIStringHandlerTests.class);
|
||||
}
|
||||
}
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2012, 2014 Mathias Kunter and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Mathias Kunter - Initial Implementation (Bug 307311)
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.mi.service.command.output;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.text.ParseException;
|
||||
|
||||
import junit.framework.JUnit4TestAdapter;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class MIStringHandlerTests {
|
||||
@Test
|
||||
public void testTranscodeString() {
|
||||
// Test transcoding of an empty string.
|
||||
assertEquals(MIStringHandler.transcodeString(""), ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test transcoding of an ASCII string.
|
||||
assertEquals(MIStringHandler.transcodeString("ASCII"), "ASCII"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test transcoding of Latin-1 strings.
|
||||
assertEquals(MIStringHandler.transcodeString("\344"), "\344"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("abc\344"), "abc\344"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("\344abc"), "\344abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("abc\344def"), "abc\344def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("abc\ndef\344ghi\tjkl"), "abc\ndef\344ghi\tjkl"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test transcoding of UTF-8 strings.
|
||||
assertEquals(MIStringHandler.transcodeString("\303\244"), "\344"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("abc\303\244"), "abc\344"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("\303\244abc"), "\344abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("abc\303\244def"), "abc\344def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.transcodeString("abc\ndef\303\244ghi\tjkl"), "abc\ndef\344ghi\tjkl"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test transcoding of a string with unsupported encoding (here: UTF-16).
|
||||
assertEquals(MIStringHandler.transcodeString("\u3090"), "\u3090"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEscapeString() {
|
||||
// Test escaping of an empty string.
|
||||
assertEquals(MIStringHandler.escapeString(""), ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of a plain text string.
|
||||
assertEquals(MIStringHandler.escapeString("abc"), "abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of strings which contain special chars.
|
||||
assertEquals(MIStringHandler.escapeString("\n"), "\\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\n\b"), "\\n\\b"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\0\1\2\3\4\5\6\7\10\11\12\13\14\15\16\17"), "\\0\\001\\002\\003\\004\\005\\006\\a\\b\\t\\n\\v\\f\\r\\016\\017"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\33"), "\\e"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\\", true), "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\\", false), "\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("'\t\\", true), "\\'\\t\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("'\t\\", false), "'\\t\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of strings which contain non-printable characters up to 0x7F.
|
||||
assertEquals(MIStringHandler.escapeString("\0"), "\\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\177"), "\\177"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\177"), "abc\\177"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\177abc"), "\\177abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\177def"), "abc\\177def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of strings which contain non-printable characters up to 0xFF.
|
||||
assertEquals(MIStringHandler.escapeString("\230"), "\\230"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\230"), "abc\\230"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\230abc"), "\\230abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\230def"), "abc\\230def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of strings which contain non-printable characters up to 0xFFFF.
|
||||
assertEquals(MIStringHandler.escapeString("\ud800"), "\\ud800"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\ud800"), "abc\\ud800"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\ud800abc"), "\\ud800abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\ud800def"), "abc\\ud800def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of strings which contain non-printable characters up to 0x10FFFF.
|
||||
assertEquals(MIStringHandler.escapeString("\udbff\udfff"), "\\U0010ffff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\udbff\udfff"), "abc\\U0010ffff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("\udbff\udfffabc"), "\\U0010ffffabc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\udbff\udfffdef"), "abc\\U0010ffffdef"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of a string which contains all sorts of non-printable characters.
|
||||
assertEquals(MIStringHandler.escapeString("abc\n\tdef\\ghi\njkl\177\230\n\ud800\udbff\udfff?mno\"", true), "abc\\n\\tdef\\\\ghi\\njkl\\177\\230\\n\\ud800\\U0010ffff\\?mno\\\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.escapeString("abc\n\tdef\\ghi\njkl\177\230\n\ud800\udbff\udfff?mno\"", false), "abc\\n\\tdef\\ghi\\njkl\\177\\230\\n\\ud800\\U0010ffff?mno\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test escaping of an ill-formed UTF-16 Java string.
|
||||
assertEquals(MIStringHandler.escapeString("abc\udbff"), "abc\\udbff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsSpecialChar() {
|
||||
// Testing non-special chars.
|
||||
assertEquals(MIStringHandler.isSpecialChar('i'), false);
|
||||
assertEquals(MIStringHandler.isSpecialChar('w'), false);
|
||||
|
||||
// Testing special chars.
|
||||
assertEquals(MIStringHandler.isSpecialChar('a'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('b'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('e'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('E'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('f'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('n'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('r'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('t'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('v'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('\''), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('"'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('\\'), true);
|
||||
assertEquals(MIStringHandler.isSpecialChar('?'), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsSpecialCodePoint() {
|
||||
// Testing non-special Unicode code points.
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x69), false); // 'i' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x77), false); // 'w' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x61), false); // 'a' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x6E), false); // 'n' character
|
||||
|
||||
// Testing special Unicode code points.
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x07), true); // 'a' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x08), true); // 'b' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x1B), true); // 'e' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x1B), true); // 'E' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x0C), true); // 'f' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x0A), true); // 'n' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x0D), true); // 'r' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x09), true); // 't' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x0B), true); // 'v' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x27), true); // '\'' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x22), true); // '"' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x5C), true); // '\\' character
|
||||
assertEquals(MIStringHandler.isSpecialCodePoint(0x3F), true); // '?' character
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseSpecialChar() {
|
||||
// Testing non-special chars. This actually should throw ParseExceptions.
|
||||
try {
|
||||
MIStringHandler.parseSpecialChar('i');
|
||||
fail("No parsing exception thrown.");
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
|
||||
try {
|
||||
MIStringHandler.parseSpecialChar('w');
|
||||
fail("No parsing exception thrown.");
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
|
||||
try {
|
||||
// Testing special chars.
|
||||
assertEquals(MIStringHandler.parseSpecialChar('a'), 0x07);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('b'), 0x08);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('e'), 0x1B);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('E'), 0x1B);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('f'), 0x0C);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('n'), 0x0A);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('r'), 0x0D);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('t'), 0x09);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('v'), 0x0B);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('\''), 0x27);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('"'), 0x22);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('\\'), 0x5C);
|
||||
assertEquals(MIStringHandler.parseSpecialChar('?'), 0x3F);
|
||||
|
||||
} catch (ParseException e) {
|
||||
fail("Parsing exception thrown."); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseSpecialCodePoint() {
|
||||
try {
|
||||
// Testing non-special Unicode code points. This actually should throw ParseExceptions.
|
||||
try {
|
||||
MIStringHandler.parseSpecialCodePoint(0x69);
|
||||
fail("No parsing exception thrown.");
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
|
||||
try {
|
||||
MIStringHandler.parseSpecialCodePoint(0x77);
|
||||
fail("No parsing exception thrown.");
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
|
||||
// Testing special Unicode code points.
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x07), 'a');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x08), 'b');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x1B), 'e');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x0C), 'f');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x0A), 'n');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x0D), 'r');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x09), 't');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x0B), 'v');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x27), '\'');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x22), '"');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x5C), '\\');
|
||||
assertEquals(MIStringHandler.parseSpecialCodePoint(0x3F), '?');
|
||||
|
||||
} catch (ParseException e) {
|
||||
fail("Parsing exception thrown."); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseString() {
|
||||
// Test parsing of an empty string.
|
||||
assertEquals(MIStringHandler.parseString(""), ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString(""), ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of a plain text string.
|
||||
assertEquals(MIStringHandler.parseString("abc"), "abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain valid special char escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\n"), "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\\\"), "\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\'\\t\\\\"), "'\t\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain invalid special char escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\w"), "\\w"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\"), "\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\"), "abc\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\www"), "\\www"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\www"), "abc\\www"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\'\\z\\\\"), "'\\z\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\'\\z\\"), "'\\z\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain valid octal escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\141\\142\\143"), "abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\141\\142\\143\\0"), "abc\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\141\\142\\143\\12"), "abc\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\141\\\\142\\143\\\\"), "a\\142c\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\12"), "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\012"), "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("'\\011\\"), "'\t\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\177"), "\177"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\377"), "\377"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\3777"), "\3777"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\177"), "abc\177"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\177abc"), "\177abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\177def"), "abc\177def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\0"), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\1"), "\001"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\1a"), "\001a"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\18"), "\0018"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\01"), "\001"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\01a"), "\001a"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\001"), "\001"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\001a"), "\001a"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\0011"), "\0011"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\0011a"), "\0011a"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\1111"), "\1111"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain invalid octal escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\400"), "\\400"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\4000"), "\\4000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\8"), "\\8"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\90"), "\\90"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\ 0"), "\\ 0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\141\\142\\143\\"), "abc\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain valid hexadecimal escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\x0"), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\xa"), "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\xa0"), "\240"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\xag"), "\ng"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x0a"), "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x0a0"), "\240"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x0ag"), "\ng"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x00a"), "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x00a0"), "\240"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x00ag"), "\ng"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x000a"), "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x000a0"), "\n0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x000ag"), "\ng"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x0000a"), "\0a"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x0000a0"), "\0a0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x0000ag"), "\0ag"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\x20def"), "abc\u20def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\x20def\\xa"), "abc\u20def\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\x20ghi"), "abc ghi"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\x20ghi\\xa"), "abc ghi\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain invalid hexadecimal escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\x"), "\\x"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\x"), "abc\\x"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\xwww"), "\\xwww"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x\\"), "\\x\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x 0"), "\\x 0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\x\\0"), "\\x\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain valid short Unicode escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\u0000"), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u000f"), "\017"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u00ff"), "\377"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u0fff"), "\u0fff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\uffff"), "\uffff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain invalid short Unicode escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\u"), "\\u"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\u"), "abc\\u"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\uwww"), "\\uwww"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u\\"), "\\u\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u 0"), "\\u 0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u\\0"), "\\u\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u0"), "\\u0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u00"), "\\u00"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u000"), "\\u000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\u000g"), "\\u000g"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\ug"), "\\ug"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain valid long Unicode escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\U00000000"), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0000000f"), "\017"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U000000ff"), "\377"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U00000fff"), "\u0fff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0000ffff"), "\uffff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U000fffff"), "\udbbf\udfff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0010ffff"), "\udbff\udfff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test parsing of strings which contain invalid long Unicode escape notations.
|
||||
assertEquals(MIStringHandler.parseString("\\U"), "\\U"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("abc\\U"), "abc\\U"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\Uwww"), "\\Uwww"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U\\"), "\\U\\"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U 0"), "\\U 0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U\\0"), "\\U\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0"), "\\U0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U00"), "\\U00"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U000"), "\\U000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0000"), "\\U0000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U00000"), "\\U00000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U000000"), "\\U000000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0000000"), "\\U0000000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0000000g"), "\\U0000000g"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U00110000"), "\\U00110000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U00f00000"), "\\U00f00000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\U0f000000"), "\\U0f000000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\Uf0000000"), "\\Uf0000000"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\Uffffffff"), "\\Uffffffff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\Ufffffff"), "\\Ufffffff"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.parseString("\\Ug"), "\\Ug"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTranslateCString() {
|
||||
// Test translating an empty string.
|
||||
assertEquals(MIStringHandler.translateCString("", false), ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("", true), ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test translating a plain text string.
|
||||
assertEquals(MIStringHandler.translateCString("abc", false), "abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc", true), "abc"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test translating strings which contain special chars and / or escaped special chars.
|
||||
assertEquals(MIStringHandler.translateCString("\t", true), "\\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\t", false), "\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\t", true), "\\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\t", false), "\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\t\\t", true), "\\t\\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\t\\t", false), "\t\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\t\t", true), "\\t\\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\t\t", false), "\t\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("'\"", true), "'\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("'\"", false), "'\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\'\\\"", true), "\\'\\\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\'\\\"", false), "'\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("'\\\"", true), "'\\\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("'\\\"", false), "'\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\'\"", true), "\\'\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\'\"", false), "'\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test translating strings which contain hexadecimal escape notations.
|
||||
assertEquals(MIStringHandler.translateCString("\\x0000", true), "\\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\x0000", false), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\x31\\x32\\x33www", true), "abc123www"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\x0031\\x0032\\x0033www", true), "abc123www"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test translating strings which contain octal escape notations.
|
||||
assertEquals(MIStringHandler.translateCString("\\000", true), "\\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\000", false), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\0", true), "\\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\0", false), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\222def", true), "abc\\222def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\222def", false), "abc\222def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\303def", true), "abc\303def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\303def", false), "abc\303def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\303\\244def", true), "abc\344def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\"def", true), "abc\"def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\"def", false), "abc\"def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc'def", true), "abc'def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc'def", false), "abc'def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\\"def", true), "abc\\\"def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\\"def", false), "abc\"def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\'def", true), "abc\\'def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\'def", false), "abc'def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test translating strings which contain short Unicode escape notations.
|
||||
assertEquals(MIStringHandler.translateCString("\\u0000", true), "\\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\u0000", false), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\u0031\\u0032\\u0033def", true), "abc123def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// Test translating strings which contain long Unicode escape notations.
|
||||
assertEquals(MIStringHandler.translateCString("\\U00000000", true), "\\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("\\U00000000", false), "\0"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
assertEquals(MIStringHandler.translateCString("abc\\U00000031\\U00000032\\U00000033def", true), "abc123def"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
public static junit.framework.Test suite() {
|
||||
return new JUnit4TestAdapter(MIStringHandlerTests.class);
|
||||
}
|
||||
}
|
|
@ -1,3 +1,14 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2011, 2014 Freescale and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Freescale - Initial API and Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Moved from cdt.tests.dsf.gdb (Bug 437562)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.mi.service.command.output;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
|
@ -3,6 +3,7 @@ Bundle-ManifestVersion: 2
|
|||
Bundle-Name: GDB/MI reference application tests
|
||||
Bundle-SymbolicName: org.eclipse.cdt.tests.dsf.gdb;singleton:=true
|
||||
Bundle-Version: 2.2.0.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin
|
||||
Bundle-Vendor: Ericsson
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
org.eclipse.cdt.dsf,
|
||||
|
@ -13,9 +14,25 @@ Require-Bundle: org.eclipse.core.runtime,
|
|||
org.eclipse.swt,
|
||||
org.eclipse.cdt.launch;bundle-version="6.1.0",
|
||||
org.eclipse.cdt.visualizer.ui,
|
||||
org.eclipse.cdt.gdb;bundle-version="7.0.0"
|
||||
org.eclipse.cdt.gdb;bundle-version="7.0.0",
|
||||
org.eclipse.cdt.dsf.gdb,
|
||||
org.eclipse.core.variables
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Bundle-ClassPath: .
|
||||
Fragment-Host: org.eclipse.cdt.dsf.gdb
|
||||
|
||||
Export-Package: org.eclipse.cdt.dsf.mi.service;x-internal:=true,
|
||||
org.eclipse.cdt.tests.dsf.gdb.framework;x-internal:=true,
|
||||
org.eclipse.cdt.tests.dsf.gdb.launching;x-internal:=true,
|
||||
org.eclipse.cdt.tests.dsf.gdb.tests;x-internal:=true,
|
||||
org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_6;x-internal:=true,
|
||||
org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_7;x-internal:=true,
|
||||
org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_8;x-internal:=true,
|
||||
org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_0;x-internal:=true,
|
||||
org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_1;x-internal:=true,
|
||||
org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_2;x-internal:=true,
|
||||
org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_3;x-internal:=true,
|
||||
org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_4;x-internal:=true,
|
||||
org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_5;x-internal:=true,
|
||||
org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_6;x-internal:=true,
|
||||
org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_7;x-internal:=true,
|
||||
org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_8;x-internal:=true
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
###############################################################################
|
||||
# Copyright (c) 2009 Wind River Systems and others.
|
||||
# Copyright (c) 2009, 2014 Wind River Systems and others.
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are made available under the terms of the Eclipse Public License v1.0
|
||||
# which accompanies this distribution, and is available at
|
||||
|
@ -8,8 +8,9 @@
|
|||
# Contributors:
|
||||
# Wind River Systems - initial API and implementation
|
||||
# IBM Corporation
|
||||
# Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
###############################################################################
|
||||
bin.includes = fragment.xml,\
|
||||
bin.includes = plugin.xml,\
|
||||
META-INF/,\
|
||||
.,\
|
||||
data/,\
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.0"?>
|
||||
<fragment>
|
||||
<?eclipse version="3.2"?>
|
||||
<plugin>
|
||||
<extension point="org.eclipse.debug.core.launchConfigurationTypes">
|
||||
<launchConfigurationType
|
||||
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
|
||||
|
@ -12,5 +12,4 @@
|
|||
modes="debug">
|
||||
</launchConfigurationType>
|
||||
</extension>
|
||||
|
||||
</fragment>
|
||||
</plugin>
|
|
@ -1,42 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008, 2012 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Marc Dumais (Ericsson) - Initial API and implementation (Bug 396268)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.mi.service.command.commands;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIStringHandlerTests;
|
||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIThreadTests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.OnceOnlySuite;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.LaunchUtilsTest;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ProcStatParserTest;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Suite;
|
||||
|
||||
/**
|
||||
* This suite executes all test classes that don't involve a debug session. As
|
||||
* such, these tests need to run just once, and not once for each GDB version we
|
||||
* support, not to mention remote vs local. We avoid lots of redundant runs by
|
||||
* running these tests with our special runner (OnceOnlySuite)
|
||||
*/
|
||||
@RunWith(OnceOnlySuite.class)
|
||||
@Suite.SuiteClasses({
|
||||
TestMIBreakInsertCommand.class,
|
||||
TestMICommandConstructCommand.class,
|
||||
MIThreadTests.class,
|
||||
LaunchUtilsTest.class,
|
||||
MIStringHandlerTests.class,
|
||||
ProcStatParserTest.class
|
||||
/* Add your test class here */
|
||||
})
|
||||
public class Suite_Sessionless_Tests {
|
||||
// This class is meant to be empty. It enables us to define the annotations
|
||||
// which list all the different JUnit class we want to run. When creating a
|
||||
// new test class, it should be added to the list above.
|
||||
}
|
|
@ -1,16 +1,17 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2009 Ericsson and others.
|
||||
* Copyright (c) 2007, 2014 Ericsson AB and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Ericsson - Initial Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.framework;
|
||||
|
||||
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.QualifiedName;
|
||||
|
@ -31,7 +32,7 @@ public class BackgroundRunner extends BlockJUnit4ClassRunner {
|
|||
super(klass);
|
||||
}
|
||||
|
||||
final static QualifiedName BACKGROUND_TEST_EXECUTION_FINISHED = new QualifiedName(GdbPlugin.getDefault().getBundle().getSymbolicName(), "background_test_execution_finished"); //$NON-NLS-1$
|
||||
final static QualifiedName BACKGROUND_TEST_EXECUTION_FINISHED = new QualifiedName(TestsPlugin.getDefault().getBundle().getSymbolicName(), "background_test_execution_finished"); //$NON-NLS-1$
|
||||
|
||||
void invokeSuperRunImpl(RunNotifier notifier) {
|
||||
super.run(notifier);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2013 Ericsson and others.
|
||||
* Copyright (c) 2007, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,9 +7,13 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Ericsson AB - Initial implementation of Test cases
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.framework;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -19,10 +23,6 @@ import java.util.Map;
|
|||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.eclipse.cdt.dsf.concurrent.CountingRequestMonitor;
|
||||
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.cdt.dsf.concurrent.ImmediateDataRequestMonitor;
|
||||
|
@ -47,7 +47,6 @@ import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMContext;
|
|||
import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMData;
|
||||
import org.eclipse.cdt.dsf.debug.service.IStack.IVariableDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.IStack.IVariableDMData;
|
||||
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
||||
import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch;
|
||||
import org.eclipse.cdt.dsf.gdb.service.IGDBProcesses;
|
||||
import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl;
|
||||
|
@ -572,12 +571,12 @@ public class SyncUtil {
|
|||
try {
|
||||
value = Integer.valueOf(value);
|
||||
if (value < 0) {
|
||||
TestsPlugin.log(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "\"" + propname + "\" property incorrectly specified. Should be an integer value or not specified at all.")); //$NON-NLS-1$
|
||||
TestsPlugin.log(new Status(IStatus.ERROR, TestsPlugin.getUniqueIdentifier(), "\"" + propname + "\" property incorrectly specified. Should be an integer value or not specified at all.")); //$NON-NLS-1$
|
||||
value = -1;
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException exc) {
|
||||
TestsPlugin.log(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "\"" + propname + "\" property incorrectly specified. Should be an integer value or not specified at all.")); //$NON-NLS-1$
|
||||
TestsPlugin.log(new Status(IStatus.ERROR, TestsPlugin.getUniqueIdentifier(), "\"" + propname + "\" property incorrectly specified. Should be an integer value or not specified at all.")); //$NON-NLS-1$
|
||||
value = -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2010 Wind River Systems and others.
|
||||
* Copyright (c) 2007, 2014 Wind River Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,30 +7,31 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.launching;
|
||||
|
||||
import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Plugin;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
/**
|
||||
* This is no longer an activator class since this is no longer a plug-in. It's
|
||||
* a fragment.
|
||||
*/
|
||||
public class TestsPlugin {
|
||||
private ResourceBundle resourceBundle;
|
||||
|
||||
/**
|
||||
* We're no longer a plug-in, but a fragment. Make this field an alias
|
||||
* to our host plugin's ID.
|
||||
*/
|
||||
public static final String PLUGIN_ID = GdbPlugin.PLUGIN_ID;
|
||||
/**
|
||||
* The main plugin class
|
||||
*/
|
||||
public class TestsPlugin extends Plugin {
|
||||
//The shared instance.
|
||||
private static TestsPlugin plugin;
|
||||
//Resource bundle.
|
||||
private ResourceBundle resourceBundle;
|
||||
private static BundleContext bundleContext;
|
||||
|
||||
public static final String PLUGIN_ID = "org.eclipse.cdt.tests.dsf.gdb"; //$NON-NLS-1$
|
||||
|
||||
/** Base tracing option for this plugin */
|
||||
public static final boolean DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.cdt.tests.dsf.gdb/debug")); //$NON-NLS-1$//$NON-NLS-2$
|
||||
|
@ -40,6 +41,7 @@ public class TestsPlugin {
|
|||
*/
|
||||
public TestsPlugin() {
|
||||
super();
|
||||
plugin = this;
|
||||
try {
|
||||
resourceBundle = ResourceBundle.getBundle("org.eclipse.cdt.tests.dsf.gdb.TestsPluginResources"); //$NON-NLS-1$
|
||||
}
|
||||
|
@ -48,29 +50,56 @@ public class TestsPlugin {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this fragment's resource bundle,
|
||||
*/
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
bundleContext = context;
|
||||
}
|
||||
/**
|
||||
* This method is called when the plug-in is stopped
|
||||
*/
|
||||
@Override
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
super.stop(context);
|
||||
}
|
||||
/**
|
||||
* Returns the shared instance.
|
||||
*/
|
||||
public static TestsPlugin getDefault() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the plugin's resource bundle,
|
||||
*/
|
||||
public ResourceBundle getResourceBundle() {
|
||||
return resourceBundle;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the host plug-in's bundle context,
|
||||
* Returns the plugin's bundle context,
|
||||
*/
|
||||
public static BundleContext getBundleContext() {
|
||||
return GdbPlugin.getBundleContext();
|
||||
}
|
||||
return bundleContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs the specified status with this host plug-in's log.
|
||||
* Logs the specified status with this plug-in's log.
|
||||
*
|
||||
* @param status
|
||||
* status to log
|
||||
*/
|
||||
public static void log(IStatus status) {
|
||||
GdbPlugin.getDefault().getLog().log(status);
|
||||
getDefault().getLog().log(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method which returns the unique identifier of this plugin.
|
||||
*/
|
||||
public static String getUniqueIdentifier() {
|
||||
return getDefault().getBundle().getSymbolicName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs an internal error with the specified throwable
|
||||
*
|
||||
|
@ -78,9 +107,10 @@ public class TestsPlugin {
|
|||
* the exception to be logged
|
||||
*/
|
||||
public static void log( Throwable e ) {
|
||||
log(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "Internal Error", e)); //$NON-NLS-1$
|
||||
log(new Status(IStatus.ERROR, getUniqueIdentifier(), "Internal Error", e)); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tests should use this utility when specifying a timeout value for a wait
|
||||
* operation. This method checks for the existence of the property
|
||||
|
@ -105,7 +135,7 @@ public class TestsPlugin {
|
|||
return (int)(timeoutMs * multiplier);
|
||||
}
|
||||
catch (NumberFormatException exc) {
|
||||
log(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "\"dsf.gdb.tests.timeout.multiplier\" property incorrectly specified. Should be a float value (e.g., \"1.5\") or not specified at all.")); //$NON-NLS-1$
|
||||
log(new Status(IStatus.ERROR, getUniqueIdentifier(), "\"dsf.gdb.tests.timeout.multiplier\" property incorrectly specified. Should be a float value (e.g., \"1.5\") or not specified at all.")); //$NON-NLS-1$
|
||||
return timeoutMs;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009, 2010 Ericsson and others.
|
||||
* Copyright (c) 2009, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_6;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -42,7 +42,6 @@ import org.junit.runners.Suite;
|
|||
LaunchConfigurationAndRestartTest_6_6.class,
|
||||
OperationsWhileTargetIsRunningTest_6_6.class,
|
||||
PostMortemCoreTest_6_6.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
CommandTimeoutTest_6_6.class,
|
||||
StepIntoSelectionTest_6_6.class,
|
||||
/* Add your test class here */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009, 2010 Ericsson and others.
|
||||
* Copyright (c) 2009, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_6;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
|
@ -42,7 +42,6 @@ import org.junit.runners.Suite;
|
|||
GDBProcessesTest_6_6.class,
|
||||
OperationsWhileTargetIsRunningTest_6_6.class,
|
||||
CommandTimeoutTest_6_6.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
StepIntoSelectionTest_6_6.class,
|
||||
/* Add your test class here */
|
||||
})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009, 2010 Ericsson and others.
|
||||
* Copyright (c) 2009, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_7;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -43,7 +43,6 @@ import org.junit.runners.Suite;
|
|||
OperationsWhileTargetIsRunningTest_6_7.class,
|
||||
PostMortemCoreTest_6_7.class,
|
||||
CommandTimeoutTest_6_7.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
StepIntoSelectionTest_6_7.class,
|
||||
/* Add your test class here */
|
||||
})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009, 2010 Ericsson and others.
|
||||
* Copyright (c) 2009, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_7;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
|
@ -42,7 +42,6 @@ import org.junit.runners.Suite;
|
|||
GDBProcessesTest_6_7.class,
|
||||
OperationsWhileTargetIsRunningTest_6_7.class,
|
||||
CommandTimeoutTest_6_7.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
StepIntoSelectionTest_6_7.class,
|
||||
/* Add your test class here */
|
||||
})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009, 2010 Ericsson and others.
|
||||
* Copyright (c) 2009, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_8;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -43,7 +43,6 @@ import org.junit.runners.Suite;
|
|||
OperationsWhileTargetIsRunningTest_6_8.class,
|
||||
PostMortemCoreTest_6_8.class,
|
||||
CommandTimeoutTest_6_8.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
StepIntoSelectionTest_6_8.class,
|
||||
/* Add your test class here */
|
||||
})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009, 2010 Ericsson and others.
|
||||
* Copyright (c) 2009, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_8;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
|
@ -42,7 +42,6 @@ import org.junit.runners.Suite;
|
|||
GDBProcessesTest_6_8.class,
|
||||
OperationsWhileTargetIsRunningTest_6_8.class,
|
||||
CommandTimeoutTest_6_8.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
StepIntoSelectionTest_6_8.class,
|
||||
/* Add your test class here */
|
||||
})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009, 2013 Ericsson and others.
|
||||
* Copyright (c) 2009, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_0;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
PostMortemCoreTest_7_0.class,
|
||||
CommandTimeoutTest_7_0.class,
|
||||
GDBMultiNonStopRunControlTest_7_0.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
StepIntoSelectionTest_7_0.class,
|
||||
StepIntoSelectionNonStopTest_7_0.class,
|
||||
/* Add your test class here */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009, 2010 Ericsson and others.
|
||||
* Copyright (c) 2009, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_0;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
OperationsWhileTargetIsRunningNonStopTest_7_0.class,
|
||||
CommandTimeoutTest_7_0.class,
|
||||
GDBMultiNonStopRunControlTest_7_0.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
StepIntoSelectionTest_7_0.class,
|
||||
StepIntoSelectionNonStopTest_7_0.class,
|
||||
/* Add your test class here */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010 Ericsson and others.
|
||||
* Copyright (c) 2010, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_1;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
PostMortemCoreTest_7_1.class,
|
||||
CommandTimeoutTest_7_1.class,
|
||||
GDBMultiNonStopRunControlTest_7_1.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
StepIntoSelectionTest_7_1.class,
|
||||
StepIntoSelectionNonStopTest_7_1.class,
|
||||
/* Add your test class here */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010 Ericsson and others.
|
||||
* Copyright (c) 2010, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_1;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
OperationsWhileTargetIsRunningNonStopTest_7_1.class,
|
||||
CommandTimeoutTest_7_1.class,
|
||||
GDBMultiNonStopRunControlTest_7_1.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
StepIntoSelectionTest_7_1.class,
|
||||
StepIntoSelectionNonStopTest_7_1.class,
|
||||
/* Add your test class here */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010 Ericsson and others.
|
||||
* Copyright (c) 2010, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_2;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
PostMortemCoreTest_7_2.class,
|
||||
CommandTimeoutTest_7_2.class,
|
||||
GDBMultiNonStopRunControlTest_7_2.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
StepIntoSelectionTest_7_2.class,
|
||||
StepIntoSelectionNonStopTest_7_2.class,
|
||||
/* Add your test class here */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2010 Ericsson and others.
|
||||
* Copyright (c) 2010, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_2;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
OperationsWhileTargetIsRunningNonStopTest_7_2.class,
|
||||
CommandTimeoutTest_7_2.class,
|
||||
GDBMultiNonStopRunControlTest_7_2.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
StepIntoSelectionTest_7_2.class,
|
||||
StepIntoSelectionNonStopTest_7_2.class,
|
||||
/* Add your test class here */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2011 Ericsson and others.
|
||||
* Copyright (c) 2011, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_3;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
PostMortemCoreTest_7_3.class,
|
||||
CommandTimeoutTest_7_3.class,
|
||||
GDBMultiNonStopRunControlTest_7_3.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
StepIntoSelectionTest_7_3.class,
|
||||
StepIntoSelectionNonStopTest_7_3.class,
|
||||
/* Add your test class here */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2011 Ericsson and others.
|
||||
* Copyright (c) 2011, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Ericsson - Initial Implementation
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_3;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
OperationsWhileTargetIsRunningNonStopTest_7_3.class,
|
||||
CommandTimeoutTest_7_3.class,
|
||||
GDBMultiNonStopRunControlTest_7_3.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
StepIntoSelectionTest_7_3.class,
|
||||
StepIntoSelectionNonStopTest_7_3.class,
|
||||
/* Add your test class here */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012 Ericsson and others.
|
||||
* Copyright (c) 2012, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_4;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
PostMortemCoreTest_7_4.class,
|
||||
CommandTimeoutTest_7_4.class,
|
||||
GDBMultiNonStopRunControlTest_7_4.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
GDBConsoleBreakpointsTest_7_4.class,
|
||||
StepIntoSelectionTest_7_4.class,
|
||||
StepIntoSelectionNonStopTest_7_4.class,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012 Ericsson and others.
|
||||
* Copyright (c) 2012, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_4;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
OperationsWhileTargetIsRunningNonStopTest_7_4.class,
|
||||
CommandTimeoutTest_7_4.class,
|
||||
GDBMultiNonStopRunControlTest_7_4.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
GDBConsoleBreakpointsTest_7_4.class,
|
||||
TraceFileTest_7_4.class,
|
||||
StepIntoSelectionTest_7_4.class,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012 Ericsson and others.
|
||||
* Copyright (c) 2012, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_5;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
OperationsWhileTargetIsRunningNonStopTest_7_5.class,
|
||||
PostMortemCoreTest_7_5.class,
|
||||
CommandTimeoutTest_7_5.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
GDBConsoleBreakpointsTest_7_5.class,
|
||||
StepIntoSelectionTest_7_5.class,
|
||||
StepIntoSelectionNonStopTest_7_5.class,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012 Ericsson and others.
|
||||
* Copyright (c) 2012, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_5;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
OperationsWhileTargetIsRunningNonStopTest_7_5.class,
|
||||
CommandTimeoutTest_7_5.class,
|
||||
GDBMultiNonStopRunControlTest_7_5.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
GDBConsoleBreakpointsTest_7_5.class,
|
||||
TraceFileTest_7_5.class,
|
||||
StepIntoSelectionTest_7_5.class,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012 Ericsson and others.
|
||||
* Copyright (c) 2012, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_6;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
PostMortemCoreTest_7_6.class,
|
||||
CommandTimeoutTest_7_6.class,
|
||||
GDBMultiNonStopRunControlTest_7_6.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
GDBConsoleBreakpointsTest_7_6.class,
|
||||
GDBConsoleSynchronizingTest_7_6.class,
|
||||
StepIntoSelectionTest_7_6.class,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012 Ericsson and others.
|
||||
* Copyright (c) 2012, 2014 Ericsson and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_6;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
OperationsWhileTargetIsRunningTest_7_6.class,
|
||||
OperationsWhileTargetIsRunningNonStopTest_7_6.class,
|
||||
CommandTimeoutTest_7_6.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
GDBConsoleBreakpointsTest_7_6.class,
|
||||
TraceFileTest_7_6.class,
|
||||
GDBConsoleSynchronizingTest_7_6.class,
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_7;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
PostMortemCoreTest_7_7.class,
|
||||
CommandTimeoutTest_7_7.class,
|
||||
GDBMultiNonStopRunControlTest_7_7.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
GDBConsoleBreakpointsTest_7_7.class,
|
||||
GDBConsoleSynchronizingTest_7_7.class,
|
||||
StepIntoSelectionTest_7_7.class,
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_7;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
OperationsWhileTargetIsRunningTest_7_7.class,
|
||||
OperationsWhileTargetIsRunningNonStopTest_7_7.class,
|
||||
CommandTimeoutTest_7_7.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
GDBConsoleBreakpointsTest_7_7.class,
|
||||
TraceFileTest_7_7.class,
|
||||
GDBConsoleSynchronizingTest_7_7.class,
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_8;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
PostMortemCoreTest_7_8.class,
|
||||
CommandTimeoutTest_7_8.class,
|
||||
GDBMultiNonStopRunControlTest_7_8.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
GDBConsoleBreakpointsTest_7_8.class,
|
||||
GDBConsoleSynchronizingTest_7_8.class,
|
||||
StepIntoSelectionTest_7_8.class,
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
|
||||
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_8;
|
||||
|
||||
import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
|
||||
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
|
||||
|
@ -46,7 +46,6 @@ import org.junit.runners.Suite;
|
|||
OperationsWhileTargetIsRunningTest_7_8.class,
|
||||
OperationsWhileTargetIsRunningNonStopTest_7_8.class,
|
||||
CommandTimeoutTest_7_8.class,
|
||||
Suite_Sessionless_Tests.class,
|
||||
GDBConsoleBreakpointsTest_7_8.class,
|
||||
TraceFileTest_7_8.class,
|
||||
GDBConsoleSynchronizingTest_7_8.class,
|
||||
|
|
1
pom.xml
1
pom.xml
|
@ -172,6 +172,7 @@
|
|||
<module>build/org.eclipse.cdt.managedbuilder.ui.tests</module>
|
||||
<module>build/org.eclipse.cdt.make.core.tests</module>
|
||||
<module>build/org.eclipse.cdt.make.ui.tests</module>
|
||||
<module>dsf-gdb/org.eclipse.cdt.dsf.gdb.tests</module>
|
||||
<module>dsf-gdb/org.eclipse.cdt.tests.dsf.gdb</module>
|
||||
|
||||
<module>build/org.eclipse.cdt.autotools.core</module>
|
||||
|
|
Loading…
Reference in a new issue