--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/build.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,251 @@
+
+<project name="com.nokia.testfw" default="build.all">
+
+ <!-- declare ant4eclipse -->
+ <taskdef resource="net/sf/ant4eclipse/antlib.xml" />
+
+ <property environment="env"/>
+
+
+ <!-- Name definitions -->
+ <property name="feature.name" value="ITE"/>
+ <property name="project.name" value="com.nokia.testfw" />
+ <property name="jar.filename" value="${ant.project.name}.jar"/>
+
+ <!-- Folder definitions -->
+ <property name="workspace.path" value="src/" />
+ <property name="testworkspace.path" value="test/" />
+ <property name="java.location" value="${env.JAVA_HOME}" />
+ <property name="destination.path" value="./build" />
+
+ <!--property name="carbide.folder" value="C:\Apps\carbide_internal" / -->
+ <property name="carbide.folder" value="${env.ECLIPSE_HOME}" />
+ <property name="carbide.int.folder" location="${carbide.folder}/plugins"/>
+ <!-- property name="carbide.dev.folder" location="c:/Carbide_development/plugins"/ -->
+
+ <property name="core.test.folder" location="test/com.nokia.testfw.core.test"/>
+ <property name="resultview.test.folder" location="test/com.nokia.testfw.resultview.test"/>
+ <property name="reports.folder" location="./build/reports"/>
+ <property name="binaries.folder" location="${destination.path}/${feature.name}.binaries"/>
+
+
+ <delete dir="${reports.folder}"/>
+ <mkdir dir="${reports.folder}"/>
+
+ <!-- Carbide_classpath -->
+ <path id="carbide_classpath">
+ <fileset dir="${carbide.int.folder}" includes="**/*.jar" />
+ </path>
+
+ <path id="dest_classpath">
+ <fileset dir="${destination.path}" includes="**/*.jar" />
+ </path>
+ <path id="ant_classpath">
+ <fileset dir="C:\Apps\ant\lib" includes="**/*.jar" />
+ </path>
+
+ <!-- Delete old plugins and features -->
+ <target name="delete">
+ <delete dir="${destination.path}/eclipse" failonerror="false"/>
+ <delete dir="${destination.path}/plugins" failonerror="false"/>
+ <delete dir="${destination.path}/features" failonerror="false"/>
+ <delete dir="src/${ant.project.name}.core/bin" failonerror="false"/>
+ <ant antfile="src/com.nokia.testfw.codegen/build.xml" target="clean" inheritAll="false"/>
+ </target>
+
+ <!--codegen, cmdtool, testrunner, core, codegen.ui, resultview, launch -->
+
+ <!-- build the codegen lib jar -->
+ <target name="buildcodegen">
+ <ant antfile="src/com.nokia.testfw.codegen/build.xml" inheritAll="false"/>
+ </target>
+
+ <!-- Target Plugin -->
+ <target name="build.plugins" depends="buildcodegen">
+
+
+ <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.core" destDir="${destination.path}" packageAsJar="true">
+ <javacLibraryCompiler>
+ <compilerSettings debug="true" fork="true"/>
+ </javacLibraryCompiler>
+ </buildPlugin>
+
+ <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.resultview" destDir="${destination.path}" packageAsJar="true">
+ <javacLibraryCompiler>
+ <compilerSettings debug="true" fork="true"/>
+ </javacLibraryCompiler>
+ </buildPlugin>
+
+ <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.launch" destDir="${destination.path}" packageAsJar="true">
+ <javacLibraryCompiler>
+ <compilerSettings debug="true" fork="true"/>
+ </javacLibraryCompiler>
+ </buildPlugin>
+
+ <copy todir="${workspace.path}/${ant.project.name}.codegen.ui/lib" failonerror="true" overwrite="true">
+ <fileset dir="${workspace.path}/${ant.project.name}.codegen/jar"/>
+ </copy>
+
+ <copy todir="${workspace.path}/${ant.project.name}.codegen.ui/bin" failonerror="true" overwrite="false">
+ <fileset dir="${workspace.path}/${ant.project.name}.codegen.ui/src/" excludes="**/*.java, **/package.htm*" />
+ </copy>
+
+ <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.codegen.ui" destDir="${destination.path}" packageAsJar="true">
+ <javacLibraryCompiler>
+ <compilerSettings debug="true" fork="true"/>
+ </javacLibraryCompiler>
+ </buildPlugin>
+ <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.stf.help" destDir="${destination.path}" packageAsJar="true">
+ <javacLibraryCompiler>
+ <compilerSettings debug="true" fork="true"/>
+ </javacLibraryCompiler>
+ </buildPlugin>
+ <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.sut.help" destDir="${destination.path}" packageAsJar="true">
+ <javacLibraryCompiler>
+ <compilerSettings debug="true" fork="true"/>
+ </javacLibraryCompiler>
+ </buildPlugin>
+
+ <copy todir="${workspace.path}/${ant.project.name}.stf.configeditor/bin" failonerror="true" overwrite="false">
+ <fileset dir="${workspace.path}/${ant.project.name}.stf.configeditor/src/" excludes="**/*.java, **/package.htm*" />
+ </copy>
+
+ <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.stf.configeditor" destDir="${destination.path}" packageAsJar="true">
+ <javacLibraryCompiler>
+ <compilerSettings debug="true" fork="true"/>
+ </javacLibraryCompiler>
+ </buildPlugin>
+
+
+ <copy todir="${workspace.path}/${ant.project.name}.stf.scripteditor/bin" failonerror="true" overwrite="false">
+ <fileset dir="${workspace.path}/${ant.project.name}.stf.scripteditor/src/" excludes="**/*.java, **/package.htm*" />
+ </copy>
+
+ <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.stf.scripteditor" destDir="${destination.path}" packageAsJar="true">
+ <javacLibraryCompiler>
+ <compilerSettings debug="true" fork="true"/>
+ </javacLibraryCompiler>
+ </buildPlugin>
+
+ <copy todir="${carbide.folder}" failonerror="true" overwrite="true">
+ <fileset dir="${destination.path}"/>
+ </copy>
+ <!-- build test plugin -->
+ <buildPlugin workspace="${testworkspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.test" destDir="${destination.path}" packageAsJar="true">
+ <javacLibraryCompiler>
+ <compilerSettings debug="true" fork="true"/>
+ </javacLibraryCompiler>
+ </buildPlugin>
+
+ <buildPlugin workspace="${testworkspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.resultview.test" destDir="${destination.path}" packageAsJar="true">
+ <javacLibraryCompiler>
+ <compilerSettings debug="true" fork="true"/>
+ </javacLibraryCompiler>
+ </buildPlugin>
+
+ <!--buildPlugin workspace="${testworkspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.codegen.ui.test" destDir="${destination.path}" packageAsJar="true">
+ <javacLibraryCompiler>
+ <compilerSettings debug="true" fork="true"/>
+ </javacLibraryCompiler>
+ </buildPlugin -->
+
+ <!-- Build feature -->
+ <buildFeature workspace="${workspace.path}"
+ targetPlatformLocation="${carbide.folder}"
+ projectname="${ant.project.name}.common"
+ buildPluginTarget="build.plugin"
+ destDir="${destination.path}" />
+
+ <copy todir="${carbide.folder}" failonerror="true" overwrite="true">
+ <fileset dir="${destination.path}"/>
+ </copy>
+
+ </target>
+
+ <!-- Empty target to do nothing -->
+ <target name="build.plugin">
+ </target>
+
+ <target name="create.zip">
+
+ <delete dir="${binaries.folder}/nightly_builds"/>
+ <mkdir dir="${binaries.folder}/nightly_builds"/>
+
+
+ <delete dir="${destiation.path}/eclipse" />
+ <mkdir dir="${destiation.path}/eclipse" />
+ <copydir dest="${destination.path}/eclipse/plugins"
+ src="${destination.path}/plugins"
+ excludes="com.nokia.testfw.test*/** com.nokia.testfw.resultview.test*/**"
+ />
+ <copydir dest="${destination.path}/eclipse/features"
+ src="${destination.path}/features" />
+
+ <tstamp>
+ <format property="timestamp" pattern="dd-MM-yyyy" />
+ </tstamp>
+
+ <zip destfile="${binaries.folder}/nightly_builds/${feature.name}-${timestamp}.zip"
+ basedir="${destination.path}"
+ includes="eclipse/**/*"/>
+
+
+ </target>
+
+ <!-- Test target, depends on instrumentation and analyze -->
+ <target name="test" description="Run unit tests">
+ <!-- Test classpath -->
+ <path id="test_classpath">
+ <pathelement location="${core.test.folder}/src"/>
+ <pathelement location="${resultview.test.folder}/src"/>
+
+ <path refid="dest_classpath" />
+ <path refid="carbide_classpath" />
+ <path refid="ant_classpath" />
+ </path>
+
+ <path id="junit_classpath">
+ <pathelement location="${core.test.folder}/src"/>
+ <pathelement location="${resultview.test.folder}/src"/>
+ <path refid="dest_classpath" />
+ <path refid="ant_classpath" />
+ </path>
+
+
+ <!-- Compile the tests -->
+ <javac srcdir="${core.test.folder}" verbose="false">
+ <classpath refid="junit_classpath"/>
+ </javac>
+
+ <!-- Run JUnit -->
+ <junit printsummary="yes" fork="yes" haltonfailure="no">
+ <classpath refid="junit_classpath" />
+ <formatter type="plain" />
+ <formatter type="xml" />
+ <!-- Test classes -->
+ <test name="com.nokia.testfw.core.AllPureJUnitTests" todir="${reports.folder}"/>
+ </junit>
+
+ <!-- Run JUnit Plugin tests -->
+ <!-- reference to instruction at http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.test/testframework.html?view=co -->
+ <!--java -jar C:\Apps\carbide_internal\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar -application org.eclipse.test.uitestapplication -os win32 -ws win32 -arch x86 -dev bin -testpluginname com.nokia.testfw.resultview.test -->
+ <!--java jar="${carbide.folde}\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar -application org.eclipse.test.uitestapplication -os win32 -ws win32 -arch x86 -dev bin -testpluginname com.nokia.testfw.resultview.test>
+ </java -->
+
+ <!-- generate test report -->
+ <junitreport todir="${reports.folder}">
+ <fileset dir="${reports.folder}">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="${reports.folder}/html"/>
+ </junitreport>
+
+
+ </target>
+
+
+
+ <!-- Target Build all -->
+ <target name="build.all" depends="delete, build.plugins, test, create.zip" />
+
+</project>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,11 @@
+<?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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.1.jar" sourcepath="com.nokia.testfw.codegen.uisrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-lang-2.4.jar" sourcepath="com.nokia.testfw.codegen.uisrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/velocity-1.6.2.jar" sourcepath="com.nokia.testfw.codegen.uisrc.zip"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/com.nokia.testfw.codegen"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.codegen.ui</name>
+ <comment></comment>
+ <projects>
+ <project>com.nokia.testfw.codegen</project>
+ </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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/.settings/org.eclipse.jdt.core.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,7 @@
+#Fri Nov 27 16:47:07 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/.settings/org.eclipse.ltk.core.refactoring.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+#Fri Sep 25 15:31:05 CST 2009
+eclipse.preferences.version=1
+org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/META-INF/MANIFEST.MF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,33 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: TESTFW Codegen UI Plug-in
+Bundle-SymbolicName: com.nokia.testfw.codegen.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: com.nokia.testfw.codegen.ui.CodegenUIPlugin
+Bundle-Vendor: Nokia
+Require-Bundle: org.eclipse.cdt.core,
+ org.eclipse.cdt.ui,
+ org.eclipse.compare,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.jface,
+ org.eclipse.jface.text,
+ org.eclipse.ui,
+ org.eclipse.ui.editors,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.workbench.texteditor,
+ com.nokia.carbide.cdt.builder,
+ com.nokia.carbide.cpp.project.ui,
+ com.nokia.carbide.cpp.epoc.engine,
+ com.nokia.carbide.cpp.sdk.core,
+ com.nokia.carbide.cpp.project.core,
+ com.nokia.carbide.cpp.sdk.ui,
+ org.eclipse.core.expressions
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .,
+ lib/commons-collections-3.2.1.jar,
+ lib/commons-lang-2.4.jar,
+ lib/tfw_codegen.jar,
+ lib/velocity-1.6.2.jar
+Import-Package: com.nokia.carbide.internal.api.templatewizard.ui
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/build.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,13 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ lib/tfw_codegen.jar,\
+ lib/commons-collections-3.2.1.jar,\
+ lib/commons-lang-2.4.jar,\
+ lib/velocity-1.6.2.jar,\
+ plugin.xml,\
+ plugin.properties,\
+ icons/
+javacSource=1.5
+javacTarget=1.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/copy_jar.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="com.nokia.testfw.codegen.ui" default="copy" basedir=".">
+
+ <property name="codegen.path" value="..\com.nokia.testfw.codegen" />
+
+ <target name="copy">
+ <ant antfile="build.xml" dir="${codegen.path}" />
+ <copy todir="lib">
+ <fileset dir="${codegen.path}/jar">
+ <exclude name="**/.svn" />
+ </fileset>
+ </copy>
+ </target>
+</project>
Binary file testdev/ite/src/com.nokia.testfw.codegen.ui/icons/class.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.codegen.ui/icons/folder.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.codegen.ui/icons/icon_symbian.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.codegen.ui/icons/method.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.codegen.ui/icons/project.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.codegen.ui/icons/template.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.codegen.ui/lib/commons-collections-3.2.1.jar has changed
Binary file testdev/ite/src/com.nokia.testfw.codegen.ui/lib/commons-lang-2.4.jar has changed
Binary file testdev/ite/src/com.nokia.testfw.codegen.ui/lib/velocity-1.6.2.jar has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/plugin.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,5 @@
+TESTFWPropertiesPreferencePage.name=Test Framework
+TESTFWTemplatePreferencePage.name=Templates
+
+wizard_name.project=TESTFW Test Harness
+NewWizards.Category.TESTFW=TESTFW
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/plugin.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="com.nokia.testfw.codegen.ui.preferences.PreferenceInitializer">
+ </initializer>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.editors.templates">
+ <contextType
+ id="com.nokia.testfw.codegen.ui.templates.testfw_template_contexttype"
+ class="com.nokia.testfw.codegen.ui.templates.CodeGenTemplateContextType"
+ name="Test Frameworks Template">
+ </contextType>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category id="com.nokia.s60tools.testFrameworks.newWizards" name="Test Frameworks" parentCategory="com.nokia.s60tools" />
+ <wizard
+ category="com.nokia.s60tools/com.nokia.s60tools.testFrameworks.newWizards"
+ class="com.nokia.testfw.codegen.ui.wizard.SUTNewTestWizard"
+ icon="icons/project.gif"
+ id="com.nokia.testfw.codegen.ui.wizard.SUTNewTestWizard"
+ name="SymbianUnitTest"/>
+ <wizard
+ category="com.nokia.s60tools/com.nokia.s60tools.testFrameworks.newWizards"
+ class="com.nokia.testfw.codegen.ui.wizard.STFNewTestWizard"
+ icon="icons/project.gif"
+ id="com.nokia.testfw.codegen.ui.wizard.STFNewTestWizard"
+ name="Symbian Test Framework"/>
+ </extension>
+
+ <!--extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="com.nokia.carbide.cpp.CarbideCppPerspective">
+ <newWizardShortcut id="com.nokia.testfw.codegen.ui.wizard.SUTNewTestWizard"/>
+ </perspectiveExtension>
+ </extension-->
+
+ <!--extension
+ point="org.eclipse.ui.navigator.navigatorContent">
+ <commonWizard
+ type="new"
+ wizardId="com.nokia.testfw.codegen.ui.wizard.SUTNewTestWizard">
+ <enablement>
+ <or>
+ <instanceof value="org.eclipse.cdt.core.model.ICElement" />
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test
+ property="org.eclipse.core.resources.projectNature"
+ value="com.nokia.carbide.cdt.builder.carbideCPPBuilderNature"/>
+ </adapt>
+ </or>
+ </enablement>
+ </commonWizard>
+ </extension-->
+
+ <!--extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ name="Symbian Test FrameWork"
+ category="com.nokia.testfw.preferences"
+ class="com.nokia.testfw.codegen.ui.preferences.TESTFWPropertiesPreferencePage"
+ id="com.nokia.testfw.codegen.ui.preferences.TESTFWPropertiesPreferencePage"/>
+ <page
+ name="SymbianUnitTest Templates"
+ category="com.nokia.testfw.preferences"
+ class="com.nokia.testfw.codegen.ui.preferences.TESTFWTemplatePreferencePage"
+ id="com.nokia.testfw.codegen.ui.preferences.TESTFWTemplatePreferencePage"/>
+ </extension-->
+
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <!-- SymbianTestFramework (New Test Module) -->
+ <objectContribution
+ objectClass="org.eclipse.core.resources.IProject"
+ id="com.nokia.testfw.codegen.ui.STFNewModulePopup"
+ adaptable="true">
+ <filter
+ name="projectNature"
+ value="com.nokia.testfw.codegen.ui.STFProjectNature"/>
+ <menu
+ label="Test Frameworks"
+ path="additions"
+ id="stfmenu">
+ <separator
+ name="group">
+ </separator>
+ </menu>
+ <action
+ label="Generate STF Test Class..."
+ class="com.nokia.testfw.codegen.ui.popup.actions.STFNewTestWizardAction"
+ menubarPath="stfmenu/group"
+ enablesFor="1"
+ id="com.nokia.testfw.codegen.ui.popup.actions.STFNewTestWizardAction">
+ </action>
+ </objectContribution>
+
+ <!-- SymbianTestFramework (New Test Cases) -->
+ <objectContribution
+ objectClass="org.eclipse.cdt.core.model.ITranslationUnit"
+ id="com.nokia.testfw.codegen.ui.STFNewCasePopup"
+ nameFilter="*.h"
+ adaptable="true">
+ <filter
+ name="projectNature"
+ value="com.nokia.testfw.codegen.ui.STFProjectNature"/>
+ <menu
+ label="Test Frameworks"
+ path="additions"
+ id="stfmenu">
+ <separator
+ name="group">
+ </separator>
+ </menu>
+ <action
+ label="Generate STF Test Cases..."
+ class="com.nokia.testfw.codegen.ui.popup.actions.STFNewTestWizardAction"
+ menubarPath="stfmenu/group"
+ enablesFor="1"
+ id="com.nokia.testfw.codegen.ui.popup.actions.STFNewTestWizardAction">
+ </action>
+ </objectContribution>
+
+ <!-- SymbianUnitTest -->
+ <objectContribution
+ objectClass="org.eclipse.cdt.core.model.ICElement"
+ id="com.nokia.testfw.codegen.ui.methodpopup">
+ <visibility>
+ <or>
+ <objectClass name="org.eclipse.cdt.core.model.ITranslationUnit"/>
+ <or>
+ <objectClass name="org.eclipse.cdt.core.model.IStructure"/>
+ <objectClass name="org.eclipse.cdt.core.model.IMethodDeclaration"/>
+ </or>
+ </or>
+ </visibility>
+ <menu
+ label="Test Frameworks"
+ path="additions"
+ id="stfmenu">
+ <separator
+ name="group">
+ </separator>
+ </menu>
+ <action
+ label="Generate SymbianUnitTest Cases..."
+ class="com.nokia.testfw.codegen.ui.popup.actions.SUTNewTestWizardAction"
+ menubarPath="stfmenu/group"
+ enablesFor="*"
+ id="com.nokia.testfw.codegen.ui.popup.actions.SUTNewTestWizardAction">
+ </action>
+ </objectContribution>
+ </extension>
+
+ <extension
+ point="org.eclipse.core.resources.natures"
+ id="STFProjectNature"
+ name="SymbianTestFramework Nature">
+ <runtime>
+ <run class="com.nokia.testfw.codegen.ui.STFProjectNature"/>
+ </runtime>
+ </extension>
+</plugin>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/CodegenUIPlugin.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.text.templates.ContextTypeRegistry;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.persistence.TemplatePersistenceData;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
+import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+import com.nokia.testfw.codegen.ui.templates.CodeGenTemplateContextType;
+import com.nokia.testfw.codegen.ui.templates.EclipseTemplateBuilder;
+import com.nokia.testfw.codegen.templates.TemplateBuilderFactory;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class CodegenUIPlugin extends AbstractUIPlugin {
+
+ // The shared instance
+ public static CodegenUIPlugin plugin;
+
+ public static String PLUGIN_ID = "com.nokia.testfw.codegen.ui";
+
+ // The template store
+ private TemplateStore fStore;
+
+ // The context type registry
+ private ContributionContextTypeRegistry fRegistry;
+
+ // The template key
+ private static final String TESTFW_TEMPLATES_KEY = "com.nokia.testfw.codegen.templates";
+
+ private IResourceChangeListener iTestFolderDeleteListener;
+
+ /**
+ * The constructor
+ */
+ public CodegenUIPlugin() {
+ System.setProperty(TemplateBuilderFactory.TEMPLATEBUILDERCLASS,
+ EclipseTemplateBuilder.class.getName());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ addTestFolderDeleteListener();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ removeTestFolderDeleteListener();
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static CodegenUIPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns this plug-in's template store.
+ *
+ * @return the template store of this plug-in instance
+ */
+ public TemplateStore getTemplateStore() {
+ if (fStore == null) {
+ fStore = new ContributionTemplateStore(getContextTypeRegistry(),
+ getPreferenceStore(), TESTFW_TEMPLATES_KEY) {
+ protected void loadContributedTemplates() throws IOException {
+ super.loadContributedTemplates();
+ Map<String, Template> lPathTemplateMap = EclipseTemplateBuilder
+ .findAllOriTemplates();
+ for (String path : lPathTemplateMap.keySet()) {
+ TemplatePersistenceData data = new TemplatePersistenceData(
+ lPathTemplateMap.get(path), true, path);
+ internalAdd(data);
+ }
+ }
+ };
+ try {
+ fStore.load();
+ } catch (IOException e) {
+ IStatus lStatus = new Status(IStatus.ERROR,
+ CodegenUIPlugin.class.getName(),
+ "Exception was thrown while loading templates.", e);
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ }
+ }
+ return fStore;
+ }
+
+ /**
+ * Returns this plug-in's context type registry.
+ *
+ * @return the context type registry for this plug-in instance
+ */
+ public ContextTypeRegistry getContextTypeRegistry() {
+ if (fRegistry == null) {
+ // create an configure the contexts available in the template editor
+ fRegistry = new ContributionContextTypeRegistry();
+ fRegistry
+ .addContextType(CodeGenTemplateContextType.FILE_TEMPLATE_CONTEXT_TYPE);
+ }
+ return fRegistry;
+ }
+
+ private void addTestFolderDeleteListener() {
+ if (iTestFolderDeleteListener == null)
+ iTestFolderDeleteListener = new ResourceChangeListener();
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(
+ iTestFolderDeleteListener);
+ }
+
+ private void removeTestFolderDeleteListener() {
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(
+ iTestFolderDeleteListener);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/Messages.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui;
+
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ private static final String BUNDLE_NAME = "com.nokia.testfw.codegen.ui.messages";
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String id) {
+ try {
+ return RESOURCE_BUNDLE.getString(id);
+ } catch (Exception e) {
+ IStatus lStatus = new Status(IStatus.WARNING, Messages.class
+ .getName(),
+ "Exception was thrown while loading string id: " + id, e);
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ return id;
+ }
+ }
+
+ public static String getString(String id, Object... arguments) {
+ try {
+ String msg = RESOURCE_BUNDLE.getString(id);
+ return MessageFormat.format(msg, arguments);
+ } catch (Exception e) {
+ IStatus lStatus = new Status(IStatus.WARNING, Messages.class
+ .getName(),
+ "Exception was thrown while loading string id: " + id, e);
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ return id;
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/ResourceChangeListener.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,283 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.codegen.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+
+import com.nokia.testfw.codegen.ui.parser.ProjectInfoHelper;
+
+public class ResourceChangeListener implements IResourceChangeListener {
+
+ private static boolean enable = true;
+
+ /**
+ * @return the enable
+ */
+ public static boolean isEnable() {
+ return enable;
+ }
+
+ /**
+ * @param enable
+ * the enable to set
+ */
+ public static void setEnable(boolean enable) {
+ ResourceChangeListener.enable = enable;
+ }
+
+ public void resourceChanged(IResourceChangeEvent event) {
+
+ if (enable == false)
+ return;
+
+ if (event.getType() != IResourceChangeEvent.POST_CHANGE) {
+ return;
+ }
+ IResourceDelta projects[] = event.getDelta().getAffectedChildren();
+ if (projects.length <= 0) {
+ return;
+ }
+
+ for (IResourceDelta projectDelta : projects) {
+ if ((projectDelta.getFlags() & IResourceDelta.OPEN) != 0
+ || projectDelta.getKind() == IResourceDelta.REMOVED
+ || (projectDelta.getFlags() & IResourceDelta.MARKERS) != 0
+ || (projectDelta.getFlags() & IResourceDelta.DESCRIPTION) != 0)
+ continue;
+ IResource resource = projectDelta.getResource();
+ if (resource == null || !(resource instanceof IProject))
+ continue;
+ IProject project = (IProject) resource;
+ try {
+ if (!project.isAccessible()
+ || !project
+ .hasNature("com.nokia.carbide.cdt.builder.carbideCPPBuilderNature"))
+ continue;
+ } catch (CoreException e) {
+ CodegenUIPlugin.getDefault().getLog().log(e.getStatus());
+ }
+ visitChildren(projectDelta);
+ }
+ }
+
+ private void visitChildren(IResourceDelta delta) {
+ IResourceDelta addedChildren[] = delta
+ .getAffectedChildren(IResourceDelta.ADDED);
+ if (addedChildren.length > 0) {
+ if (addedChildren.length == 1
+ && (addedChildren[0].getFlags() & IResourceDelta.MOVED_FROM) != 0) {
+ IResourceDelta removedDeltaChildren[] = getDeltaChildren(delta,
+ true);
+ if (removedDeltaChildren.length == 1
+ && (removedDeltaChildren[0].getFlags() & IResourceDelta.MOVED_TO) != 0) {
+ IResource oldResource = removedDeltaChildren[0]
+ .getResource();
+ IResource newResource = addedChildren[0].getResource();
+ if (oldResource instanceof IFolder
+ && newResource instanceof IFolder) {
+ testFolderRenamed((IFolder) oldResource,
+ (IFolder) newResource);
+ }
+ return;
+ }
+ }
+ }
+
+ IResourceDelta removedChildren[] = delta
+ .getAffectedChildren(IResourceDelta.REMOVED);
+ if (removedChildren.length > 0) {
+ List<IFolder> removedIFolders = new ArrayList<IFolder>(0);
+ for (IResourceDelta child : removedChildren) {
+ IResource resource = child.getResource();
+ if (resource != null && (resource instanceof IFolder))
+ removedIFolders.add((IFolder) resource);
+ }
+
+ if (removedIFolders.size() > 0)
+ testFolderDeleted(removedIFolders.toArray(new IFolder[0]));
+ }
+
+ IResourceDelta changedChildren[] = delta
+ .getAffectedChildren(IResourceDelta.CHANGED);
+ if (changedChildren.length > 0)
+ if (changedChildren.length == 1) {
+ IResourceDelta child = changedChildren[0];
+ if (child.getAffectedChildren().length > 0)
+ visitChildren(child);
+ } else {
+ boolean rename = false;
+ if (changedChildren.length == 2) {
+ IResourceDelta oldFiles[] = changedChildren[0]
+ .getAffectedChildren(IResourceDelta.REMOVED);
+ IResourceDelta newFiles[] = changedChildren[1]
+ .getAffectedChildren(IResourceDelta.ADDED);
+ if (oldFiles.length == 0 && newFiles.length == 0) {
+ oldFiles = changedChildren[1]
+ .getAffectedChildren(IResourceDelta.REMOVED);
+ newFiles = changedChildren[0]
+ .getAffectedChildren(IResourceDelta.ADDED);
+ }
+ for (IResourceDelta oldDelta : oldFiles) {
+ String oldName = oldDelta.getFullPath().lastSegment();
+ for (IResourceDelta newDelta : newFiles) {
+ if (!newDelta.getFullPath().lastSegment().equals(
+ oldName))
+ continue;
+ IResource oldResource = oldDelta.getResource();
+ IResource newResource = newDelta.getResource();
+ if (oldResource instanceof IFolder
+ && newResource instanceof IFolder) {
+ testFolderRenamed((IFolder) oldResource,
+ (IFolder) newResource);
+ }
+ rename = true;
+ break;
+ }
+
+ }
+ }
+ if (!rename) {
+ List<IFolder> removedFolders = new ArrayList<IFolder>(0);
+ for (IResourceDelta child : changedChildren) {
+ IResourceDelta removedDeltaChildren[] = getDeltaChildren(
+ child, true);
+ for (IResourceDelta removedChild : removedDeltaChildren) {
+ IResource resource = removedChild.getResource();
+ if (resource != null
+ && (resource instanceof IFolder))
+ removedFolders.add((IFolder) resource);
+ }
+ }
+
+ if (removedFolders.size() > 0)
+ testFolderDeleted(removedFolders
+ .toArray(new IFolder[0]));
+ }
+ }
+ }
+
+ private IResourceDelta[] getDeltaChildren(IResourceDelta delta,
+ boolean removed) {
+ List<IResourceDelta> deltaChildren = new ArrayList<IResourceDelta>();
+ IResourceDelta airesourcedelta[] = delta
+ .getAffectedChildren(removed ? IResourceDelta.REMOVED
+ : IResourceDelta.ADDED);
+ for (IResourceDelta child : airesourcedelta) {
+ deltaChildren.add(child);
+ }
+
+ airesourcedelta = delta.getAffectedChildren(IResourceDelta.CHANGED);
+ for (IResourceDelta child : airesourcedelta) {
+ IResourceDelta[] childresourcedelta = getDeltaChildren(child,
+ removed);
+ for (IResourceDelta child2 : childresourcedelta) {
+ deltaChildren.add(child2);
+ }
+ }
+
+ return (IResourceDelta[]) deltaChildren
+ .toArray(new IResourceDelta[deltaChildren.size()]);
+ }
+
+ private void testFolderRenamed(final IFolder oldFolder,
+ final IFolder newFolder) {
+ final IProject oldProject = oldFolder.getProject();
+ WorkspaceJob job = new WorkspaceJob(
+ "Update test folder informaton (rename)") {
+
+ public IStatus runInWorkspace(IProgressMonitor monitor)
+ throws CoreException {
+ try {
+ String template = ProjectInfoHelper
+ .getProjectTemplate(oldProject);
+ Set<String> testFolders = ProjectInfoHelper.getTestFolders(
+ oldProject, template);
+ if (testFolders.contains(oldFolder.getProjectRelativePath()
+ .toString())) {
+ ProjectInfoHelper.renameTestFolders(oldProject,
+ template, oldFolder.getProjectRelativePath()
+ .toString(), newFolder
+ .getProjectRelativePath().toString());
+ }
+ } catch (CoreException e) {
+ CodegenUIPlugin.getDefault().getLog().log(e.getStatus());
+ }
+ return Status.OK_STATUS;
+ }
+
+ };
+
+ job.setRule(oldProject.getWorkspace().getRoot());
+ job.setUser(true);
+ job.schedule();
+ return;
+ }
+
+ private void testFolderDeleted(final IFolder[] folders) {
+ if (folders.length > 0) {
+ final IProject project = folders[0].getProject();
+
+ WorkspaceJob job = new WorkspaceJob(
+ "Update test folder informaton (delete)") {
+
+ public IStatus runInWorkspace(IProgressMonitor monitor)
+ throws CoreException {
+ try {
+ String template = ProjectInfoHelper
+ .getProjectTemplate(project);
+ Set<String> testFolders = ProjectInfoHelper
+ .getTestFolders(project, template);
+ for (IFolder folder : folders) {
+ String folderPathStr = folder
+ .getProjectRelativePath().toString();
+ if (testFolders.contains(folderPathStr)) {
+ ProjectInfoHelper.removeTestFolders(project,
+ template, folderPathStr);
+ }
+ }
+ } catch (CoreException e) {
+ CodegenUIPlugin.getDefault().getLog()
+ .log(e.getStatus());
+ return e.getStatus();
+ }
+ return Status.OK_STATUS;
+ }
+
+ };
+
+ job.setRule(project.getWorkspace().getRoot());
+ job.setUser(true);
+ job.schedule();
+ return;
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/STFProjectNature.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.runtime.CoreException;
+
+public class STFProjectNature implements IProjectNature {
+
+ private IProject project;
+
+ public void configure() throws CoreException {
+ }
+
+ public void deconfigure() throws CoreException {
+ }
+
+ public IProject getProject() {
+ return project;
+ }
+
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/messages.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,121 @@
+Dialog.OK=&OK
+Dialog.Cancel=&Cancel
+Dialog.YES=&YES
+Dialog.NO=&NO
+
+MethodDialog.AddMethodTitle=Add Method
+MethodDialog.EditMethodTitle=Edit Method
+MethodDialog.MethodName=Method Name:
+MethodDialog.Error=Error
+MethodDialog.InvalidMethodName=Invalid Method Name : \"{0}\".
+MethodDialog.DuplicateMethodName=Duplicate Method Name : \"{0}\".
+
+GenTestMethodPage.AddMethod=Add
+GenTestMethodPage.EditMethod=Edit
+GenTestMethodPage.DeleteMethod=Delete
+GenTestMethodPage.BindMethod=Bind...
+GenTestMethodPage.ConfirmDelete=Confirm Delete
+GenTestMethodPage.WhetherDeleteMethod=Are you sure you want to delete the method \"{0}\"?
+
+ChooseProjectPage.Title=Select project
+ChooseProjectPage.Description=Add a new test harness to an existing project
+
+ChooseObjectivePage.Title=Classes to Test
+ChooseObjectivePage.Description=Select the classes and methods you want to test.
+
+ChooseProjectPage.Label=Select an existing project
+ChooseProjectPage.NoProjectsError=No eligible projects exist in the workspace
+ChooseProjectPage.NoSelectionError=A project must be selected
+
+PropertyPage.Title=Properties
+PropertyPage.Description=The project properties
+PropertyPage.UIDHexError = ''{0}'' is not a valid hexadecimal value
+
+LocationAndPropertyPage.Title=Location And Properties
+LocationAndPropertyPage.Description=The test folder location and test properties
+LocationAndPropertyPage.Location_Tooltip=The test folder location bases on project location.
+LocationAndPropertyPage.Empty_TestFolderLocation=The test folder must be specified.
+LocationAndPropertyPage.Invalid_TestFolderName=The test folder name is invalid.
+
+ModuleAndPropertyPage.Title=Test Class Properties
+ModuleAndPropertyPage.Description=The test class properties
+ModuleAndPropertyPage.Invalid_ModuleName=The test class name is invalid.
+ModuleAndPropertyPage.Duplicate_ModuleName=The test class name is duplicate.
+
+TESTFWPropertiesPreferencePage.UIDHexError = ''{0}'' is not a valid hexadecimal value
+TESTFWPropertiesPreferencePage.Description = Properties setting
+TESTFWPropertiesPreferencePage.TestFolder.Name=Test Folder Name
+TESTFWPropertiesPreferencePage.TestFolder.Error=Test Folder Name can not contain illegal characters
+TESTFWPropertiesPreferencePage.UID3.MaxValue=UID3 Max Value
+TESTFWPropertiesPreferencePage.UID3.MinValue=UID3 Min Value
+TESTFWPropertiesPreferencePage.UID3.Error1='UID3 Max Value' must be more than 'UID3 Min Value'
+TESTFWPropertiesPreferencePage.UID3.Error2='UID3 Min Value' must be less than 'UID3 Max Value'
+TESTFWPropertiesPreferencePage.Author=Auther Name
+TESTFWPropertiesPreferencePage.Copyright=Copyright
+TESTFWPropertiesPreferencePage.UIDHexError2=Value must be an hexadecimal number between {0} and {1}
+TESTFWPropertiesPreferencePage.UIDHexError3="Value must be an hexadecimal number"
+
+TESTFWTemplateBlock_templates_new_button=&New...
+TESTFWTemplateBlock_templates_edit_button=&Edit...
+TESTFWTemplateBlock_templates_remove_button=&Remove
+TESTFWTemplateBlock_templates_import_button=I&mport...
+TESTFWTemplateBlock_templates_export_button=E&xport...
+TESTFWTemplateBlock_templates_exportall_button=Ex&port All...
+TESTFWTemplateBlock_templates_label=&Configure generated code and comments:
+TESTFWTemplateBlock_preview=Pa&ttern:
+TESTFWTemplateBlock_import_title=Import Templates
+TESTFWTemplateBlock_import_extension=*.xml
+TESTFWTemplateBlock_export_title=Export {0} Code Template(s)
+TESTFWTemplateBlock_export_filename=codetemplates.xml
+TESTFWTemplateBlock_export_extension=*.xml
+TESTFWTemplateBlock_export_error_title= Export Templates
+TESTFWTemplateBlock_export_error_hidden= Export failed.\n{0} is a hidden file.
+TESTFWTemplateBlock_export_error_canNotWrite= Export failed.\n{0} cannot be modified.
+TESTFWTemplateBlock_export_exists_title=Export Code Templates
+TESTFWTemplateBlock_export_exists_message={0} already exists.\nDo you want to replace it?
+TESTFWTemplateBlock_error_read_title= Code Templates
+TESTFWTemplateBlock_error_read_message= Failed to read templates.
+
+TESTFWTemplateBlock_error_parse_message= Failed to parse templates:\n{0}
+
+TESTFWTemplateBlock_error_write_title=Code Templates
+TESTFWTemplateBlock_error_write_message=Failed to write templates.
+
+TemplatePreferencePage_question_create_new_title= Edit Template
+TemplatePreferencePage_question_create_new_message= The name of the template has been changed. Click 'Yes' to create an additional template with the new name or 'No' to rename the existing one.
+
+TemplatePreferencePage_new=&New...
+TemplatePreferencePage_edit=&Edit...
+TemplatePreferencePage_import=&Import...
+TemplatePreferencePage_export=E&xport...
+TemplatePreferencePage_remove=&Remove
+TemplatePreferencePage_editor=Template
+TemplatePreferencePage_revert=Re&vert to Default
+TemplatePreferencePage_restore=Restore Re&moved
+
+TemplatePreferencePage_import_title=Importing Templates
+TemplatePreferencePage_import_extension=*.xml
+
+TemplatePreferencePage_export_title=Export Templates
+TemplatePreferencePage_export_filename=templates.xml
+TemplatePreferencePage_export_extension=*.xml
+
+TemplatePreferencePage_export_exists_title= Exporting Templates
+TemplatePreferencePage_export_exists_message= {0} already exists.\nDo you want to replace it?
+
+TemplatePreferencePage_export_error_title= Exporting Templates
+TemplatePreferencePage_export_error_hidden= Export failed.\n{0} is a hidden file.
+TemplatePreferencePage_export_error_canNotWrite= Export failed.\n{0} cannot be modified.
+TemplatePreferencePage_export_error_fileNotFound= Export failed:\n{0}
+
+TemplatePreferencePage_error_parse_message= Failed to parse templates:\n{0}
+TemplatePreferencePage_error_read_message= Failed to read templates.
+TemplatePreferencePage_error_write_message= Failed to write templates.
+
+TemplatePreferencePage_question_create_new_title= Edit Template
+TemplatePreferencePage_question_create_new_message= The name of the template has been changed. Click 'Yes' to create an additional template with the new name or 'No' to rename the existing one.
+
+TemplatePreferencePage_preview=Previe&w:
+
+NewTestCaseWizard_generate_failed_title=Failed
+NewTestCaseWizard_generate_failed_message=Generating test cases failed, please check log to find detail message.
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/parser/Parser.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.parser;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.cdt.core.model.CModelException;
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.core.model.IMethodDeclaration;
+import org.eclipse.cdt.core.model.IStructure;
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+
+import com.nokia.testfw.codegen.ui.CodegenUIPlugin;
+import com.nokia.testfw.codegen.ui.parser.model.UIClassNode;
+import com.nokia.testfw.codegen.ui.parser.model.UIMethodNode;
+import com.nokia.testfw.codegen.ui.parser.model.UIProjectNode;
+
+public class Parser {
+
+ public static int PUBLIC = 1;
+ public static int PROTECTED = 2;
+ public static int PRIVATE = 4;
+ public static int FRIEND = 8;
+
+ public static UIProjectNode parseProject(IProject aProject,
+ String lTemplateName, int accessVisibility) {
+ UIProjectNode lProjectNode = null;
+
+ try {
+ Set<String> testFolders = ProjectInfoHelper.getTestFolders(
+ aProject, lTemplateName);
+
+ ICProject lCProject = CoreModel.getDefault().create(aProject);
+ lProjectNode = new UIProjectNode(lCProject);
+
+ List<ITranslationUnit> headers = new ArrayList<ITranslationUnit>();
+ lCProject.accept(new TranslationUnitCollector(null, headers,
+ new NullProgressMonitor()));
+ for (ITranslationUnit header : headers) {
+ if (!matchTestFolder(header.getResource()
+ .getProjectRelativePath().toString(), testFolders)) {
+ parseTranslationUnit(header, lProjectNode, accessVisibility);
+ }
+ }
+
+ collectBuildInfo(aProject, lProjectNode);
+ } catch (CoreException lCoreException) {
+ IStatus lStatus = new Status(IStatus.ERROR, Parser.class.getName(),
+ IStatus.ERROR, "Core exception while parsing project",
+ lCoreException);
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ }
+ return lProjectNode;
+ }
+
+ private static boolean matchTestFolder(final String path,
+ final Set<String> testFolders) {
+ for (String testfolder : testFolders) {
+ if (path.startsWith(testfolder)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static void collectBuildInfo(IProject aProject,
+ UIProjectNode aProjectNode) {
+ Map<String, Set<String>> lBuildInfoMap = ProjectInfoHelper
+ .getBuildInfoMap(aProject);
+ aProjectNode.setUserIncludes(lBuildInfoMap
+ .get(ProjectInfoHelper.USERINCLUDE));
+ aProjectNode.setSystemIncludes(lBuildInfoMap
+ .get(ProjectInfoHelper.SYSTEMINCLUDE));
+ aProjectNode.setLibrarys(lBuildInfoMap.get(ProjectInfoHelper.LIBRARY));
+ }
+
+ private static void parseTranslationUnit(final ITranslationUnit tu,
+ UIProjectNode aProjectNode, int accessVisibility)
+ throws CModelException {
+ if (tu != null) {
+ ICElement[] elements = tu.getChildren();
+ for (ICElement element : elements) {
+ if (element instanceof IStructure) {
+ UIClassNode lClassNode = parseClass((IStructure) element,
+ aProjectNode, accessVisibility);
+ if (lClassNode.getChildren().size() > 0) {
+ aProjectNode.addChild(lClassNode);
+ }
+ }
+ }
+ }
+ }
+
+ public static UIProjectNode parseTranslationUnit(ITranslationUnit[] tus,
+ int accessVisibility) throws CModelException {
+ UIProjectNode lProjectNode = new UIProjectNode(tus[0].getCProject());
+ for (ITranslationUnit tu : tus) {
+ parseTranslationUnit(tu, lProjectNode, accessVisibility);
+ }
+ collectBuildInfo(tus[0].getCProject().getProject(), lProjectNode);
+ return lProjectNode;
+ }
+
+ public static UIProjectNode parseTranslationUnit(ITranslationUnit tu,
+ int accessVisibility) throws CModelException {
+ UIProjectNode lProjectNode = new UIProjectNode(tu.getCProject());
+ parseTranslationUnit(tu, lProjectNode, accessVisibility);
+ return lProjectNode;
+ }
+
+ private static UIClassNode parseClass(IStructure classDec,
+ UIProjectNode parent, int accessVisibility) throws CModelException {
+ UIClassNode lClassNode = new UIClassNode(classDec, parent);
+ lClassNode.setDeclLocation(classDec.getTranslationUnit().getLocation()
+ .toOSString());
+ IMethodDeclaration[] lMethodsList = classDec.getMethods();
+ for (IMethodDeclaration lMethod : lMethodsList) {
+ if (lMethod.getVisibility() == ASTAccessVisibility.PUBLIC) {
+ if ((accessVisibility & PUBLIC) == 0) {
+ continue;
+ }
+ } else if (lMethod.getVisibility() == ASTAccessVisibility.PROTECTED) {
+ if ((accessVisibility & PROTECTED) == 0) {
+ continue;
+ }
+ } else if (lMethod.getVisibility() == ASTAccessVisibility.PRIVATE) {
+ if ((accessVisibility & PRIVATE) == 0) {
+ continue;
+ }
+ }
+ if (lMethod.isFriend()) {
+ if ((accessVisibility & FRIEND) == 0) {
+ continue;
+ }
+ }
+ UIMethodNode lMethodItem = parseMethod(lMethod, lClassNode);
+ lClassNode.addChild(lMethodItem);
+ }
+ if (lClassNode.getChildren().size() > 0) {
+ parent.addChild(lClassNode);
+ }
+ return lClassNode;
+ }
+
+ public static UIProjectNode parseClass(IStructure[] classDecs,
+ int accessVisibility) throws CModelException {
+ UIProjectNode lProjectNode = new UIProjectNode(classDecs[0]
+ .getCProject());
+ for (IStructure classDec : classDecs) {
+ parseClass(classDec, lProjectNode, accessVisibility);
+ }
+ collectBuildInfo(classDecs[0].getCProject().getProject(), lProjectNode);
+ return lProjectNode;
+ }
+
+ private static UIMethodNode parseMethod(IMethodDeclaration methodDec,
+ UIClassNode parent) throws CModelException {
+ UIMethodNode lMethodNode = new UIMethodNode(methodDec, parent);
+
+ if (methodDec.getVisibility() == ASTAccessVisibility.PUBLIC) {
+ lMethodNode.setVisibility(0);
+ } else if (methodDec.getVisibility() == ASTAccessVisibility.PROTECTED) {
+ lMethodNode.setVisibility(1);
+ } else {// private
+ lMethodNode.setVisibility(2);
+ }
+ lMethodNode.setConstructor(methodDec.isConstructor());
+ lMethodNode.setDestructor(methodDec.isDestructor());
+ lMethodNode.setInline(methodDec.isInline());
+ lMethodNode.setOperator(methodDec.isOperator());
+ lMethodNode.setPureVirtual(methodDec.isPureVirtual());
+ lMethodNode.setStatic(methodDec.isStatic());
+ lMethodNode.setVirtual(methodDec.isVirtual());
+ lMethodNode.setConst(methodDec.isConst());
+
+ String[] lParameterTypes = methodDec.getParameterTypes();
+
+ for (int i = 0; i < lParameterTypes.length; i++) {
+ String type = lParameterTypes[i];
+ if ("TRequestStatus&".equals(type)) {
+ lMethodNode.setAsync(true);
+ }
+ type = type.split("=")[0];
+ lMethodNode.addParameters(type, "aParam" + (i + 1));
+ }
+ return lMethodNode;
+ }
+
+ public static UIProjectNode parseMethod(IMethodDeclaration[] methodDecs)
+ throws CModelException {
+ UIProjectNode lProjectNode = new UIProjectNode(methodDecs[0]
+ .getCProject());
+ Map<IStructure, UIClassNode> classDecMap = new HashMap<IStructure, UIClassNode>();
+ for (IMethodDeclaration methodDec : methodDecs) {
+ IStructure classDec = (IStructure) methodDec.getParent();
+ UIClassNode lClassNode = (UIClassNode) classDecMap.get(classDec);
+ if (lClassNode == null) {
+ lClassNode = new UIClassNode(classDec, lProjectNode);
+ lClassNode.setDeclLocation(classDec.getTranslationUnit()
+ .getLocation().toOSString());
+ lProjectNode.addChild(lClassNode);
+ classDecMap.put(classDec, lClassNode);
+ }
+ UIMethodNode lMethodItem = parseMethod(methodDec, lClassNode);
+ lClassNode.addChild(lMethodItem);
+ }
+ collectBuildInfo(methodDecs[0].getCProject().getProject(), lProjectNode);
+ return lProjectNode;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/parser/ProjectInfoHelper.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,420 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.parser;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.settings.model.ICProjectDescription;
+import org.eclipse.cdt.core.settings.model.ICStorageElement;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
+import com.nokia.carbide.cdt.builder.DefaultMMPViewConfiguration;
+import com.nokia.carbide.cdt.builder.DefaultViewConfiguration;
+import com.nokia.carbide.cdt.builder.EMMPPathContext;
+import com.nokia.carbide.cdt.builder.EpocEngineHelper;
+import com.nokia.carbide.cdt.builder.MMPViewPathHelper;
+import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration;
+import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo;
+import com.nokia.carbide.cpp.epoc.engine.BldInfDataRunnableAdapter;
+import com.nokia.carbide.cpp.epoc.engine.BldInfViewRunnableAdapter;
+import com.nokia.carbide.cpp.epoc.engine.EpocEnginePlugin;
+import com.nokia.carbide.cpp.epoc.engine.MMPDataRunnableAdapter;
+import com.nokia.carbide.cpp.epoc.engine.model.IView;
+import com.nokia.carbide.cpp.epoc.engine.model.bldinf.IBldInfData;
+import com.nokia.carbide.cpp.epoc.engine.model.bldinf.IBldInfView;
+import com.nokia.carbide.cpp.epoc.engine.model.bldinf.IMMPReference;
+import com.nokia.carbide.cpp.epoc.engine.model.bldinf.IMakMakeReference;
+import com.nokia.carbide.cpp.epoc.engine.model.mmp.IMMPData;
+import com.nokia.carbide.cpp.epoc.engine.preprocessor.AcceptedNodesViewFilter;
+import com.nokia.carbide.cpp.epoc.engine.preprocessor.AllNodesViewFilter;
+
+import com.nokia.testfw.codegen.ui.CodegenUIPlugin;
+
+public class ProjectInfoHelper {
+
+ public final static String USERINCLUDE = "USERINCLUDE";
+ public final static String SYSTEMINCLUDE = "SYSTEMINCLUDE";
+ public final static String LIBRARY = "LIBRARY";
+ public final static String TEMPLATE = "com.nokia.testfw.codegen.Template";
+ public final static String NAME = "name";
+ public final static String LOCATION = "location";
+
+ public static Map<String, Set<String>> getBuildInfoMap(IProject project) {
+ Set<String> lUserIncludeSet = new TreeSet<String>();
+ Set<String> lSystemIncludeSet = new TreeSet<String>();
+ Set<String> lLibrarySet = new TreeSet<String>();
+
+ ICarbideProjectInfo carbideprojectinfo = CarbideBuilderPlugin
+ .getBuildManager().getProjectInfo(project);
+
+ if (carbideprojectinfo != null) {
+ getProjectInclude(carbideprojectinfo, lUserIncludeSet,
+ lSystemIncludeSet, lLibrarySet);
+ }
+
+ Map<String, Set<String>> lBuildInfoMap = new HashMap<String, Set<String>>();
+ lBuildInfoMap.put(USERINCLUDE, lUserIncludeSet);
+ lBuildInfoMap.put(SYSTEMINCLUDE, lSystemIncludeSet);
+ lBuildInfoMap.put(LIBRARY, lLibrarySet);
+ return lBuildInfoMap;
+
+ }
+
+ public static void getProjectInclude(final ICarbideProjectInfo info,
+ final Set<String> userIncludeSet,
+ final Set<String> systemIncluseSet, final Set<String> librarySet) {
+ final ICarbideBuildConfiguration buildConfig = info
+ .getDefaultConfiguration();
+ final IPath epocRoot = EpocEngineHelper.getEpocRootForProject(info
+ .getProject());
+ EpocEnginePlugin.runWithBldInfData(info
+ .getWorkspaceRelativeBldInfPath(),
+ new DefaultViewConfiguration(info.getProject(), buildConfig,
+ new AcceptedNodesViewFilter()),
+ new BldInfDataRunnableAdapter() {
+
+ public Object run(IBldInfData data) {
+ List<IMakMakeReference> maks = data
+ .getMakMakeReferences();
+ for (int i = 0; i < maks.size(); i++) {
+ IMakMakeReference mak = maks.get(i);
+ if (!(mak instanceof IMMPReference)) {
+ continue;
+ }
+ IMMPReference mmp = (IMMPReference) mak;
+ IPath workspaceRelativeMMPPath = (new Path(info
+ .getProject().getName())).append(mmp
+ .getPath());
+ EpocEnginePlugin.runWithMMPData(
+ workspaceRelativeMMPPath,
+ new DefaultMMPViewConfiguration(info
+ .getProject(), buildConfig,
+ new AcceptedNodesViewFilter()),
+ new MMPDataRunnableAdapter() {
+
+ public Object run(IMMPData mmpData) {
+ MMPViewPathHelper helper = new MMPViewPathHelper(
+ mmpData, epocRoot);
+ for (Iterator<IPath> iterator = mmpData
+ .getUserIncludes()
+ .iterator(); iterator
+ .hasNext();) {
+ IPath path = iterator.next();
+ IPath fullPath = helper
+ .convertMMPToFilesystem(
+ EMMPPathContext.USERINCLUDE,
+ path);
+ if (fullPath != null)
+ userIncludeSet.add(fullPath
+ .toOSString());
+ }
+ for (Iterator<IPath> iterator = mmpData
+ .getSystemIncludes()
+ .iterator(); iterator
+ .hasNext();) {
+ IPath includePath = iterator
+ .next();
+ systemIncluseSet
+ .add(includePath
+ .toString());
+ }
+ librarySet.addAll(mmpData
+ .getLibraries());
+ return null;
+ }
+ });
+ }
+
+ return null;
+ }
+ });
+ }
+
+ public static void addMMPFileToProject(final IProject project,
+ final IPath projectRelativeMmpPath, final boolean isTestMMP) {
+ final ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager()
+ .getProjectInfo(project);
+ if (cpi == null || cpi.getDefaultConfiguration() == null) {
+ return;
+ } else {
+ EpocEnginePlugin.runWithBldInfView(cpi
+ .getWorkspaceRelativeBldInfPath(),
+ new DefaultViewConfiguration(project, null,
+ new AllNodesViewFilter()),
+ new BldInfViewRunnableAdapter() {
+ public Object run(IBldInfView infView) {
+ List<IMakMakeReference> refs = isTestMMP ? infView
+ .getTestMakMakeReferences() : infView
+ .getMakMakeReferences();
+ // check if the test project mmp already exists in
+ // the bld.inf file
+ for (IMakMakeReference ref : refs) {
+ if (ref.getPath()
+ .equals(projectRelativeMmpPath)) {
+ return null;
+ }
+ }
+
+ IMMPReference newRef = infView.createMMPReference();
+ newRef.setPath(projectRelativeMmpPath);
+ refs.add(newRef);
+ IFile file = project.getFile(cpi
+ .getProjectRelativeBldInfPath());
+ commitStanza(infView, file);
+ return null;
+ }
+ });
+ return;
+ }
+ }
+
+ public static void addSubBldInfToProject(IProject project,
+ IPath projectRelativeBldInfPath) throws CoreException, IOException {
+ final ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager()
+ .getProjectInfo(project);
+ if (cpi == null || cpi.getDefaultConfiguration() == null) {
+ return;
+ } else {
+ IPath mainBldInfPath = cpi.getProjectRelativeBldInfPath();
+ if (!mainBldInfPath.equals(projectRelativeBldInfPath)) {
+ // check if the test bld.inf already exists in the main bld.inf
+ IPath base = mainBldInfPath.uptoSegment(1);
+ if (base.equals(mainBldInfPath)) {
+ base = Path.EMPTY;
+ }
+ IPath relativePath = makeRelativeTo(base,
+ projectRelativeBldInfPath);
+ String include = "#include \"" + relativePath.toString() + "\"";
+
+ IFile mainBldInfFile = project.getFile(mainBldInfPath);
+ BufferedReader reader = new BufferedReader(
+ new InputStreamReader(mainBldInfFile.getContents()));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ line = line.replaceAll("\\s", " ").trim();
+ if (line.matches("^" + include)) {
+ return;
+ }
+ }
+
+ include = "\n" + include;
+ mainBldInfFile.appendContents(new ByteArrayInputStream(include
+ .getBytes()), true, true, null);
+ }
+ }
+ }
+
+ public static IPath makeRelativeTo(IPath base, IPath target) {
+ if (target.getDevice() != base.getDevice()
+ && (target.getDevice() == null || !target.getDevice()
+ .equalsIgnoreCase(base.getDevice())))
+ return target;
+ int commonLength = target.matchingFirstSegments(base);
+ int differenceLength = base.segmentCount() - commonLength;
+ int newSegmentLength = (differenceLength + target.segmentCount())
+ - commonLength;
+ if (newSegmentLength == 0) {
+ return Path.EMPTY;
+ } else {
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < differenceLength; i++) {
+ sb.append("..").append(File.separator);
+ }
+ String[] segments = target.segments();
+ for (int i = commonLength; i < target.segmentCount(); i++) {
+ sb.append(segments[i]).append(File.separator);
+ }
+ return (new Path(sb.toString())).removeTrailingSeparator();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private static void commitStanza(IView view, IFile file) {
+ if (confirmEdit(file))
+ do
+ try {
+ view.commit();
+ break;
+ } catch (IllegalStateException _ex) {
+ if (!view.merge())
+ view.revert();
+ }
+ while (true);
+ else
+ view.revert();
+ }
+
+ private static boolean confirmEdit(IFile file) {
+ IWorkbench workbench = null;
+ try {
+ workbench = PlatformUI.getWorkbench();
+ } catch (IllegalStateException _ex) {
+ return true;
+ }
+ IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
+ if (window == null) {
+ IWorkbenchWindow windows[] = workbench.getWorkbenchWindows();
+ window = windows[0];
+ }
+ org.eclipse.swt.widgets.Shell shell = window.getShell();
+ IStatus status = ResourcesPlugin.getWorkspace().validateEdit(
+ new IFile[] { file }, shell);
+ return status == null || status.isOK();
+ }
+
+ public static String getProjectTemplate(IProject project)
+ throws CoreException {
+ return getProjectStorage(project, TEMPLATE, NAME);
+ }
+
+ public static void setProjectTemplate(IProject project, String template)
+ throws CoreException {
+ setProjectStorage(project, TEMPLATE, NAME, template);
+ }
+
+ public static String getProjectStorage(IProject project, String block,
+ String key) throws CoreException {
+ String id = CodegenUIPlugin.getDefault().getBundle().getSymbolicName();
+ ICProjectDescription lCPD = CCorePlugin.getDefault()
+ .getProjectDescription(project, true);
+ ICStorageElement element = lCPD.getStorage(id, true);
+ ICStorageElement[] blockArray = element.getChildrenByName(block);
+ if (blockArray != null) {
+ for (ICStorageElement blockElement : blockArray) {
+ String info = blockElement.getAttribute(key);
+ if (info != null && info.trim().length() > 0) {
+ return info;
+ }
+ }
+ }
+ return null;
+ }
+
+ public static void setProjectStorage(IProject project, String block,
+ String key, String value) throws CoreException {
+ String id = CodegenUIPlugin.getDefault().getBundle().getSymbolicName();
+ ICProjectDescription lCPD = CCorePlugin.getDefault()
+ .getProjectDescription(project, true);
+ ICStorageElement element = lCPD.getStorage(id, true);
+ ICStorageElement[] blockArray = element.getChildrenByName(block);
+ ICStorageElement targetBlock;
+ if (blockArray != null && blockArray.length > 0) {
+ targetBlock = blockArray[0];
+ } else {
+ targetBlock = element.createChild(block);
+ }
+ targetBlock.setAttribute(key, value);
+ lCPD.importStorage(id, element);
+ CCorePlugin.getDefault().getProjectDescriptionManager()
+ .setProjectDescription(project, lCPD, true,
+ new NullProgressMonitor());
+ }
+
+ public static Set<String> getTestFolders(IProject project, String template)
+ throws CoreException {
+ Set<String> lTestFolderSet = new LinkedHashSet<String>();
+ if (project != null && template != null) {
+ String folders = getProjectStorage(project, template, LOCATION);
+ if (folders != null) {
+ String[] folderArray = folders.trim().split(",");
+ for (String f : folderArray) {
+ lTestFolderSet.add(f.trim());
+ }
+ }
+ }
+ return lTestFolderSet;
+ }
+
+ public static void addTestFolders(IProject project, String template,
+ String testfolder) throws CoreException {
+ Set<String> folderSet = getTestFolders(project, template);
+ if (folderSet.contains(testfolder.trim())) {
+ return;
+ }
+ folderSet.add(testfolder);
+ StringBuilder sb = new StringBuilder();
+ for (String folder : folderSet) {
+ if (sb.length() == 0) {
+ sb.append(folder);
+ } else {
+ sb.append(",").append(folder);
+ }
+ }
+ setProjectStorage(project, template, LOCATION, sb.toString());
+ }
+
+ public static void removeTestFolders(IProject project, String template,
+ String testfolder) throws CoreException {
+ Set<String> folderSet = getTestFolders(project, template);
+ if (!folderSet.contains(testfolder.trim())) {
+ return;
+ }
+ folderSet.remove(testfolder);
+ StringBuilder sb = new StringBuilder();
+ for (String folder : folderSet) {
+ if (sb.length() == 0) {
+ sb.append(folder);
+ } else {
+ sb.append(",").append(folder);
+ }
+ }
+ setProjectStorage(project, template, LOCATION, sb.toString());
+ }
+
+ public static void renameTestFolders(IProject project, String template,
+ String oldfolder, String newfolder) throws CoreException {
+ Set<String> folderSet = getTestFolders(project, template);
+ if (!folderSet.contains(oldfolder)) {
+ return;
+ }
+ StringBuilder sb = new StringBuilder();
+ for (String folder : folderSet) {
+ if (folder.equals(oldfolder)) {
+ folder = newfolder;
+ }
+ if (sb.length() == 0) {
+ sb.append(folder);
+ } else {
+ sb.append(",").append(folder);
+ }
+ }
+ setProjectStorage(project, template, LOCATION, sb.toString());
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/parser/TranslationUnitCollector.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui.parser;
+
+import java.util.Collection;
+
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICElementVisitor;
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+final public class TranslationUnitCollector implements ICElementVisitor {
+ private final Collection<ITranslationUnit> fSources;
+ private final Collection<ITranslationUnit> fHeaders;
+ private final IProgressMonitor fProgressMonitor;
+
+ public TranslationUnitCollector(Collection<ITranslationUnit> sources,
+ Collection<ITranslationUnit> headers, IProgressMonitor pm) {
+ fSources = sources;
+ fHeaders = headers;
+ fProgressMonitor = pm;
+ }
+
+ public boolean visit(ICElement element) throws CoreException {
+ if (fProgressMonitor.isCanceled()) {
+ return false;
+ }
+ switch (element.getElementType()) {
+ case ICElement.C_UNIT:
+ ITranslationUnit tu = (ITranslationUnit) element;
+ if (fSources != null && tu.isSourceUnit()) {
+ fSources.add(tu);
+ } else if (fHeaders != null && tu.isHeaderUnit()) {
+ fHeaders.add(tu);
+ }
+ return false;
+ case ICElement.C_CCONTAINER:
+ case ICElement.C_PROJECT:
+ return true;
+ }
+ return false;
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/parser/model/IUINode.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.codegen.ui.parser.model;
+
+import org.eclipse.cdt.core.model.ICElement;
+
+public interface IUINode {
+
+ /**
+ *
+ * @return if this object is selected by user
+ */
+ public boolean isSelected();
+
+ /**
+ * Set the flag of whether object is selected by user
+ */
+ public void setSelected(boolean selected);
+
+ /**
+ *
+ * @return if this object is selected by user
+ */
+ public boolean isVisible();
+
+ /**
+ * Set the flag of whether object is selected by user
+ */
+ public void setVisible(boolean visible);
+
+ /**
+ * Get ICElement
+ *
+ * @return storage
+ */
+ public ICElement getICElement();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/parser/model/UIClassNode.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.parser.model;
+
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.IStructure;
+
+import com.nokia.testfw.codegen.model.ClassNodeImpl;
+import com.nokia.testfw.codegen.model.INode;
+
+/**
+ * @author k21wang
+ *
+ */
+public class UIClassNode extends ClassNodeImpl implements IUINode {
+
+ private ICElement iCElement;
+
+ /**
+ * @param classDec
+ * @param parent
+ */
+ public UIClassNode(IStructure classDec, UIProjectNode parent) {
+ super(classDec.getElementName(), parent);
+ iCElement = classDec;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.testfw.codegen.ui.parser.model.IUINode#getData()
+ */
+ public ICElement getICElement() {
+ return iCElement;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.testfw.codegen.ui.parser.model.IUINode#isSelected()
+ */
+ public boolean isSelected() {
+ boolean lSelected = false;
+ for (INode child : getChildren()) {
+ if (child instanceof IUINode) {
+ if (((IUINode) child).isSelected()) {
+ lSelected = true;
+ break;
+ }
+ } else {
+ lSelected = true;
+ break;
+ }
+ }
+ return lSelected;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.testfw.codegen.ui.parser.model.IUINode#setSelected(boolean)
+ */
+ public void setSelected(boolean selected) {
+ for (INode child : getChildren()) {
+ if (child instanceof IUINode) {
+ ((IUINode) child).setSelected(selected);
+ }
+ }
+ }
+
+ public boolean isVisible() {
+ boolean isVisible = false;
+ for (INode child : getChildren()) {
+ if (child instanceof IUINode) {
+ if (((IUINode) child).isVisible()) {
+ isVisible = true;
+ break;
+ }
+ } else {
+ isVisible = true;
+ break;
+ }
+ }
+ return isVisible;
+ }
+
+ public void setVisible(boolean visible) {
+ for (INode child : getChildren()) {
+ if (child instanceof IUINode) {
+ ((IUINode) child).setVisible(visible);
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/parser/model/UIMethodNode.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.parser.model;
+
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.IMethodDeclaration;
+
+import com.nokia.testfw.codegen.model.MethodNodeImpl;
+
+/**
+ * @author k21wang
+ *
+ */
+public class UIMethodNode extends MethodNodeImpl implements IUINode {
+
+ private boolean iSelected = true;
+
+ private boolean isVisible = true;
+
+ private ICElement iCElement;
+
+ /**
+ * @param methodDec
+ * @param parent
+ */
+ public UIMethodNode(IMethodDeclaration methodDec, UIClassNode parent) {
+ super(methodDec.getElementName(), parent);
+ iCElement = methodDec;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.testfw.codegen.ui.parser.model.IUINode#getData()
+ */
+ public ICElement getICElement() {
+ return iCElement;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.testfw.codegen.ui.parser.model.IUINode#isSelected()
+ */
+ public boolean isSelected() {
+ return iSelected;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.testfw.codegen.ui.parser.model.IUINode#setSelected(boolean)
+ */
+ public void setSelected(boolean selected) {
+ iSelected = selected;
+ }
+
+ public boolean isVisible() {
+ return isVisible;
+ }
+
+ public void setVisible(boolean visible) {
+ isVisible = visible;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/parser/model/UIProjectNode.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.parser.model;
+
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+
+import com.nokia.testfw.codegen.model.INode;
+import com.nokia.testfw.codegen.model.ProjectNodeImpl;
+
+/**
+ * @author k21wang
+ *
+ */
+public class UIProjectNode extends ProjectNodeImpl implements IUINode {
+
+ private ICElement iCElement;
+
+ /**
+ * @param arg0
+ */
+ public UIProjectNode(ICProject project) {
+ super(project.getElementName());
+ iCElement = project;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.testfw.codegen.ui.parser.model.IUINode#getData()
+ */
+ public ICElement getICElement() {
+ return iCElement;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.testfw.codegen.ui.parser.model.IUINode#isSelected()
+ */
+ public boolean isSelected() {
+ boolean lSelected = false;
+ for (INode child : getChildren()) {
+ if (child instanceof IUINode) {
+ if (((IUINode) child).isSelected()) {
+ lSelected = true;
+ break;
+ }
+ } else {
+ lSelected = true;
+ break;
+ }
+ }
+ return lSelected;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.testfw.codegen.ui.parser.model.IUINode#setSelected(boolean)
+ */
+ public void setSelected(boolean selected) {
+ for (INode child : getChildren()) {
+ if (child instanceof IUINode) {
+ ((IUINode) child).setSelected(selected);
+ }
+ }
+ }
+
+ public boolean isVisible() {
+ boolean isVisible = false;
+ for (INode child : getChildren()) {
+ if (child instanceof IUINode) {
+ if (((IUINode) child).isVisible()) {
+ isVisible = true;
+ break;
+ }
+ } else {
+ isVisible = true;
+ break;
+ }
+ }
+ return isVisible;
+ }
+
+ public void setVisible(boolean visible) {
+ for (INode child : getChildren()) {
+ if (child instanceof IUINode) {
+ ((IUINode) child).setVisible(visible);
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/popup/actions/STFNewTestWizardAction.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.testfw.codegen.ui.popup.actions;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+import com.nokia.testfw.codegen.ui.wizard.STFNewTestWizard;
+
+/**
+ * Test Case Wizard class
+ *
+ */
+public class STFNewTestWizardAction implements IObjectActionDelegate {
+
+ IWorkbenchPart part;
+ ISelection selection;
+
+ /*
+ * Constructor
+ */
+ public STFNewTestWizardAction() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.
+ * action.IAction, org.eclipse.ui.IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ this.part = targetPart;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+
+ if (selection instanceof IStructuredSelection) {
+ STFNewTestWizard wizard = new STFNewTestWizard();
+ String title;
+
+ IStructuredSelection sel = (IStructuredSelection) selection;
+ if (sel.getFirstElement() instanceof IResource) {
+ wizard.setShowNewProjectPage(false);
+ title = "New Symbian Test Framework Test Class Wizard";
+ } else {
+ wizard.setShowNewProjectPage(false);
+ wizard.setShowNewModulePage(false);
+ title = "New Symbian Test Framework Test Case Wizard";
+ }
+ wizard
+ .init(part.getSite().getWorkbenchWindow().getWorkbench(),
+ sel);
+ // Instantiates the wizard container with the wizard and
+ // opens it
+ WizardDialog dialog = new WizardDialog(part.getSite().getShell(),
+ wizard);
+ dialog.setTitle(title);
+ dialog.create();
+ dialog.open();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action
+ * .IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ this.selection = selection;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/popup/actions/SUTNewTestWizardAction.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.testfw.codegen.ui.popup.actions;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.core.model.IMethodDeclaration;
+import org.eclipse.cdt.core.model.IStructure;
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+import com.nokia.testfw.codegen.ui.wizard.SUTNewTestWizard;
+
+/**
+ * Test Case Wizard class
+ *
+ */
+public class SUTNewTestWizardAction implements IObjectActionDelegate {
+
+ IWorkbenchPart part;
+ ISelection selection;
+
+ /*
+ * Constructor
+ */
+ public SUTNewTestWizardAction() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.
+ * action.IAction, org.eclipse.ui.IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ this.part = targetPart;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection sel = (IStructuredSelection) selection;
+ Object[] elements = sel.toArray();
+ Set<ICProject> projectSet = new HashSet<ICProject>();
+ for (Object element : elements) {
+ projectSet.add(((ICElement) element).getCProject());
+ if (element instanceof ITranslationUnit) {
+ if (!((ITranslationUnit) element).isHeaderUnit()) {
+ MessageBox box = new MessageBox(new Shell(),
+ SWT.ICON_ERROR);
+ box.setText("Impossible to generate test cases");
+ box
+ .setMessage("SymbianUnitTest Case Wizard works only with header files.");
+ box.open();
+ return;
+ }
+ }
+ if (element instanceof IMethodDeclaration
+ && !(((IMethodDeclaration) element).getParent() instanceof IStructure)) {
+ MessageBox box = new MessageBox(new Shell(), SWT.ICON_ERROR);
+ box.setText("Impossible to generate test cases");
+ box
+ .setMessage("SymbianUnitTest Case Wizard works only with header files.");
+ box.open();
+ return;
+ }
+ }
+ if (projectSet.size() > 1) {
+ MessageBox box = new MessageBox(new Shell(), SWT.ICON_ERROR);
+ box.setText("Impossible to generate test cases");
+ box
+ .setMessage("SymbianUnitTest Case Wizard works only with single project.");
+ box.open();
+ return;
+ }
+
+ SUTNewTestWizard wizard = new SUTNewTestWizard();
+ wizard.setShowChooseProjectPage(false);
+ wizard
+ .init(part.getSite().getWorkbenchWindow().getWorkbench(),
+ sel);
+ // Instantiates the wizard container with the wizard and
+ // opens it
+ WizardDialog dialog = new WizardDialog(part.getSite().getShell(),
+ wizard);
+ dialog.setTitle("New SymbianUnitTest Case(s) Wizard");
+ dialog.create();
+ dialog.open();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action
+ * .IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ this.selection = selection;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/preferences/PreferenceConstants.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.codegen.ui.preferences;
+
+/**
+ * Constant definitions for plug-in preferences
+ */
+public class PreferenceConstants {
+
+ public static final String UID3_MIN_VALUE = "uid3_min_value";
+
+ public static final String UID3_MAX_VALUE = "uid3_max_value";
+
+ public static final String AUTHER = "auther";
+
+ public static final String COPYRIGHT = "copyright";
+
+ public static final String TEST_FOLDER_NAME = "test_folder_name";
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/preferences/PreferenceInitializer.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+import com.nokia.testfw.codegen.ui.CodegenUIPlugin;
+
+/**
+ * Class used to initialize default preference values.
+ */
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#
+ * initializeDefaultPreferences()
+ */
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = CodegenUIPlugin.getDefault()
+ .getPreferenceStore();
+ store.setDefault(PreferenceConstants.TEST_FOLDER_NAME, "tsrc");
+ store.setDefault(PreferenceConstants.UID3_MAX_VALUE, "0x0EFFFFFF");
+ store.setDefault(PreferenceConstants.UID3_MIN_VALUE, "0x0E000000");
+ store.setDefault(PreferenceConstants.AUTHER, System
+ .getProperty("user.name"));
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/preferences/PreferenceUtil.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui.preferences;
+
+import java.io.File;
+import java.util.Random;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+
+import com.nokia.testfw.codegen.ui.CodegenUIPlugin;
+
+public class PreferenceUtil {
+ private static IPreferenceStore preferenceStore = CodegenUIPlugin
+ .getDefault().getPreferenceStore();
+ private static Random random = new Random();
+ private static int minValue;
+ private static int maxValue;
+ private static final int HEX_PREFIX_LEN = "0x".length();
+
+ public static String getTestFolderName(String base) {
+ String folder = CodegenUIPlugin.getDefault().getPreferenceStore()
+ .getString(PreferenceConstants.TEST_FOLDER_NAME).trim();
+ if (base == null) {
+ return folder;
+ } else {
+ return base + File.separator + folder;
+ }
+ }
+
+ private static void updateMaxMinValue() {
+ String hexMin = preferenceStore
+ .getString(PreferenceConstants.UID3_MIN_VALUE);
+ minValue = Integer.decode(hexMin).intValue();
+ String hexMax = preferenceStore
+ .getString(PreferenceConstants.UID3_MAX_VALUE);
+ maxValue = Integer.decode(hexMax).intValue();
+ }
+
+ public static String getRandomAppUID() {
+ updateMaxMinValue();
+ int value = Math.abs(random.nextInt());
+ value = value % (maxValue - minValue) + minValue;
+ return createCanonicalHexString(value);
+ }
+
+ public static String createCanonicalHexString(int value) {
+ char ZEROS[] = { '0', '0', '0', '0', '0', '0', '0', '0' };
+ String unprocessedHex = Long.toHexString(value).toUpperCase();
+ StringBuffer buf = new StringBuffer(10);
+ buf.append("0x");
+ int numSigDigits = unprocessedHex.length();
+ int numLeadingZeros = 8 - numSigDigits;
+ if (numLeadingZeros > 0)
+ buf.append(ZEROS, 0, numLeadingZeros);
+ buf.append(unprocessedHex);
+ return buf.toString();
+ }
+
+ public static boolean validateAppUIDValue(int value) {
+ updateMaxMinValue();
+ return value >= minValue && value <= maxValue;
+ }
+
+ public static boolean validateAppUIDText(String text) {
+ if(text.length()<2){
+ return false;
+ }
+ if (!text.substring(0, HEX_PREFIX_LEN).equalsIgnoreCase("0x"))
+ return false;
+ String valueText = text.substring(HEX_PREFIX_LEN);
+ int value = -1;
+ try {
+ value = Integer.parseInt(valueText, 16);
+ } catch (NumberFormatException _ex) {
+ }
+ return PreferenceUtil.validateAppUIDValue(value);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/preferences/TESTFWPropertiesPreferencePage.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,238 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui.preferences;
+
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+import com.nokia.testfw.codegen.ui.CodegenUIPlugin;
+import com.nokia.testfw.codegen.ui.preferences.PreferenceConstants;
+import com.nokia.testfw.codegen.ui.preferences.PreferenceUtil;
+import com.nokia.testfw.codegen.ui.Messages;
+
+public class TESTFWPropertiesPreferencePage extends FieldEditorPreferencePage
+ implements IWorkbenchPreferencePage {
+
+ public StringFieldEditor iTestFolderName;
+ public HexFieldEditor iUID3MaxValue;
+ public HexFieldEditor iUID3MinValue;
+ public StringFieldEditor iAutherName;
+
+ public TESTFWPropertiesPreferencePage() {
+ super(GRID);
+ setPreferenceStore(CodegenUIPlugin.getDefault().getPreferenceStore());
+ setDescription(Messages
+ .getString("TESTFWPropertiesPreferencePage.Description"));
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+
+ @Override
+ protected void createFieldEditors() {
+
+ iTestFolderName = new StringFieldEditor(
+ PreferenceConstants.TEST_FOLDER_NAME,
+ Messages
+ .getString("TESTFWPropertiesPreferencePage.TestFolder.Name"),
+ getFieldEditorParent()) {
+ protected boolean doCheckState() {
+ String testFolderName = getTextControl().getText();
+ if (!testFolderName.matches("[\\w]*")) {
+ setErrorMessage(Messages
+ .getString("TESTFWPropertiesPreferencePage.TestFolder.Error"));
+ return false;
+ }
+ return true;
+ }
+ };
+
+ iUID3MaxValue = new HexFieldEditor(
+ PreferenceConstants.UID3_MAX_VALUE,
+ Messages
+ .getString("TESTFWPropertiesPreferencePage.UID3.MaxValue"),
+ getFieldEditorParent()) {
+ protected boolean doCheckState() {
+ if (super.doCheckState()) {
+ if (iUID3MaxValue.getIntValue() < iUID3MinValue
+ .getIntValue()) {
+ setErrorMessage(Messages
+ .getString("TESTFWPropertiesPreferencePage.UID3.Error1"));
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ Messages.getString(
+ "TESTFWPropertiesPreferencePage.UIDHexError",
+ iUID3MaxValue.getStringValue());
+ return false;
+ }
+ }
+ };
+
+ iUID3MinValue = new HexFieldEditor(
+ PreferenceConstants.UID3_MIN_VALUE,
+ Messages
+ .getString("TESTFWPropertiesPreferencePage.UID3.MinValue"),
+ getFieldEditorParent()) {
+ protected boolean doCheckState() {
+ if (super.doCheckState()) {
+ if (iUID3MinValue.getIntValue() > iUID3MaxValue
+ .getIntValue()) {
+ setErrorMessage(Messages
+ .getString("TESTFWPropertiesPreferencePage.UID3.Error2"));
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ Messages.getString(
+ "TESTFWPropertiesPreferencePage.UIDHexError",
+ iUID3MinValue.getStringValue());
+ return false;
+ }
+ }
+ };
+
+ iAutherName = new StringFieldEditor(PreferenceConstants.AUTHER,
+ Messages.getString("TESTFWPropertiesPreferencePage.Author"),
+ getFieldEditorParent());
+
+ iTestFolderName.setEmptyStringAllowed(false);
+ iUID3MaxValue.setEmptyStringAllowed(false);
+ iUID3MinValue.setEmptyStringAllowed(false);
+ iAutherName.setEmptyStringAllowed(true);
+
+ addField(iTestFolderName);
+ addField(iUID3MaxValue);
+ addField(iUID3MinValue);
+ addField(iAutherName);
+ }
+
+ public boolean performOk() {
+ //CodegenUIPlugin.getDefault().savePluginPreferences();
+ return super.performOk();
+ }
+
+ public class HexFieldEditor extends StringFieldEditor {
+
+ private int minValidValue = 0;
+ private int maxValidValue = Integer.MAX_VALUE;
+ private static final int DEFAULT_TEXT_LIMIT = 10;
+
+ protected HexFieldEditor() {
+ }
+
+ public HexFieldEditor(String name, String labelText, Composite parent) {
+ this(name, labelText, parent, DEFAULT_TEXT_LIMIT);
+ }
+
+ public HexFieldEditor(String name, String labelText, Composite parent,
+ int textLimit) {
+ init(name, labelText);
+ setTextLimit(textLimit);
+ setEmptyStringAllowed(false);
+ setErrorMessage(Messages
+ .getString("TESTFWPropertiesPreferencePage.UIDHexError3"));
+ createControl(parent);
+ final Text text = getTextControl();
+ text.addFocusListener(new FocusAdapter() {
+ public void focusLost(FocusEvent event) {
+ String hexString = text.getText();
+ int number = -1;
+ try {
+ number = Integer.decode(hexString).intValue();
+ hexString = PreferenceUtil
+ .createCanonicalHexString(number);
+ text.setText(hexString);
+ } catch (NumberFormatException _ex) {
+ }
+ }
+ });
+ }
+
+ public void setValidRange(int min, int max) {
+ minValidValue = min;
+ maxValidValue = max;
+ setErrorMessage(Messages.getString(
+ "TESTFWPropertiesPreferencePage.UIDHexError2",
+ new Object[] { Integer.toHexString(min),
+ Integer.toHexString(max) }));
+ }
+
+ protected boolean checkState() {
+ String hexString;
+ Text text = getTextControl();
+ if (text == null)
+ return false;
+ hexString = text.getText();
+ int number = -1;
+ try {
+ number = Integer.decode(hexString).intValue();
+ } catch (NumberFormatException _ex) {
+ showErrorMessage();
+ return false;
+ }
+ if (number < minValidValue || number > maxValidValue) {
+ showErrorMessage();
+ return false;
+ }
+ clearErrorMessage();
+ return true;
+ }
+
+ protected void doLoad() {
+ Text text = getTextControl();
+ if (text != null) {
+ String strHex = getPreferenceStore().getString(
+ getPreferenceName());
+ text.setText(strHex);
+ oldValue = strHex;
+ }
+ }
+
+ protected void doLoadDefault() {
+ Text text = getTextControl();
+ if (text != null) {
+ String strHex = getPreferenceStore().getString(
+ getPreferenceName());
+ text.setText(strHex);
+ }
+ valueChanged();
+ }
+
+ protected void doStore() {
+ Text text = getTextControl();
+ if (text != null) {
+ getPreferenceStore().setValue(getPreferenceName(),
+ text.getText());
+ }
+ }
+
+ public int getIntValue() throws NumberFormatException {
+ return Integer.decode(getStringValue()).intValue();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/preferences/TESTFWTemplatePreferencePage.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,770 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.preferences;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.text.Collator;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.eclipse.cdt.internal.ui.editor.CSourceViewer;
+import org.eclipse.cdt.internal.ui.preferences.CSourcePreviewerUpdater;
+import org.eclipse.cdt.internal.ui.preferences.CodeTemplateSourceViewerConfiguration;
+import org.eclipse.cdt.internal.ui.text.CTextTools;
+import org.eclipse.cdt.internal.ui.text.template.TemplateVariableProcessor;
+import org.eclipse.cdt.internal.ui.util.PixelConverter;
+import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.persistence.TemplatePersistenceData;
+import org.eclipse.jface.text.templates.persistence.TemplateReaderWriter;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.ui.internal.texteditor.NLSUtility;
+import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.PlatformUI;
+
+import com.nokia.testfw.codegen.ui.CodegenUIPlugin;
+import com.nokia.testfw.codegen.templates.TemplateLoader;
+import com.nokia.testfw.codegen.ui.Messages;
+import com.nokia.testfw.codegen.ui.util.PathNode;
+import com.nokia.testfw.codegen.ui.util.PathNodeConverter;
+
+/**
+ * This class represents a preference page that is contributed to the
+ * Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>, we
+ * can use the field support built into JFace that allows us to create a page
+ * that is small and knows how to save, restore and apply itself.
+ * <p>
+ * This page is used to modify preferences only. They are stored in the
+ * preference store that belongs to the main plug-in class. That way,
+ * preferences can be accessed directly via the preference store.
+ */
+
+@SuppressWarnings("restriction")
+public class TESTFWTemplatePreferencePage extends TemplatePreferencePage
+ implements IWorkbenchPreferencePage {
+
+ private class TESTFWTemplateAdapter implements ITreeContentProvider,
+ ISelectionChangedListener, IDoubleClickListener {
+
+ private final Object NO_CHILDREN[];
+
+ TESTFWTemplateAdapter() {
+ super();
+ NO_CHILDREN = new Object[0];
+ }
+
+ public Object[] getChildren(Object obj) {
+ if (obj instanceof PathNode)
+ return ((PathNode) obj).getChildren();
+ else
+ return NO_CHILDREN;
+ }
+
+ public Object getParent(Object obj) {
+ if (obj instanceof PathNode)
+ return ((PathNode) obj).getParent();
+ else
+ return null;
+ }
+
+ public boolean hasChildren(Object obj) {
+ if (obj instanceof PathNode)
+ return ((PathNode) obj).getChildren().length > 0;
+ else
+ return false;
+ }
+
+ public Object[] getElements(Object obj) {
+ if (obj instanceof TemplateStore) {
+ return convertToPathTree((TemplateStore) obj).getChildren();
+ }
+ return NO_CHILDREN;
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object obj, Object obj1) {
+ }
+
+ public void selectionChanged(SelectionChangedEvent selectionchangedevent) {
+ updateButtons();
+ updateViewerInput();
+ }
+
+ public void doubleClick(DoubleClickEvent doubleclickevent) {
+ if (canEdit()) {
+ edit();
+ }
+ }
+ }
+
+ private static class TESTFWTemplateLabelProvider extends LabelProvider {
+
+ @SuppressWarnings("deprecation")
+ public Image getImage(Object obj) {
+ if (obj instanceof PathNode) {
+ PathNode node = (PathNode) obj;
+ if (node.getData() != null) {
+ return PlatformUI.getWorkbench().getSharedImages()
+ .getImage(ISharedImages.IMG_OBJ_FILE);
+ }
+ if (node.getParent().getParent() == null) {
+ return PlatformUI.getWorkbench().getSharedImages()
+ .getImage(ISharedImages.IMG_OBJ_PROJECT);
+ } else {
+ return PlatformUI.getWorkbench().getSharedImages()
+ .getImage(ISharedImages.IMG_OBJ_FOLDER);
+ }
+ }
+ return null;
+ }
+
+ public String getText(Object obj) {
+ if (obj instanceof PathNode)
+ return ((PathNode) obj).getName();
+ return null;
+ }
+ }
+
+ /** The tree presenting the templates. */
+ public TreeViewer iTreeViewer;
+
+ /* buttons */
+ public Button iAddButton;
+ public Button iEditButton;
+ public Button iImportButton;
+ public Button iExportButton;
+ public Button iRemoveButton;
+ public Button iRestoreButton;
+ public Button iRevertButton;
+
+ private SourceViewer iPatternViewer;
+ private TemplateVariableProcessor iTemplateProcessor;
+
+ public TESTFWTemplatePreferencePage() {
+ setPreferenceStore(CodegenUIPlugin.getDefault().getPreferenceStore());
+ setTemplateStore(CodegenUIPlugin.getDefault().getTemplateStore());
+ setContextTypeRegistry(CodegenUIPlugin.getDefault()
+ .getContextTypeRegistry());
+ iTemplateProcessor = new TemplateVariableProcessor();
+ }
+
+ protected boolean isShowFormatterSetting() {
+ return false;
+ }
+
+ public boolean performOk() {
+
+ boolean ok = super.performOk();
+
+ //CodegenUIPlugin.getDefault().savePluginPreferences();
+
+ return ok;
+ }
+
+ protected Control createContents(Composite ancestor) {
+ Composite parent = new Composite(ancestor, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ parent.setLayout(layout);
+
+ Composite innerParent = new Composite(parent, SWT.NONE);
+ GridLayout innerLayout = new GridLayout();
+ innerLayout.numColumns = 2;
+ innerLayout.marginHeight = 0;
+ innerLayout.marginWidth = 0;
+ innerParent.setLayout(innerLayout);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 2;
+ innerParent.setLayoutData(gd);
+
+ Composite treeComposite = new Composite(innerParent, SWT.NONE);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.widthHint = 360;
+ data.heightHint = convertHeightInCharsToPixels(10);
+ treeComposite.setLayoutData(data);
+
+ FillLayout treeLayout = new FillLayout();
+ treeComposite.setLayout(treeLayout);
+
+ TESTFWTemplateAdapter adapter = new TESTFWTemplateAdapter();
+
+ iTreeViewer = new TreeViewer(treeComposite, SWT.BORDER | SWT.H_SCROLL
+ | SWT.V_SCROLL);
+ iTreeViewer.setLabelProvider(new TESTFWTemplateLabelProvider());
+ iTreeViewer.setContentProvider(adapter);
+ iTreeViewer.addSelectionChangedListener(adapter);
+ iTreeViewer.addDoubleClickListener(adapter);
+
+ iTreeViewer.setComparator(new ViewerComparator() {
+ public int compare(Viewer viewer, Object object1, Object object2) {
+ if ((object1 instanceof PathNode)
+ && (object2 instanceof PathNode)) {
+ String leftName = ((PathNode) object1).getName();
+ String rightName = ((PathNode) object2).getName();
+ int result = Collator.getInstance().compare(leftName,
+ rightName);
+ return result;
+ }
+ return super.compare(viewer, object1, object2);
+ }
+
+ public boolean isSorterProperty(Object element, String property) {
+ return true;
+ }
+ });
+
+ Composite buttons = new Composite(innerParent, SWT.NONE);
+ buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
+ layout = new GridLayout();
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ buttons.setLayout(layout);
+
+ iAddButton = new Button(buttons, SWT.PUSH);
+ iAddButton.setText(Messages.getString("TemplatePreferencePage_new"));
+ iAddButton.setLayoutData(new GridData(768));
+ iAddButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event e) {
+ add();
+ }
+ });
+
+ iEditButton = new Button(buttons, SWT.PUSH);
+ iEditButton.setText(Messages.getString("TemplatePreferencePage_edit"));
+ iEditButton.setLayoutData(new GridData(768));
+ iEditButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event e) {
+ edit();
+ }
+ });
+
+ iRemoveButton = new Button(buttons, SWT.PUSH);
+ iRemoveButton.setText(Messages
+ .getString("TemplatePreferencePage_remove"));
+ iRemoveButton.setLayoutData(new GridData(768));
+ iRemoveButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event e) {
+ remove();
+ }
+ });
+
+ createSeparator(buttons);
+
+ iRestoreButton = new Button(buttons, SWT.PUSH);
+ iRestoreButton.setText(Messages
+ .getString("TemplatePreferencePage_restore"));
+ iRestoreButton.setLayoutData(new GridData(768));
+ iRestoreButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event e) {
+ restoreDeleted();
+ }
+ });
+
+ iRevertButton = new Button(buttons, SWT.PUSH);
+ iRevertButton.setText(Messages
+ .getString("TemplatePreferencePage_revert"));
+ iRevertButton.setLayoutData(new GridData(768));
+ iRevertButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event e) {
+ revert();
+ }
+ });
+
+ createSeparator(buttons);
+
+ iImportButton = new Button(buttons, SWT.PUSH);
+ iImportButton.setText(Messages
+ .getString("TemplatePreferencePage_import"));
+ iImportButton.setLayoutData(new GridData(768));
+ iImportButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event e) {
+ import_();
+ }
+ });
+
+ iExportButton = new Button(buttons, SWT.PUSH);
+ iExportButton.setText(Messages
+ .getString("TemplatePreferencePage_export"));
+ iExportButton.setLayoutData(new GridData(768));
+ iExportButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event e) {
+ export();
+ }
+ });
+
+ iPatternViewer = createViewer(parent, 2);
+
+ iTreeViewer.setInput(getTemplateStore());
+
+ updateButtons();
+ Dialog.applyDialogFont(parent);
+ innerParent.layout();
+
+ return parent;
+ }
+
+ private Label createSeparator(Composite parent) {
+ Label separator = new Label(parent, 0);
+ separator.setVisible(false);
+ GridData gd = new GridData();
+ gd.horizontalAlignment = 4;
+ gd.verticalAlignment = 1;
+ gd.heightHint = 4;
+ separator.setLayoutData(gd);
+ return separator;
+ }
+
+ private void add() {
+
+ Iterator<?> it = getContextTypeRegistry().contextTypes();
+ if (it.hasNext()) {
+ Template template = new Template(
+ "", "", ((TemplateContextType) it.next()).getId(), "", true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ Template newTemplate = editTemplate(template, false, true);
+ if (newTemplate != null) {
+ TemplatePersistenceData data = new TemplatePersistenceData(
+ newTemplate, true);
+ getTemplateStore().add(data);
+ iTreeViewer.refresh();
+ iTreeViewer.setSelection(new StructuredSelection(data));
+ }
+ }
+ }
+
+ protected boolean canEdit() {
+ IStructuredSelection selection = (IStructuredSelection) iTreeViewer
+ .getSelection();
+
+ return (selection.size() == 1 && (((PathNode) selection
+ .getFirstElement()).getData() != null));
+ }
+
+ private void edit() {
+ IStructuredSelection selection = (IStructuredSelection) iTreeViewer
+ .getSelection();
+
+ Object[] objects = selection.toArray();
+ if ((objects == null) || (objects.length != 1))
+ return;
+
+ TemplatePersistenceData data = (TemplatePersistenceData) ((PathNode) selection
+ .getFirstElement()).getData();
+ if (data != null)
+ edit(data);
+ }
+
+ private void edit(TemplatePersistenceData data) {
+ Template oldTemplate = data.getTemplate();
+ Template newTemplate = editTemplate(new Template(oldTemplate), true,
+ true);
+ if (newTemplate != null) {
+
+ if (!newTemplate.getName().equals(oldTemplate.getName())
+ && MessageDialog
+ .openQuestion(
+ getShell(),
+ Messages
+ .getString("TemplatePreferencePage_question_create_new_title"),
+ Messages
+ .getString("TemplatePreferencePage_question_create_new_message"))) {
+ data = new TemplatePersistenceData(newTemplate, true);
+ getTemplateStore().add(data);
+ iTreeViewer.refresh();
+ } else {
+ data.setTemplate(newTemplate);
+ iTreeViewer.refresh(data);
+ }
+ selectionChanged();
+ iTreeViewer.setSelection(new StructuredSelection(data));
+ }
+ }
+
+ protected boolean canRemove() {
+ IStructuredSelection selection = (IStructuredSelection) iTreeViewer
+ .getSelection();
+
+ if (selection.size() == 1
+ && (((PathNode) selection.getFirstElement()).getData() != null)) {
+ TemplatePersistenceData data = (TemplatePersistenceData) ((PathNode) selection
+ .getFirstElement()).getData();
+ return data.isUserAdded();
+ } else {
+ return false;
+ }
+ }
+
+ private void remove() {
+ IStructuredSelection selection = (IStructuredSelection) iTreeViewer
+ .getSelection();
+
+ Iterator<?> elements = selection.iterator();
+ while (elements.hasNext()) {
+ TemplatePersistenceData data = (TemplatePersistenceData) ((PathNode) elements
+ .next()).getData();
+ getTemplateStore().delete(data);
+ }
+
+ iTreeViewer.refresh();
+ }
+
+ private void restoreDeleted() {
+ getTemplateStore().restoreDeleted();
+ iTreeViewer.refresh();
+ updateButtons();
+ }
+
+ private void revert() {
+ IStructuredSelection selection = (IStructuredSelection) iTreeViewer
+ .getSelection();
+
+ Iterator<?> elements = selection.iterator();
+ while (elements.hasNext()) {
+ TemplatePersistenceData data = (TemplatePersistenceData) ((PathNode) elements
+ .next()).getData();
+ data.revert();
+ }
+
+ selectionChanged();
+ iTreeViewer.refresh();
+ }
+
+ private void import_() {
+ FileDialog dialog = new FileDialog(getShell());
+ dialog.setText(Messages
+ .getString("TemplatePreferencePage_import_title"));
+ dialog.setFilterExtensions(new String[] { Messages
+ .getString("TemplatePreferencePage_import_extension") });
+ String path = dialog.open();
+
+ if (path == null)
+ return;
+
+ try {
+ TemplateReaderWriter reader = new TemplateReaderWriter();
+ File file = new File(path);
+ if (file.exists()) {
+ InputStream input = new BufferedInputStream(
+ new FileInputStream(file));
+ try {
+ TemplatePersistenceData[] datas = reader.read(input, null);
+ for (int i = 0; i < datas.length; i++) {
+ TemplatePersistenceData data = datas[i];
+ getTemplateStore().add(data);
+ }
+ } finally {
+ try {
+ input.close();
+ } catch (IOException x) {
+ // ignore
+ }
+ }
+ }
+
+ iTreeViewer.refresh();
+
+ } catch (FileNotFoundException e) {
+ openReadErrorDialog();
+ } catch (IOException e) {
+ openReadErrorDialog();
+ }
+ }
+
+ private void export() {
+ IStructuredSelection selection = (IStructuredSelection) iTreeViewer
+ .getSelection();
+ Object[] nodes = selection.toArray();
+
+ Set<TemplatePersistenceData> dataSet = new HashSet<TemplatePersistenceData>();
+ for (int i = 0; i != nodes.length; i++) {
+ dataSet.addAll(getChildrenTemplate((PathNode) nodes[i]));
+ }
+ export(dataSet.toArray(new TemplatePersistenceData[0]));
+ }
+
+ private void export(TemplatePersistenceData[] templates) {
+ FileDialog dialog = new FileDialog(getShell(), SWT.SAVE);
+ dialog.setText(Messages
+ .getString("TemplatePreferencePage_export_title"));
+ dialog.setFilterExtensions(new String[] { Messages
+ .getString("TemplatePreferencePage_export_extension") });
+ dialog.setFileName(Messages
+ .getString("TemplatePreferencePage_export_filename"));
+ String path = dialog.open();
+
+ if (path == null)
+ return;
+
+ File file = new File(path);
+
+ if (file.isHidden()) {
+ String title = Messages
+ .getString("TemplatePreferencePage_export_error_title");
+ String message = NLSUtility.format(Messages
+ .getString("TemplatePreferencePage_export_error_hidden"),
+ file.getAbsolutePath());
+ MessageDialog.openError(getShell(), title, message);
+ return;
+ }
+
+ if (file.exists() && !file.canWrite()) {
+ String title = Messages
+ .getString("TemplatePreferencePage_export_error_title");
+ String message = NLSUtility
+ .format(
+ Messages
+ .getString("TemplatePreferencePage_export_error_canNotWrite"),
+ file.getAbsolutePath());
+ MessageDialog.openError(getShell(), title, message);
+ return;
+ }
+
+ if (!file.exists() || confirmOverwrite(file)) {
+ OutputStream output = null;
+ try {
+ output = new BufferedOutputStream(new FileOutputStream(file));
+ TemplateReaderWriter writer = new TemplateReaderWriter();
+ writer.save(templates, output);
+ } catch (IOException e) {
+ openWriteErrorDialog();
+ } finally {
+ if (output != null) {
+ try {
+ output.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
+ }
+ }
+
+ private boolean confirmOverwrite(File file) {
+ return MessageDialog
+ .openQuestion(
+ getShell(),
+ Messages
+ .getString("TemplatePreferencePage_export_exists_title"),
+ NLSUtility
+ .format(
+ Messages
+ .getString("TemplatePreferencePage_export_exists_message"),
+ file.getAbsolutePath()));
+ }
+
+ private void openReadErrorDialog() {
+ String title = Messages
+ .getString("TemplatePreferencePage_error_read_title");
+ String message = Messages
+ .getString("TemplatePreferencePage_error_read_message");
+ MessageDialog.openError(getShell(), title, message);
+ }
+
+ /*
+ * @since 3.2
+ */
+ private void openWriteErrorDialog() {
+ String title = Messages
+ .getString("TemplatePreferencePage_error_write_title");
+ String message = Messages
+ .getString("TemplatePreferencePage_error_write_message");
+ MessageDialog.openError(getShell(), title, message);
+ }
+
+ private void selectionChanged() {
+ updateViewerInput();
+ updateButtons();
+ }
+
+ /**
+ * Updates the pattern viewer.
+ */
+ protected void updateViewerInput() {
+ if (iPatternViewer == null
+ || iPatternViewer.getTextWidget().isDisposed())
+ return;
+ IStructuredSelection selection = (IStructuredSelection) iTreeViewer
+ .getSelection();
+
+ if (selection.size() == 1
+ && (((PathNode) selection.getFirstElement()).getData() != null)) {
+ TemplatePersistenceData data = (TemplatePersistenceData) ((PathNode) selection
+ .getFirstElement()).getData();
+ Template template = data.getTemplate();
+ TemplateContextType type = CUIPlugin.getDefault()
+ .getCodeTemplateContextRegistry().getContextType(
+ template.getContextTypeId());
+ if (type == null) {
+ type = CodegenUIPlugin.getDefault().getContextTypeRegistry()
+ .getContextType(template.getContextTypeId());
+ }
+ iTemplateProcessor.setContextType(type);
+ reconfigurePatternViewer();
+ iPatternViewer.getDocument().set(template.getPattern());
+ } else {
+ iPatternViewer.getDocument().set("");
+ }
+
+ }
+
+ private SourceViewer createViewer(Composite parent, int nColumns) {
+ Label label = new Label(parent, 0);
+ label.setText(Messages.getString("TemplatePreferencePage_preview"));
+ GridData data = new GridData();
+ data.horizontalSpan = nColumns;
+ label.setLayoutData(data);
+ IDocument document = new Document();
+ CTextTools tools = CUIPlugin.getDefault().getTextTools();
+ tools.setupCDocumentPartitioner(document, "___c_partitioning", null);
+ org.eclipse.jface.preference.IPreferenceStore store = CUIPlugin
+ .getDefault().getCombinedPreferenceStore();
+ SourceViewer viewer = new CSourceViewer(parent, null, null, false,
+ 2816, store);
+ CodeTemplateSourceViewerConfiguration configuration = new CodeTemplateSourceViewerConfiguration(
+ tools.getColorManager(), store, null, iTemplateProcessor);
+ viewer.configure(configuration);
+ viewer.setEditable(false);
+ viewer.setDocument(document);
+ org.eclipse.swt.graphics.Font font = JFaceResources
+ .getFont("org.eclipse.cdt.ui.editors.textfont");
+ viewer.getTextWidget().setFont(font);
+ new CSourcePreviewerUpdater(viewer, configuration, store);
+ Control control = viewer.getControl();
+ data = new GridData(1296);
+ data.horizontalSpan = nColumns;
+ data.heightHint = new PixelConverter(parent)
+ .convertHeightInCharsToPixels(5);
+ control.setLayoutData(data);
+ return viewer;
+ }
+
+ private void reconfigurePatternViewer() {
+ if (iPatternViewer == null) {
+ return;
+ } else {
+ CTextTools tools = CUIPlugin.getDefault().getTextTools();
+ org.eclipse.jface.preference.IPreferenceStore store = CUIPlugin
+ .getDefault().getCombinedPreferenceStore();
+ CodeTemplateSourceViewerConfiguration configuration = new CodeTemplateSourceViewerConfiguration(
+ tools.getColorManager(), store, null, iTemplateProcessor);
+ iPatternViewer.unconfigure();
+ iPatternViewer.configure(configuration);
+ iPatternViewer.invalidateTextPresentation();
+ return;
+ }
+ }
+
+ /**
+ * Updates the buttons.
+ */
+ protected void updateButtons() {
+ IStructuredSelection selection = (IStructuredSelection) iTreeViewer
+ .getSelection();
+ int selectionCount = selection.size();
+ boolean canRestore = getTemplateStore().getTemplateData(true).length != getTemplateStore()
+ .getTemplateData(false).length;
+ boolean canRevert = false;
+ TemplatePersistenceData data = null;
+ for (Iterator<?> it = selection.iterator(); it.hasNext();) {
+ data = (TemplatePersistenceData) ((PathNode) it.next()).getData();
+ if (data != null && data.isModified()) {
+ canRevert = true;
+ break;
+ }
+ }
+
+ iEditButton.setEnabled(selectionCount == 1 && data != null);
+ iExportButton.setEnabled(selectionCount > 0);
+ iRemoveButton.setEnabled(selectionCount > 0);
+ iRestoreButton.setEnabled(canRestore);
+ iRevertButton.setEnabled(canRevert);
+ }
+
+ private PathNode convertToPathTree(TemplateStore aTemplateStore) {
+ PathNode root = new PathNode(TemplateLoader.TEMPLATES_DIR);
+ TemplatePersistenceData[] lTemplateDataArray = aTemplateStore
+ .getTemplateData(false);
+
+ for (TemplatePersistenceData data : lTemplateDataArray) {
+ String path = data.getTemplate().getDescription();
+ PathNode node = PathNodeConverter.pathToNode(root, path);
+ node.setData(data);
+ }
+ return root;
+ }
+
+ private Set<TemplatePersistenceData> getChildrenTemplate(PathNode parent) {
+ Set<TemplatePersistenceData> templates = new HashSet<TemplatePersistenceData>();
+ if (parent.getData() != null) {
+ templates.add((TemplatePersistenceData) parent.getData());
+ } else {
+ for (PathNode child : parent.getChildren()) {
+ if (child.getData() != null) {
+ templates.add((TemplatePersistenceData) child.getData());
+ } else {
+ templates.addAll(getChildrenTemplate(child));
+ }
+ }
+ }
+ return templates;
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/templates/CodeGenTemplateContextType.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.codegen.ui.templates;
+
+import org.eclipse.jface.text.templates.GlobalTemplateVariables;
+import org.eclipse.jface.text.templates.TemplateContextType;
+
+public class CodeGenTemplateContextType extends TemplateContextType {
+
+ /** This context's id */
+ public static final String FILE_TEMPLATE_CONTEXT_TYPE = "com.nokia.testfw.codegen.templates.testfw_template_contexttype"; //$NON-NLS-1$
+
+ public CodeGenTemplateContextType() {
+ addGlobalResolvers();
+ }
+
+ private void addGlobalResolvers() {
+ addResolver(new GlobalTemplateVariables.Cursor());
+ // addResolver(new GlobalTemplateVariables.WordSelection());
+ // addResolver(new GlobalTemplateVariables.LineSelection());
+ // addResolver(new GlobalTemplateVariables.Dollar());
+ // addResolver(new GlobalTemplateVariables.Date());
+ // addResolver(new GlobalTemplateVariables.Year());
+ // addResolver(new GlobalTemplateVariables.Time());
+ // addResolver(new GlobalTemplateVariables.User());
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/templates/EclipseTemplateBuilder.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui.templates;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.internal.content.ContentTypeManager;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.persistence.TemplatePersistenceData;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+
+import com.nokia.testfw.codegen.templates.TemplateBuilder;
+import com.nokia.testfw.codegen.templates.TemplateLoader;
+import com.nokia.testfw.codegen.ui.CodegenUIPlugin;
+
+@SuppressWarnings("restriction")
+public class EclipseTemplateBuilder implements TemplateBuilder {
+
+ private static Map<String, Template> iPath2TemplateMap;
+
+ public static Map<String, Template> getPathTemplateMap(String template) {
+ Map<String, Template> lPathTemplateMap = new HashMap<String, Template>();
+ String lTemplatePath = template + "/";
+
+ TemplateStore lTemplateStore = CodegenUIPlugin.getDefault()
+ .getTemplateStore();
+
+ TemplatePersistenceData[] lTemplateDataArray = lTemplateStore
+ .getTemplateData(false);
+
+ for (TemplatePersistenceData data : lTemplateDataArray) {
+ String path = data.getId();
+ if (path.startsWith(lTemplatePath)) {
+ if (data.isEnabled()) {
+ lPathTemplateMap.put(
+ path.substring(lTemplatePath.length()), data
+ .getTemplate());
+ }
+ }
+ }
+
+ return lPathTemplateMap;
+ }
+
+ public static Map<String, Template> findAllOriTemplates() {
+ if (iPath2TemplateMap == null) {
+ iPath2TemplateMap = new HashMap<String, Template>();
+
+ try {
+ Map<String, String> lPath2PatternMap = TemplateLoader.load("");
+ for (String lpath : lPath2PatternMap.keySet()) {
+ String name = lpath.substring(lpath.lastIndexOf("/") + 1);
+ String description = lpath;
+ String pattern = lPath2PatternMap.get(lpath);
+
+ ContentTypeManager lContentTypeManager = ContentTypeManager
+ .getInstance();
+ IContentType type = lContentTypeManager
+ .findContentTypeFor(name);
+ String contextTypeId;
+ if (type != null) {
+ contextTypeId = (new StringBuilder(String.valueOf(type
+ .getId()))).append(".contenttype_context")
+ .toString();
+ } else {
+ contextTypeId = CodeGenTemplateContextType.FILE_TEMPLATE_CONTEXT_TYPE;
+ }
+
+ Template lTemplate = new Template(name, description,
+ contextTypeId, pattern, true);
+ iPath2TemplateMap.put(lpath, lTemplate);
+ }
+ } catch (IOException e) {
+ IStatus lStatus = new Status(IStatus.ERROR,
+ EclipseTemplateBuilder.class.getName(),
+ "Exception was thrown while loading templates.", e);
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ }
+ }
+ return iPath2TemplateMap;
+
+ }
+
+ public Map<String, String> build(String path) {
+ Map<String, String> result = new HashMap<String, String>();
+ Map<String, org.eclipse.jface.text.templates.Template> lTemplatePathMap = getPathTemplateMap(path);
+
+ for (String lpath : lTemplatePathMap.keySet()) {
+ org.eclipse.jface.text.templates.Template lEclipseTemplate = lTemplatePathMap
+ .get(lpath);
+ String pattern = lEclipseTemplate.getPattern();
+ result.put(lpath, pattern);
+ }
+ return result;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/util/PathNode.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui.util;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class PathNode {
+ private String name;
+ private PathNode parent;
+ private Map<String, PathNode> childrenMap = new HashMap<String, PathNode>();
+ private Object data;
+
+ public PathNode(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public PathNode getParent() {
+ return parent;
+ }
+
+ public void setParent(PathNode parent) {
+ this.parent = parent;
+ }
+
+ public void addChild(PathNode node) {
+ node.setParent(this);
+ childrenMap.put(node.name, node);
+ }
+
+ public PathNode getChild(String name) {
+ return childrenMap.get(name);
+ }
+
+ public PathNode[] getChildren() {
+ return childrenMap.values().toArray(new PathNode[0]);
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+ public void setData(Object data) {
+ this.data = data;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/util/PathNodeConverter.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.util;
+
+public class PathNodeConverter {
+
+ static public PathNode pathToNode(PathNode root, String path) {
+ PathNode parent = root;
+ PathNode child = null;
+ String[] segmentArray = path.split("/");
+ for (String segment : segmentArray) {
+ child = parent.getChild(segment);
+ if (child == null) {
+ child = new PathNode(segment);
+ parent.addChild(child);
+ }
+ parent = child;
+ }
+ return child;
+ }
+
+ static public String nodeToPath(PathNode node) {
+ String path = node.getName();
+ while (node.getParent() != null) {
+ path = node.getParent().getName() + "/" + path;
+ node = node.getParent();
+ }
+ return path;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/util/PathNodeTreeContentLabelProvoder.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui.util;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+
+public class PathNodeTreeContentLabelProvoder extends LabelProvider implements
+ ITreeContentProvider {
+
+ private final Object NO_CHILDREN[];
+
+ public PathNodeTreeContentLabelProvoder() {
+ super();
+ NO_CHILDREN = new Object[0];
+ }
+
+ public Object[] getChildren(Object obj) {
+ if (obj instanceof PathNode)
+ return ((PathNode) obj).getChildren();
+ else
+ return NO_CHILDREN;
+ }
+
+ public Object getParent(Object obj) {
+ if (obj instanceof PathNode)
+ return ((PathNode) obj).getParent();
+ else
+ return null;
+ }
+
+ public boolean hasChildren(Object obj) {
+ if (obj instanceof PathNode)
+ return ((PathNode) obj).getChildren().length > 0;
+ else
+ return false;
+ }
+
+ public Object[] getElements(Object obj) {
+ if (obj instanceof PathNode) {
+ return ((PathNode) obj).getChildren();
+ }
+ return NO_CHILDREN;
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object obj, Object obj1) {
+ }
+
+ @SuppressWarnings("deprecation")
+ public Image getImage(Object obj) {
+ if (obj instanceof PathNode) {
+ PathNode node = (PathNode) obj;
+ if (node.getData() != null) {
+ return PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJ_FILE);
+ }
+ if (node.getParent().getParent() == null) {
+ return PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJ_PROJECT);
+ } else {
+ return PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJ_FOLDER);
+ }
+ }
+ return null;
+ }
+
+ public String getText(Object obj) {
+ if (obj instanceof PathNode)
+ return ((PathNode) obj).getName();
+ return null;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/util/PathNodeTreeViewerComparator.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui.util;
+
+import java.text.Collator;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+
+public class PathNodeTreeViewerComparator extends ViewerComparator {
+
+ public int compare(Viewer viewer, Object object1, Object object2) {
+ if ((object1 instanceof PathNode) && (object2 instanceof PathNode)) {
+ String leftName = ((PathNode) object1).getName();
+ String rightName = ((PathNode) object2).getName();
+ return Collator.getInstance().compare(leftName, rightName);
+ }
+ return super.compare(viewer, object1, object2);
+ }
+
+ public int category(Object element) {
+ if (element instanceof PathNode) {
+ if (((PathNode) element).getData() == null) {
+ return 0;
+ } else {
+ return 1;
+ }
+ }
+ return super.category(element);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/AbstractTemplateWizard.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,675 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.testfw.codegen.ui.wizard;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.core.model.ISourceEntry;
+import org.eclipse.cdt.core.settings.model.CSourceEntry;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICProjectDescription;
+import org.eclipse.cdt.core.settings.model.ICSourceEntry;
+import org.eclipse.cdt.core.settings.model.WriteAccessException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.IPageChangingListener;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.PageChangingEvent;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
+
+import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
+import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration;
+import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo;
+import com.nokia.carbide.cpp.internal.project.ui.ProjectUIPlugin;
+import com.nokia.carbide.cpp.project.core.ProjectCorePlugin;
+import com.nokia.carbide.cpp.project.ui.sharedui.NewProjectPage;
+import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
+import com.nokia.carbide.cpp.sdk.ui.shared.BuildTargetsPage;
+import com.nokia.testfw.codegen.ChangeFileContent;
+import com.nokia.testfw.codegen.CodegenEngine;
+import com.nokia.testfw.codegen.ui.CodegenUIPlugin;
+import com.nokia.testfw.codegen.ui.ResourceChangeListener;
+import com.nokia.testfw.codegen.ui.parser.Parser;
+import com.nokia.testfw.codegen.ui.parser.ProjectInfoHelper;
+
+public abstract class AbstractTemplateWizard extends BasicNewResourceWizard
+ implements IPreviewResult, INewWizard {
+
+ public static final String PROJECT_OBJECT = "project_object";
+ public static final String PROJECT_NAME = "project_name";
+ public static final String LOCATION = "location";
+
+ protected boolean iShowNewProjectPage = true;
+ protected NewProjectPage iNewProjectPage;
+ protected BuildTargetsPage iBuildTargetsPage;
+ protected List<ISymbianBuildContext> iBuildConfigs;
+ protected ISymbianSDK iDefaultSDK;
+
+ protected IProject iTargetProject;
+ protected String iProjectName;
+ protected String iProjectLocation;
+ protected boolean iSelfCreateProject = false;
+ protected String iTestFolderLocation = null;
+
+ protected Map<String, Object> iDataMap = new HashMap<String, Object>();
+ protected Map<String, ChangeFileContent> iResultMap;
+ protected final String iTemplateName;
+ protected boolean iTestMMP = true;
+
+ public AbstractTemplateWizard(String template) {
+ iTemplateName = template;
+ setNeedsProgressMonitor(true);
+ }
+
+ @Override
+ public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
+ super.init(workbench, currentSelection);
+ if (iShowNewProjectPage == false) {
+ Object sel = selection.getFirstElement();
+ if (sel == null)
+ return;
+ if (sel instanceof ICElement) {
+ iTargetProject = ((ICElement) sel).getCProject().getProject();
+ } else if (sel instanceof IResource) {
+ iTargetProject = ((IResource) sel).getProject();
+ }
+ iProjectName = iTargetProject.getName();
+ iProjectLocation = iTargetProject.getLocation().toOSString();
+ iDataMap.put(PROJECT_NAME, iProjectName);
+ iDefaultSDK = getDefaultSDK(iTargetProject);
+ }
+ }
+
+ protected ISymbianSDK getDefaultSDK(IProject project) {
+ if (project != null
+ && CarbideBuilderPlugin.getBuildManager().isCarbideProject(
+ project) && project.isAccessible()) {
+ ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager()
+ .getProjectInfo(project);
+ if (cpi != null) {
+ ICarbideBuildConfiguration config = cpi
+ .getDefaultConfiguration();
+ if (config != null) {
+ return config.getSDK();
+ }
+ }
+ }
+ return null;
+ }
+
+ public void addPages() {
+ if (iShowNewProjectPage) {
+ iNewProjectPage = new NewProjectPage("Symbian Test Framework",
+ "Create a new Symbian Test Framework project") {
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ ((WizardDialog) getContainer())
+ .addPageChangingListener(new IPageChangingListener() {
+ public void handlePageChanging(
+ PageChangingEvent event) {
+ if (event.getCurrentPage() instanceof NewProjectPage) {
+ iProjectName = iNewProjectPage
+ .getProjectName();
+ iProjectLocation = iNewProjectPage
+ .getLocationPath().append(
+ iProjectName)
+ .toOSString();
+ iDataMap
+ .put(PROJECT_NAME, iProjectName);
+ }
+ }
+ });
+ }
+ };
+ addPage(iNewProjectPage);
+
+ iBuildTargetsPage = new BuildTargetsPage() {
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ ((WizardDialog) getContainer())
+ .addPageChangingListener(new IPageChangingListener() {
+ public void handlePageChanging(
+ PageChangingEvent event) {
+ if (event.getCurrentPage() instanceof BuildTargetsPage) {
+ iBuildConfigs = getSelectedBuildConfigs();
+ iDefaultSDK = iBuildConfigs.get(0)
+ .getSDK();
+ initPages();
+ }
+ }
+ });
+ }
+
+ protected boolean validatePage() {
+ boolean valid = super.validatePage();
+ if (valid)
+ checkPathWithSDKs(iNewProjectPage.getLocationPath());
+ return valid;
+ }
+ };
+ addPage(iBuildTargetsPage);
+ }
+ }
+
+ public ISymbianSDK getDefaultSDK() {
+ if (iDefaultSDK == null) {
+ iDefaultSDK = getDefaultSDK(iTargetProject);
+ }
+ return iDefaultSDK;
+ }
+
+ public void createPageControls(Composite pageContainer) {
+ super.createPageControls(pageContainer);
+ if (initPagesConditon()) {
+ initPages();
+ }
+ }
+
+ protected abstract boolean initPagesConditon();
+
+ public List<ISymbianBuildContext> getBuildConfigs() {
+ return iBuildConfigs;
+ }
+
+ @Override
+ public boolean performFinish() {
+ int oldAddFilesOption = ProjectUIPlugin.getAddFilesToProjectOption();
+ int oldChangedFilesOption = ProjectUIPlugin
+ .getChangedFilesInProjectOption();
+ ProjectUIPlugin.setAddFilesToProjectOption(2);
+ ProjectUIPlugin.setChangedFilesInProjectOption(2);
+ ResourceChangeListener.setEnable(false);
+
+ IRunnableWithProgress op = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException {
+ monitor.beginTask("Starting...", IProgressMonitor.UNKNOWN);
+ try {
+ if (iTargetProject == null) {
+ iTargetProject = createTargetProject(monitor);
+ }
+ if (iResultMap == null) {
+ iResultMap = generateFiles(monitor);
+ }
+ if (iResultMap != null && iTargetProject != null) {
+ writeResultMapToFiles(iTargetProject, monitor);
+ } else {
+ MessageDialog.openError(getShell(), "Error",
+ "Exception was thrown while generating files");
+ }
+ } catch (Throwable e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+
+ try {
+ new ProgressMonitorDialog(getShell()).run(true, false, op);
+ } catch (InterruptedException e) {
+ } catch (InvocationTargetException e) {
+ IStatus lStatus = new Status(IStatus.ERROR,
+ AbstractTemplateWizard.class.getName(),
+ "Exception was thrown while generating files.", e
+ .getTargetException());
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ MessageDialog.openError(getShell(),
+ "Exception was thrown while generating files", e
+ .getTargetException().getMessage());
+ } finally {
+ ProjectUIPlugin.setAddFilesToProjectOption(oldAddFilesOption);
+ ProjectUIPlugin
+ .setChangedFilesInProjectOption(oldChangedFilesOption);
+ ResourceChangeListener.setEnable(true);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean performCancel() {
+ if (iSelfCreateProject && iTargetProject != null) {
+ IRunnableWithProgress op = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException {
+ try {
+ iTargetProject.delete(true, null);
+ } catch (Throwable e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+
+ try {
+ new ProgressMonitorDialog(getShell()).run(true, false, op);
+ } catch (InterruptedException e) {
+ } catch (InvocationTargetException e) {
+ IStatus lStatus = new Status(IStatus.ERROR,
+ AbstractTemplateWizard.class.getName(),
+ "Exception was thrown while delete temporary project.",
+ e.getTargetException());
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ }
+
+ }
+ return super.performCancel();
+ }
+
+ public void setSelection(IStructuredSelection currentSelection) {
+ selection = currentSelection;
+ }
+
+ public IProject createTargetProject(IProgressMonitor monitor)
+ throws CoreException {
+ if (monitor != null) {
+ monitor.subTask("Creating new project");
+ }
+ if (iTargetProject == null) {
+ iTargetProject = ProjectCorePlugin.createProject(iProjectName,
+ iProjectLocation);
+ iSelfCreateProject = true;
+ }
+ return iTargetProject;
+ }
+
+ protected void setProjectInfo(IProject project, IFile bldInf,
+ IProgressMonitor monitor) throws CoreException {
+ monitor.subTask("Setting project information");
+ if (iShowNewProjectPage) {
+ // Convert IProject to ICProject;
+ IFolder groupFolder = iTargetProject.getFolder("group");
+ if (groupFolder.exists() == false) {
+ groupFolder.create(true, true, monitor);
+ }
+ IFile mainBldInf = groupFolder.getFile("bld.inf");
+ if (mainBldInf.exists() == false) {
+ String content = "";
+ if (bldInf != null) {
+ content = abstractBldInf(bldInf);
+ }
+ mainBldInf.create(new ByteArrayInputStream(content.getBytes()),
+ true, monitor);
+ }
+ ProjectCorePlugin
+ .postProjectCreatedActions(iTargetProject, mainBldInf
+ .getProjectRelativePath().toString(),
+ iBuildConfigs, new ArrayList<String>(), null, null,
+ monitor);
+ }
+
+ ProjectInfoHelper.setProjectTemplate(project, iTemplateName);
+ if (iTestFolderLocation != null) {
+ Set<String> testFoldersSet = ProjectInfoHelper.getTestFolders(
+ project, iTemplateName);
+ if (!testFoldersSet.contains(iTestFolderLocation)) {
+ try {
+ ProjectInfoHelper.addTestFolders(project, iTemplateName,
+ iTestFolderLocation);
+ } catch (CoreException e) {
+ CodegenUIPlugin.getDefault().getLog().log(e.getStatus());
+ }
+ }
+ }
+ }
+
+ private String abstractBldInf(IFile bldInf) throws CoreException {
+ boolean inBlock = false;
+ StringBuilder sb = new StringBuilder();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(bldInf
+ .getContents()));
+ String line;
+ try {
+ while ((line = reader.readLine()) != null) {
+ if (inBlock == false) {
+ sb.append(line).append("\n");
+ }
+ if (line.indexOf("] Begin - Do not remove") > 0) {
+ inBlock = true;
+ } else if (line.indexOf("] End - Do not remove") > 0) {
+ sb.append(line).append("\n");
+ inBlock = false;
+ }
+ }
+ } catch (IOException e) {
+ IStatus lStatus = new Status(IStatus.ERROR, Parser.class.getName(),
+ IStatus.ERROR, "Exception while reading file", e);
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ }
+ return sb.toString();
+ }
+
+ private void writeResultMapToFiles(final IProject project,
+ IProgressMonitor monitor) throws CoreException, IOException {
+ monitor.subTask("Writing new test codes to file");
+ Set<IPath> lSourcePathSet = new HashSet<IPath>();
+ IFile bldinf = null;
+ ICProject lCProject = CoreModel.getDefault().create(iTargetProject);
+ Set<IFile> mmpSet = new HashSet<IFile>();
+ for (String path : iResultMap.keySet()) {
+ IPath newFilePath = new Path(path);
+ IFile newFile = project.getFile(newFilePath);
+ ChangeFileContent lChangeContent = iResultMap.get(path);
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(
+ lChangeContent.getNewContent().getBytes());
+ if (newFile.exists()) {
+ newFile.setContents(inputStream, true, true, monitor);
+ } else {
+ createParentFolder(newFile, monitor);
+ newFile.create(inputStream, true, monitor);
+ }
+ String lFileExtension = newFilePath.getFileExtension();
+ if ("h".equalsIgnoreCase(lFileExtension)
+ || "cpp".equalsIgnoreCase(lFileExtension)
+ || "hrh".equalsIgnoreCase(lFileExtension)) {
+ if (!lCProject.isOnSourceRoot(newFile)) {
+ lSourcePathSet.add(newFilePath.uptoSegment(1));
+ }
+ }
+ if (newFilePath.lastSegment().equalsIgnoreCase("bld.inf")) {
+ bldinf = newFile;
+ } else if (newFilePath.lastSegment().endsWith(".mmp")) {
+ mmpSet.add(newFile);
+ }
+ monitor.worked(1);
+ }
+ setProjectInfo(project, bldinf, monitor);
+ if (bldinf != null) {
+ ProjectInfoHelper.addSubBldInfToProject(project, bldinf
+ .getProjectRelativePath());
+ } else {
+ for (IFile mmpFile : mmpSet) {
+ ProjectInfoHelper.addMMPFileToProject(project, mmpFile
+ .getProjectRelativePath(), iTestMMP);
+ }
+ }
+
+ if (lSourcePathSet.size() > 0) {
+ CoreModel lCoreModel = CoreModel.getDefault();
+ if (lCoreModel.isNewStyleProject(iTargetProject)) {
+ ArrayList<ICSourceEntry> lSourcePathList = new ArrayList<ICSourceEntry>();
+ for (IPath lSourcePath : lSourcePathSet) {
+ lSourcePathList.add(new CSourceEntry(lSourcePath, null, 0));
+ }
+ ICSourceEntry[] lCSourceEntry = lSourcePathList
+ .toArray(new ICSourceEntry[0]);
+ ICProjectDescription des = CCorePlugin.getDefault()
+ .getProjectDescription(iTargetProject, true);
+ addEntryToAllCfgs(des, lCSourceEntry, false);
+ CCorePlugin.getDefault().setProjectDescription(iTargetProject,
+ des, false, monitor);
+ } else {
+ ArrayList<ISourceEntry> lSourcePathList = new ArrayList<ISourceEntry>();
+ for (IPath lSourcePath : lSourcePathSet) {
+ lSourcePathList.add(CoreModel.newSourceEntry(lSourcePath));
+ }
+ ISourceEntry[] lSourceEntry = lSourcePathList
+ .toArray(new ISourceEntry[0]);
+ CoreModel.getDefault().create(iTargetProject)
+ .setRawPathEntries(lSourceEntry, monitor);
+ }
+ }
+ // project.refreshLocal(IResource.DEPTH_ONE, monitor);
+ }
+
+ private void addEntryToAllCfgs(ICProjectDescription des,
+ ICSourceEntry[] entry, boolean removeProj)
+ throws WriteAccessException, CoreException {
+ ICConfigurationDescription cfgs[] = des.getConfigurations();
+ ICConfigurationDescription aicconfigurationdescription[];
+ int j = (aicconfigurationdescription = cfgs).length;
+ for (int i = 0; i < j; i++) {
+ ICConfigurationDescription cfg = aicconfigurationdescription[i];
+ ICSourceEntry entries[] = cfg.getSourceEntries();
+ entries = addEntry(entries, entry, removeProj);
+ cfg.setSourceEntries(entries);
+ }
+
+ }
+
+ private ICSourceEntry[] addEntry(ICSourceEntry entries[],
+ ICSourceEntry[] entry, boolean removeProj) {
+ Set<ICSourceEntry> set = new HashSet<ICSourceEntry>();
+ ICSourceEntry aicsourceentry[];
+ int j = (aicsourceentry = entries).length;
+ for (int i = 0; i < j; i++) {
+ ICSourceEntry se = aicsourceentry[i];
+ if (!removeProj || (new Path(se.getValue())).segmentCount() != 1)
+ set.add(se);
+ }
+ for (ICSourceEntry en : entry) {
+ set.add(en);
+ }
+ return (ICSourceEntry[]) set.toArray(new ICSourceEntry[set.size()]);
+ }
+
+ private Map<String, ChangeFileContent> generateFiles(
+ IProgressMonitor monitor) throws Exception {
+ Map<String, ChangeFileContent> lResultMap = new HashMap<String, ChangeFileContent>();
+ collectPagesData();
+
+ monitor.subTask("Creating new test codes");
+
+ String output = iTargetProject.getLocation().toOSString();
+ if (iTestFolderLocation != null && iTestFolderLocation.length() > 0) {
+ output = iTargetProject.getLocation().append(iTestFolderLocation)
+ .toOSString();
+ }
+
+ CodegenEngine engine = new CodegenEngine(output, iDataMap);
+ engine.init();
+ engine.setWriteToFile(false);
+ Map<String, ChangeFileContent> result = engine.generate(iTemplateName);
+
+ if (iTestFolderLocation != null && iTestFolderLocation.length() > 0) {
+ Map<String, ChangeFileContent> new_result = new HashMap<String, ChangeFileContent>();
+ IPath testFolder = new Path(iTestFolderLocation);
+ for (String path : result.keySet()) {
+ new_result.put(testFolder.append(path).toString(), result
+ .get(path));
+ }
+ result = new_result;
+ }
+
+ lResultMap.putAll(result);
+ monitor.worked(1);
+ return lResultMap;
+ }
+
+ /**
+ * @return the iTargetProject
+ */
+ public IProject getTargetProject() {
+ return iTargetProject;
+ }
+
+ /**
+ * @param targetProject
+ * the iTargetProject to set
+ */
+ public void setTargetProject(IProject project) {
+ iTargetProject = project;
+ }
+
+ /**
+ * @return the iShowChooseProjectPage
+ */
+ public boolean isShowNewProjectPage() {
+ return iShowNewProjectPage;
+ }
+
+ /**
+ * @param iShowChooseProjectPage
+ * the iShowChooseProjectPage to set
+ */
+ public void setShowNewProjectPage(boolean showNewProjectPage) {
+ this.iShowNewProjectPage = showNewProjectPage;
+ }
+
+ protected void initPages() {
+ IWizardPage[] pages = getPages();
+ for (IWizardPage page : pages) {
+ if (page instanceof AbstractTemplateWizardPage) {
+ ((AbstractTemplateWizardPage) page).initPage(iDataMap);
+ }
+ }
+ }
+
+ protected void collectPagesData() {
+ IWizardPage[] pages = getPages();
+ for (IWizardPage page : pages) {
+ if (page instanceof AbstractTemplateWizardPage) {
+ ((AbstractTemplateWizardPage) page).collectData();
+ }
+ }
+ }
+
+ public Map<String, Object> getDataMap() {
+ return iDataMap;
+ }
+
+ private void createParentFolder(IResource resource, IProgressMonitor monitor)
+ throws CoreException {
+ if (!resource.getParent().exists()) {
+ createParentFolder(resource.getParent(), monitor);
+ ((IFolder) resource.getParent()).create(true, true, monitor);
+ }
+ }
+
+ public String getTemplateName() {
+ return iTemplateName;
+ }
+
+ public String getProjectName() {
+ return iProjectName;
+ }
+
+ public String getProjectLocation() {
+ return iProjectLocation;
+ }
+
+ public void setProjectLocation(String projectLocation) {
+ iProjectLocation = projectLocation;
+ }
+
+ public String getTestFolderLocation() {
+ return iTestFolderLocation;
+ }
+
+ public void setTestFolderLocation(String location) {
+ iTestFolderLocation = location;
+ }
+
+ /**
+ * @return the testFoldersSet
+ */
+ public Set<String> getTestFoldersSet() {
+ try {
+ if (iTargetProject != null
+ && CarbideBuilderPlugin.getBuildManager().isCarbideProject(
+ iTargetProject) && iTargetProject.isAccessible()) {
+ return ProjectInfoHelper.getTestFolders(iTargetProject,
+ iTemplateName);
+ }
+ } catch (CoreException e) {
+ IStatus lStatus = new Status(
+ IStatus.ERROR,
+ SUTNewTestWizard.class.getName(),
+ "Exception was thrown while accessing project persistent property.",
+ e);
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ MessageDialog.openError(getShell(),
+ "Exception was thrown while generating files", e
+ .getMessage());
+ }
+ return null;
+ }
+
+ public Map<String, ChangeFileContent> getPreviewResult() {
+ IRunnableWithProgress op = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException {
+ monitor.beginTask("Creating new test codes",
+ IProgressMonitor.UNKNOWN);
+ try {
+ iResultMap = generateFiles(monitor);
+ } catch (Throwable e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+
+ try {
+ new ProgressMonitorDialog(getShell()).run(true, true, op);
+ } catch (InterruptedException e) {
+ return null;
+ } catch (InvocationTargetException e) {
+ IStatus lStatus = new Status(IStatus.ERROR,
+ AbstractTemplateWizard.class.getName(),
+ "Exception was thrown while generating files.", e
+ .getTargetException());
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ MessageDialog.openError(getShell(),
+ "Exception was thrown while generating files", e
+ .getTargetException().getMessage());
+ return null;
+ }
+
+ return iResultMap;
+ }
+
+ public void setPreviewResult(Map<String, ChangeFileContent> result) {
+ iResultMap = result;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/AbstractTemplateWizardPage.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui.wizard;
+
+import java.util.Map;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.WizardPage;
+
+public abstract class AbstractTemplateWizardPage extends WizardPage implements
+ IDataCollector {
+
+ protected Map<String, Object> iDataMap;
+
+ public AbstractTemplateWizardPage(String pageName, String title,
+ ImageDescriptor titleImage) {
+ super(pageName, title, titleImage);
+ }
+
+ public AbstractTemplateWizardPage(String pageName) {
+ super(pageName);
+ }
+
+ public void initPage(Map<String, Object> dataMap) {
+ iDataMap = dataMap;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/ChooseObjectivePage.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,452 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.wizard;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.cdt.core.model.CModelException;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.IMethodDeclaration;
+import org.eclipse.cdt.core.model.IStructure;
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.cdt.ui.CElementLabelProvider;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.dialogs.ContainerCheckedTreeViewer;
+
+import com.nokia.testfw.codegen.model.IMethodNode;
+import com.nokia.testfw.codegen.model.INode;
+import com.nokia.testfw.codegen.model.IProjectNode;
+import com.nokia.testfw.codegen.model.NodeImpl;
+import com.nokia.testfw.codegen.ui.CodegenUIPlugin;
+import com.nokia.testfw.codegen.ui.Messages;
+import com.nokia.testfw.codegen.ui.parser.Parser;
+import com.nokia.testfw.codegen.ui.parser.model.IUINode;
+import com.nokia.testfw.codegen.ui.parser.model.UIClassNode;
+import com.nokia.testfw.codegen.ui.parser.model.UIMethodNode;
+import com.nokia.testfw.codegen.ui.parser.model.UIProjectNode;
+
+/**
+ * A customized wizard page for user to select classes and methods to test using
+ * TEF Block project.
+ *
+ * @author Development Tools
+ */
+class ChooseObjectivePage extends AbstractTemplateWizardPage {
+
+ private static final String CONSTRUCTOR = "Constructor";
+
+ private static final String DESTRUCTOR = "Destructor";
+
+ private static final String OPERATOR = "Operator";
+
+ private static final String CONST = "Const";
+
+ private static final String INLINE = "Inline";
+
+ private static final String STATIC = "Static";
+
+ private static final String VIRTUAL = "Virtual";
+
+ private static final String PUREVIRTUAL = "PureVirtual";
+
+ private static final String[] iFilters = new String[] { CONSTRUCTOR,
+ DESTRUCTOR, OPERATOR, CONST, INLINE, STATIC, VIRTUAL, PUREVIRTUAL };
+
+ private Tree iTree;
+
+ private final Map<String, Boolean> filtersMap = new HashMap<String, Boolean>();
+
+ private ContainerCheckedTreeViewer iCheckboxTreeViewer;
+
+ private IStructuredSelection iSelection;
+
+ private UIProjectNode iUIProjectNode;
+
+ private Label iCounterLabel;
+
+ private int iMethodCounter = 0;
+
+ private int iSelectedCounter = 0;
+
+ /**
+ *
+ */
+ public ChooseObjectivePage() {
+ super("ChooseObjectivePage");
+ setTitle(Messages.getString("ChooseObjectivePage.Title"));
+ setDescription(Messages.getString("ChooseObjectivePage.Description"));
+ for (String filter : iFilters) {
+ filtersMap.put(filter, Boolean.TRUE);
+ }
+ }
+
+ /**
+ * Implement method of IDialogPage to create UI of this wizard page
+ */
+ public void createControl(Composite aComposite) {
+ initializeDialogUnits(aComposite);
+
+ Composite lComposite = new Composite(aComposite, SWT.NONE);
+ {
+ lComposite.setLayout(new GridLayout(2, false));
+ lComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ setControl(lComposite);
+
+ iCheckboxTreeViewer = new ContainerCheckedTreeViewer(lComposite,
+ SWT.BORDER);
+
+ // Content Provider
+ iCheckboxTreeViewer.setContentProvider(new ITreeContentProvider() {
+ public Object[] getChildren(Object aObject) {
+ return ((INode) aObject).getChildren().toArray();
+ }
+
+ public Object getParent(Object aObject) {
+ return ((INode) aObject).getParent();
+ }
+
+ public boolean hasChildren(Object aObject) {
+ return !(aObject instanceof IMethodNode);
+ }
+
+ public Object[] getElements(Object aObject) {
+ return (Object[]) aObject;
+ }
+
+ public void dispose() {
+ // do nothing
+ }
+
+ public void inputChanged(Viewer aViewer, Object aOldInput,
+ Object aNewInput) {
+ // do nothing
+ }
+ });
+
+ // Label Provider
+ iCheckboxTreeViewer.setLabelProvider(new CElementLabelProvider() {
+ public Image getImage(Object aObject) {
+ if (aObject instanceof IUINode) {
+ return super.getImage(((IUINode) aObject)
+ .getICElement());
+ }
+ return null;
+ }
+
+ public String getText(Object aObject) {
+ if (aObject instanceof IUINode) {
+ return super
+ .getText(((IUINode) aObject).getICElement());
+ }
+ return null;
+ }
+ });
+
+ iCheckboxTreeViewer.addFilter(createTreeViewerFilter());
+
+ iTree = iCheckboxTreeViewer.getTree();
+ iTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ // Add Checked Listener
+ iCheckboxTreeViewer
+ .addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(
+ CheckStateChangedEvent aChangedEvent) {
+ IUINode lNodeItem = (IUINode) aChangedEvent
+ .getElement();
+ lNodeItem.setSelected(aChangedEvent.getChecked());
+ refresh(false);
+ }
+ });
+
+ Group filterGroup = new Group(lComposite, SWT.SHADOW_IN);
+ filterGroup.setLayoutData(new GridData(
+ GridData.VERTICAL_ALIGN_BEGINNING));
+ filterGroup.setLayout(new GridLayout());
+ filterGroup.setText("Method Filters:");
+
+ SelectionAdapter adapter = createSelectionAdapter();
+ for (String filter : iFilters) {
+ Boolean filtervalue = filtersMap.get(filter);
+ Button button = new Button(filterGroup, SWT.CHECK);
+ button.setLayoutData(new GridData());
+ button.setText(filter);
+ button.setSelection(filtervalue);
+ button.setData(filter);
+ button.addSelectionListener(adapter);
+ }
+
+ iCounterLabel = new Label(lComposite, SWT.LEFT);
+ GridData lCounterGridData = new GridData(GridData.FILL_HORIZONTAL);
+ lCounterGridData.horizontalSpan = 2;
+ iCounterLabel.setLayoutData(lCounterGridData);
+ }
+ setPageComplete(isValid());
+ }
+
+ private ViewerFilter createTreeViewerFilter() {
+ ViewerFilter filter = new ViewerFilter() {
+ @Override
+ public boolean select(Viewer viewer, Object parentNode, Object node) {
+ IUINode lUINode = (IUINode) node;
+ ICElement lICElement = lUINode.getICElement();
+ if (lICElement instanceof IStructure) {
+ boolean result = false;
+ UIClassNode classNode = (UIClassNode) lUINode;
+ for (INode child : classNode.getChildren()) {
+ boolean visibility = getMethodVisibility((IMethodDeclaration) ((IUINode) child)
+ .getICElement());
+ ((IUINode) child).setVisible(visibility);
+ result = result || visibility;
+ }
+ return result;
+ }
+ if (lICElement instanceof IMethodDeclaration) {
+ boolean visibility = getMethodVisibility((IMethodDeclaration) lICElement);
+ lUINode.setVisible(visibility);
+ if (visibility == true) {
+ iMethodCounter++;
+ if (lUINode.isSelected()) {
+ iSelectedCounter++;
+ }
+ }
+ return visibility;
+ }
+ return true;
+ }
+
+ private boolean getMethodVisibility(IMethodDeclaration lMethod) {
+ boolean visibility = true;
+ try {
+ if (!filtersMap.get(CONSTRUCTOR)) {
+ if (lMethod.isConstructor()) {
+ visibility = false;
+ }
+ }
+ if (!filtersMap.get(DESTRUCTOR)) {
+ if (lMethod.isDestructor()) {
+ visibility = false;
+ }
+ }
+ if (!filtersMap.get(INLINE)) {
+ if (lMethod.isInline()) {
+ visibility = false;
+ }
+ }
+ if (!filtersMap.get(OPERATOR)) {
+ if (lMethod.isOperator()) {
+ visibility = false;
+ }
+ }
+ if (!filtersMap.get(PUREVIRTUAL)) {
+ if (lMethod.isPureVirtual()) {
+ visibility = false;
+ }
+ }
+ if (!filtersMap.get(STATIC)) {
+ if (lMethod.isStatic()) {
+ visibility = false;
+ }
+ }
+ if (!filtersMap.get(VIRTUAL)) {
+ if (lMethod.isVirtual()) {
+ visibility = false;
+ }
+ }
+ if (!filtersMap.get(CONST)) {
+ if (lMethod.isConst()) {
+ visibility = false;
+ }
+ }
+ } catch (CModelException e) {
+ IStatus lStatus = new Status(IStatus.ERROR,
+ ChooseObjectivePage.class.getName(),
+ "Exception was thrown while showing methods.", e);
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ }
+ return visibility;
+ }
+
+ };
+ return filter;
+ }
+
+ private SelectionAdapter createSelectionAdapter() {
+ SelectionAdapter adapter = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ Button button = (Button) event.widget;
+ String filter = (String) button.getData();
+ filtersMap.put(filter, button.getSelection());
+ refresh(true);
+ for (INode classnode : iUIProjectNode.getChildren()) {
+ for (INode methodnode : classnode.getChildren()) {
+ if (((UIMethodNode) methodnode).isVisible()) {
+ iCheckboxTreeViewer.setChecked(methodnode,
+ ((UIMethodNode) methodnode).isSelected());
+ }
+ }
+ }
+ if (iUIProjectNode.isVisible() == false) {
+ iCheckboxTreeViewer.setChecked(iUIProjectNode, false);
+ }
+ }
+ };
+ return adapter;
+ }
+
+ @SuppressWarnings("unchecked")
+ private void update(IStructuredSelection currentSelection) {
+ if (currentSelection == iSelection) {
+ return;
+ }
+ if (currentSelection == null) {
+ iSelection = null;
+ iUIProjectNode = null;
+ iCheckboxTreeViewer.setInput(null);
+ iCheckboxTreeViewer.refresh();
+ iCounterLabel.setText("");
+ return;
+ } else {
+ iSelection = currentSelection;
+ }
+ Object element = iSelection.getFirstElement();
+ try {
+ if (element instanceof IProject) {
+ iUIProjectNode = Parser.parseProject((IProject) element,
+ ((AbstractTemplateWizard) getWizard())
+ .getTemplateName(), Parser.PUBLIC);
+ }
+ if (element instanceof IMethodDeclaration) {
+ Object[] elements = iSelection.toList().toArray(
+ new IMethodDeclaration[0]);
+ iUIProjectNode = Parser
+ .parseMethod((IMethodDeclaration[]) elements);
+ }
+ if (element instanceof IStructure) {
+ Object[] elements = iSelection.toList().toArray(
+ new IStructure[0]);
+ iUIProjectNode = Parser.parseClass((IStructure[]) elements,
+ Parser.PUBLIC);
+ }
+ if (element instanceof ITranslationUnit) {
+ Object[] elements = iSelection.toList().toArray(
+ new ITranslationUnit[0]);
+ iUIProjectNode = Parser.parseTranslationUnit(
+ (ITranslationUnit[]) elements, Parser.PUBLIC);
+ }
+ } catch (CModelException e) {
+ IStatus lStatus = new Status(
+ IStatus.ERROR,
+ ChooseObjectivePage.class.getName(),
+ "Exception was thrown while updating Classes to Test Page.",
+ e);
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ }
+ if (iUIProjectNode != null) {
+ iMethodCounter = 0;
+ iSelectedCounter = 0;
+ iCheckboxTreeViewer.setInput(new Object[] { iUIProjectNode });
+ iCheckboxTreeViewer.setSubtreeChecked(iUIProjectNode, true);
+ iCheckboxTreeViewer.expandAll();
+ iCounterLabel.setText("[" + iSelectedCounter + "/" + iMethodCounter
+ + "]" + " methods selected.");
+ setPageComplete(isValid());
+ }
+ }
+
+ private void refresh(boolean expand) {
+ iMethodCounter = 0;
+ iSelectedCounter = 0;
+ iCheckboxTreeViewer.refresh();
+ if (expand) {
+ iCheckboxTreeViewer.expandAll();
+ }
+ iCounterLabel.setText("[" + iSelectedCounter + "/" + iMethodCounter
+ + "]" + " methods selected.");
+ setPageComplete(isValid());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.WizardPage#isPageComplete()
+ */
+ private boolean isValid() {
+
+ boolean isValid = false;
+
+ if (iUIProjectNode == null || iUIProjectNode.isVisible() == false)
+ return false;
+
+ for (INode classnode : iUIProjectNode.getChildren()) {
+ for (INode methodnode : classnode.getChildren()) {
+ UIMethodNode uimethodnode = (UIMethodNode) methodnode;
+ if (uimethodnode.isVisible() && uimethodnode.isSelected()) {
+ isValid = true;
+ break;
+ }
+ }
+ }
+ return isValid;
+ }
+
+ private INode cloneSelclted(INode node) {
+ INode clone = (INode) ((NodeImpl) node).clone();
+ for (INode child : node.getChildren()) {
+ if (((IUINode) child).isSelected() && ((IUINode) child).isVisible()) {
+ if ((child instanceof IMethodNode)) {
+ ((NodeImpl) clone).addChild((INode) ((NodeImpl) child)
+ .clone());
+ } else {
+ ((NodeImpl) clone).addChild(cloneSelclted(child));
+ }
+ }
+ }
+ return clone;
+ }
+
+ public void collectData() {
+ IProjectNode selProjectNode = (IProjectNode) cloneSelclted(iUIProjectNode);
+ iDataMap.put(AbstractTemplateWizard.PROJECT_OBJECT, selProjectNode);
+ }
+
+ public void initPage(Map<String, Object> dataMap) {
+ super.initPage(dataMap);
+ update(((AbstractTemplateWizard) getWizard()).getSelection());
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/ChooseProjectPage.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.wizard;
+
+import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
+import com.nokia.carbide.cdt.builder.ICarbideBuildManager;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.dialogs.IPageChangingListener;
+import org.eclipse.jface.dialogs.PageChangingEvent;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+import com.nokia.testfw.codegen.ui.Messages;
+
+public class ChooseProjectPage extends WizardPage implements
+ IPageChangingListener {
+
+ private TableViewer iTableViewer;
+ private IStructuredSelection iSelection;
+ private ICarbideBuildManager iBuildManager;
+ private IProject iTargetProject;
+
+ public ChooseProjectPage() {
+ super("ChooseProjectPage");
+ setTitle(Messages.getString("ChooseProjectPage.Title"));
+ setDescription(Messages.getString("ChooseProjectPage.Description"));
+ iBuildManager = CarbideBuilderPlugin.getBuildManager();
+ }
+
+ public void createControl(Composite parent) {
+ initializeDialogUnits(parent);
+ Composite container = new Composite(parent, 0);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.marginTop = 10;
+ gridLayout.marginRight = 10;
+ gridLayout.marginLeft = 10;
+ gridLayout.marginBottom = 10;
+ gridLayout.horizontalSpacing = 10;
+ container.setLayout(gridLayout);
+ Label selectAnExistingLabel = new Label(container, 0);
+ GridData gridData = new GridData(4, 2, true, false);
+ selectAnExistingLabel.setLayoutData(gridData);
+ selectAnExistingLabel.setText(Messages
+ .getString("ChooseProjectPage.Label"));
+ iTableViewer = new TableViewer(container, 2816);
+ iTableViewer.getTable().setLayoutData(new GridData(4, 4, true, true));
+ iTableViewer.setContentProvider(new ArrayContentProvider());
+ iTableViewer.setLabelProvider(new WorkbenchLabelProvider());
+ iTableViewer.setInput(getEligibleProjects());
+ iTableViewer
+ .addSelectionChangedListener(new ISelectionChangedListener() {
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) event
+ .getSelection();
+ handleSelection(selection);
+ }
+ });
+ setControl(container);
+
+ iSelection = (IStructuredSelection) ((BasicNewResourceWizard) getWizard())
+ .getSelection();
+ iTableViewer.setSelection(iSelection);
+ handleSelection(iSelection);
+
+ ((WizardDialog) getContainer()).addPageChangingListener(this);
+ }
+
+ public IProject getTargetProject() {
+ return iTargetProject;
+ }
+
+ private boolean isValid() {
+ return !iSelection.isEmpty();
+ }
+
+ protected void handleSelection(IStructuredSelection selection) {
+ iSelection = selection;
+ if (iTableViewer.getTable().getItemCount() == 0) {
+ setErrorMessage(Messages
+ .getString("ChooseProjectPage.NoProjectsError"));
+ } else {
+ if (iSelection.isEmpty()) {
+ setErrorMessage(Messages
+ .getString("ChooseProjectPage.NoSelectionError"));
+ } else {
+ iTargetProject = (IProject) iSelection.getFirstElement();
+ setErrorMessage(null);
+ }
+ }
+ setPageComplete(isValid());
+ }
+
+ private IProject[] getEligibleProjects() {
+ List<IProject> eligibleProjects = new ArrayList<IProject>();
+ IProject projects[] = ResourcesPlugin.getWorkspace().getRoot()
+ .getProjects();
+ for (int i = 0; i < projects.length; i++) {
+ IProject project = projects[i];
+ if (projectIsEligible(project))
+ eligibleProjects.add(project);
+ }
+
+ return (IProject[]) eligibleProjects
+ .toArray(new IProject[eligibleProjects.size()]);
+ }
+
+ private boolean projectIsEligible(IProject project) {
+ return iBuildManager.isCarbideProject(project);
+ }
+
+ public void handlePageChanging(PageChangingEvent event) {
+ if (event.getCurrentPage() instanceof ChooseProjectPage) {
+ if(iTargetProject!=null){
+ ((AbstractTemplateWizard) getWizard()).setSelection(iSelection);
+ ((AbstractTemplateWizard) getWizard())
+ .setTargetProject(iTargetProject);
+ ((AbstractTemplateWizard) getWizard())
+ .setProjectLocation(iTargetProject.getLocation()
+ .toOSString());
+ ((AbstractTemplateWizard) getWizard()).getDataMap().put(
+ AbstractTemplateWizard.PROJECT_NAME,
+ iTargetProject.getName());
+ ((AbstractTemplateWizard) getWizard()).initPages();
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/GenTestMethodDialog.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,387 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.codegen.ui.wizard;
+
+import java.io.File;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.cdt.ui.CElementLabelProvider;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+import org.eclipse.ui.dialogs.ContainerCheckedTreeViewer;
+
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
+import com.nokia.testfw.codegen.model.ClassNodeImpl;
+import com.nokia.testfw.codegen.model.IMethodNode;
+import com.nokia.testfw.codegen.model.INode;
+import com.nokia.testfw.codegen.ui.CodegenUIPlugin;
+import com.nokia.testfw.codegen.ui.Messages;
+import com.nokia.testfw.codegen.ui.parser.Parser;
+import com.nokia.testfw.codegen.ui.parser.model.IUINode;
+import com.nokia.testfw.codegen.ui.parser.model.UIProjectNode;
+
+public class GenTestMethodDialog extends Dialog {
+ private boolean result = false;
+ private Button iBtnOK;
+ private Text iHeaderText;
+ private String iHeaderPath;
+ private String iLib;
+ private Text iLibText;
+ private IProject iProject;
+ private ContainerCheckedTreeViewer iCheckboxTreeViewer;
+ private Composite iComposite;
+ private UIProjectNode iHeaderNode;
+ private ISymbianSDK iSDK;
+ private CLabel iMessageLabel;
+ private static final Image ERROR_IMG = JFaceResources
+ .getImage("dialog_message_error_image");
+
+ public GenTestMethodDialog(Shell parent, IProject project, ISymbianSDK sdk) {
+ super(parent, 0);
+ iProject = project;
+ iSDK = sdk;
+ }
+
+ private void createControl(final Shell shell) {
+
+ shell.setText("Generate Test Case From Header File");
+ shell.setLayout(new GridLayout(4, true));
+
+ // Header
+ Label lHeaderLabel = new Label(shell, SWT.NONE);
+ lHeaderLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ lHeaderLabel.setText("Header File:");
+
+ iHeaderText = new Text(shell, SWT.BORDER);
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 2;
+ iHeaderText.setLayoutData(data);
+ iHeaderText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent event) {
+ String filename = iHeaderText.getText();
+ File headerFile = new File(filename);
+ if (headerFile.exists()) {
+ showAST(new Path(filename));
+ } else {
+ iCheckboxTreeViewer.setInput(null);
+ }
+ checkComplete();
+ }
+ });
+
+ Button lHeaderButton = new Button(shell, SWT.PUSH);
+ lHeaderButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ lHeaderButton.setText("&Browse...");
+ lHeaderButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ FileDialog dialog = new FileDialog(shell, SWT.OPEN);
+ dialog.setFilterExtensions(new String[] { "*.h" });
+ dialog.setFilterPath(iSDK.getIncludePath().toOSString());
+ String filename = dialog.open();
+ if (filename != null) {
+ iHeaderText.setText(filename);
+ }
+ }
+ });
+
+ // Lib
+ Label lLibLabel = new Label(shell, SWT.None);
+ lLibLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ lLibLabel.setText("Lib File:");
+
+ iLibText = new Text(shell, SWT.BORDER);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 2;
+ iLibText.setLayoutData(data);
+ iLibText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent arg0) {
+ checkComplete();
+ }
+ });
+
+ Button lLibButton = new Button(shell, SWT.PUSH);
+ lLibButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ lLibButton.setText("&Browse...");
+ lLibButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ FileDialog dialog = new FileDialog(shell, SWT.OPEN);
+ dialog.setFilterExtensions(new String[] { "*.lib" });
+ dialog.setFilterPath(iSDK.getReleaseRoot().toOSString());
+ String filename = dialog.open();
+ if (filename != null) {
+ iLibText.setText(new Path(filename).lastSegment());
+ }
+ }
+ });
+
+ iComposite = new Composite(shell, SWT.None);
+ data = new GridData(GridData.FILL_BOTH);
+ data.horizontalSpan = 4;
+ iComposite.setLayoutData(data);
+ iComposite.setLayout(new FillLayout());
+
+ iCheckboxTreeViewer = new ContainerCheckedTreeViewer(iComposite,
+ SWT.BORDER);
+
+ // Content Provider
+ iCheckboxTreeViewer.setContentProvider(new ITreeContentProvider() {
+ public Object[] getChildren(Object aObject) {
+ return ((INode) aObject).getChildren().toArray();
+ }
+
+ public Object getParent(Object aObject) {
+ return ((INode) aObject).getParent();
+ }
+
+ public boolean hasChildren(Object aObject) {
+ return !(aObject instanceof IMethodNode);
+ }
+
+ public Object[] getElements(Object aObject) {
+ if (aObject instanceof UIProjectNode) {
+ return ((UIProjectNode) aObject).getChildren().toArray(
+ new IUINode[0]);
+ }
+ return null;
+ }
+
+ public void dispose() {
+ // do nothing
+ }
+
+ public void inputChanged(Viewer aViewer, Object aOldInput,
+ Object aNewInput) {
+ // do nothing
+ }
+ });
+
+ // Label Provider
+ iCheckboxTreeViewer.setLabelProvider(new CElementLabelProvider() {
+ public Image getImage(Object aObject) {
+ if (aObject instanceof IUINode) {
+ return super.getImage(((IUINode) aObject).getICElement());
+ }
+ return null;
+ }
+
+ public String getText(Object aObject) {
+ if (aObject instanceof IUINode) {
+ return super.getText(((IUINode) aObject).getICElement());
+ }
+ return null;
+ }
+ });
+
+ // Add Checked Listener
+ iCheckboxTreeViewer.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent aChangedEvent) {
+ IUINode lNodeItem = (IUINode) aChangedEvent.getElement();
+ lNodeItem.setSelected(aChangedEvent.getChecked());
+ }
+ });
+
+ // Message Label
+ iMessageLabel = new CLabel(shell, SWT.NONE);
+ GridData messageLabelData = new GridData(GridData.FILL_HORIZONTAL);
+ messageLabelData.horizontalSpan = 4;
+ iMessageLabel.setLayoutData(messageLabelData);
+
+ // Space holder
+ Label label = new Label(shell, SWT.None);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 2;
+ label.setLayoutData(data);
+
+ // OK
+ iBtnOK = new Button(shell, SWT.PUSH);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ iBtnOK.setLayoutData(data);
+ iBtnOK.setText(Messages.getString("Dialog.OK"));
+ iBtnOK.setEnabled(false);
+ iBtnOK.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ result = true;
+ shell.dispose();
+ }
+ });
+
+ // Cancel
+ Button lBtnCancel = new Button(shell, SWT.PUSH);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ lBtnCancel.setLayoutData(data);
+ lBtnCancel.setText(Messages.getString("Dialog.Cancel"));
+ lBtnCancel.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ result = false;
+ shell.dispose();
+ }
+ });
+ }
+
+ private void showAST(final IPath header) {
+ IRunnableWithProgress op = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException {
+ monitor.beginTask("Starting syntax analysis...",
+ IProgressMonitor.UNKNOWN);
+ try {
+ ICProject cproject = CoreModel.getDefault()
+ .create(iProject);
+
+ ITranslationUnit tu = CCorePlugin.getDefault()
+ .getCoreModel().createTranslationUnitFrom(cproject,
+ header);
+ iHeaderNode = Parser
+ .parseTranslationUnit(tu, Parser.PUBLIC);
+ } catch (Throwable e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+
+ try {
+ new ProgressMonitorDialog(getParent()).run(true, false, op);
+ iCheckboxTreeViewer.setInput(iHeaderNode);
+ iCheckboxTreeViewer.setCheckedElements(iHeaderNode.getChildren()
+ .toArray(new ClassNodeImpl[0]));
+ iCheckboxTreeViewer.expandAll();
+ } catch (InterruptedException e) {
+ } catch (InvocationTargetException e) {
+ IStatus lStatus = new Status(IStatus.ERROR,
+ AbstractTemplateWizard.class.getName(),
+ "Exception was thrown while analysis header file.", e
+ .getTargetException());
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ MessageDialog.openError(getParent(),
+ "Exception was thrown while analysis header file.", e
+ .getTargetException().getMessage());
+ }
+ }
+
+ public boolean open() {
+ Shell parent = getParent();
+ Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+
+ createControl(shell);
+ shell.pack();
+ shell.setSize(400, 400);
+
+ Rectangle lParentBounds = parent.getBounds();
+ Point lDialogSize = shell.getSize();
+ shell.setLocation(lParentBounds.x
+ + (lParentBounds.width - lDialogSize.x) / 2, lParentBounds.y
+ + (lParentBounds.height - lDialogSize.y) / 2);
+
+ shell.open();
+ Display display = parent.getDisplay();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ return result;
+ }
+
+ private void showMessage(String message) {
+ if (message == null) {
+ iMessageLabel.setImage(null);
+ iMessageLabel.setText(null);
+ } else {
+ iMessageLabel.setImage(ERROR_IMG);
+ iMessageLabel.setText(message);
+ }
+ }
+
+ private boolean validate() {
+ if (!new File(iHeaderText.getText()).exists()) {
+ showMessage("Specified header file \"" + iHeaderText.getText()
+ + "\" doesn't exist.");
+ return false;
+ }
+ iHeaderPath = iHeaderText.getText();
+
+ if (iLibText.getText() == "") {
+ showMessage("Must specify lib file.");
+ return false;
+ }
+ iLib = iLibText.getText();
+ showMessage(null);
+ return true;
+ }
+
+ // Check whether complete
+ private void checkComplete() {
+ if (validate()) {
+ iBtnOK.setEnabled(true);
+ } else {
+ iBtnOK.setEnabled(false);
+ }
+ }
+
+ public String getHeaderFilePath() {
+ return iHeaderPath;
+ }
+
+ public UIProjectNode getHeaderNode() {
+ return iHeaderNode;
+ }
+
+ public String getLib() {
+ return iLib;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/GenTestMethodPage.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,485 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.testfw.codegen.ui.wizard;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.Display;
+
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
+import com.nokia.testfw.codegen.ui.CodegenUIPlugin;
+import com.nokia.testfw.codegen.ui.Messages;
+import com.nokia.testfw.codegen.ui.parser.model.IUINode;
+import com.nokia.testfw.codegen.ui.parser.model.UIMethodNode;
+import com.nokia.testfw.codegen.model.INode;
+import com.nokia.testfw.codegen.model.MethodNodeImpl;
+import com.nokia.testfw.codegen.model.NodeImpl;
+import com.nokia.testfw.codegen.model.ProjectNodeImpl;
+import com.nokia.testfw.codegen.model.ClassNodeImpl;
+
+final class GenTestMethodPage extends AbstractTemplateWizardPage {
+
+ private final class ClassMethodLabelProvider extends LabelProvider {
+ public Image getImage(Object aObject) {
+
+ Image image = null;
+
+ if (aObject instanceof ProjectNodeImpl) {
+ image = new Image(Display.getCurrent(), getClass()
+ .getResourceAsStream("/icons/project.gif"));
+ }
+ if (aObject instanceof ClassNodeImpl) {
+ image = new Image(Display.getCurrent(), getClass()
+ .getResourceAsStream("/icons/class.gif"));
+ }
+
+ if (aObject instanceof MethodNodeImpl) {
+ image = new Image(Display.getCurrent(), getClass()
+ .getResourceAsStream("/icons/method.gif"));
+ }
+
+ return image;
+ }
+
+ public String getText(Object aObject) {
+ if (aObject instanceof NodeImpl) {
+ return ((NodeImpl) aObject).getName();
+ }
+ return null;
+ }
+ }
+
+ /**
+ * @author Development Tools
+ *
+ */
+ private final class ClassMethodContentProvider implements
+ ITreeContentProvider {
+
+ public Object[] getChildren(Object aObject) {
+ if (aObject instanceof NodeImpl) {
+ if (((NodeImpl) aObject).getChildren() != null) {
+ return ((NodeImpl) aObject).getChildren().toArray();
+ }
+ }
+ return null;
+ }
+
+ public Object getParent(Object aObject) {
+ if (aObject instanceof NodeImpl) {
+ return ((NodeImpl) aObject).getParent();
+ }
+ return null;
+ }
+
+ public boolean hasChildren(Object aObject) {
+ if (getChildren(aObject) != null) {
+ return getChildren(aObject).length > 0;
+ }
+ return false;
+ }
+
+ public Object[] getElements(Object aObject) {
+ if (aObject instanceof ProjectNodeImpl) {
+ Set<INode> classSet = ((ProjectNodeImpl) aObject).getChildren();
+ return classSet.iterator().next().getChildren().toArray(
+ new INode[0]);
+ }
+ return null;
+ }
+
+ public void dispose() {
+ // do nothing
+ }
+
+ public void inputChanged(Viewer aViewer, Object aOldInput,
+ Object aNewInput) {
+ // do nothing
+ }
+ }
+
+ private final class ClassMethodViewerFilter extends ViewerFilter {
+ @Override
+ public boolean select(Viewer viewer, Object parentNode, Object node) {
+ if (node instanceof IUINode) {
+ IUINode lUINode = (IUINode) node;
+ return lUINode.isVisible();
+ }
+ return true;
+ }
+ }
+
+ private Tree iTree;
+ private TreeViewer iTreeViewer;
+
+ private ProjectNodeImpl iProjectNode;
+ private ClassNodeImpl iClassNode;
+ private Button iBtnAddMethod;
+ private Button iBtnEditMethod;
+ private Button iBtnDeleteMethod;
+ private NodeImpl iSelectedItem;
+ private Button iHeaderButton;
+ private IProject iTargetProject;
+
+ // Constants
+ private static final String NAME = "Test Class Properties";
+
+ /**
+ *
+ */
+ public GenTestMethodPage() {
+ super(NAME);
+ setTitle(NAME);
+ setDescription("Define the test methods.");
+ }
+
+ /**
+ * Implement method of IDialogPage to create UI of this wizard page
+ */
+ public void createControl(Composite aComposite) {
+ initializeDialogUnits(aComposite);
+
+ final Composite lComposite = new Composite(aComposite, SWT.NONE);
+ {
+ lComposite.setLayout(new GridLayout(1, false));
+ lComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ setControl(lComposite);
+
+ iTreeViewer = new TreeViewer(lComposite, SWT.BORDER);
+
+ // Content Provider
+ iTreeViewer.setContentProvider(new ClassMethodContentProvider());
+
+ // Label Provider
+ iTreeViewer.setLabelProvider(new ClassMethodLabelProvider());
+
+ // Filter
+ iTreeViewer.addFilter(new ClassMethodViewerFilter());
+
+ // Selection Changed listener
+ iTreeViewer
+ .addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ checkButtonState();
+ }
+ });
+
+ iTreeViewer.setComparator(new ViewerComparator());
+
+ // Double Click Listener
+ iTreeViewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) event
+ .getSelection();
+ iSelectedItem = (NodeImpl) selection.getFirstElement();
+ if (iSelectedItem instanceof MethodNodeImpl) {
+ iBtnEditMethod.notifyListeners(SWT.Selection, null);
+ }
+ }
+ });
+ iTree = iTreeViewer.getTree();
+ iTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ }
+
+ final Composite lBtnComposite = new Composite(lComposite, SWT.NONE);
+ {
+ lBtnComposite.setLayout(new GridLayout(4, true));
+ lBtnComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ // Add Method Button
+ iBtnAddMethod = new Button(lBtnComposite, SWT.PUSH);
+ iBtnAddMethod.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ iBtnAddMethod.setText(Messages
+ .getString("GenTestMethodPage.AddMethod"));
+ iBtnAddMethod.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ try {
+
+ MethodEditDialog dialog = new MethodEditDialog(
+ lBtnComposite.getShell(),
+ Messages
+ .getString("MethodDialog.AddMethodTitle"),
+ iClassNode);
+ if (dialog.open()) {
+ addMethod(dialog.getMethodItem().getName());
+ iTreeViewer.refresh();
+ }
+ setPageComplete(isPageComplete());
+ } catch (Exception e) {
+ IStatus lStatus = new Status(IStatus.WARNING,
+ GenTestMethodPage.class.getName(),
+ "Exception was thrown while adding method.", e);
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ }
+ }
+ });
+
+ // Edit Method Button
+ iBtnEditMethod = new Button(lBtnComposite, SWT.PUSH);
+ iBtnEditMethod
+ .setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ iBtnEditMethod.setText(Messages
+ .getString("GenTestMethodPage.EditMethod"));
+ iBtnEditMethod.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ MethodNodeImpl item = (MethodNodeImpl) iSelectedItem;
+ MethodEditDialog dialog = new MethodEditDialog(
+ lBtnComposite.getShell(), Messages
+ .getString("MethodDialog.EditMethodTitle"),
+ item);
+ if (dialog.open()) {
+ iTreeViewer.update(item, null);
+ }
+ setPageComplete(isPageComplete());
+ }
+ });
+
+ // Delete Method Button
+ iBtnDeleteMethod = new Button(lBtnComposite, SWT.PUSH);
+ iBtnDeleteMethod.setLayoutData(new GridData(
+ GridData.FILL_HORIZONTAL));
+ iBtnDeleteMethod.setText(Messages
+ .getString("GenTestMethodPage.DeleteMethod"));
+ iBtnDeleteMethod.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ MethodNodeImpl item = (MethodNodeImpl) iSelectedItem;
+ boolean rlt = MessageDialog.openQuestion(lBtnComposite
+ .getShell(), Messages
+ .getString("GenTestMethodPage.ConfirmDelete"),
+ Messages.getString(
+ "GenTestMethodPage.WhetherDeleteMethod",
+ item.getName()));
+ if (rlt) {
+ ((ClassNodeImpl) item.getParent()).removeChild(item);
+ iTreeViewer.remove(item);
+ }
+ setPageComplete(isPageComplete());
+ }
+ });
+
+ // HeaderButton
+ iHeaderButton = new Button(lBtnComposite, SWT.PUSH);
+ iHeaderButton.setText(Messages
+ .getString("GenTestMethodPage.BindMethod"));
+ iHeaderButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ iHeaderButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ iHeaderButton.setEnabled(false);
+
+ IRunnableWithProgress op = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException {
+ iTargetProject = ((AbstractTemplateWizard) getWizard())
+ .getTargetProject();
+ if (iTargetProject == null) {
+ try {
+ iTargetProject = ((AbstractTemplateWizard) getWizard())
+ .createTargetProject(monitor);
+ } catch (CoreException e) {
+ CodegenUIPlugin.getDefault().getLog().log(
+ e.getStatus());
+ MessageDialog
+ .openError(
+ getShell(),
+ "Exception was thrown while generating files",
+ e.getMessage());
+ }
+ }
+
+ }
+ };
+ try {
+ new ProgressMonitorDialog(getShell()).run(true, false,
+ op);
+ } catch (InterruptedException e) {
+ } catch (InvocationTargetException e) {
+ IStatus lStatus = new Status(IStatus.ERROR,
+ AbstractTemplateWizard.class.getName(),
+ "Exception was thrown while creating project.",
+ e.getTargetException());
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ MessageDialog.openError(getShell(),
+ "Exception was thrown while creating project.",
+ e.getTargetException().getMessage());
+ }
+
+ ISymbianSDK sdk = ((AbstractTemplateWizard) getWizard())
+ .getDefaultSDK();
+ GenTestMethodDialog dialog = new GenTestMethodDialog(
+ iHeaderButton.getShell(), iTargetProject, sdk);
+ try {
+ if (dialog.open()) {
+ IPath includePath = new Path(dialog
+ .getHeaderFilePath());
+ iClassNode.addIIncludeHeader(includePath
+ .lastSegment());
+ includePath = includePath.removeLastSegments(1);
+ int match = includePath
+ .matchingFirstSegments(new Path(sdk
+ .getEPOCROOT()));
+ if (match > 0) {
+ includePath = includePath
+ .removeFirstSegments(match);
+ }
+ includePath = includePath.setDevice(null);
+ iProjectNode.getSystemIncludes().add(
+ includePath.toString());
+ iProjectNode.getLibrarys().add(dialog.getLib());
+ for (INode classNode : dialog.getHeaderNode()
+ .getChildren()) {
+ for (INode methodNode : classNode.getChildren()) {
+ if (((UIMethodNode) methodNode)
+ .isSelected()) {
+ addMethod(classNode.getName() + "_"
+ + methodNode.getName());
+ }
+ }
+ }
+ iTreeViewer.refresh();
+ setPageComplete(isPageComplete());
+ }
+ } catch (Exception e) {
+ IStatus lStatus = new Status(IStatus.ERROR,
+ AbstractTemplateWizard.class.getName(),
+ "Exception was thrown while creating project.",
+ e);
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ } finally {
+ iHeaderButton.setEnabled(true);
+ }
+ }
+ });
+ }
+ }
+
+ public void update() {
+ iTreeViewer.setInput(iProjectNode);
+ checkButtonState();
+ setPageComplete(isPageComplete());
+ }
+
+ private void addMethod(String name) {
+ if (isDuplicateMethod(name)) {
+ int counter = 1;
+ while (isDuplicateMethod(name + Integer.toString(counter))) {
+ counter++;
+ }
+ name = name + Integer.toString(counter);
+ }
+ MethodNodeImpl node = new MethodNodeImpl(name, iClassNode);
+ iClassNode.addChild(node);
+ }
+
+ private boolean isDuplicateMethod(String name) {
+ Set<INode> lMethodSet = (Set<INode>) iClassNode.getChildren();
+ for (INode item : lMethodSet) {
+ if (item.getName().equals(name)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void checkButtonState() {
+ IStructuredSelection selection = (IStructuredSelection) iTreeViewer
+ .getSelection();
+ iSelectedItem = (NodeImpl) selection.getFirstElement();
+ iBtnAddMethod.setEnabled(true);
+ iHeaderButton.setEnabled(true);
+ if (iSelectedItem instanceof MethodNodeImpl) {
+ iBtnEditMethod.setEnabled(true);
+ iBtnDeleteMethod.setEnabled(true);
+ } else {// Nothing selected
+ iBtnEditMethod.setEnabled(false);
+ iBtnDeleteMethod.setEnabled(false);
+ }
+ }
+
+ public void collectData() {
+ if (iClassNode instanceof IUINode) {
+ Iterator<INode> itr = iClassNode.getChildren().iterator();
+ while (itr.hasNext()) {
+ INode node = itr.next();
+ if (node instanceof IUINode) {
+ if (((IUINode) node).isVisible() == false) {
+ itr.remove();
+ }
+ }
+ }
+ }
+ iDataMap.put(AbstractTemplateWizard.PROJECT_OBJECT, iProjectNode);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.WizardPage#isPageComplete()
+ */
+ public boolean isPageComplete() {
+ if (iClassNode != null) {
+ return iClassNode.getChildren().size() > 0;
+ }
+ return false;
+ }
+
+ public void initPage(Map<String, Object> dataMap) {
+ super.initPage(dataMap);
+ iProjectNode = (ProjectNodeImpl) iDataMap
+ .get(AbstractTemplateWizard.PROJECT_OBJECT);
+ if (iProjectNode == null || iProjectNode.getChildren().size() == 0) {
+ throw new IllegalArgumentException("Must have test class object");
+ }
+ iClassNode = (ClassNodeImpl) iProjectNode.getChildren().iterator()
+ .next();
+ update();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/IDataCollector.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui.wizard;
+
+import java.util.Map;
+
+public interface IDataCollector {
+
+ public void initPage(Map<String, Object> dataMap);
+
+ public void collectData();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/IPreviewResult.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui.wizard;
+
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+
+import com.nokia.testfw.codegen.ChangeFileContent;
+
+public interface IPreviewResult {
+
+ public IProject getTargetProject();
+
+ public Map<String, ChangeFileContent> getPreviewResult();
+
+ public void setPreviewResult(Map<String, ChangeFileContent> result);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/LocationAndPropertyPage.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.wizard;
+
+import java.util.Set;
+
+import org.eclipse.cdt.core.CConventions;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+import com.nokia.testfw.codegen.ui.preferences.PreferenceUtil;
+import com.nokia.testfw.codegen.ui.Messages;
+
+public class LocationAndPropertyPage extends PropertyPage {
+
+ private Text iTestFolderLocationEdit;
+
+ private String iTestFolderLocation;
+
+ public LocationAndPropertyPage() {
+ super(Messages.getString("LocationAndPropertyPage.Title"));
+ setTitle(Messages.getString("LocationAndPropertyPage.Title"));
+ setDescription(Messages
+ .getString("LocationAndPropertyPage.Description"));
+ }
+
+ protected void customExtention(Composite parent) {
+ // Location
+ Label lTestFolderLocationLabel = new Label(parent, SWT.NONE);
+ GridData gd_TestFolderLocationLabel = new GridData();
+ lTestFolderLocationLabel.setLayoutData(gd_TestFolderLocationLabel);
+ lTestFolderLocationLabel.setText("Test Folder:");
+
+ iTestFolderLocationEdit = new Text(parent, SWT.BORDER);
+ GridData gd_TestFolderLocationEdit = new GridData(4, 16777216, true,
+ false);
+ gd_TestFolderLocationEdit.horizontalSpan = 2;
+ iTestFolderLocationEdit.setLayoutData(gd_TestFolderLocationEdit);
+ iTestFolderLocationEdit.setToolTipText(Messages
+ .getString("LocationAndPropertyPage.Location_Tooltip"));
+
+ Set<String> folderSet = ((AbstractTemplateWizard) getWizard())
+ .getTestFoldersSet();
+ IProject targetProject = ((AbstractTemplateWizard) getWizard())
+ .getTargetProject();
+ if (targetProject != null && folderSet != null && folderSet.size() > 0) {
+ String folder = folderSet.iterator().next();
+ if (targetProject.getFolder(folder).exists()) {
+ iTestFolderLocation = folder;
+ }
+ }
+ if (iTestFolderLocation == null) {
+ iTestFolderLocationEdit
+ .setText(iTestFolderLocation = PreferenceUtil
+ .getTestFolderName(null));
+ } else {
+ iTestFolderLocationEdit.setText(iTestFolderLocation);
+ iTestFolderLocationEdit.setEnabled(false);
+ }
+ iTestFolderLocationEdit.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ org.eclipse.swt.graphics.Point selection = iTestFolderLocationEdit
+ .getSelection();
+ setPath(iTestFolderLocationEdit, new Path(
+ iTestFolderLocationEdit.getText()));
+ iTestFolderLocationEdit.setSelection(selection);
+ // iTestFolderSet
+ setPageComplete(validatePage());
+ }
+ });
+ }
+
+ private void setPath(Text text, IPath path) {
+ path = path.makeRelative().setDevice(null);
+ String pathStr = path.toPortableString();
+ if (!text.getText().equals(pathStr))
+ text.setText(pathStr);
+ }
+
+ protected boolean validatePage() {
+ boolean isValid = true;
+ setMessage(null);
+
+ if (iTestFolderLocationEdit.getText().length() == 0) {
+ isValid = false;
+ setErrorMessage(Messages
+ .getString("LocationAndPropertyPage.Empty_TestFolderLocation"));
+ } else if (!(CConventions.validateFieldName(iTestFolderLocationEdit
+ .getText()).isOK())) {
+ isValid = false;
+ setErrorMessage(Messages
+ .getString("LocationAndPropertyPage.Invalid_TestFolderName"));
+ }
+ if (isValid) {
+ iTestFolderLocation = iTestFolderLocationEdit.getText().trim();
+ setErrorMessage(null);
+ return super.validatePage();
+ }
+ return isValid;
+ }
+
+ public void collectData() {
+ super.collectData();
+ ((AbstractTemplateWizard) getWizard())
+ .setTestFolderLocation(iTestFolderLocation);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/MethodEditDialog.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,220 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.testfw.codegen.ui.wizard;
+
+import java.util.Set;
+
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+import com.nokia.testfw.codegen.ui.Messages;
+import com.nokia.testfw.codegen.model.INode;
+import com.nokia.testfw.codegen.model.MethodNodeImpl;
+import com.nokia.testfw.codegen.model.ClassNodeImpl;
+
+public class MethodEditDialog extends Dialog {
+ private static final Image ERROR_IMG = JFaceResources
+ .getImage("dialog_message_error_image");
+
+ private boolean result = false;
+ private String iTitle;
+ private MethodNodeImpl iTestMethod;
+ private ClassNodeImpl iTestClass;
+ private Text iTestMethodNameText;
+ private Button iBtnOK;
+ private CLabel iMessageLabel;
+ private String iMethodName;
+
+ private static final String NEWMETHOD = "TestMethod";
+
+ public MethodEditDialog(Shell parent, String title,
+ MethodNodeImpl testmethod) {
+ super(parent, 0);
+ iTitle = title;
+ if (testmethod != null) {
+ iTestMethod = testmethod;
+ iTestClass = (ClassNodeImpl) iTestMethod.getParent();
+ } else {
+ throw new IllegalArgumentException(
+ "Parameter testmethod can not be null.");
+ }
+ }
+
+ public MethodEditDialog(Shell parent, String title,
+ ClassNodeImpl parentClass) {
+ super(parent, 0);
+ iTitle = title;
+ if (parentClass != null) {
+ iTestClass = parentClass;
+ int counter = 1;
+ while (isDuplicate(NEWMETHOD + Integer.toString(counter))) {
+ counter++;
+ }
+ iTestMethod = new MethodNodeImpl(NEWMETHOD
+ + Integer.toString(counter), parentClass);
+ } else {
+ throw new IllegalArgumentException(
+ "Parameter parentClass can not be null.");
+ }
+ }
+
+ private void init(final Shell shell) {
+ shell.setText(iTitle);
+ shell.setLayout(new GridLayout(4, true));
+ Label label = new Label(shell, SWT.None);
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 1;
+ label.setLayoutData(data);
+ label.setText(Messages.getString("MethodDialog.MethodName"));
+
+ iTestMethodNameText = new Text(shell, SWT.BORDER);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 3;
+ iTestMethodNameText.setLayoutData(data);
+ iTestMethodNameText.setText(iTestMethod.getName());
+ iTestMethodNameText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent event) {
+ canComplete(validation());
+ }
+ });
+ iTestMethodNameText.selectAll();
+
+ // Message Label
+ iMessageLabel = new CLabel(shell, SWT.NONE);
+ GridData messageLabelData = new GridData(GridData.FILL_HORIZONTAL);
+ messageLabelData.horizontalSpan = 4;
+ iMessageLabel.setLayoutData(messageLabelData);
+
+ label = new Label(shell, SWT.None);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 2;
+ label.setLayoutData(data);
+
+ iBtnOK = new Button(shell, SWT.PUSH);
+ iBtnOK.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ iBtnOK.setText(Messages.getString("Dialog.OK"));
+ iBtnOK.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ result = true;
+ iTestMethod.setName(iMethodName);
+ ((Button) event.widget).getShell().dispose();
+ }
+ });
+
+ Button lBtnCancel = new Button(shell, SWT.PUSH);
+ lBtnCancel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ lBtnCancel.setText(Messages.getString("Dialog.Cancel"));
+ lBtnCancel.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ result = false;
+ ((Button) event.widget).getShell().dispose();
+ }
+ });
+
+ canComplete(validation());
+ }
+
+ public boolean open() {
+ Shell parent = getParent();
+ Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+
+ init(shell);
+ shell.pack();
+
+ Rectangle lParentBounds = parent.getBounds();
+ Point lDialogSize = shell.getSize();
+ shell.setLocation(lParentBounds.x
+ + (lParentBounds.width - lDialogSize.x) / 2, lParentBounds.y
+ + (lParentBounds.height - lDialogSize.y) / 2);
+
+ shell.open();
+ Display display = parent.getDisplay();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ return result;
+ }
+
+ private boolean isDuplicate(String name) {
+ Set<INode> lMethodSet = (Set<INode>) iTestClass.getChildren();
+ for (INode item : lMethodSet) {
+ if (item != iTestMethod) {
+ if (item.getName().equals(name)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean validation() {
+ String text = iTestMethodNameText.getText();
+ if (!text.matches("^[a-zA-Z~_]\\w*")) {
+ showMessage(Messages.getString("MethodDialog.InvalidMethodName",
+ text));
+ return false;
+ }
+ if (isDuplicate(text)) {
+ showMessage(Messages.getString("MethodDialog.DuplicateMethodName",
+ text));
+ return false;
+ }
+ iMethodName = text;
+ showMessage(null);
+ return true;
+ }
+
+ private void canComplete(boolean validate) {
+ if (validate) {
+ iBtnOK.setEnabled(true);
+ } else {
+ iBtnOK.setEnabled(false);
+ }
+ }
+
+ private void showMessage(String message) {
+ if (message == null) {
+ iMessageLabel.setImage(null);
+ iMessageLabel.setText(null);
+ } else {
+ iMessageLabel.setImage(ERROR_IMG);
+ iMessageLabel.setText(message);
+ }
+ }
+
+ public MethodNodeImpl getMethodItem() {
+ return iTestMethod;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/ModuleAndPropertyPage.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.wizard;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.cdt.core.CConventions;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+import com.nokia.testfw.codegen.ui.CodegenUIPlugin;
+import com.nokia.testfw.codegen.ui.Messages;
+import com.nokia.testfw.codegen.ui.parser.ProjectInfoHelper;
+
+public class ModuleAndPropertyPage extends PropertyPage {
+
+ private Text iModuleNameText;
+ private String iModuleName;
+ private Set<String> iModuleSet = new HashSet<String>();
+ private Button iModuleSeparateFolderBtn;
+ private boolean iSeparateFolder = false;
+ private IProject iProject;
+
+ public ModuleAndPropertyPage() {
+ super(Messages.getString("ModuleAndPropertyPage.Title"));
+ setTitle(Messages.getString("ModuleAndPropertyPage.Title"));
+ setDescription(Messages.getString("ModuleAndPropertyPage.Description"));
+ }
+
+ protected void customExtention(Composite parent) {
+ // Module
+ Label lTestFolderLocationLabel = new Label(parent, SWT.NONE);
+ GridData gd_TestFolderLocationLabel = new GridData();
+ lTestFolderLocationLabel.setLayoutData(gd_TestFolderLocationLabel);
+ lTestFolderLocationLabel.setText("Test Class Name:");
+
+ iModuleNameText = new Text(parent, SWT.BORDER);
+ GridData gd_ModuleNameText = new GridData(4, 16777216, true, false);
+ gd_ModuleNameText.horizontalSpan = 2;
+ iModuleNameText.setLayoutData(gd_ModuleNameText);
+ iModuleNameText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent event) {
+ setPageComplete(validatePage());
+ }
+ });
+
+ iModuleSeparateFolderBtn = new Button(parent, SWT.CHECK);
+ GridData gd_TModuleSeparateFolderBtn = new GridData();
+ gd_TModuleSeparateFolderBtn.horizontalSpan = 3;
+ iModuleSeparateFolderBtn.setLayoutData(gd_TModuleSeparateFolderBtn);
+ iModuleSeparateFolderBtn
+ .setText("Create individual folder for this Test Class");
+ iModuleSeparateFolderBtn.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ iSeparateFolder = iModuleSeparateFolderBtn.getSelection();
+ }
+ });
+ iModuleSeparateFolderBtn.setSelection(iSeparateFolder);
+ }
+
+ @Override
+ public void initPage(Map<String, Object> dataMap) {
+ super.initPage(dataMap);
+ iProject = ((AbstractTemplateWizard) getWizard()).getTargetProject();
+ try {
+ if (((AbstractTemplateWizard) getWizard()).isShowNewProjectPage()) {
+ String lProjectName = (String) iDataMap
+ .get(AbstractTemplateWizard.PROJECT_NAME);
+ iModuleNameText.setText(lProjectName);
+ } else {
+ String modules = ProjectInfoHelper.getProjectStorage(iProject,
+ STFNewTestWizard.STF_SCRIPT, STFNewTestWizard.MODULES);
+ if (modules != null) {
+ String[] module = modules.split(",");
+ for (String m : module) {
+ iModuleSet.add(m.toLowerCase());
+ }
+ }
+
+ String separate_folder = ProjectInfoHelper.getProjectStorage(
+ iProject, STFNewTestWizard.STF_SCRIPT,
+ STFNewTestWizard.SEPARATE_FOLDER);
+ iSeparateFolder = Boolean.parseBoolean(separate_folder);
+ iModuleSeparateFolderBtn.setSelection(iSeparateFolder);
+ }
+ } catch (CoreException e) {
+ CodegenUIPlugin.getDefault().getLog().log(e.getStatus());
+ }
+ }
+
+ protected boolean validatePage() {
+ boolean isValid = true;
+ setMessage(null);
+
+ if(!(CConventions.validateFieldName(iModuleNameText.getText()).isOK())){
+ isValid = false;
+ setErrorMessage(Messages
+ .getString("ModuleAndPropertyPage.Invalid_ModuleName"));
+ }
+ if (iModuleSet.contains(iModuleNameText.getText().toLowerCase())) {
+ isValid = false;
+ setErrorMessage(Messages
+ .getString("ModuleAndPropertyPage.Duplicate_ModuleName"));
+ }
+
+ if (isValid) {
+ iModuleName = iModuleNameText.getText().trim();
+ iSeparateFolder = iModuleSeparateFolderBtn.getSelection();
+ setErrorMessage(null);
+ return super.validatePage();
+ }
+ return isValid;
+ }
+
+ public String getModuleName() {
+ return iModuleNameText.getText().trim();
+ }
+
+ public void setModuleName(String module) {
+ iModuleName = module;
+ }
+
+ public void collectData() {
+ super.collectData();
+ iDataMap.put("class_name", iModuleName);
+ ((STFNewTestWizard) getWizard()).setModuleName(iModuleName);
+ if (iSeparateFolder) {
+ ((AbstractTemplateWizard) getWizard())
+ .setTestFolderLocation(iModuleName);
+ } else {
+ ((AbstractTemplateWizard) getWizard()).setTestFolderLocation(null);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/PropertyPage.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,201 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.wizard;
+
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+import com.nokia.testfw.codegen.ui.preferences.PreferenceConstants;
+import com.nokia.testfw.codegen.ui.preferences.PreferenceUtil;
+import com.nokia.testfw.codegen.ui.CodegenUIPlugin;
+import com.nokia.testfw.codegen.ui.Messages;
+
+public class PropertyPage extends AbstractTemplateWizardPage {
+
+ private Text iUID3Edit;
+ private Button iUID3Button;
+ private Text iAutherNameEdit;
+ private String iUID3;
+ private String iAutherName;
+ protected Button iPreviewButton;
+ protected boolean isShowPreview = true;
+ protected Map<String, Object> iDataMap;
+
+ public PropertyPage() {
+ super(Messages.getString("PropertyPage.Title"));
+ setTitle(Messages.getString("PropertyPage.Title"));
+ setDescription(Messages.getString("PropertyPage.Description"));
+ }
+
+ protected PropertyPage(String pageName) {
+ super(pageName);
+ }
+
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.marginTop = 10;
+ gridLayout.marginRight = 10;
+ gridLayout.marginLeft = 10;
+ gridLayout.marginBottom = 10;
+ gridLayout.horizontalSpacing = 10;
+ gridLayout.numColumns = 3;
+ container.setLayout(gridLayout);
+
+ // Custom extention
+ customExtention(container);
+
+ // UID3
+ Label lUID3Label = new Label(container, SWT.NONE);
+ GridData gd_UID3Label = new GridData();
+ lUID3Label.setLayoutData(gd_UID3Label);
+ lUID3Label.setText("UID3:");
+
+ iUID3Edit = new Text(container, 2048);
+ GridData gd_UID3Edit = new GridData(GridData.FILL_HORIZONTAL);
+ gd_UID3Edit.horizontalSpan = 1;
+ iUID3Edit.setLayoutData(gd_UID3Edit);
+ iUID3Edit.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent arg0) {
+ setPageComplete(validatePage());
+ }
+ });
+
+ iUID3Button = new Button(container, SWT.NONE);
+ iUID3Button.setText("Random");
+ iUID3Button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent selectionevent) {
+ setUID3Random();
+ }
+ });
+
+ // AutherName
+ Label lAutherNameLabel = new Label(container, SWT.NONE);
+ GridData gd_AutherNameLabel = new GridData();
+ lAutherNameLabel.setLayoutData(gd_AutherNameLabel);
+ lAutherNameLabel.setText("Author:");
+
+ iAutherNameEdit = new Text(container, 2048);
+ GridData gd_AutherNameEdit = new GridData(GridData.FILL_HORIZONTAL);
+ gd_AutherNameEdit.horizontalSpan = 2;
+ iAutherNameEdit.setLayoutData(gd_AutherNameEdit);
+
+ // Seperator
+ Label lSeperator = new Label(container, SWT.SEPARATOR | SWT.HORIZONTAL);
+ GridData gd_Seperator = new GridData(GridData.FILL_HORIZONTAL);
+ gd_Seperator.horizontalSpan = 3;
+ lSeperator.setLayoutData(gd_Seperator);
+
+ // PreviewButton
+ iPreviewButton = new Button(container, SWT.CHECK);
+ iPreviewButton.setLayoutData(new GridData());
+ iPreviewButton.setText("Preview changes");
+ iPreviewButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent selectionevent) {
+ getContainer().updateButtons();
+ }
+ });
+ iPreviewButton.setVisible(isShowPreview);
+
+ setControl(container);
+ initDefaults();
+ }
+
+ protected void customExtention(Composite parent) {
+ }
+
+ protected void initDefaults() {
+ IPreferenceStore preferenceStore = CodegenUIPlugin.getDefault()
+ .getPreferenceStore();
+ setUID3Random();
+ iAutherNameEdit.setText(iAutherName = preferenceStore
+ .getString(PreferenceConstants.AUTHER));
+ }
+
+ private void setUID3Random() {
+ iUID3Edit.setText(iUID3 = PreferenceUtil.getRandomAppUID());
+ Event event = new Event();
+ event.item = iUID3Edit;
+ iUID3Edit.notifyListeners(24, event);
+ }
+
+ protected boolean validatePage() {
+ boolean isValid = true;
+ setMessage(null);
+
+ if (!PreferenceUtil.validateAppUIDText(iUID3Edit.getText())) {
+ isValid = false;
+ setErrorMessage(Messages.getString(
+ "LocationAndPropertyPage.UIDHexError", iUID3Edit.getText()));
+ }
+
+ if (isValid) {
+ iUID3 = iUID3Edit.getText();
+ iAutherName = iAutherNameEdit.getText();
+ setErrorMessage(null);
+ }
+ return isValid;
+ }
+
+ public boolean isShowPreviewChanges() {
+ return iPreviewButton.getSelection();
+ }
+
+ public void setShowPreviewChanges(boolean show) {
+ iPreviewButton.setSelection(show);
+ }
+
+ public boolean isShowPreviewButton() {
+ return isShowPreview;
+ }
+
+ public void setShowPreviewButton(boolean isShowPreviewButton) {
+ this.isShowPreview = isShowPreviewButton;
+ }
+
+ public void collectData() {
+ iDataMap.put("UID3", iUID3);
+ iDataMap.put("auther_name", iAutherName);
+ }
+
+ public String getiUID3() {
+ return iUID3;
+ }
+
+ public String getiAutherName() {
+ return iAutherName;
+ }
+
+ public void initPage(Map<String, Object> dataMap) {
+ iDataMap = dataMap;
+ setPageComplete(validatePage());
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/STFNewTestWizard.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.testfw.codegen.ui.wizard;
+
+import java.util.Set;
+
+import org.eclipse.cdt.core.model.CModelException;
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbench;
+
+import com.nokia.testfw.codegen.model.ClassNodeImpl;
+import com.nokia.testfw.codegen.model.ProjectNodeImpl;
+import com.nokia.testfw.codegen.ui.CodegenUIPlugin;
+import com.nokia.testfw.codegen.ui.parser.Parser;
+import com.nokia.testfw.codegen.ui.parser.ProjectInfoHelper;
+import com.nokia.testfw.codegen.ui.parser.model.UIProjectNode;
+
+public class STFNewTestWizard extends AbstractTemplateWizard {
+
+ public static final String STF_SCRIPT = "STF_Script";
+ public static final String MODULES = "modules";
+ public static final String SEPARATE_FOLDER = "separate_folder";
+
+ private boolean iShowNewModulePage = true;
+ private GenTestMethodPage iGenTestMethodPage;
+ private ModuleAndPropertyPage iModuleAndPropertyPage;
+ private TestCasePreviewPage iTestCasePreviewPage;
+
+ private ProjectNodeImpl iProjectNode;
+ private ClassNodeImpl iClassNode;
+ private String iModuleName;
+
+ public STFNewTestWizard() {
+ super(STF_SCRIPT);
+ }
+
+ @Override
+ public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
+ super.init(workbench, currentSelection);
+ if (iShowNewModulePage == false) {
+ Object selObj = currentSelection.getFirstElement();
+ if (selObj instanceof ITranslationUnit) {
+ iModuleName = ((ITranslationUnit) selObj).getElementName();
+ iModuleName = iModuleName.substring(0, iModuleName
+ .lastIndexOf('.'));
+ iDataMap.put("class_name", iModuleName);
+ iProjectNode = createProjectNode(selObj);
+ Set<String> lTestFolders = getTestFoldersSet();
+ if (lTestFolders != null && lTestFolders.size() > 0) {
+ String folder = ((ITranslationUnit) selObj).getResource()
+ .getProjectRelativePath().segment(0);
+ if (lTestFolders.contains(folder)) {
+ iTestFolderLocation = folder;
+ }
+ }
+ }
+ }
+ if (iProjectNode == null || iClassNode == null) {
+ iProjectNode = createProjectNode(iTargetProject);
+ }
+ iDataMap.put(PROJECT_OBJECT, iProjectNode);
+ }
+
+ public void addPages() {
+ super.addPages();
+
+ if (iShowNewModulePage) {
+ iModuleAndPropertyPage = new ModuleAndPropertyPage();
+ iModuleAndPropertyPage.setShowPreviewButton(false);
+ addPage(iModuleAndPropertyPage);
+ }
+
+ iGenTestMethodPage = new GenTestMethodPage();
+ addPage(iGenTestMethodPage);
+
+ if (!iShowNewProjectPage && !iShowNewModulePage) {
+ iTestCasePreviewPage = new TestCasePreviewPage();
+ addPage(iTestCasePreviewPage);
+ }
+ }
+
+ @Override
+ protected boolean initPagesConditon() {
+ return !iShowNewProjectPage;
+ }
+
+ public boolean isShowNewModulePage() {
+ return iShowNewModulePage;
+ }
+
+ public void setShowNewModulePage(boolean showNewModulePage) {
+ iShowNewModulePage = showNewModulePage;
+ }
+
+ private ProjectNodeImpl createProjectNode(Object sel) {
+ if (sel instanceof ITranslationUnit) {
+ try {
+ iProjectNode = Parser.parseTranslationUnit(
+ (ITranslationUnit) sel, Parser.PUBLIC
+ | Parser.PROTECTED | Parser.PRIVATE);
+ if (iProjectNode.getChildren().size() > 0) {
+ iClassNode = (ClassNodeImpl) iProjectNode.getChildren()
+ .iterator().next();
+ }
+ ((UIProjectNode) iProjectNode).setVisible(false);
+ } catch (CModelException e) {
+ CodegenUIPlugin.getDefault().getLog().log(e.getStatus());
+ }
+ } else if (sel instanceof IProject) {
+ iProjectNode = new ProjectNodeImpl(((IProject) sel).getName());
+ iClassNode = new ClassNodeImpl(((IProject) sel).getName(),
+ iProjectNode);
+ iProjectNode.addChild(iClassNode);
+ } else {
+ iProjectNode = new ProjectNodeImpl("");
+ iClassNode = new ClassNodeImpl("TestClass", iProjectNode);
+ iProjectNode.addChild(iClassNode);
+ }
+
+ return iProjectNode;
+ }
+
+ public String getModuleName() {
+ return iModuleName;
+ }
+
+ public void setModuleName(String moduleName) {
+ iModuleName = moduleName;
+ }
+
+ @Override
+ protected void collectPagesData() {
+ super.collectPagesData();
+ iProjectNode.setName(iProjectName);
+ iClassNode.setName(iModuleName);
+ }
+
+ @Override
+ protected void setProjectInfo(IProject project, IFile bldInf,
+ IProgressMonitor monitor) throws CoreException {
+ super.setProjectInfo(project, bldInf, monitor);
+ if (iShowNewProjectPage) {
+ // Add STF Nature
+ IProjectDescription description = project.getDescription();
+ String[] natures = description.getNatureIds();
+ String[] newNatures = new String[natures.length + 1];
+ System.arraycopy(natures, 0, newNatures, 0, natures.length);
+ newNatures[natures.length] = "com.nokia.testfw.codegen.ui.STFProjectNature";
+ description.setNatureIds(newNatures);
+ project.setDescription(description, monitor);
+ }
+
+ if (iShowNewModulePage) {
+ ProjectInfoHelper.setProjectStorage(project, STF_SCRIPT,
+ SEPARATE_FOLDER, Boolean
+ .toString(iTestFolderLocation != null));
+
+ String modules = ProjectInfoHelper.getProjectStorage(project,
+ STF_SCRIPT, MODULES);
+ boolean module_exist = false;
+ if (modules != null && modules.trim().length() > 0) {
+ modules = modules.trim();
+ String[] module = modules.split(",");
+ for (String m : module) {
+ if (m.equalsIgnoreCase(iModuleName)) {
+ module_exist = true;
+ break;
+ }
+ }
+ }
+ if (!module_exist) {
+ if (modules == null) {
+ modules = iModuleName;
+ } else {
+ modules += "," + iModuleName;
+ }
+ ProjectInfoHelper.setProjectStorage(project, STF_SCRIPT,
+ MODULES, modules);
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/SUTNewTestWizard.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.testfw.codegen.ui.wizard;
+
+import org.eclipse.jface.wizard.IWizardPage;
+
+public class SUTNewTestWizard extends AbstractTemplateWizard {
+
+ public static final String SYMBIAN_UNIT_TEST = "SymbianUnitTest";
+
+ private ChooseProjectPage iChooseProjectPage;
+ private ChooseObjectivePage iChooseObjectivePage;
+ private LocationAndPropertyPage iLocationAndPropertyPage;
+ private TestCasePreviewPage iTestCasePreviewPage;
+
+ private boolean iShowChooseProjectPage = true;
+
+ public SUTNewTestWizard() {
+ super(SYMBIAN_UNIT_TEST);
+ iShowNewProjectPage = false;
+ }
+
+ public void addPages() {
+ super.addPages();
+ if (iShowChooseProjectPage) {
+ iChooseProjectPage = new ChooseProjectPage();
+ addPage(iChooseProjectPage);
+ }
+
+ iChooseObjectivePage = new ChooseObjectivePage();
+ addPage(iChooseObjectivePage);
+
+ iLocationAndPropertyPage = new LocationAndPropertyPage();
+ addPage(iLocationAndPropertyPage);
+
+ if (iShowChooseProjectPage) {
+ iLocationAndPropertyPage.setShowPreviewButton(false);
+ } else {
+ iTestCasePreviewPage = new TestCasePreviewPage();
+ addPage(iTestCasePreviewPage);
+ }
+ }
+
+ @Override
+ protected boolean initPagesConditon() {
+ return !iShowChooseProjectPage;
+ }
+
+ /**
+ * @return the iShowChooseProjectPage
+ */
+ public boolean isShowChooseProjectPage() {
+ return iShowChooseProjectPage;
+ }
+
+ /**
+ * @param iShowChooseProjectPage
+ * the iShowChooseProjectPage to set
+ */
+ public void setShowChooseProjectPage(boolean showChooseProjectPage) {
+ this.iShowChooseProjectPage = showChooseProjectPage;
+ }
+
+ /**
+ * Overridden to check if preview page is the next page and is it requested
+ * to be shown. If user has not selected it to be shown, returns null as
+ * next page.
+ */
+ @Override
+ public IWizardPage getNextPage(IWizardPage page) {
+ if (page instanceof LocationAndPropertyPage) {
+ if (!iLocationAndPropertyPage.isShowPreviewChanges()) {
+ return null;
+ }
+ }
+ return super.getNextPage(page);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/TestCasePreviewPage.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.wizard;
+
+import java.util.Map;
+
+import org.eclipse.jface.dialogs.IPageChangedListener;
+import org.eclipse.jface.dialogs.IPageChangingListener;
+import org.eclipse.jface.dialogs.PageChangedEvent;
+import org.eclipse.jface.dialogs.PageChangingEvent;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.part.PageBook;
+
+import com.nokia.testfw.codegen.ChangeFileContent;
+import com.nokia.testfw.codegen.ui.util.PathNode;
+import com.nokia.testfw.codegen.ui.util.PathNodeConverter;
+import com.nokia.testfw.codegen.ui.util.PathNodeTreeContentLabelProvoder;
+import com.nokia.testfw.codegen.ui.util.PathNodeTreeViewerComparator;
+import com.nokia.testfw.codegen.ui.wizard.preview.ChangeElement;
+import com.nokia.testfw.codegen.ui.wizard.preview.ComparePreviewer;
+
+/**
+ * Test Case Wizard page for reviewing changes
+ *
+ */
+public class TestCasePreviewPage extends WizardPage implements
+ IPageChangedListener, IPageChangingListener {
+
+ private PageBook previewContainer;
+ private ComparePreviewer comparePreview;
+ private TreeViewer iTreeViewer;
+
+ private Map<String, ChangeFileContent> iResultMap;
+
+ Composite container;
+
+ /**
+ * @param pageName
+ */
+ public TestCasePreviewPage() {
+ super("SkeletonPreviewPage");
+ setTitle("Preview changes");
+ setDescription("Click finish to generate test case(s)");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
+ * .Composite)
+ */
+ public void createControl(Composite parent) {
+ container = new Composite(parent, SWT.NONE);
+ container.setLayout(new GridLayout(1, true));
+
+ // table to display all files that are going to be changed
+ Label label1 = new Label(container, SWT.SINGLE);
+ label1.setText("Files to be modified");
+
+ iTreeViewer = new TreeViewer(container, SWT.BORDER | SWT.H_SCROLL
+ | SWT.V_SCROLL);
+ iTreeViewer.getTree().setLayoutData(
+ new GridData(SWT.FILL, SWT.TOP, true, false));
+ PathNodeTreeContentLabelProvoder provider = new PathNodeTreeContentLabelProvoder();
+ iTreeViewer.setLabelProvider(provider);
+ iTreeViewer.setContentProvider(provider);
+ iTreeViewer.setComparator(new PathNodeTreeViewerComparator());
+ iTreeViewer
+ .addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ ITreeSelection sel = (ITreeSelection) event
+ .getSelection();
+ if (sel != null) {
+ PathNode node = (PathNode) sel.getFirstElement();
+ if (node != null) {
+ setSelectElement((ChangeElement) node.getData());
+ }
+ }
+ }
+ });
+
+ // UI elements to show the CompareViewerSwitchingPane
+ SashForm sashForm = new SashForm(container, SWT.VERTICAL);
+ sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ sashForm.setBackground(new Color(getShell().getDisplay(), 0, 0, 0));
+ previewContainer = new PageBook(sashForm, SWT.NONE);
+ comparePreview = new ComparePreviewer(previewContainer, false, false);
+
+ setSelectElement(null);
+ setControl(container);
+
+ /**
+ * We want to be informed about pageChanged event in order to generate
+ * content.
+ */
+ ((WizardDialog) getContainer()).addPageChangedListener(this);
+ ((WizardDialog) getContainer()).addPageChangingListener(this);
+ }
+
+ private void update() {
+ if (iResultMap != null) {
+ PathNode root = new PathNode("");
+ PathNode targetProject = new PathNode(
+ ((AbstractTemplateWizard) getWizard()).getProjectName());
+ root.addChild(targetProject);
+ for (String path : iResultMap.keySet()) {
+ ChangeFileContent lChangeContent = iResultMap.get(path);
+ if (lChangeContent.getNewContent().equals(
+ lChangeContent.getOldContent())) {
+ continue;
+ }
+ PathNode node = PathNodeConverter.pathToNode(targetProject,
+ path);
+ node.setData(new ChangeElement(lChangeContent));
+ }
+ iTreeViewer.setInput(root);
+ iTreeViewer.expandAll();
+ }
+ }
+
+ /**
+ * Sets input to compare preview (called from wizard when page is set to
+ * visible)
+ *
+ * @param changeElement
+ * to set to the preview
+ **/
+ private void setSelectElement(ChangeElement changeElement) {
+ comparePreview.setInput(changeElement);
+ previewContainer.showPage(comparePreview.getControl());
+ }
+
+ public void pageChanged(PageChangedEvent event) {
+ if (event.getSelectedPage() instanceof TestCasePreviewPage) {
+ iResultMap = ((IPreviewResult) getWizard()).getPreviewResult();
+ ((IPreviewResult) getWizard()).setPreviewResult(iResultMap);
+ update();
+ }
+ }
+
+ public void handlePageChanging(PageChangingEvent event) {
+ if (event.getCurrentPage() instanceof TestCasePreviewPage) {
+ ((IPreviewResult) getWizard()).setPreviewResult(null);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/preview/ChangeElement.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.testfw.codegen.ui.wizard.preview;
+
+import com.nokia.testfw.codegen.ChangeFileContent;
+
+/**
+ * Objects of this class describe changes in code that will be performed during
+ * Test Case Wizard operation. Needed for change preview.
+ *
+ */
+public class ChangeElement {
+
+ public ChangeElement(ChangeFileContent changeContent) {
+ oldElement = new StringInput(changeContent.getOldContent());
+ newElement = new StringInput(changeContent.getNewContent());
+ }
+
+ private StringInput oldElement;
+ private StringInput newElement;
+
+ // private String oldLabel;
+ // private String newLabel;
+
+ /**
+ * Gets new element
+ *
+ * @return new element
+ */
+ public StringInput getNewElement() {
+ return newElement;
+ }
+
+ /**
+ * Gets old element
+ *
+ * @return old element
+ */
+ public StringInput getOldElement() {
+ return oldElement;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/preview/ComparePreviewer.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.testfw.codegen.ui.wizard.preview;
+
+import org.eclipse.compare.CompareConfiguration;
+import org.eclipse.compare.CompareUI;
+import org.eclipse.compare.CompareViewerSwitchingPane;
+import org.eclipse.compare.contentmergeviewer.ContentMergeViewer;
+import org.eclipse.compare.structuremergeviewer.DiffNode;
+import org.eclipse.compare.structuremergeviewer.Differencer;
+import org.eclipse.compare.structuremergeviewer.ICompareInput;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+import com.nokia.testfw.codegen.ui.CodegenUIPlugin;
+
+/**
+ * Changes previewer of Test Case Wizard
+ *
+ */
+public class ComparePreviewer extends CompareViewerSwitchingPane {
+
+ private CompareConfiguration fCompareConfiguration;
+
+ /**
+ * Constructor
+ *
+ * @param parent
+ * Parenent composite
+ * @param leftEditable
+ * Says if left window is editable
+ * @param rightEditable
+ * Says if right window is editable
+ */
+ public ComparePreviewer(Composite parent, boolean leftEditable,
+ boolean rightEditable) {
+ super(parent, SWT.BORDER | SWT.FLAT, true);
+ fCompareConfiguration = new CompareConfiguration();
+ fCompareConfiguration.setLeftEditable(leftEditable);
+ fCompareConfiguration.setRightEditable(rightEditable);
+ }
+
+ /**
+ * Method returning handle to current object
+ *
+ * @return object of ComparePreviewer class
+ */
+ public Control getControl() {
+ return this;
+ }
+
+ /**
+ * Called by
+ * {@link org.eclipse.compare.CompareViewerSwitchingPane#setInput(Object input)}
+ *
+ * @see org.eclipse.compare.CompareViewerSwitchingPane#getViewer(org.eclipse.jface.viewers.Viewer,
+ * java.lang.Object)
+ */
+ protected Viewer getViewer(Viewer oldViewer, Object input) {
+ Viewer mergeViewer = CompareUI.findContentViewer(oldViewer,
+ (ICompareInput) input, this, fCompareConfiguration);
+ if (mergeViewer instanceof ContentMergeViewer) {
+ ((ContentMergeViewer) mergeViewer).setConfirmSave(true);
+ }
+ return mergeViewer;
+ }
+
+ /**
+ * Sets input for the compare preview
+ *
+ * @param input
+ * ChangeElement or suitable object for
+ * CompareViewerSwitchingPane.setInput
+ */
+ public void setInput(Object input) {
+ try {
+ if (input instanceof ChangeElement) {
+ ChangeElement changeElement = (ChangeElement) input;
+ fCompareConfiguration.setLeftLabel("New");
+ fCompareConfiguration.setRightLabel("Original");
+ super.setInput(new DiffNode(Differencer.CHANGE, null,
+ changeElement.getNewElement(), changeElement
+ .getOldElement()));
+ } else {
+ super.setInput(input);
+ }
+ } catch (Throwable e) {
+ IStatus lStatus = new Status(IStatus.ERROR, ComparePreviewer.class
+ .getName(), "Exception was thrown while comparing changes",
+ e);
+ CodegenUIPlugin.getDefault().getLog().log(lStatus);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen.ui/src/com/nokia/testfw/codegen/ui/wizard/preview/StringInput.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.wizard.preview;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import org.eclipse.compare.IEditableContent;
+import org.eclipse.compare.IStreamContentAccessor;
+import org.eclipse.compare.ITypedElement;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Class used by compare preview
+ *
+ */
+public class StringInput implements ITypedElement, IEditableContent,
+ IStreamContentAccessor {
+
+ private String text;
+ @SuppressWarnings("unused")
+ private InputStream fContent;
+ private boolean isEditable;
+
+ /**
+ * Constructor
+ */
+ public StringInput(final String text) {
+ this.text = text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.compare.ITypedElement#getImage()
+ */
+ public Image getImage() {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.compare.ITypedElement#getName()
+ */
+ public String getName() {
+ return "StringInput";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.compare.ITypedElement#getType()
+ */
+ public String getType() {
+ return "cpp";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.compare.IStreamContentAccessor#getContents()
+ */
+ public InputStream getContents() throws CoreException {
+ if (text == null) {
+ return null;
+ } else {
+ return new ByteArrayInputStream(text.getBytes());
+ }
+ }
+
+ public void setContent(byte[] newContent) {
+ fContent = new ByteArrayInputStream(newContent);
+ }
+
+ public ITypedElement replace(ITypedElement child, ITypedElement other) {
+ return child;
+ }
+
+ public boolean isEditable() {
+ return isEditable;
+ }
+
+ public void setEditable(boolean isEditable) {
+ this.isEditable = isEditable;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="lib/commons-collections-3.2.1.jar"/>
+ <classpathentry kind="lib" path="lib/commons-lang-2.4.jar"/>
+ <classpathentry kind="lib" path="lib/velocity-1.6.2.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.codegen</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/.settings/org.eclipse.jdt.core.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,12 @@
+#Wed Dec 23 11:15:02 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+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.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/build.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="com.nokia.testfw.codegen" default="build" basedir=".">
+
+ <path id="class.path">
+ <fileset dir="lib">
+ <include name="*.jar" />
+ </fileset>
+ </path>
+
+ <property name="sources.src.dir" value="src" />
+ <property name="classes.dest.dir" value="bin" />
+ <property name="outputs.jar.dir" value="jar" />
+
+ <target name="build">
+ <mkdir dir="${classes.dest.dir}" />
+ <mkdir dir="${outputs.jar.dir}" />
+ <javac srcdir="${sources.src.dir}" destdir="${classes.dest.dir}" excludes="**/.svn/**" optimize="on" nowarn="no" deprecation="on">
+ <classpath refid="class.path" />
+ </javac>
+ <copy todir="${classes.dest.dir}/templates">
+ <fileset dir="${sources.src.dir}/templates">
+ <exclude name="**/.svn"/>
+ </fileset>
+ </copy>
+ <jar destfile="${outputs.jar.dir}/tfw_codegen.jar" basedir="${classes.dest.dir}" />
+ </target>
+
+ <target name="clean" description="Clean the plug-in: com.nokia.testfw.codegen of all the zips, jars and logs created.">
+ <delete dir="${classes.dest.dir}" />
+ <delete dir="${outputs.jar.dir}" />
+ </target>
+
+</project>
Binary file testdev/ite/src/com.nokia.testfw.codegen/lib/commons-collections-3.2.1.jar has changed
Binary file testdev/ite/src/com.nokia.testfw.codegen/lib/commons-lang-2.4.jar has changed
Binary file testdev/ite/src/com.nokia.testfw.codegen/lib/velocity-1.6.2.jar has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/ChangeFileContent.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen;
+
+/**
+ * @author k21wang
+ *
+ */
+public class ChangeFileContent {
+
+
+ private String oldContent;
+ private String newContent;
+ private String filePath;
+
+ /**
+ * @return the filePath
+ */
+ public String getFilePath() {
+ return filePath;
+ }
+
+ /**
+ * @param filePath the filePath to set
+ */
+ public void setFilePath(String filePath) {
+ this.filePath = filePath;
+ }
+
+ /**
+ * Gets new element
+ *
+ * @return
+ * new element
+ */
+ public String getNewContent() {
+ return newContent;
+ }
+
+ /**
+ * Gets old element
+ *
+ * @return
+ * old element
+ */
+ public String getOldContent() {
+ return oldContent;
+ }
+
+ /**
+ * Sets new element
+ *
+ * @param newContent
+ * new element
+ */
+ public void setNewContent(String newContent) {
+ this.newContent = newContent;
+ }
+
+ /**
+ * Sets old element
+ *
+ * @param oldContent
+ * old element
+ */
+ public void setOldContent(String oldContent) {
+ this.oldContent = oldContent;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/CodegenEngine.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,528 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Random;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.exception.ParseErrorException;
+import org.apache.velocity.exception.ResourceNotFoundException;
+
+import com.nokia.testfw.codegen.model.IClassNode;
+import com.nokia.testfw.codegen.model.IMethodNode;
+import com.nokia.testfw.codegen.model.IProjectNode;
+import com.nokia.testfw.codegen.templates.TemplateBuilder;
+import com.nokia.testfw.codegen.templates.TemplateBuilderFactory;
+
+public class CodegenEngine {
+
+ VelocityContext iContext;
+ VelocityEngine iEngine;
+ String iOutputPath;
+ boolean isInit = false;
+ boolean writeToFile = true;
+ Map<String, ChangeFileContent> iResultMap;
+ public final static String REPEAT = "repeat";
+ public final static String PLAIN = "plain";
+
+ /**
+ * @return the writeToFile
+ */
+ public boolean isWriteToFile() {
+ return writeToFile;
+ }
+
+ /**
+ * @param writeToFile
+ * the writeToFile to set
+ */
+ public void setWriteToFile(boolean writeToFile) {
+ this.writeToFile = writeToFile;
+ }
+
+ @SuppressWarnings("unchecked")
+ public CodegenEngine(String outputPath, Map data) {
+
+ iOutputPath = outputPath;
+ iContext = new VelocityContext(data);
+ iEngine = new VelocityEngine();
+ }
+
+ public void init() throws Exception {
+ Properties p = new Properties();
+ p.put("resource.loader", "string");
+ p.put("string.resource.loader.class", StringResourceLoader.class
+ .getName());
+ iEngine.init(p);
+ isInit = true;
+ }
+
+ public Map<String, ChangeFileContent> generate(String template)
+ throws ResourceNotFoundException, ParseErrorException, Exception {
+ if (isInit == false) {
+ throw new IllegalStateException(
+ "CodegenEngine must be initialized.");
+ }
+
+ TemplateBuilder lTemplateBuilder = null;
+ lTemplateBuilder = TemplateBuilderFactory.newInstance()
+ .newTemplateBuilder();
+
+ Map<String, String> lPathTemplateMap = lTemplateBuilder.build(template);
+ collectBuildInfo();
+
+ iResultMap = new TreeMap<String, ChangeFileContent>();
+
+ for (String path : lPathTemplateMap.keySet()) {
+ VelocityContext lContext = iContext;
+ if (path.endsWith(".mmp")) {
+ String buildBaseDir = iOutputPath + File.separator;
+ if (path.lastIndexOf("/") > 0) {
+ buildBaseDir += path.substring(0, path.lastIndexOf("/"));
+ }
+ buildBaseDir = new File(buildBaseDir).getCanonicalPath();
+ lContext = adjustBuildInfo(buildBaseDir, lContext);
+ }
+
+ String pattern = lPathTemplateMap.get(path);
+ dealSingleTemplate(pattern, path, lContext);
+ }
+ return iResultMap;
+ }
+
+ @SuppressWarnings("unchecked")
+ private void dealSingleTemplate(String pattern, final String path,
+ VelocityContext aContext) throws ResourceNotFoundException,
+ ParseErrorException, Exception {
+ boolean containClassName = false;
+ boolean containMethodName = false;
+
+ if (path.indexOf("${class_name}") > 0) {
+ containClassName = true;
+ }
+ if (path.indexOf("${method_name}") > 0) {
+ containMethodName = true;
+ }
+
+ String filepath;
+ if (!containClassName && !containMethodName) {
+ filepath = parse(path, aContext);
+ String content = getContent(filepath, pattern, aContext);
+ writeToFile(filepath, content);
+ } else {
+ IProjectNode lProjectNode = (IProjectNode) aContext
+ .get("project_object");
+ Set<IClassNode> lClassNodeSet = (Set<IClassNode>) lProjectNode
+ .getChildren();
+ VelocityContext lContext = (VelocityContext) aContext.clone();
+ for (IClassNode lClassNode : lClassNodeSet) {
+ lContext.put("class_name", lClassNode.getName());
+ lContext.put("class_object", lClassNode);
+ if (containMethodName) {
+ Set<IMethodNode> lMethodNodeSet = (Set<IMethodNode>) lClassNode
+ .getChildren();
+ for (IMethodNode lMethodNode : lMethodNodeSet) {
+ lContext.put("method_name", lMethodNode.getName());
+ lContext.put("method_object", lMethodNode);
+
+ filepath = parse(path, lContext);
+ String content = getContent(filepath, pattern, lContext);
+ writeToFile(filepath, content);
+ }
+ } else {
+ filepath = parse(path, lContext);
+ String content = getContent(filepath, pattern, lContext);
+ writeToFile(filepath, content);
+ }
+ }
+ }
+ }
+
+ private String getContent(String filepath, String pattern,
+ VelocityContext aContext) throws ResourceNotFoundException,
+ ParseErrorException, Exception {
+ ChangeFileContent lChangeFileContent = new ChangeFileContent();
+ lChangeFileContent.setFilePath(filepath);
+ lChangeFileContent.setOldContent(readFromFile(filepath));
+ if (lChangeFileContent.getOldContent() == null) {
+ StringBuilder content = new StringBuilder();
+ Map<String, String> lFragmentsMap = getFragments(pattern);
+ for (String fragment : lFragmentsMap.keySet()) {
+ String type = lFragmentsMap.get(fragment);
+ if (REPEAT.equals(type)) {
+ if (fragment.indexOf("${RepeatCounter}") == -1) {
+ content.append(parse(fragment, aContext));
+ } else {
+ aContext.remove("RepeatCounter");
+ String workcontent = parse(fragment, aContext);
+ while (workcontent.indexOf("${RepeatCounter}") != -1) {
+ String lines[] = workcontent.split("\n");
+ StringBuilder sb = new StringBuilder();
+ boolean findCounter = false;
+ for (int i = 0; i < lines.length; i++) {
+ lines[i] += "\n";
+ if (findCounter == false
+ && lines[i].indexOf("${RepeatCounter}") != -1) {
+ findCounter = true;
+ String identityLine = lines[i].replace(
+ "${RepeatCounter}", "");
+
+ int counter = 1;
+ while (workcontent.indexOf(identityLine) != -1) {
+ counter++;
+ identityLine = lines[i].replace(
+ "${RepeatCounter}", Integer
+ .toString(counter));
+ }
+ sb.append(identityLine);
+ } else {
+ sb.append(lines[i]);
+ }
+ }
+ workcontent = sb.toString();
+ }
+ content.append(workcontent);
+ }
+ } else {
+ aContext.put("RepeatCounter", "");
+ content.append(parse(fragment, aContext));
+ }
+ }
+ lChangeFileContent.setNewContent(content.toString());
+ } else {
+ String content = lChangeFileContent.getOldContent();
+ Map<String, String> lRepeatSectionMap = getRepeatSections(pattern);
+ for (String mark : lRepeatSectionMap.keySet()) {
+ String section = lRepeatSectionMap.get(mark);
+
+ int startIndex = content.indexOf(mark + " Begin");
+ if (startIndex == -1) {
+ throw new IllegalStateException("Cannot find mark: " + mark
+ + " Begin");
+ }
+ startIndex = content.indexOf("\n", startIndex) + 1;
+ int endIndex = content.indexOf(mark + " End");
+ if (endIndex == -1) {
+ throw new IllegalStateException("Cannot find mark: " + mark
+ + " End");
+ }
+ String subcontent = content.substring(0, endIndex);
+ endIndex = subcontent.lastIndexOf("\n") + 1;
+ if ((startIndex > endIndex)) {
+ throw new IllegalStateException("Illegal mark definition: "
+ + mark);
+ }
+ String workcontent = content.substring(startIndex, endIndex);
+
+ if (section.indexOf("${RepeatCounter}") == -1) {
+ String appendent = parse(section, aContext);
+
+ Set<String> appendentSet = new LinkedHashSet<String>();
+ String lines[] = appendent.split("\n");
+ for (int i = 0; i < lines.length; i++) {
+ lines[i] += "\n";
+ if (workcontent.indexOf(lines[i]) == -1) {
+ appendentSet.add(lines[i]);
+ }
+ }
+ if (appendentSet.size() > 0) {
+ StringBuilder sb = new StringBuilder();
+ for (Iterator<String> itr = appendentSet.iterator(); itr
+ .hasNext();) {
+ sb.append(itr.next());
+ }
+ workcontent = workcontent + "\n" + sb.toString();
+ }
+ } else {
+ aContext.remove("RepeatCounter");
+ String appendent = parse(section, aContext);
+
+ while (appendent.indexOf("${RepeatCounter}") != -1) {
+ String lines[] = appendent.split("\n");
+ StringBuilder sb = new StringBuilder();
+ boolean findCounter = false;
+
+ for (int i = 0; i < lines.length; i++) {
+ lines[i] += "\n";
+ if (findCounter == false
+ && lines[i].indexOf("${RepeatCounter}") != -1) {
+ findCounter = true;
+ String identityLine = lines[i].replace(
+ "${RepeatCounter}", "");
+
+ int counter = 1;
+ while (workcontent.indexOf(identityLine) != -1
+ || appendent.indexOf(identityLine) != -1) {
+ counter++;
+ identityLine = lines[i].replace(
+ "${RepeatCounter}", Integer
+ .toString(counter));
+ }
+ sb.append(identityLine);
+ } else {
+ sb.append(lines[i]);
+ }
+ }
+ appendent = sb.toString();
+ }
+ if (appendent.trim().length() > 0) {
+ workcontent = workcontent + "\n" + appendent;
+ }
+ }
+
+ content = content.substring(0, startIndex) + workcontent
+ + content.substring(endIndex);
+ }
+ lChangeFileContent.setNewContent(content);
+ }
+ iResultMap.put(filepath, lChangeFileContent);
+ return lChangeFileContent.getNewContent();
+ }
+
+ private String pretreat(String pattern) {
+ return pattern.replaceAll("#", "\\\\#").replaceAll("//!!", "#");
+ }
+
+ private String posttreat(String pattern) {
+ return pattern.replaceAll("\\\\#", "#");
+ }
+
+ private String parse(String pattern, VelocityContext context)
+ throws ResourceNotFoundException, ParseErrorException, Exception {
+ String result = null;
+ StringWriter writer = new StringWriter();
+ Template t = iEngine.getTemplate(pretreat(pattern));
+ t.merge(context, writer);
+ result = posttreat(writer.toString());
+ return result;
+ }
+
+ private String readFromFile(String path) throws IOException {
+ String filepath = iOutputPath + File.separator + path;
+ File outputFile = new File(filepath);
+ if (outputFile.exists()) {
+ InputStream lInputStream = new FileInputStream(outputFile);
+ return StringResourceLoader.getString(lInputStream);
+ }
+ return null;
+ }
+
+ private void writeToFile(String path, String content) throws IOException {
+ if (!writeToFile)
+ return;
+ String filepath = iOutputPath + File.separator + path;
+ File outputFile = new File(filepath);
+ if (!outputFile.exists()) {
+ filepath = outputFile.getCanonicalPath();
+ String parentpath = filepath.substring(0, filepath
+ .lastIndexOf(File.separator));
+ File parentDir = new File(parentpath);
+ if (!parentDir.exists()) {
+ parentDir.mkdirs();
+ }
+ outputFile.createNewFile();
+ }
+ PrintWriter writer;
+ writer = new PrintWriter(new FileWriter(outputFile));
+ writer.write(content);
+ writer.flush();
+ writer.close();
+ }
+
+ @SuppressWarnings("unchecked")
+ private void collectBuildInfo() {
+ Set<String> lTestedIncludeSet = new TreeSet<String>();
+ IProjectNode lProjectNode = (IProjectNode) iContext
+ .get("project_object");
+
+ for (IClassNode lClassNode : (Set<IClassNode>) lProjectNode
+ .getChildren()) {
+ String lDeclLocation = lClassNode.getDeclLocation();
+ if (lDeclLocation != null) {
+ lTestedIncludeSet.add(lDeclLocation.substring(0, lDeclLocation
+ .lastIndexOf(File.separator)));
+ }
+ }
+
+ lProjectNode.getUserIncludes().addAll(lTestedIncludeSet);
+ iContext.put("user_include", lProjectNode.getUserIncludes());
+ iContext.put("system_include", lProjectNode.getSystemIncludes());
+ iContext.put("library", lProjectNode.getLibrarys());
+
+ if (iContext.get("UID3") == null) {
+ iContext.put("UID3", "0xE" + (new Random()).nextInt(9999999));
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private VelocityContext adjustBuildInfo(String baseDir,
+ VelocityContext aContext) {
+ VelocityContext lContext = (VelocityContext) aContext.clone();
+ Set<String> lTestedIncludeSet = new TreeSet<String>();
+ for (String path : (Set<String>) lContext.get("user_include")) {
+ lTestedIncludeSet.add(genRelativePath(baseDir, path));
+ }
+ lContext.put("user_include", lTestedIncludeSet);
+
+ // Map<String, Set<String>> lTestedSourceMap = new TreeMap<String,
+ // Set<String>>();
+ // Map<String, Set<String>> originalMap = (Map<String, Set<String>>)
+ // lContext
+ // .get("sourcepath_map");
+ // for (String path : originalMap.keySet()) {
+ // Set fileSet = originalMap.get(path);
+ // lTestedSourceMap.put(genRelativePath(baseDir, path), fileSet);
+ // }
+ // lContext.put("sourcepath_map", lTestedSourceMap);
+
+ return lContext;
+ }
+
+ // Return relative path
+ private String genRelativePath(String base, String target) {
+ String separator = File.separator;
+ if ("\\".equals(separator)) {
+ separator = "\\\\";
+ }
+ String[] baseSegment = base.split(separator);
+ String[] targetSegment = target.split(separator);
+ int counter = 0;
+ for (; counter < baseSegment.length; counter++) {
+ if (counter < targetSegment.length
+ && baseSegment[counter].equals(targetSegment[counter])) {
+ continue;
+ } else {
+ break;
+ }
+ }
+
+ if (counter == 0) {
+ return target;
+ }
+ if (counter == baseSegment.length && counter == targetSegment.length) {
+ return ".";
+ }
+
+ String path = genAncestor(baseSegment.length - counter);
+ for (int i = counter; i < targetSegment.length; i++) {
+ if ("".equals(path)) {
+ path += targetSegment[i];
+ } else {
+ path += "/" + targetSegment[i];
+ }
+ }
+ return path;
+ }
+
+ // Return ancestor layer by ..
+ private String genAncestor(int deep) {
+ String result = "";
+ if (deep > 0) {
+ result = "..";
+ for (int i = 1; i < deep; i++) {
+ result += "/..";
+ }
+ }
+ return result;
+ }
+
+ private Map<String, String> getFragments(String pattern) {
+ Map<String, String> fragmentsMap = new LinkedHashMap<String, String>();
+
+ String lines[] = pattern.split("\n");
+ StringBuilder fragment = new StringBuilder();
+
+ for (int count = 0; count < lines.length;) {
+ String line = lines[count].trim();
+ if (line.startsWith("//!!//!![Repeat Section Begin]::")) {
+ String endline = line.replace(
+ "//!!//!![Repeat Section Begin]::",
+ "//!!//!![Repeat Section End]::");
+ if (fragment.length() > 0) {
+ fragmentsMap.put(fragment.toString(), PLAIN);
+ }
+ fragment = new StringBuilder(line = lines[count]).append("\n");
+ count++;
+
+ while (count < lines.length) {
+ line = lines[count].trim();
+ fragment.append(lines[count]).append("\n");
+ if (line.equals(endline)) {
+ break;
+ }
+ count++;
+ }
+ if (fragment.length() > 0) {
+ fragmentsMap.put(fragment.toString(), REPEAT);
+ }
+ fragment = new StringBuilder();
+ } else {
+ fragment.append(lines[count]).append("\n");
+ }
+ count++;
+ }
+ if (fragment.length() > 0) {
+ fragmentsMap.put(fragment.toString(), PLAIN);
+ }
+ return fragmentsMap;
+ }
+
+ private Map<String, String> getRepeatSections(String pattern) {
+ Map<String, String> repeatSectionMap = new LinkedHashMap<String, String>();
+ String lines[] = pattern.split("\n");
+ for (int count = 0; count < lines.length; count++) {
+ String line = lines[count].trim();
+ if (line.startsWith("//!!//!![Repeat Section Begin]::")) {
+ String mark = line.substring("//!!//!![Repeat Section Begin]::"
+ .length());
+ StringBuilder repeatSection = new StringBuilder();
+ int sectionIndex = count + 1;
+ String endline = line.replace(
+ "//!!//!![Repeat Section Begin]::",
+ "//!!//!![Repeat Section End]::");
+ while (sectionIndex < lines.length) {
+ if (lines[sectionIndex].trim().equals(endline)) {
+ break;
+ }
+ repeatSection.append(lines[sectionIndex]).append("\n");
+ sectionIndex++;
+ }
+ if (repeatSection.length() > 0) {
+ repeatSectionMap.put(mark, repeatSection.toString());
+ }
+ }
+ }
+ return repeatSectionMap;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/StringResourceLoader.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.testfw.codegen;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import org.apache.commons.collections.ExtendedProperties;
+import org.apache.velocity.exception.ResourceNotFoundException;
+import org.apache.velocity.runtime.resource.Resource;
+import org.apache.velocity.runtime.resource.loader.ResourceLoader;
+
+public class StringResourceLoader extends ResourceLoader {
+
+ @Override
+ public long getLastModified(Resource resource) {
+ return 0;
+ }
+
+ @Override
+ public InputStream getResourceStream(String s)
+ throws ResourceNotFoundException {
+ InputStream result = null;
+ if (s == null || s.length() == 0) {
+ throw new ResourceNotFoundException("template is not defined.");
+ }
+ result = new ByteArrayInputStream(s.getBytes());
+ return result;
+ }
+
+ @Override
+ public boolean isSourceModified(Resource resource) {
+ return false;
+ }
+
+ @Override
+ public void init(ExtendedProperties extendedproperties) {
+ }
+
+ public static String getString(InputStream is) throws IOException {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(is));
+ StringBuilder sb = new StringBuilder();
+
+ String line = null;
+ while ((line = reader.readLine()) != null) {
+ if (sb.length() == 0) {
+ sb.append(line);
+ } else {
+ sb.append("\n").append(line);
+ }
+ }
+ is.close();
+
+ return sb.toString();
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/model/ClassNodeImpl.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.model;
+
+import java.io.File;
+import java.util.Set;
+import java.util.TreeSet;
+
+public class ClassNodeImpl extends NodeImpl implements IClassNode {
+
+ // Class declaration location
+ private String iDeclLocation;
+
+ // Class header file name
+ private String iHeaderFileName;
+
+ // Class implementation locations
+ private Set<String> iImplLocationSet = new TreeSet<String>();
+
+ // Class include header files
+ private Set<String> iIncludeHeaderSet = new TreeSet<String>();
+
+ public ClassNodeImpl(String name, ProjectNodeImpl parent) {
+ super(name, parent);
+ }
+
+ // Set declaration location
+ public void setDeclLocation(String location) {
+ iDeclLocation = location;
+ if (location != null) {
+ iHeaderFileName = location.substring(location
+ .lastIndexOf(File.separator) + 1);
+ } else {
+ iHeaderFileName = null;
+ }
+ }
+
+ // Get declaration location
+ public String getDeclLocation() {
+ return iDeclLocation;
+ }
+
+ public String getHeaderFileName() {
+ return iHeaderFileName;
+ }
+
+ // Get implementation location
+ public String[] getImplLocation() {
+ return iImplLocationSet.toArray(new String[0]);
+ }
+
+ // Set implementation location
+ public void setImplLocation(Set<String> locationSet) {
+ iImplLocationSet = locationSet;
+ }
+
+ // Add implementation location
+ public void addImplLocation(String location) {
+ iImplLocationSet.add(location);
+ }
+
+ // Get implementation location
+ public String[] getIncludeHeaders() {
+ return iIncludeHeaderSet.toArray(new String[0]);
+ }
+
+ // Set implementation location
+ public void setIncludeHeaders(Set<String> headerSet) {
+ iIncludeHeaderSet = headerSet;
+ }
+
+ // Add implementation location
+ public void addIIncludeHeader(String header) {
+ iIncludeHeaderSet.add(header);
+ }
+
+ public Object clone() {
+ ClassNodeImpl clone = new ClassNodeImpl(getName(),
+ (ProjectNodeImpl) getParent());
+ clone.iDeclLocation = iDeclLocation;
+ clone.iHeaderFileName = iHeaderFileName;
+ clone.iImplLocationSet = new TreeSet<String>(iImplLocationSet);
+ clone.iIncludeHeaderSet = new TreeSet<String>(iIncludeHeaderSet);
+ return clone;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/model/IClassNode.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.codegen.model;
+
+public interface IClassNode extends INode{
+
+ // Get declare location
+ public String getDeclLocation();
+
+ // Get header file name
+ public String getHeaderFileName();
+
+ // Get implementation location
+ public String[] getImplLocation();
+
+ // Get include header files
+ public String[] getIncludeHeaders();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/model/IMethodNode.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.model;
+
+import java.util.List;
+
+public interface IMethodNode extends INode {
+
+ // Get visibility: public=0, protected=1, private=2
+ public int getVisibility();
+
+ // Get full name
+ public String getFullName();
+
+ // Get normalised Name
+ public String getNormalisedName();
+
+ // Get parameters
+ public List<String[]> getParameters();
+
+ // Asynchronous flag
+ public boolean isAsync();
+
+ // Constructor flag
+ public boolean isConstructor();
+
+ // Destructor flag
+ public boolean isDestructor();
+
+ // Operator flag
+ public boolean isOperator();
+
+ // PureVirtual flag
+ public boolean isPureVirtual();
+
+ // Static flag
+ public boolean isStatic();
+
+ // Asynchronous flag
+ public boolean isInline();
+
+ // Virtual flag
+ public boolean isVirtual();
+
+ // Const flag
+ public boolean isConst();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/model/INode.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.model;
+
+import java.util.Set;
+
+public interface INode extends Cloneable {
+
+ /**
+ *
+ * @return name of object
+ */
+ public String getName();
+
+ /**
+ *
+ * @return upper case name of object
+ */
+ public String getNameUpperCase();
+
+ /**
+ *
+ * @return lower case name of object
+ */
+ public String getNameLowerCase();
+
+ /**
+ *
+ * @return Child test object of this test object
+ */
+ public Set<? extends INode> getChildren();
+
+ /**
+ *
+ * @return Parent test object of this test object
+ */
+ public INode getParent();
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/model/IProjectNode.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.model;
+
+import java.util.Set;
+
+public interface IProjectNode extends INode {
+
+ // Get librarys
+ public Set<String> getLibrarys();
+
+ // Get system include
+ public Set<String> getSystemIncludes();
+
+ // Get user include
+ public Set<String> getUserIncludes();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/model/MethodNodeImpl.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,243 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MethodNodeImpl extends NodeImpl implements IMethodNode {
+
+ public final static int TYPE = 0;
+
+ public final static int NAME = 1;
+
+ private int iVisibility = 0;
+
+ private boolean iAsync = false;
+
+ private boolean iConstructor = false;
+
+ private boolean iDestructor = false;
+
+ private boolean iInline = false;
+
+ private boolean iOperator = false;
+
+ private boolean iPureVirtual = false;
+
+ private boolean iStatic = false;
+
+ private boolean iVirtual = false;
+
+ private boolean iConst = false;
+
+ private String iNormalisedMethodName;
+
+ private String iNormalisedMethodFullName;
+
+ private List<String[]> iParameters = new ArrayList<String[]>();
+
+ private String iFullName;
+
+ // Constructor
+ public MethodNodeImpl(String name, ClassNodeImpl parent) {
+ super(name, parent);
+ iFullName = fullName(name);
+ iNormalisedMethodName = normalisedName(name);
+ iNormalisedMethodFullName = normalisedName(iFullName);
+ }
+
+ // Get full name
+ public String getFullName() {
+ return iFullName;
+ }
+
+ // Set name
+ public void setName(String name) {
+ super.setName(name);
+ iFullName = fullName(name);
+ iNormalisedMethodName = normalisedName(name);
+ iNormalisedMethodFullName = normalisedName(iFullName);
+ }
+
+ // Get whether valid
+ public boolean isValid() {
+ return true;
+ }
+
+ // Set whether asynchronous
+ public boolean isAsync() {
+ return iAsync;
+ }
+
+ // Get whether asynchronous
+ public void setAsync(boolean async) {
+ iAsync = async;
+ }
+
+ private String fullName(String name) {
+ String lFullName = name + " (";
+ if (iParameters.size() > 0) {
+ lFullName += iParameters.get(0)[TYPE];
+ for (int i = 1; i < iParameters.size(); i++) {
+ lFullName += ", " + iParameters.get(i)[TYPE];
+ }
+ }
+ lFullName += ")";
+ return lFullName;
+ }
+
+ private String normalisedName(String name) {
+ String normalised = name.replace(" ", "").replace("(void)", "")
+ .replace("()", "").replace(",", "_").replace("(", "_").replace(
+ ")", "").replace("+", "Plus").replace("-", "Minus")
+ .replace("/", "Devide").replace("*",
+ name.contains("opeartor") ? "Multiply" : "Pointer")
+ .replace("&", "Reference").replace("=", "Equals").replace("!",
+ "Not").replace(">>", "ShiftRight").replace("<<",
+ "ShiftLeft").replace("~", "DTOR_");
+ if (getName().equals(getParent().getName())) {
+ normalised = "CTOR_" + normalised;
+ }
+
+ return normalised;
+ }
+
+ // Get Normalised Name
+ public String getNormalisedName() {
+ return iNormalisedMethodName;
+ }
+
+ // Get Normalised Full Name
+ public String getNormalisedFullName() {
+ return iNormalisedMethodFullName;
+ }
+
+ public List<String[]> getParameters() {
+ return iParameters;
+ }
+
+ public void setParameters(List<String[]> parameters) {
+ iParameters = parameters;
+ iFullName = fullName(getName());
+ iNormalisedMethodFullName = normalisedName(iFullName);
+ }
+
+ public void addParameters(String type, String name) {
+ iParameters.add(new String[] { type, name });
+ iFullName = fullName(getName());
+ iNormalisedMethodFullName = normalisedName(iFullName);
+ }
+
+ // For TreeSet
+ public int compareTo(INode o) {
+ return iNormalisedMethodFullName
+ .compareToIgnoreCase(((MethodNodeImpl) o).iNormalisedMethodFullName);
+ }
+
+ public boolean isConstructor() {
+ return iConstructor;
+ }
+
+ public boolean isDestructor() {
+ return iDestructor;
+ }
+
+ public boolean isInline() {
+ return iInline;
+ }
+
+ public boolean isOperator() {
+ return iOperator;
+ }
+
+ public boolean isPureVirtual() {
+ return iPureVirtual;
+ }
+
+ public boolean isStatic() {
+ return iStatic;
+ }
+
+ public boolean isVirtual() {
+ return iVirtual;
+ }
+
+ public void setConstructor(boolean constructor) {
+ iConstructor = constructor;
+ }
+
+ public void setDestructor(boolean destructor) {
+ iDestructor = destructor;
+ }
+
+ public void setInline(boolean inline) {
+ iInline = inline;
+ }
+
+ public void setOperator(boolean operator) {
+ iOperator = operator;
+ }
+
+ public void setPureVirtual(boolean pureVirtual) {
+ iPureVirtual = pureVirtual;
+ }
+
+ public void setStatic(boolean static1) {
+ iStatic = static1;
+ }
+
+ public void setVirtual(boolean virtual) {
+ iVirtual = virtual;
+ }
+
+ public int getVisibility() {
+ return iVisibility;
+ }
+
+ public void setVisibility(int visibility) {
+ iVisibility = visibility;
+ }
+
+ public boolean isConst() {
+ return iConst;
+ }
+
+ public void setConst(boolean const1) {
+ iConst = const1;
+ }
+
+ public Object clone() {
+ MethodNodeImpl clone = new MethodNodeImpl(getName(),
+ (ClassNodeImpl) getParent());
+ clone.iAsync = iAsync;
+ clone.iConst = iConst;
+ clone.iConstructor = iConstructor;
+ clone.iDestructor = iDestructor;
+ clone.iFullName = iFullName;
+ clone.iInline = iInline;
+ clone.iNormalisedMethodName = iNormalisedMethodName;
+ clone.iNormalisedMethodFullName = iNormalisedMethodFullName;
+ clone.iOperator = iOperator;
+ clone.iPureVirtual = iPureVirtual;
+ clone.iStatic = iStatic;
+ clone.iVirtual = iVirtual;
+ clone.iVisibility = iVisibility;
+ clone.iParameters = new ArrayList<String[]>(iParameters);
+ return clone;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/model/NodeImpl.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.model;
+
+import java.util.Set;
+import java.util.TreeSet;
+
+abstract public class NodeImpl implements INode, Comparable<INode> {
+
+ private String iName;
+
+ // Parent item of this item
+ private INode iParent;
+
+ // Children items of this item
+ private Set<INode> iChildSet = new TreeSet<INode>();
+
+ // Constructor
+ protected NodeImpl(String name, NodeImpl parent) {
+ iName = name;
+ iParent = parent;
+ }
+
+ // Get name
+ public String getName() {
+ return iName;
+ }
+
+ // Get name
+ public String getNameUpperCase() {
+ return iName.toUpperCase();
+ }
+
+ // Get name
+ public String getNameLowerCase() {
+ return iName.toLowerCase();
+ }
+
+ // Set name
+ public void setName(String name) {
+ iName = name;
+ }
+
+ // Get parent
+ public INode getParent() {
+ return iParent;
+ }
+
+ // Set parent
+ public void setParent(INode parent) {
+ iParent = parent;
+ }
+
+ // Get children
+ public Set<INode> getChildren() {
+ return iChildSet;
+ }
+
+ // Set children
+ public void setChildren(Set<INode> childSet) {
+ iChildSet = childSet;
+ for (INode child : iChildSet) {
+ ((NodeImpl) child).setParent(this);
+ }
+ }
+
+ // Add child
+ public boolean addChild(INode aNode) {
+ ((NodeImpl) aNode).setParent(this);
+ return iChildSet.add(aNode);
+ }
+
+ // Remove child
+ public boolean removeChild(INode aNode) {
+ ((NodeImpl) aNode).setParent(null);
+ return iChildSet.remove(aNode);
+ }
+
+ // For TreeSet
+ public int compareTo(INode o) {
+ return iName.compareToIgnoreCase(o.getName());
+ }
+
+ abstract public Object clone();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/model/ProjectNodeImpl.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.model;
+
+import java.util.Set;
+import java.util.TreeSet;
+
+public class ProjectNodeImpl extends NodeImpl implements IProjectNode {
+
+ protected Set<String> iLibSet = new TreeSet<String>();
+
+ protected Set<String> iSysIncSet = new TreeSet<String>();
+
+ protected Set<String> iUserIncSet = new TreeSet<String>();
+
+ // Constructor
+ public ProjectNodeImpl(String name) {
+ super(name, null);
+ }
+
+ public Set<String> getLibrarys() {
+ return iLibSet;
+ }
+
+ public void setLibrarys(Set<String> librarySet) {
+ iLibSet = librarySet;
+ }
+
+ public Set<String> getSystemIncludes() {
+ return iSysIncSet;
+ }
+
+ public void setSystemIncludes(Set<String> includeSet) {
+ iSysIncSet = includeSet;
+ }
+
+ public Set<String> getUserIncludes() {
+ return iUserIncSet;
+ }
+
+ public void setUserIncludes(Set<String> includeSet) {
+ iUserIncSet = includeSet;
+ }
+
+ public Object clone() {
+ ProjectNodeImpl clone = new ProjectNodeImpl(getName());
+ clone.iLibSet = new TreeSet<String>(iLibSet);
+ clone.iSysIncSet = new TreeSet<String>(iSysIncSet);
+ clone.iUserIncSet = new TreeSet<String>(iUserIncSet);
+ return clone;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/templates/CMDTemplateBuilder.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.templates;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+
+public class CMDTemplateBuilder implements TemplateBuilder {
+
+ public Map<String, String> build(String path) throws IOException {
+ String templatePath = path.replaceAll("\\\\", "/");
+ if (!templatePath.endsWith("/")) {
+ templatePath += "/";
+ }
+
+ Map<String, String> result = TemplateLoader.load(path);
+
+ if (result.size() == 0) {
+ File templateRootDir = new File(templatePath);
+ if (templateRootDir.exists() && templateRootDir.isDirectory()) {
+ result.putAll(TemplateLoader.searchTemplates(templateRootDir));
+ } else {
+ throw new IOException("Can not find templat: " + path);
+ }
+ }
+ return result;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/templates/TemplateBuilder.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.codegen.templates;
+
+import java.io.IOException;
+import java.util.Map;
+
+public interface TemplateBuilder {
+
+ /**
+ * build path-template map from specified path.
+ *
+ * @param path
+ * the path of root folder
+ * @return path-template map
+ */
+ public Map<String, String> build(String path) throws IOException;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/templates/TemplateBuilderFactory.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.templates;
+
+public class TemplateBuilderFactory {
+
+ public static String TEMPLATEBUILDERCLASS = "com.nokia.testfw.codegen.templates.TemplateBuilder";
+ public static String DEFAULTTEMPLATEBUILDERCLASS = CMDTemplateBuilder.class
+ .getName();
+
+ public String iTemplateBuilderClassName;
+
+ public static TemplateBuilderFactory newInstance() {
+ String lClassName = System.getProperty(TEMPLATEBUILDERCLASS,
+ DEFAULTTEMPLATEBUILDERCLASS);
+ return new TemplateBuilderFactory(lClassName);
+ }
+
+ private TemplateBuilderFactory(String templateClassName) {
+ iTemplateBuilderClassName = templateClassName;
+ }
+
+ public TemplateBuilder newTemplateBuilder() throws InstantiationException,
+ IllegalAccessException, ClassNotFoundException {
+ return (TemplateBuilder) Class.forName(iTemplateBuilderClassName)
+ .newInstance();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/com/nokia/testfw/codegen/templates/TemplateLoader.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.templates;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+import com.nokia.testfw.codegen.StringResourceLoader;
+
+public class TemplateLoader {
+
+ public static String TEMPLATES_DIR = "templates/";
+
+ public static Map<String, String> load(String template) throws IOException {
+ Map<String, String> result = new HashMap<String, String>();
+ String templatePath = template.replaceAll("\\\\", "/");
+ String lTemplateRoot = TEMPLATES_DIR + templatePath;
+ if (!lTemplateRoot.endsWith("/")) {
+ lTemplateRoot += "/";
+ }
+
+ URL lSourceRootURL = TemplateLoader.class.getProtectionDomain()
+ .getCodeSource().getLocation();
+
+ File lSourceRoot = new File(lSourceRootURL.getFile());
+
+ if (lSourceRoot.isFile()) {
+ JarFile jf = new JarFile(lSourceRoot);
+ Enumeration<JarEntry> resources = jf.entries();
+ while (resources.hasMoreElements()) {
+ JarEntry je = (JarEntry) resources.nextElement();
+
+ // find a file that matches this string from anywhere in my
+ // jar file
+ if (je.getName().startsWith(lTemplateRoot)) {
+ if (je.isDirectory()) {
+ continue;
+ }
+ String filename = je.getName();
+ InputStream is = jf.getInputStream(jf.getEntry(filename));
+ String pattern = StringResourceLoader.getString(is);
+ String lpath = filename.substring(lTemplateRoot.length());
+ result.put(lpath, pattern);
+ is.close();
+ }
+ }
+ } else {// for test in dev env
+ File templateRootDir = new File(lSourceRoot, lTemplateRoot);
+ lTemplateRoot = templateRootDir.getAbsolutePath() + "/";
+ if (templateRootDir.exists() && templateRootDir.isDirectory()) {
+ result.putAll(searchTemplates(templateRootDir, lTemplateRoot));
+ }
+ }
+ return result;
+ }
+
+ public static Map<String, String> searchTemplates(File root)
+ throws IOException {
+ String lTemplateRoot = root.getPath() + File.separator;
+ return searchTemplates(root, lTemplateRoot);
+ }
+
+ private static Map<String, String> searchTemplates(File root,
+ String filterPath) throws IOException {
+ Map<String, String> lPathPatternMap = new HashMap<String, String>();
+ for (File file : root.listFiles()) {
+ if (file.isDirectory()) {
+ lPathPatternMap.putAll(searchTemplates(file, filterPath));
+ } else {
+ InputStream lInputStream = new FileInputStream(file);
+ String pattern = StringResourceLoader.getString(lInputStream);
+ String lPath = file.getAbsolutePath().substring(
+ filterPath.length());
+ lPath = lPath.replaceAll("\\\\", "/");
+ lPathPatternMap.put(lPath, pattern);
+ }
+ }
+ return lPathPatternMap;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/Bmarm/${class_name}.DEF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+EXPORTS
+ LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/Bmarm/${class_name}U.DEF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+EXPORTS
+ LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/Bmarm/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/Bwins/${class_name}U.DEF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+EXPORTS
+ ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/Bwins/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/EABI/${class_name}U.def Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+EXPORTS
+ _Z9LibEntryLR13CTestModuleIf @ 1 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/EABI/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/conf/${class_name}.cfg Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,30 @@
+//
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: Script file for STF Test Framework's TestScripter
+//
+//
+
+// [Test Case Script] Begin - Do not remove
+//!!//!![Repeat Section Begin]::// [Test Case Script]
+//!!foreach( ${method_object} in ${class_object.Children})
+[Test]
+ title ${class_name}_${method_object.NormalisedName}${RepeatCounter}
+ create ${class_name} foobar
+ foobar ${class_name}_${method_object.NormalisedName}${RepeatCounter} pa ra me ters
+ delete foobar
+[Endtest]
+
+//!!end
+//!!//!![Repeat Section End]::// [Test Case Script]
+// [Test Case Script] End - Do not remove
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/conf/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/data/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/docs/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/group/${class_name}.mmp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MMP file for STF Test Framework's TestScripter
+* test class.
+*
+*/
+
+#include <platform_paths.hrh>
+
+TARGET ${class_name}.dll
+TARGETTYPE dll
+UID 0x1000008D 0x101FB3E3
+
+CAPABILITY ALL -TCB
+
+DEFFILE ${class_name}.def
+
+USERINCLUDE ../inc
+
+// [System Include] Begin - Do not remove
+OS_LAYER_SYSTEMINCLUDE
+//!!//!![Repeat Section Begin]::// [System Include]
+//!!foreach( ${include} in ${system_include})
+SYSTEMINCLUDE ${include}
+//!!end
+//!!//!![Repeat Section End]::// [System Include]
+// [System Include] End - Do not remove
+
+SOURCEPATH ../src
+// [Test Case Source] Begin - Do not remove
+//!!//!![Repeat Section Begin]::// [Test Case Source]
+SOURCE ${class_name}.cpp
+SOURCE ${class_name}Blocks.cpp
+//!!//!![Repeat Section End]::// [Test Case Source]
+// [Test Case Source] End - Do not remove
+
+// [Library] Begin - Do not remove
+LIBRARY euser.lib
+LIBRARY stiftestinterface.lib
+LIBRARY stiftestengine.lib
+//!!//!![Repeat Section Begin]::// [Library]
+//!!foreach( ${lib} in ${library})
+LIBRARY ${lib}
+//!!end
+//!!//!![Repeat Section End]::// [Library]
+// [Library] End - Do not remove
+
+//RESOURCE resource_file
+//RESOURCE resource_file2
+
+LANG SC
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/group/${class_name}.pkg Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,60 @@
+;
+; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+; Installation file for STF
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"STIF"},(0x00000000),1,1,0,TYPE=SA
+
+; Series60 product id for S60 3.0
+[0x101F7961], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"\epoc32\release\armv5\udeb\\${class_name}.dll" - "!:\Sys\Bin\\${class_name}.dll"
+
+; Embedded SIS
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/group/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/group/bld.inf Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+PRJ_TESTEXPORTS
+
+// [Test Script Export] Begin - Do not remove
+//!!//!![Repeat Section Begin]::// [Test Script Export]
+ ../conf/${class_name}.cfg +/winscw/c/TestFramework/${class_name}.cfg
+//!!//!![Repeat Section End]::// [Test Script Export]
+// [Test Script Export] End - Do not remove
+
+
+PRJ_TESTMMPFILES
+
+// [Test Class] Begin - Do not remove
+//!!//!![Repeat Section Begin]::// [Test Class]
+ ${class_name}.mmp
+//!!//!![Repeat Section End]::// [Test Class]
+// [Test Class] End - Do not remove
+
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/inc/${class_name}.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: STF testclass declaration
+ *
+ */
+#ifndef ${class_object.NameUpperCase}_H
+#define ${class_object.NameUpperCase}_H
+// INCLUDES
+#include <StifLogger.h>
+#include <TestScripterInternal.h>
+#include <StifTestModule.h>
+#include <TestclassAssert.h>
+// MACROS
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+// Logging path
+_LIT( K${class_name}LogPath, "\\logs\\testframework\\\\${class_name}\\" );
+// Log file
+_LIT( K${class_name}LogFile, "${class_name}.txt" );
+_LIT( K${class_name}LogFileWithTitle, "${class_name}_[%S].txt" );
+
+// FORWARD DECLARATIONS
+class C${class_name};
+
+// CLASS DECLARATION
+
+/**
+ * C${class_name} test class for STF Test Framework TestScripter.
+ */
+NONSHARABLE_CLASS(C${class_name}) : public CScriptBase
+ {
+public:
+ // Constructors and destructor
+
+ /**
+ * Two-phased constructor.
+ */
+ static C${class_name}* NewL(CTestModuleIf& aTestModuleIf);
+
+ /**
+ * Destructor.
+ */
+ virtual ~C${class_name}();
+
+public:
+ // Functions from base classes
+
+ /**
+ * From CScriptBase Runs a script line.
+ * @param aItem Script line containing method name and parameters
+ * @return Symbian OS error code
+ */
+ virtual TInt RunMethodL(CStifItemParser& aItem);
+
+private:
+
+ /**
+ * C++ default constructor.
+ */
+ C${class_name}(CTestModuleIf& aTestModuleIf);
+
+ /**
+ * By default Symbian 2nd phase constructor is private.
+ */
+ void ConstructL();
+
+ /**
+ * Frees all resources allocated from test methods.
+ */
+ void Delete();
+
+ /**
+ * Method used to log version of test class
+ */
+ void SendTestClassVersion();
+
+ /**
+ * Test methods are listed below.
+ */
+
+ // [Test Case Declarations] Begin - Do not remove
+//!!//!![Repeat Section Begin]::// [Test Case Declarations]
+//!!foreach( ${method_object} in ${class_object.Children})
+ TInt ${method_object.NormalisedName}${RepeatCounter}(CStifItemParser& aItem);
+//!!end
+//!!//!![Repeat Section End]::// [Test Case Declarations]
+ // [Test Case Declarations] End - Do not remove
+ };
+
+#endif // ${class_object.NameUpperCase}_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/inc/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/init/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/src/${class_name}.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: This file contains testclass implementation.
+ *
+ */
+
+// INCLUDE FILES
+#include <StifTestInterface.h>
+#include "${class_name}.h"
+#include <SettingServerClient.h>
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// C${class_name}::C${class_name}
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+C${class_name}::C${class_name}(CTestModuleIf& aTestModuleIf) :
+ CScriptBase(aTestModuleIf)
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// C${class_name}::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void C${class_name}::ConstructL()
+ {
+ //Read logger settings to check whether test case name is to be
+ //appended to log file name.
+ RSettingServer settingServer;
+ TInt ret = settingServer.Connect();
+ if (ret != KErrNone)
+ {
+ User::Leave(ret);
+ }
+ // Struct to StifLogger settigs.
+ TLoggerSettings loggerSettings;
+ // Parse StifLogger defaults from STIF initialization file.
+ ret = settingServer.GetLoggerSettings(loggerSettings);
+ if (ret != KErrNone)
+ {
+ User::Leave(ret);
+ }
+ // Close Setting server session
+ settingServer.Close();
+
+ TFileName logFileName;
+
+ if (loggerSettings.iAddTestCaseTitle)
+ {
+ TName title;
+ TestModuleIf().GetTestCaseTitleL(title);
+ logFileName.Format(K${class_name}LogFileWithTitle, &title);
+ }
+ else
+ {
+ logFileName.Copy(K${class_name}LogFile);
+ }
+
+ iLog = CStifLogger::NewL(K${class_name}LogPath, logFileName, CStifLogger::ETxt,
+ CStifLogger::EFile, EFalse);
+
+ SendTestClassVersion();
+ }
+
+// -----------------------------------------------------------------------------
+// C${class_name}::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+C${class_name}* C${class_name}::NewL(CTestModuleIf& aTestModuleIf)
+ {
+ C${class_name}* self = new (ELeave) C${class_name}(aTestModuleIf);
+
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop();
+
+ return self;
+
+ }
+
+// Destructor
+C${class_name}::~C${class_name}()
+ {
+
+ // Delete resources allocated from test methods
+ Delete();
+
+ // Delete logger
+ delete iLog;
+
+ }
+
+//-----------------------------------------------------------------------------
+// C${class_name}::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void C${class_name}::SendTestClassVersion()
+ {
+ TVersion moduleVersion;
+ moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+ moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+ moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+
+ TFileName moduleName;
+ moduleName = _L("${class_name}.dll");
+
+ TBool newVersionOfMethod = ETrue;
+ TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName,
+ newVersionOfMethod);
+ }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL(CTestModuleIf& aTestModuleIf) // Backpointer to STIF Test Framework
+ {
+
+ return (CScriptBase*) C${class_name}::NewL(aTestModuleIf);
+
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/src/${class_name}Blocks.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: This file contains testclass implementation.
+ *
+ */
+
+// [Include Files] Begin - Do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+
+//!!//!![Repeat Section Begin]::// [Include Files]
+#include "${class_name}.h"
+//!!foreach( ${header_file} in ${class_object.IncludeHeaders})
+#include <${header_file}>
+//!!end
+//!!//!![Repeat Section End]::// [Include Files]
+// [Include Files] End - Do not remove
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// C${class_name}::Delete
+// Delete here all resources allocated and opened from test methods.
+// Called from destructor.
+// -----------------------------------------------------------------------------
+//
+void C${class_name}::Delete()
+ {
+
+ }
+
+// -----------------------------------------------------------------------------
+// C${class_name}::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt C${class_name}::RunMethodL(CStifItemParser& aItem)
+ {
+
+ static TStifFunctionInfo const KFunctions[] =
+ {
+ // Copy this line for every implemented function.
+ // First string is the function name used in TestScripter script file.
+ // Second is the actual implementation member function.
+
+ // [Test Case Entries] Begin - Do not remove
+//!!//!![Repeat Section Begin]::// [Test Case Entries]
+//!!foreach( ${method_object} in ${class_object.Children})
+ ENTRY( "${class_object.Name}_${method_object.NormalisedName}${RepeatCounter}", C${class_object.Name}::${method_object.NormalisedName}${RepeatCounter} ),
+//!!end
+//!!//!![Repeat Section End]::// [Test Case Entries]
+ // [Test Case Entries] End - Do not remove
+ };
+
+ const TInt count = sizeof(KFunctions) / sizeof(TStifFunctionInfo);
+
+ return RunInternalL(KFunctions, count, aItem);
+
+ }
+
+// [Test Case Implement] Begin - Do not remove
+//!!//!![Repeat Section Begin]::// [Test Case Implement]
+//!!foreach( ${method_object} in ${class_object.Children})
+TInt C${class_name}::${method_object.NormalisedName}${RepeatCounter}(CStifItemParser& aItem)
+ {
+ STIF_ASSERT_LEAVES(_L("This test case is unimplemented."));
+ return KErrNone;
+ }
+
+//!!end
+//!!//!![Repeat Section End]::// [Test Case Implement]
+// [Test Case Implement] End - Do not remove
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/STF_Script/src/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/SymbianUnitTest/BWINS/ut_${project_name}U.DEF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+EXPORTS
+ ?CreateTestL@@YAPAVMSymbianUnitTestInterface@@XZ @ 1 NONAME ; class MSymbianUnitTestInterface * CreateTestL(void)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/SymbianUnitTest/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/SymbianUnitTest/EABI/ut_${project_name}U.DEF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,4 @@
+EXPORTS
+ _Z11CreateTestLv @ 1 NONAME
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/SymbianUnitTest/group/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/SymbianUnitTest/group/bld.inf Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,18 @@
+//
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRJ_TESTMMPFILES
+ut_${project_name}.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/SymbianUnitTest/group/ut_${project_name}.mmp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+TARGET ut_${project_name}.dll
+TARGETTYPE dll
+UID 0x20022E76 ${UID3}
+
+MACRO SYMBIAN_UNIT_TEST
+
+// [Test Case Source] Begin - Do not remove
+SOURCEPATH ../src
+SOURCE dllEntry.cpp
+//!!//!![Repeat Section Begin]::// [Test Case Source]
+//!!foreach( ${class_object} in ${project_object.Children})
+SOURCE ut_${class_object.Name}.cpp
+//!!end
+//!!//!![Repeat Section End]::// [Test Case Source]
+// [Test Case Source] End - Do not remove
+
+USERINCLUDE ../inc
+//!!foreach( ${include} in ${user_include})
+USERINCLUDE ${include}
+//!!end
+
+//!!foreach( ${include} in ${system_include})
+SYSTEMINCLUDE ${include}
+//!!end
+SYSTEMINCLUDE /epoc32/include/symbianunittest
+
+//!!foreach( ${lib} in ${library})
+LIBRARY ${lib}
+//!!end
+LIBRARY symbianunittestfw.lib
+
+VENDORID 0x101FB657
+
+CAPABILITY ALL -TCB
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/SymbianUnitTest/inc/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/SymbianUnitTest/inc/ut_${class_name}.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+ *
+ * Description:
+ *
+*/
+
+
+#ifndef UT_${class_object.NameUpperCase}_H
+#define UT_${class_object.NameUpperCase}_H
+
+// INCLUDES
+#include <symbianunittest.h>
+
+// FORWARD DECLARATIONS
+class ${class_name};
+
+// CLASS DECLARATION
+class UT_${class_name}: public CSymbianUnitTest
+{
+public: // Constructors and destructor
+
+ static UT_${class_name}* NewL();
+ static UT_${class_name}* NewLC();
+ ~UT_${class_name}();
+
+protected: // From CSymbianUnitTest
+
+ void SetupL();
+ void Teardown();
+
+protected: // Test functions
+
+ // [Test Case Declarations] Begin - Do not remove
+//!!//!![Repeat Section Begin]::// [Test Case Declarations]
+//!!foreach( $method_object in $class_object.Children)
+ void UT_${method_object.NormalisedName}${RepeatCounter}();
+//!!end
+//!!//!![Repeat Section End]::// [Test Case Declarations]
+ // [Test Case Declarations] End - Do not remove
+private: // Constructors
+
+ UT_${class_name}();
+ void ConstructL();
+
+private: // Data
+
+ // The object to be tested as a member variable:
+ ${class_name} *i${class_name};
+};
+
+#endif // UT_${class_object.NameUpperCase}_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/SymbianUnitTest/src/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/SymbianUnitTest/src/dllentry.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+ *
+ * Description:
+ *
+*/
+
+// [Test Class Headers] Begin - Do not remove
+//!!//!![Repeat Section Begin]::// [Test Class Headers]
+//!!foreach( $class_object in ${project_object.Children})
+#include "ut_${class_object.Name}.h"
+//!!end
+//!!//!![Repeat Section End]::// [Test Class Headers]
+// [Test Class Headers] End - Do not remove
+#include <symbianunittestsuite.h>
+
+// Exactly one exported function returning
+// the pointer to the suite of tests for the SymbianUnit framework.
+//
+EXPORT_C MSymbianUnitTestInterface* CreateTestL()
+{
+ CSymbianUnitTestSuite* testSuite =
+ CSymbianUnitTestSuite::NewLC( _L("ut_${project_name}") );
+
+ // [Test Class Entries] Begin - Do not remove
+//!!//!![Repeat Section Begin]::// [Test Class Entries]
+//!!foreach( $class_object in ${project_object.Children})
+ testSuite->AddL( UT_${class_object.Name}::NewLC() );
+ CleanupStack::Pop();//UT_${class_object.Name}::NewLC()
+
+//!!end
+//!!//!![Repeat Section End]::// [Test Class Entries]
+ // [Test Class Entries] End - Do not remove
+
+ CleanupStack::Pop( testSuite );
+ return testSuite;
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.codegen/src/templates/SymbianUnitTest/src/ut_${class_name}.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ut_${class_name}.h"
+#include "${class_object.HeaderFileName}"
+#include <symbianunittestmacros.h>
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+UT_${class_name}* UT_${class_name}::NewL()
+ {
+ UT_${class_name}* self = UT_${class_name}::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+UT_${class_name}* UT_${class_name}::NewLC()
+ {
+ UT_${class_name}* self = new( ELeave )UT_${class_name}();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+UT_${class_name}::UT_${class_name}()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void UT_${class_name}::ConstructL()
+ {
+ BASE_CONSTRUCT
+ DEFINE_TEST_CLASS(UT_${class_name})
+ // [Test Case Entries] Begin - Do not remove
+//!!//!![Repeat Section Begin]::// [Test Case Entries]
+//!!foreach( $method_object in $class_object.Children)
+ ADD_SUT( UT_${method_object.NormalisedName}${RepeatCounter} )
+//!!end
+//!!//!![Repeat Section End]::// [Test Case Entries]
+ // [Test Case Entries] End - Do not remove
+
+ // Setup and teardown functions can be changed for each test function
+ // Usually this is not needed, but this is possible.
+ // ADD_SUT_WITH_SETUP_AND_TEARDOWN( SetupL, UT_YouFunc, Teardown )
+ }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+UT_${class_name}::~UT_${class_name}()
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// SetupL
+// -----------------------------------------------------------------------------
+//
+void UT_${class_name}::SetupL()
+ {
+ //i${class_name} = ${class_name}::NewL();
+ }
+
+// -----------------------------------------------------------------------------
+// Teardown
+// -----------------------------------------------------------------------------
+//
+void UT_${class_name}::Teardown()
+ {
+ //delete i${class_name};
+ //i${class_name} = NULL;
+ }
+
+// [Test Case Implementations] Begin - Do not remove
+//!!//!![Repeat Section Begin]::// [Test Case Implementations]
+//!!foreach( $method_object in $class_object.Children)
+// -----------------------------------------------------------------------------
+// test ${class_name}::${method_object.FullName}
+// -----------------------------------------------------------------------------
+//
+void UT_${class_name}::UT_${method_object.NormalisedName}${RepeatCounter}()
+ {
+ //i${class_name}->${method_object.FullName}
+ SUT_ASSERT_LEAVE_WITH(_L("This test case is unimplemented."), KErrNotReady);
+ }
+
+//!!end
+//!!//!![Repeat Section End]::// [Test Case Implementations]
+// [Test Case Implementations] End - Do not remove
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.common/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.common</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.common/build.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+bin.includes = feature.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.common/feature.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="com.nokia.testfw.common"
+ label="Integrated Test Environment"
+ version="1.0.0.qualifier"
+ provider-name="NOKIA">
+
+ <description url="http://wikis.in.nokia.com/Personal/ITE">
+ ITE is an Carbide based test case development and execution environment.
+ </description>
+
+ <copyright url="http://www.eclipse.org/legal/epl-v10.html">
+ /*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+ </copyright>
+
+ <license url="http://www.eclipse.org/legal/epl-v10.html">
+ This component and the accompanying materials are made available under the terms of "Eclipse Public License v1.0" which accompanies this distribution.
+ </license>
+
+ <plugin
+ id="com.nokia.testfw.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="com.nokia.testfw.resultview"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="com.nokia.testfw.codegen.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="com.nokia.testfw.launch"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="com.nokia.testfw.stf.configeditor"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="com.nokia.testfw.stf.scripteditor"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="com.nokia.testfw.stf.help"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="com.nokia.testfw.sut.help"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+</feature>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.core</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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/.settings/org.eclipse.jdt.core.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,12 @@
+#Wed Dec 23 11:14:38 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+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.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/META-INF/MANIFEST.MF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Core Plug-in
+Bundle-SymbolicName: com.nokia.testfw.core
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: com.nokia.testfw.core.StfPlugin
+Bundle-Vendor: Nokia
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: com.nokia.testfw.core,
+ com.nokia.testfw.core.model,
+ com.nokia.testfw.core.model.result,
+ com.nokia.testfw.core.utils
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/build.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,6 @@
+javacSource=1.5
+javacTarget=1.5
+source.. = src/
+output.. = bin/
+bin.includes = .,META-INF/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/src/com/nokia/testfw/core/StfPlugin.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.core;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class StfPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "com.nokia.testfw.core";
+
+ // The shared instance
+ private static StfPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public StfPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static StfPlugin getDefault() {
+ return plugin;
+ }
+
+ public static void log(Throwable e) {
+ log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, "Error", e)); //$NON-NLS-1$
+ }
+
+ public static void log(IStatus status) {
+ getDefault().getLog().log(status);
+ }
+
+ public static void log(int status, String msg) {
+ Status s = new Status(status, PLUGIN_ID, status, msg, null);
+ log(s);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/src/com/nokia/testfw/core/model/Test.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.core.model;
+
+/**
+ * @author xiaoma
+ *
+ */
+public abstract class Test {
+
+ /**
+ * An unambiguous reference to the test
+ */
+ protected String name;
+ /**
+ * @return the identifier
+ */
+ public String getIdentifier() {
+ return name;
+ }
+
+ /**
+ * @param identifier the identifier to set
+ */
+ public void setIdentifier(String identifier) {
+ this.name = identifier;
+ }
+
+ /**
+ * @return the title
+ */
+// public String getTitle() {
+// return title;
+// }
+
+ /**
+ * @param title the title to set
+ */
+// public void setTitle(String title) {
+// this.title = title;
+// }
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @param description the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * @return the version
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * @param version the version to set
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ /**
+ * the name by which the test is formally known
+ */
+// protected String title;
+ /**
+ * A representation in words of the nature and characteristics of the test
+ */
+ protected String description;
+ /**
+ * an identifier that allows one to distinguish between different revisions of test
+ */
+ protected String version;
+
+ /**
+ *
+ */
+ public Test() {
+ super();
+ }
+
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/src/com/nokia/testfw/core/model/TestCase.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,249 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors: Johnson Ma
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.core.model;
+
+import java.util.Hashtable;
+import com.nokia.testfw.core.model.TestResult.TestStatus;
+
+/**
+ * A test case in software engineering is a set of conditions or variables under which
+ * a tester will determine whether an application or software system is working correctly or not.
+ *
+ * <p>
+ * The test case class is defined following W3C Test Metadata specification
+ * {@link http://www.w3.org/TR/test-metadata/}
+ * <p>
+ * the follow attributes defined in the W3C spec are not supported
+ * <li>preconditions</li>
+ * <li>inputs</li>
+ * <li>expectedResults</li>
+ */
+public class TestCase extends Test {
+
+ /**
+ * A brief explanation of the reason the test was developed
+ */
+ protected String purpose;
+
+ /**
+ * One of an enumerated list of values that can be used to trace the state of a test
+ * at a given time
+ */
+ protected TestResult result = null;
+
+ /**
+ * Identification of the portion of the specification tested by this test.
+ */
+ protected String specRef;
+
+
+ /**
+ * A mechanism for classifying tests into groups
+ */
+ protected String[] grouping = null;
+
+ /**
+ * the properties attribute is defined to allow user to extend test case attributes
+ */
+ protected Hashtable<String, Object> properties = new Hashtable<String, Object>();
+
+ protected TestSuite suite = null;
+
+ public TestCase(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the suite
+ */
+ public TestSuite getSuite() {
+ return suite;
+ }
+
+
+ /**
+ * @param suite the suite to set
+ */
+ public void setSuite(TestSuite suite) {
+ this.suite = suite;
+ }
+
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return name.hashCode();
+ }
+
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ TestCase other = (TestCase) obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+
+
+ /**
+ * @return the purpose
+ */
+ public String getPurpose() {
+ return purpose;
+ }
+
+
+ /**
+ * @param purpose the purpose to set
+ */
+ public void setPurpose(String purpose) {
+ this.purpose = purpose;
+ }
+
+
+ /**
+ * @return the result
+ */
+ public TestResult getResult() {
+ return result;
+ }
+
+
+ /**
+ * @param result the result to set
+ */
+ public void setStatus(TestResult result) {
+ this.result = result;
+ }
+
+
+ /**
+ * @return the specRef
+ */
+ public String getSpecRef() {
+ return specRef;
+ }
+
+
+ /**
+ * @param specRef the specRef to set
+ */
+ public void setSpecRef(String specRef) {
+ this.specRef = specRef;
+ }
+
+ /**
+ * @return the grouping
+ */
+ public String[] getGrouping() {
+ return grouping;
+ }
+
+
+ /**
+ * @param grouping the grouping to set
+ */
+ public void setGrouping(String[] grouping) {
+ this.grouping = grouping;
+ }
+
+ public void addProperty(String key, Object value) {
+ properties.put(key, value);
+ return;
+ }
+
+ public Object getProperty(String key) {
+ return properties.get(key);
+ }
+
+ public Hashtable<String, Object> getProperties() {
+ return properties;
+ }
+
+
+ @Override
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append("[testcase]");
+ if (name != null) {
+ sb.append(" name:" + name);
+ }
+// if (title != null) {
+// sb.append(" title:" + title);
+// }
+ if (purpose != null) {
+ sb.append(" purpoes:" + purpose);
+ }
+ if (description != null) {
+ sb.append(" description:" + description);
+ }
+ if (result != null) {
+ sb.append(" result:" + result);
+ }
+ if (specRef != null) {
+ sb.append(" specRef:" + specRef);
+ }
+ if (version != null) {
+ sb.append(" version:" + version);
+ }
+
+
+ return sb.toString();
+
+ }
+
+ /**
+ *
+ */
+ public void start() {
+ if (result == null) {
+ result = new TestResult();
+ }
+ result.setStartTime(System.currentTimeMillis());
+ result.status = TestResult.TestStatus.STARTED;
+ }
+
+ /**
+ *
+ * @param status, the test case status
+ * @parm errorMsg, the error message if any
+ */
+ public void stop(TestStatus status, String errorMsg) {
+ result.setEndTime(System.currentTimeMillis());
+ result.status = status;
+ suite.updateResult(status);
+ if (status == TestStatus.FAILURE) {
+ result.failure = new TestFailure(errorMsg);
+ }
+
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/src/com/nokia/testfw/core/model/TestFailure.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.core.model;
+
+/**
+ * This class represents a test failure.
+ * There are several reasons
+ * <li>ERROR, test error by assertion<li>
+ * <li>TIMEOUT, time out during test case execution<li>
+ * <li>CRASH, Test case Panic or device crash<li>
+ * <li>UNKNOW, all other failures<li>
+ * <p>
+ *
+ * @author xiaoma
+ *
+ */
+public class TestFailure {
+ /**
+ * the failure message
+ */
+ protected String message;
+
+ /**
+ * the source and script file which caused the error,
+ * if null, means no error file has been located
+ */
+ protected String file;
+
+ /**
+ * the error number in the file. if -1, means no error has been located.
+ */
+ protected int lineNum;
+
+ /**
+ * the failure type
+ */
+ protected Type type;
+
+ /**
+ * create test failure from error message
+ * the failure type will be set to ERROR
+ * @param message, the error message
+ */
+ public TestFailure(String message) {
+ this(Type.ERROR, message);
+ }
+
+
+
+ /**
+ * create test failure with assigned type and message
+ * @param type, the failure type,
+ * @param message, the error message
+ * @see Type
+ */
+ public TestFailure(Type type, String message) {
+ this(type, message, null, -1);
+ }
+
+ /**
+ * create test failure
+ * @param type, the failure type
+ * @param message, error message
+ * @param file, the error file
+ * @param lineNum, the error line number
+ * @see Type
+ */
+ public TestFailure(Type type, String message, String file,
+ int lineNum) {
+ this.type = type;
+ this.message = message;
+ this.file = file;
+ this.lineNum = lineNum;
+ }
+
+ /**
+ * parse the file name and error location from error message.
+ * @return true, parse successfully
+ */
+ public boolean parseFileAndLine() {
+ return false;
+ }
+
+
+ public enum Type {ERROR, TIMEOUT, CRASH, UNKNOWN};
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/src/com/nokia/testfw/core/model/TestResult.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.core.model;
+
+/**
+ * This class is used a save test result information for a test case.
+ * It also keep the detail failure if any
+ *
+ * @author xiaoma
+ * @see TestFailure
+ */
+public class TestResult {
+ protected TestStatus status;
+ protected long startTime;
+ protected long endTime;
+ protected TestFailure failure;
+
+ /**
+ * @return the failure
+ */
+ public TestFailure getFailure() {
+ return failure;
+ }
+
+ /**
+ * @param failure the failure to set
+ */
+ public void setFailure(TestFailure failure) {
+ this.failure = failure;
+ }
+
+ public TestResult() {
+ status = TestStatus.NOTSTART;
+ }
+
+ /**
+ * @return the startTime
+ */
+ public long getStartTime() {
+ return startTime;
+ }
+
+ /**
+ * @param startTime the startTime to set
+ */
+ public void setStartTime(long startTime) {
+ this.startTime = startTime;
+ }
+
+ /**
+ * @return the endTime
+ */
+ public long getEndTime() {
+ return endTime;
+ }
+
+ /**
+ * @param endTime the endTime to set
+ */
+ public void setEndTime(long endTime) {
+ this.endTime = endTime;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append("[TestResult]");
+ sb.append("status:" + status);
+ return sb.toString();
+ }
+
+ public enum TestStatus {
+ SUCCESS,
+ FAILURE,
+ SKIP,
+ STARTED,
+ NOTSTART;
+ }
+
+}
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/src/com/nokia/testfw/core/model/TestSuite.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.core.model;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import com.nokia.testfw.core.model.TestResult.TestStatus;
+
+/**
+ * A test suite is a collection of test cases that are intended to be used
+ * to test software program to show that it has some specified set of behaviours.
+ * @see TestCase
+ *
+ */
+public class TestSuite extends Test {
+
+ protected Collection<TestCase> testCases = new ArrayList<TestCase>();
+ protected TestSuiteResult suiteResult = new TestSuiteResult();
+
+ /**
+ * @return the suiteResult
+ */
+ public TestSuiteResult getSuiteResult() {
+ return suiteResult;
+ }
+
+ /**
+ * get all test cases or suite defined in this test suite
+ * @return testcases
+ */
+ public Collection<TestCase> getTestCases() {
+ return testCases;
+ }
+
+ /**
+ * add a new test case
+ * @param tescase
+ */
+ public void addTestCase(TestCase testcase) {
+ testCases.add(testcase);
+ suiteResult.testCount ++;
+ testcase.setSuite(this);
+ }
+
+ public void updateResult(TestStatus status) {
+ if (status == TestStatus.FAILURE) {
+ suiteResult.failedTestCount++;
+ } else if (status == TestStatus.SKIP) {
+ suiteResult.skippedTestCount++;
+ } else if (status == TestStatus.SUCCESS) {
+ suiteResult.passedTestCount++;
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append("[testsuite]");
+ if (name != null) {
+ sb.append(" name:" + name);
+ }
+// if (title != null) {
+// sb.append(" title:" + title);
+// }
+ for (Test c : testCases) {
+ sb.append(c.toString());
+ }
+ return sb.toString();
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/src/com/nokia/testfw/core/model/TestSuiteResult.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.core.model;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class TestSuiteResult extends TestResult {
+ protected int testCount;
+ protected int passedTestCount;
+ protected int failedTestCount;
+ protected int skippedTestCount;
+
+ public int getTestCount() {
+ return testCount;
+ }
+
+ public int getPassedTestCount() {
+ return passedTestCount;
+ }
+
+ public int getFailedTestCount() {
+ return failedTestCount;
+ }
+
+ public int getSkippedTestCount() {
+ return skippedTestCount;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/src/com/nokia/testfw/core/model/result/TestCaseResult.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.core.model.result;
+
+public class TestCaseResult extends TestResult {
+
+ public TestCaseResult(String name) {
+ super(name, "TestCase");
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/src/com/nokia/testfw/core/model/result/TestResult.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.core.model.result;
+
+import java.text.NumberFormat;
+
+public abstract class TestResult {
+
+ public enum TestStatus {
+ SUCCESS, FAILURE, SKIP, STARTED, NOTSTART;
+ }
+
+ protected static final NumberFormat TIMEFORMAT;
+
+ static {
+ TIMEFORMAT = NumberFormat.getNumberInstance();
+ TIMEFORMAT.setGroupingUsed(true);
+ TIMEFORMAT.setMinimumFractionDigits(3);
+ TIMEFORMAT.setMaximumFractionDigits(3);
+ TIMEFORMAT.setMinimumIntegerDigits(1);
+ }
+
+ /**
+ * the test status;
+ */
+ protected TestStatus iStatus = TestStatus.NOTSTART;
+
+ /**
+ * the parent suite
+ */
+ protected TestSuiteResult iParent;
+
+ /**
+ * test result name
+ */
+ protected final String iName;
+
+ /**
+ * test result type
+ */
+ private final String iType;
+
+ /**
+ * time spend on the test case(suite), in second
+ */
+ protected double iTime = Double.NEGATIVE_INFINITY;
+
+ /**
+ * the message about the result
+ */
+ protected String iMessage;
+
+ /**
+ * the file where testcase(suite) defined
+ */
+ protected String iFile;
+
+ /**
+ * the line number in the file
+ */
+ protected int iLine;
+
+ /**
+ * the column number in the file
+ */
+ protected int iColumn;
+
+ public TestResult(String name, String type) {
+ this(name, type, TestStatus.NOTSTART);
+ }
+
+ public TestResult(String name, String type, TestStatus status) {
+ iName = name;
+ iType = type;
+ iStatus = status;
+ iParent = null;
+ iFile = null;
+ iLine = -1;
+ iColumn = -1;
+ }
+
+ /**
+ * @return the parent
+ */
+ public TestSuiteResult getParent() {
+ return iParent;
+ }
+
+ /**
+ * @return the iMessage
+ */
+ public String getMessage() {
+ return iMessage;
+ }
+
+ /**
+ * @param message
+ * the iMessage to set
+ */
+ public void setMessage(String message) {
+ iMessage = message;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return iName;
+ }
+
+ public String getDesc() {
+ if (getTime() >= 0
+ && (iStatus == TestStatus.SUCCESS || iStatus == TestStatus.FAILURE)) {
+ return iName + "(" + getTimeString() + ")";
+ } else {
+ return iName;
+ }
+ }
+
+ /**
+ * @return the file
+ */
+ public String getFile() {
+ return iFile;
+ }
+
+ /**
+ * @param file
+ * the file to set
+ */
+ public void setFile(String file) {
+ this.iFile = file;
+ }
+
+ /**
+ * @return the line
+ */
+ public int getLine() {
+ return iLine;
+ }
+
+ /**
+ * @param line
+ * the line to set
+ */
+ public void setLine(int line) {
+ this.iLine = line;
+ }
+
+ /**
+ * @return the column
+ */
+ public int getColumn() {
+ return iColumn;
+ }
+
+ /**
+ * @param column
+ * the column to set
+ */
+ public void setColumn(int column) {
+ this.iColumn = column;
+ }
+
+ /**
+ * if this test case is defined in a test suite, the unique name is
+ * suitename.casename, otherwise it is just case name
+ *
+ * @return
+ */
+ public String getUniqueName() {
+ StringBuilder sb = new StringBuilder();
+ if (iParent == null) {
+ sb.append(iType).append(": ").append(iName);
+ } else {
+ sb.append(iParent.getUniqueName()).append(".").append(iName);
+ }
+ return sb.toString();
+ }
+
+ /**
+ * @return the time
+ */
+ public double getTime() {
+ return iTime;
+ }
+
+ /**
+ * @return the time string
+ */
+ public String getTimeString() {
+ return TIMEFORMAT.format(getTime()) + " s";
+ }
+
+ /**
+ * @param time
+ * the time to set
+ */
+ public void setTime(double time) {
+ this.iTime = time;
+ }
+
+ /**
+ * @return the iStatus
+ */
+ public TestStatus getStatus() {
+ return iStatus;
+ }
+
+ /**
+ * @param status
+ * the iStatus to set
+ */
+ public void setStatus(TestStatus status) {
+ iStatus = status;
+ }
+
+ /**
+ * this test case is identified by suite name and case name
+ *
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null)
+ return false;
+ if (this == obj)
+ return true;
+ if (getClass() != obj.getClass())
+ return false;
+ if (getUniqueName().equals(((TestResult) obj).getUniqueName())) {
+ return true;
+ }
+ return false;
+ }
+
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(getUniqueName());
+ if (getTime() >= 0) {
+ sb.append(" ").append(getTimeString());
+ }
+ sb.append(" ").append(iStatus);
+ return sb.toString();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/src/com/nokia/testfw/core/model/result/TestResultListener.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.core.model.result;
+
+import com.nokia.testfw.core.model.result.TestResult.TestStatus;
+
+/**
+ * Listener for test result updates
+ *
+ * @author xiaoma
+ * @see TestRunResult
+ */
+public interface TestResultListener {
+
+ public void testStarted();
+
+ public void testFinished();
+
+ public void addTestCase(TestCaseResult result);
+
+ public void testCaseStateChange(TestCaseResult result, TestStatus status);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/src/com/nokia/testfw/core/model/result/TestRunResult.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,342 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.core.model.result;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IStatus;
+
+import com.nokia.testfw.core.StfPlugin;
+import com.nokia.testfw.core.model.result.TestResult.TestStatus;
+
+/**
+ * Result for one test run. It has summary counters and detail result for each
+ * test case.
+ * <P>
+ *
+ * This result will be updated during test execution.
+ *
+ * <P>
+ *
+ */
+public class TestRunResult {
+ int testCount = 0;
+ int passedTestCount = 0;
+ int failedTestCount = 0;
+ int skippedTestCount = 0;
+
+ LinkedHashMap<String, TestResult> root;
+ ArrayList<TestResultListener> listeners;
+
+ public TestRunResult() {
+ root = new LinkedHashMap<String, TestResult>();
+ listeners = new ArrayList<TestResultListener>();
+ }
+
+ public int getTestCount() {
+ return testCount;
+ }
+
+ public int getPassedTestCount() {
+ return passedTestCount;
+ }
+
+ public int getfailedTestCount() {
+ return failedTestCount;
+ }
+
+ public int getSkippedTestCount() {
+ return skippedTestCount;
+ }
+
+ /**
+ * add a suite to the result.
+ *
+ * @param suiteName
+ * @return
+ */
+ public synchronized TestSuiteResult addTestSuite(String suiteName) {
+ String[] suites = suiteName.split("\\.");
+
+ TestResult testResult;
+ TestSuiteResult parentSuite = null;
+ for (String suite : suites) {
+ if (parentSuite == null) {
+ testResult = root.get(new TestSuiteResult(suite)
+ .getUniqueName());
+ } else {
+ testResult = parentSuite.getChild(suite);
+ }
+ if ((testResult == null)
+ || !(testResult instanceof TestSuiteResult)) {
+ testResult = new TestSuiteResult(suite);
+ if (parentSuite == null) {
+ root.put(testResult.getUniqueName(), testResult);
+ } else {
+ parentSuite.addTestResult(testResult);
+ }
+ }
+ parentSuite = (TestSuiteResult) testResult;
+ }
+
+ return parentSuite;
+ }
+
+ /**
+ * add a test case to the result
+ *
+ * @param suiteName
+ * , maybe null if no associated suite
+ * @param caseName
+ * , test case name
+ * @return
+ */
+ public synchronized TestCaseResult addTestCase(String suiteName,
+ String caseName) {
+ TestCaseResult result = new TestCaseResult(caseName);
+ if (suiteName == null) {
+ // top level result
+ root.put(result.getUniqueName(), result);
+ } else {
+ TestSuiteResult suite = addTestSuite(suiteName);
+ suite.addTestResult(result);
+ }
+ testCount++;
+ for (TestResultListener listener : listeners) {
+ listener.addTestCase(result);
+ }
+ return result;
+ }
+
+ /**
+ * add a suite to the result.
+ *
+ * @param suiteName
+ * @return
+ */
+ public TestSuiteResult getTestSuite(String suiteName) {
+ String[] suites = suiteName.split("\\.");
+
+ TestResult testResult;
+ TestSuiteResult parentSuite = null;
+ for (String suite : suites) {
+ if (parentSuite == null) {
+ testResult = root.get(new TestSuiteResult(suite)
+ .getUniqueName());
+ } else {
+ testResult = parentSuite.getChild(suite);
+ }
+ if ((testResult != null) && (testResult instanceof TestSuiteResult)) {
+ parentSuite = (TestSuiteResult) testResult;
+ } else {
+ return null;
+ }
+ }
+
+ return parentSuite;
+ }
+
+ private TestCaseResult getTestCaseResult(String suiteName, String caseName) {
+ if (suiteName == null) {
+ return (TestCaseResult) root.get((new TestCaseResult(caseName))
+ .getUniqueName());
+ } else {
+ TestSuiteResult suite = getTestSuite(suiteName);
+ if (suite != null) {
+ TestResult result = suite.getChild(caseName);
+ if (result instanceof TestCaseResult) {
+ return (TestCaseResult) result;
+ }
+ }
+ return null;
+ }
+ }
+
+ /**
+ * update test case status and execution time. notify all listener about the
+ * test case state change
+ *
+ * @param suiteName
+ * , test suite name
+ * @param caseName
+ * , test case name
+ * @param status
+ * , the test case status
+ * @param time
+ * , will be ignored if set to -1
+ * @see TestStatus
+ * @see TestResultListener
+ */
+ public synchronized TestCaseResult updateCaseStatus(String suiteName,
+ String caseName, TestStatus status, double time) {
+ TestCaseResult result = getTestCaseResult(suiteName, caseName);
+ if (result != null) {
+ updateCaseStatus(result, status, time);
+ } else {
+ StringBuilder sb = new StringBuilder("unknown test case: ");
+ if (suiteName != null) {
+ sb.append(suiteName).append(".");
+ }
+ sb.append(caseName);
+ StfPlugin.log(IStatus.ERROR, sb.toString());
+ }
+ return result;
+ }
+
+ /**
+ * update test case status and execution time. notify all listener about the
+ * test case state change
+ *
+ * @param result
+ * , test case result
+ * @param status
+ * , the test case status
+ * @param time
+ * , will be ignored if set to -1
+ * @see TestStatus
+ * @see TestResultListener
+ */
+ public synchronized TestCaseResult updateCaseStatus(TestCaseResult result,
+ TestStatus status, double time) {
+ result.setStatus(status);
+ if (time >= 0) {
+ result.setTime(time);
+ }
+ switch (status) {
+ case SUCCESS:
+ passedTestCount++;
+ break;
+ case FAILURE:
+ failedTestCount++;
+ break;
+ case SKIP:
+ skippedTestCount++;
+ break;
+ case STARTED:
+ break;
+ default:
+ StfPlugin.log(IStatus.ERROR, "unknown teststatus:" + status);
+ }
+ updateSuiteResult(result, status);
+ for (TestResultListener listener : listeners) {
+ listener.testCaseStateChange(result, status);
+ }
+ return result;
+ }
+
+ private void updateSuiteResult(TestResult result, TestStatus status) {
+ TestSuiteResult suite = result.iParent;
+ if (suite == null) {
+ return;
+ }
+ if (status == TestStatus.STARTED) {
+ if (suite.getStatus() == TestStatus.NOTSTART) {
+ suite.setStatus(TestStatus.STARTED);
+ }
+ } else if (status == TestStatus.FAILURE) {
+ suite.setStatus(status);
+ } else if (status == TestStatus.SKIP) {
+ if (suite.getStatus() != TestStatus.FAILURE) {
+ suite.setStatus(status);
+ }
+ } else if (status == TestStatus.SUCCESS) {
+ // set the suite to pass only all cases passed
+ boolean suitePassed = true;
+ for (TestResult test : suite.getChildren()) {
+ if (test.getStatus() != TestStatus.SUCCESS) {
+ suitePassed = false;
+ break;
+ }
+ }// end of for
+ if (suitePassed) {
+ suite.setStatus(TestStatus.SUCCESS);
+ }
+ }
+ updateSuiteResult(suite, suite.getStatus());
+ }
+
+ /**
+ * add a new test result listener
+ *
+ * @param listener
+ * , the listener
+ */
+ public void addResultListener(TestResultListener listener) {
+ listeners.add(listener);
+ }
+
+ /**
+ * remove a test listener from the result
+ *
+ * @param listener
+ * , the listener to remove
+ */
+ public void removeResultListener(TestResultListener listener) {
+ listeners.remove(listener);
+ }
+
+ /**
+ * notify all listeners that test has started
+ *
+ * @see TestResultListener
+ */
+ public void testStarted() {
+ for (TestResultListener listener : listeners) {
+ listener.testStarted();
+ }
+ }
+
+ /**
+ * notify all listeners the test has finished.
+ *
+ * @see TestResultListener
+ */
+ public void testFinished() {
+ for (TestResultListener listener : listeners) {
+ listener.testFinished();
+ }
+ }
+
+ public TestResult[] getResults() {
+ return root.values().toArray(new TestResult[0]);
+ }
+
+ public Set<TestCaseResult> getFailedResults() {
+ return gatherFailedTestCaseResult(root.values());
+ }
+
+ private Set<TestCaseResult> gatherFailedTestCaseResult(
+ Collection<TestResult> results) {
+ Set<TestCaseResult> failedCaseSet = new HashSet<TestCaseResult>();
+ for (TestResult result : results) {
+ if (result instanceof TestCaseResult) {
+ if (result.getStatus() == TestStatus.FAILURE) {
+ failedCaseSet.add((TestCaseResult) result);
+ }
+ } else {
+ failedCaseSet
+ .addAll(gatherFailedTestCaseResult(((TestSuiteResult) result)
+ .getChildren()));
+ }
+ }
+ return failedCaseSet;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/src/com/nokia/testfw/core/model/result/TestSuiteResult.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.core.model.result;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+public class TestSuiteResult extends TestResult {
+ private LinkedHashSet<TestResult> children = new LinkedHashSet<TestResult>();
+
+ public TestSuiteResult(String name) {
+ super(name, "TestSuite");
+ }
+
+ /**
+ * Returns a (possibly empty) array of TestResult which are the children of
+ * the test suite.
+ *
+ * @return
+ */
+ public Set<TestResult> getChildren() {
+ return children;
+ }
+
+ public TestResult getChild(String name) {
+ for (TestResult child : children) {
+ if (child.getName().equals(name)) {
+ return child;
+ }
+ }
+ return null;
+ }
+
+ public void addTestResult(TestResult result) {
+ children.add(result);
+ result.iParent = this;
+ }
+
+ /**
+ * @return the time
+ */
+ @Override
+ public double getTime() {
+ boolean started = false;
+ double timecount = 0;
+ for (TestResult child : children) {
+ double time = child.getTime();
+ if (time >= 0) {
+ started = true;
+ timecount += child.getTime();
+ }
+ }
+ if (started) {
+ iTime = timecount;
+ }
+ return iTime;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.core/src/com/nokia/testfw/core/utils/STFScriptUtils.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.testfw.core.utils;
+
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class STFScriptUtils {
+ private static final String TITLE_KEYWORD = "title ";
+
+ public static ArrayList<String> getTestCasesFromScript(String filePath) {
+ try {
+ return getTestCasesFromScript(new FileInputStream(filePath));
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ return new ArrayList<String>(0);
+ }
+ }
+
+ /*
+ * get list of test cases names from the STF script file
+ *
+ * @param filePath, the full path of the script file
+ *
+ * @return ArrayList<String>, the list of test cases. size is 0 if no test
+ * cases found.
+ */
+ public static ArrayList<String> getTestCasesFromScript(
+ InputStream fileStream) {
+ ArrayList<String> testCases = new ArrayList<String>();
+ BufferedReader br = null;
+ try {
+ br = new BufferedReader(new InputStreamReader(fileStream));
+ String line;
+ while ((line = br.readLine()) != null) {
+ line = line.trim();
+ if (isCommentLine(line)) {
+ continue;
+ }
+ if (!line.startsWith(TITLE_KEYWORD)) {
+ continue;
+ }
+ testCases.add(line.substring(TITLE_KEYWORD.length()));
+ }
+ br.close();
+ br = null;
+ } catch (Exception e) {
+ e.printStackTrace();
+ if (br != null) {
+ try {
+ br.close();
+ } catch (IOException e1) {
+ }
+ }
+ }
+
+ return testCases;
+ }
+
+ private static boolean isCommentLine(String line) {
+ if (line.startsWith("//")) {
+ return true;
+ }
+ return false;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.launch</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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/.settings/org.eclipse.jdt.core.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,12 @@
+#Wed Dec 23 11:14:23 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+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.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/.settings/org.eclipse.pde.core.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+#Mon Sep 21 17:45:23 CST 2009
+eclipse.preferences.version=1
+resolve.requirebundle=false
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/META-INF/MANIFEST.MF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,37 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %bundle.name
+Bundle-SymbolicName: com.nokia.testfw.launch;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: com.nokia.testfw.launch.TFWLaunchPlugin
+Bundle-Vendor: %vendor.name
+Require-Bundle: org.eclipse.core.expressions,
+ org.eclipse.core.runtime,
+ org.eclipse.cdt.core,
+ org.eclipse.cdt.debug.core,
+ org.eclipse.cdt.launch,
+ org.eclipse.cdt.ui,
+ org.eclipse.debug.core,
+ org.eclipse.debug.ui,
+ org.eclipse.ui,
+ org.eclipse.ui.console,
+ com.nokia.cdt.debug.launch,
+ com.nokia.carbide.cdt.builder,
+ com.nokia.cdt.debug.cw.symbian,
+ com.nokia.carbide.cpp.support,
+ com.nokia.carbide.cpp.sdk.core,
+ com.nokia.carbide.cpp.ui,
+ com.nokia.sdt.utils,
+ com.nokia.carbide.remoteConnections,
+ com.freescale.swt,
+ com.freescale.cdt.debug.cw.core,
+ com.freescale.cdt.debug.cw.core.ui,
+ com.nokia.testfw.core;bundle-version="1.0.0",
+ com.nokia.testfw.resultview;bundle-version="1.0.0",
+ com.nokia.carbide.cpp.epoc.engine
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: com.nokia.testfw.launch,
+ com.nokia.testfw.launch.monitor,
+ com.nokia.testfw.launch.processor,
+ com.nokia.testfw.launch.ui
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/build.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ icons/
+additional.bundles = com.nokia.cdt.debug.launch
+javacSource=1.5
+javacTarget=1.5
Binary file testdev/ite/src/com.nokia.testfw.launch/icons/launch_config_file_16x16.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/plugin.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+bundle.name=Test Framework Launcher
+vendor.name=Nokia
+testRunListeners.name= Test Run Listeners
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/plugin.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension-point id="testRunProcessors" name="%testRunProcessors.name" schema="schema/testRunProcessors.exsd"/>
+
+ <extension
+ point="org.eclipse.debug.core.launchConfigurationTypes">
+ <launchConfigurationType
+ sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
+ sourcePathComputerId="com.nokia.cdt.debug.cw.symbian.CarbideSourcePathComputer"
+ delegate="com.nokia.testfw.launch.TFWEmulationLaunchDelegate"
+ delegateDescription="This Symian Unit Test Emulator Launcher supports running and debugging unit tests on Emulator"
+ delegateName="SymbianUnitTest Emulator Launcher"
+ id="com.nokia.testfw.launch.SUTEmulationLaunch"
+ modes="run,debug"
+ name="SymbianUnitTest Emulator Test"
+ public="true">
+ </launchConfigurationType>
+ <launchConfigurationType
+ sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
+ sourcePathComputerId="com.nokia.cdt.debug.cw.symbian.CarbideSourcePathComputer"
+ delegate="com.nokia.testfw.launch.TFWEmulationLaunchDelegate"
+ delegateDescription="This Symbian Test Framework Emulator Launcher supports running and debugging STF tests on Emulator"
+ delegateName="Symbian Test Framework Emulator Launcher"
+ id="com.nokia.testfw.launch.STFEmulationLaunch"
+ modes="run,debug"
+ name="STF Emulator Test"
+ public="true">
+ </launchConfigurationType>
+ </extension>
+ <extension
+ point="org.eclipse.debug.ui.launchConfigurationTabGroups">
+ <launchConfigurationTabGroup
+ class="com.nokia.testfw.launch.ui.SUTEmulationConfigTagGroup"
+ id="com.nokia.testfw.launch.SUTEmulationConfigTagGroup"
+ type="com.nokia.testfw.launch.SUTEmulationLaunch">
+ </launchConfigurationTabGroup>
+ <launchConfigurationTabGroup
+ class="com.nokia.testfw.launch.ui.STFEmulationConfigTagGroup"
+ id="com.nokia.testfw.launch.STFEmulationConfigTagGroup"
+ type="com.nokia.testfw.launch.STFEmulationLaunch">
+ </launchConfigurationTabGroup>
+ </extension>
+ <extension
+ point="org.eclipse.debug.ui.launchConfigurationTypeImages">
+ <launchConfigurationTypeImage
+ configTypeID="com.nokia.testfw.launch.SUTEmulationLaunch"
+ icon="icons/launch_config_file_16x16.png"
+ id="com.nokia.testfw.launch.launchConfigurationTypeSUTImage">
+ </launchConfigurationTypeImage>
+ <launchConfigurationTypeImage
+ configTypeID="com.nokia.testfw.launch.STFEmulationLaunch"
+ icon="icons/launch_config_file_16x16.png"
+ id="com.nokia.testfw.launch.launchConfigurationTypeSTFImage">
+ </launchConfigurationTypeImage>
+ </extension>
+ <extension
+ point="com.nokia.testfw.launch.testRunProcessors">
+ <testRunProcessor class="com.nokia.testfw.launch.processor.SUTProcessor"/>
+ <testRunProcessor class="com.nokia.testfw.launch.processor.STFProcessor"/>
+ </extension>
+</plugin>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/src/com/nokia/testfw/launch/LaunchConfigurationConstants.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.launch;
+
+public class LaunchConfigurationConstants {
+
+ public static final String DLLNAME = "com.nokia.testfw.sut.dll";
+ public static final String TESTCASENAME = "com.nokia.testfw.sut.testcase";
+ public static final String SCRIPT_DEVICE_PATH = "com.nokia.testfw.stf.script.device.path";
+ public static final String SCRIPT_HOST_PATH = "com.nokia.testfw.stf.script.host.path";
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/src/com/nokia/testfw/launch/ProcessorRegistry.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+/**
+ *
+ */
+package com.nokia.testfw.launch;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+
+import com.nokia.testfw.resultview.model.IDataProcessor;
+
+/**
+ * @author k21wang
+ *
+ */
+public class ProcessorRegistry {
+
+ private static final String ID_EXTENSION_POINT_TEST_PROCESSORS = TFWLaunchPlugin.PLUGIN_ID
+ + ".testRunProcessors";
+ private static ProcessorRegistry iRegistry;
+
+ private final IExtensionPoint iExtensionPoint;
+
+ public static ProcessorRegistry getDefault() {
+ if (iRegistry != null)
+ return iRegistry;
+
+ iRegistry = new ProcessorRegistry(Platform.getExtensionRegistry()
+ .getExtensionPoint(ID_EXTENSION_POINT_TEST_PROCESSORS));
+ return iRegistry;
+ }
+
+ /**
+ * @param extensionPoint
+ *
+ */
+ private ProcessorRegistry(IExtensionPoint extensionPoint) {
+ iExtensionPoint = extensionPoint;
+ }
+
+ public IDataProcessor[] getAllProcessors() {
+ ArrayList<IDataProcessor> list = new ArrayList<IDataProcessor>();
+ IExtension[] extensions = iExtensionPoint.getExtensions();
+ for (IExtension extension : extensions) {
+ IConfigurationElement[] configs = extension
+ .getConfigurationElements();
+ for (IConfigurationElement config : configs) {
+ Object testRunProcessor;
+ try {
+ testRunProcessor = config
+ .createExecutableExtension("class");
+ if (testRunProcessor instanceof IDataProcessor) {
+ list.add((IDataProcessor) testRunProcessor);
+ }
+ } catch (CoreException e) {
+ TFWLaunchPlugin.log(e);
+ } //$NON-NLS-1$
+ }
+ }
+ return list.toArray(new IDataProcessor[0]);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/src/com/nokia/testfw/launch/TFWEmulationLaunchDelegate.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+/**
+ *
+ */
+package com.nokia.testfw.launch;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+
+import com.freescale.cdt.debug.cw.core.cdi.ISessionListener;
+import com.freescale.cdt.debug.cw.core.cdi.Session;
+import com.nokia.cdt.internal.debug.launch.EmulationLaunchDelegate;
+
+public class TFWEmulationLaunchDelegate extends EmulationLaunchDelegate {
+
+ public void launch(ILaunchConfiguration config, String mode,
+ ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ TFWLaunchPlugin.addLaunchListener();
+ super.launch(config, mode, launch, monitor);
+ }
+
+ public void openDebugTraceConsole(final Session session) {
+ super.openDebugTraceConsole(session);
+ session.addListener(new ISessionListener() {
+ public void sessionEnded() {
+ TFWLaunchListener listener = TFWLaunchPlugin
+ .getLaunchListener();
+ if (listener != null) {
+ listener.launchRemoved(session.getLaunch());
+ }
+ }
+ });
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/src/com/nokia/testfw/launch/TFWLaunchListener.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.launch;
+
+import java.util.HashMap;
+
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchListener;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+
+import com.nokia.testfw.resultview.model.IDataProcessor;
+import com.nokia.testfw.resultview.model.TestRunSession;
+import com.nokia.testfw.resultview.view.TestRunnerViewPart;
+
+public class TFWLaunchListener implements ILaunchListener {
+
+ private HashMap<ILaunch, TestRunSession> iTrackedLaunches = new HashMap<ILaunch, TestRunSession>();
+
+ /*
+ * @see ILaunchListener#launchAdded(ILaunch)
+ */
+ public void launchAdded(final ILaunch launch) {
+ ILaunchConfiguration config = launch.getLaunchConfiguration();
+
+ IDataProcessor[] processors = ProcessorRegistry.getDefault()
+ .getAllProcessors();
+ for (IDataProcessor processor : processors) {
+ if (processor.isDealType(config)) {
+ final TestRunSession session = new TestRunSession(launch,
+ processor);
+ session.init(config);
+ iTrackedLaunches.put(launch, session);
+ TFWLaunchPlugin.getLogMonitor().addTestRunSession(session);
+
+ getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ connectTestRunnerView(session);
+ } catch (Throwable e) {
+ TFWLaunchPlugin.log(e);
+ }
+ }
+ });
+ break;
+ }
+ }
+
+ }
+
+ /*
+ * @see ILaunchListener#launchRemoved(ILaunch)
+ */
+ public void launchRemoved(final ILaunch launch) {
+ TestRunSession session = iTrackedLaunches.remove(launch);
+ if (session != null) {
+ TFWLaunchPlugin.getLogMonitor().removeTestRunSession(session);
+ session.close();
+ }
+ }
+
+ /*
+ * @see ILaunchListener#launchChanged(ILaunch)
+ */
+ public void launchChanged(final ILaunch launch) {
+ }
+
+ private TestRunnerViewPart showTestRunnerViewPartInActivePage(
+ TestRunnerViewPart testRunner) {
+ IWorkbenchPart activePart = null;
+ IWorkbenchPage page = null;
+ try {
+ // have to force the creation of view part contents
+ // otherwise the UI will not be updated
+ if (testRunner != null && testRunner.isCreated())
+ return testRunner;
+ page = TFWLaunchPlugin.getActivePage();
+ if (page == null)
+ return null;
+ activePart = page.getActivePart();
+ // show the result view if it isn't shown yet
+ return (TestRunnerViewPart) page.showView(TestRunnerViewPart.NAME);
+ } catch (PartInitException pie) {
+ TFWLaunchPlugin.log(pie);
+ return null;
+ } finally {
+ // restore focus stolen by the creation of the result view
+ if (page != null && activePart != null)
+ page.activate(activePart);
+ }
+ }
+
+ private void connectTestRunnerView(TestRunSession session) {
+ TestRunnerViewPart testRunnerViewPart = showTestRunnerViewPartInActivePage(findTestRunnerViewPartInActivePage());
+ testRunnerViewPart.addTestRunSession(session);
+ TFWLaunchPlugin.getActivePage().bringToTop(testRunnerViewPart);
+ }
+
+ private TestRunnerViewPart findTestRunnerViewPartInActivePage() {
+ IWorkbenchPage page = TFWLaunchPlugin.getActivePage();
+ if (page == null)
+ return null;
+ return (TestRunnerViewPart) page.findView(TestRunnerViewPart.NAME);
+ }
+
+ private Display getDisplay() {
+ Display display = Display.getCurrent();
+ if (display == null) {
+ display = Display.getDefault();
+ }
+ return display;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/src/com/nokia/testfw/launch/TFWLaunchPlugin.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.launch;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
+import com.nokia.testfw.launch.monitor.LogMonitor;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class TFWLaunchPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "com.nokia.testfw.launch";
+
+ // The shared instance
+ private static TFWLaunchPlugin plugin;
+
+ private static TFWLaunchListener iLaunchListener;
+
+ private static LogMonitor iLogMonitor;
+
+ /**
+ * The constructor
+ */
+ public TFWLaunchPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+ * )
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ addLaunchListener();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+ * )
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ if (iLogMonitor != null) {
+ iLogMonitor.stopme();
+ iLogMonitor = null;
+ }
+ super.stop(context);
+ removeLaunchListener();
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static TFWLaunchPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * @return the iLogMonitor
+ */
+ public static LogMonitor getLogMonitor() {
+ if (iLogMonitor == null) {
+ iLogMonitor = new LogMonitor();
+ iLogMonitor.start();
+ }
+ return iLogMonitor;
+ }
+
+ public static IProject getSelectedProject() {
+ return CarbideBuilderPlugin.getProjectInContext();
+ }
+
+ /**
+ * Returns the active workbench window
+ *
+ * @return the active workbench window
+ */
+ public static IWorkbenchWindow getActiveWorkbenchWindow() {
+ if (plugin == null)
+ return null;
+ IWorkbench workBench = plugin.getWorkbench();
+ if (workBench == null)
+ return null;
+ return workBench.getActiveWorkbenchWindow();
+ }
+
+ public static IWorkbenchPage getActivePage() {
+ IWorkbenchWindow activeWorkbenchWindow = getActiveWorkbenchWindow();
+ if (activeWorkbenchWindow == null)
+ return null;
+ return activeWorkbenchWindow.getActivePage();
+ }
+
+ public static void addLaunchListener() {
+ ILaunchManager launchManager = DebugPlugin.getDefault()
+ .getLaunchManager();
+ if (iLaunchListener == null) {
+ iLaunchListener = new TFWLaunchListener();
+ launchManager.addLaunchListener(iLaunchListener);
+ }
+ }
+
+ public static void removeLaunchListener() {
+ if (iLaunchListener != null) {
+ ILaunchManager launchManager = DebugPlugin.getDefault()
+ .getLaunchManager();
+ launchManager.removeLaunchListener(iLaunchListener);
+ iLaunchListener = null;
+ }
+ }
+
+ public static TFWLaunchListener getLaunchListener() {
+ return iLaunchListener;
+ }
+
+ public static void log(Throwable e) {
+ log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, "Error", e)); //$NON-NLS-1$
+ }
+
+ public static void log(CoreException e) {
+ log(e.getStatus()); //$NON-NLS-1$
+ }
+
+ public static void log(IStatus status) {
+ getDefault().getLog().log(status);
+ }
+
+ public static void log(int status, String msg) {
+ Status s = new Status(status, PLUGIN_ID, status, msg, null);
+ log(s);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/src/com/nokia/testfw/launch/monitor/LogMonitor.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.launch.monitor;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.debug.core.model.IProcess;
+
+import com.nokia.testfw.core.model.result.TestRunResult;
+import com.nokia.testfw.launch.TFWLaunchPlugin;
+import com.nokia.testfw.resultview.model.TestRunSession;
+
+/**
+ * Monitor stf log file during test progress. It will create a test result
+ * object and continue update the result during test execution according to real
+ * time information get from stf log file
+ *
+ * @see TestRunResult
+ * @author kevin wang
+ *
+ */
+public class LogMonitor extends Thread {
+
+ private boolean iStop = false;
+ private Map<TestRunSession, InputStream> iMonitorSessions = new HashMap<TestRunSession, InputStream>();
+ private Set<TestRunSession> iTerminatedSessions = new HashSet<TestRunSession>();
+
+ public void addTestRunSession(TestRunSession session) {
+ synchronized (iMonitorSessions) {
+ iMonitorSessions.put(session, session.getInputStream());
+ iMonitorSessions.notifyAll();
+ }
+ }
+
+ public void removeTestRunSession(TestRunSession session) {
+ synchronized (iMonitorSessions) {
+ iMonitorSessions.remove(session);
+ iMonitorSessions.notifyAll();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Thread#run()
+ */
+ @Override
+ public void run() {
+ long count;
+ int readlength;
+ byte[] buffer = new byte[4096];
+ while (!iStop) {
+ count = 0;
+ iTerminatedSessions.clear();
+ synchronized (iMonitorSessions) {
+ if (iMonitorSessions.isEmpty()) {
+ try {
+ iMonitorSessions.wait();
+ } catch (InterruptedException ignore) {
+ }
+ }
+ for (TestRunSession session : iMonitorSessions.keySet()) {
+ if (session.isClosed()) {
+ iTerminatedSessions.add(session);
+ } else {
+ InputStream stream = iMonitorSessions.get(session);
+ try {
+ if (stream == null) {
+ stream = session.getInputStream();
+ if (stream == null) {
+ continue;
+ } else {
+ iMonitorSessions.put(session, stream);
+ stream.reset();
+ }
+ }
+ if (stream.available() > 0) {
+ StringBuilder builder = new StringBuilder();
+ while ((readlength = stream.read(buffer)) > -1) {
+ builder.append(new String(buffer, 0,
+ readlength));
+ count = count + readlength;
+ }
+ session.update(builder.toString());
+ }
+ } catch (IOException e) {
+ TFWLaunchPlugin.log(e);
+ }
+ }
+ boolean isTerminated = true;
+ IProcess[] lProcesses = session.getLaunch().getProcesses();
+ for (IProcess process : lProcesses) {
+ if (!process.isTerminated()) {
+ isTerminated = false;
+ break;
+ }
+ }
+ if (isTerminated && lProcesses.length > 0) {
+ iTerminatedSessions.add(session);
+ session.close();
+ }
+ }
+ for (TestRunSession session : iTerminatedSessions) {
+ iMonitorSessions.remove(session);
+ }
+ if (count == 0) {
+ try {
+ iMonitorSessions.wait(100);
+ } catch (InterruptedException ignore) {
+ }
+ }
+ }
+ }
+ for (TestRunSession session : iMonitorSessions.keySet()) {
+ session.close();
+ }
+ }
+
+ public void stopme() {
+ iStop = true;
+ iMonitorSessions.notifyAll();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/src/com/nokia/testfw/launch/monitor/LogXmlHandler.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.launch.monitor;
+
+import java.text.SimpleDateFormat;
+
+import org.eclipse.core.runtime.IStatus;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import com.nokia.testfw.core.model.result.TestCaseResult;
+import com.nokia.testfw.core.model.result.TestResult;
+import com.nokia.testfw.core.model.result.TestRunResult;
+import com.nokia.testfw.core.model.result.TestSuiteResult;
+import com.nokia.testfw.core.model.result.TestResult.TestStatus;
+import com.nokia.testfw.launch.TFWLaunchPlugin;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class LogXmlHandler extends DefaultHandler {
+
+ TestRunResult result;
+ TestSuiteResult curSuiteResult;
+ TestCaseResult curCaseResult;
+ boolean isDefinition = false;
+ String suiteStartTime;
+ String caseStartTime;
+ boolean isSuite = false;
+ boolean isCase = false;
+ boolean isStartTime = false;
+ boolean isFinishTime = false;
+
+ public LogXmlHandler(TestRunResult result) {
+ this.result = result;
+ curSuiteResult = null;
+ curCaseResult = null;
+ }
+
+ public void startDocument() throws SAXException {
+ TFWLaunchPlugin.log(IStatus.INFO, "start process result xml log");
+ result.testStarted();
+ }
+
+ public void endDocument() throws SAXException {
+ TFWLaunchPlugin.log(IStatus.INFO, "end process result xml log");
+ result.testFinished();
+ }
+
+ public void startElement(String uri, String localName, String qName,
+ Attributes attributes) throws SAXException {
+ if (qName.equals("testsuite")) {
+ processTestSuiteStart(attributes);
+ isSuite = true;
+ } else if (qName.equals("test")) {
+ processTestStart(attributes);
+ isCase = true;
+ } else if (qName.equals("status")) {
+ processTestStatus(attributes);
+ } else if (qName.equals("location")) {
+ processLocation(attributes);
+ } else if (qName.equals("definition")) {
+ isDefinition = true;
+ } else if (qName.equals("started")) {
+ isStartTime = true;
+ } else if (qName.equals("finished")) {
+ isFinishTime = true;
+ }
+ }
+
+ public void endElement(String uri, String localName, String qName)
+ throws SAXException {
+ if (qName.equals("testsuite")) {
+ curSuiteResult = null;
+ isSuite = false;
+ } else if (qName.equals("test")) {
+ curCaseResult = null;
+ isCase = false;
+ } else if (qName.equals("definition")) {
+ isDefinition = false;
+ } else if (qName.equals("started")) {
+ isStartTime = false;
+ } else if (qName.equals("finished")) {
+ isFinishTime = false;
+ }
+ }
+
+ private void processTestSuiteStart(Attributes attributes) {
+ String name = attributes.getValue("name");
+ curSuiteResult = result.addTestSuite(name);
+ }
+
+ private void processTestStart(Attributes attributes) {
+ String suiteName = null;
+ if (curSuiteResult != null) {
+ suiteName = curSuiteResult.getName();
+ }
+ String caseName = attributes.getValue("name");
+ curCaseResult = result.addTestCase(suiteName, caseName);
+ // start test case
+ result.updateCaseStatus(suiteName, caseName, TestStatus.STARTED, 0);
+
+ }
+
+ private void processTestStatus(Attributes attributes) {
+ String type = attributes.getValue("type");
+ TestStatus status = null;
+ if (type.equals("pass")) {
+ status = TestStatus.SUCCESS;
+ } else if (type.equals("crash")) {
+ status = TestStatus.FAILURE;
+ } else if (type.equals("fail")) {
+ status = TestStatus.FAILURE;
+ } else {
+ System.err.println("unknow status status:" + type);
+ }
+
+ result.updateCaseStatus(curSuiteResult.getName(), curCaseResult
+ .getName(), status, 0);
+ // the current schema has problem
+ }
+
+ private void processLocation(Attributes attributes) {
+ if (!isDefinition) {
+ return;
+ }
+ TestResult tr = null;
+ if (curCaseResult != null) {
+ tr = curCaseResult;
+ } else if (curSuiteResult != null) {
+ tr = curSuiteResult;
+ }
+ String file = attributes.getValue("file");
+ String line = attributes.getValue("line");
+ String col = attributes.getValue("column");
+
+ if (tr != null) {
+ tr.setFile(file);
+ if (line != null) {
+ tr.setLine(Integer.parseInt(line));
+ }
+ if (col != null) {
+ tr.setColumn(Integer.parseInt(col));
+ }
+ }
+ }
+
+ public void characters(char ch[], int start, int length)
+ throws SAXException {
+
+ if (isStartTime) {
+ String time = new String(ch, start, length);
+ // processStartTime
+ if (isCase) {
+ caseStartTime = time;
+ } else if (isSuite) {
+ suiteStartTime = time;
+ }
+ } else if (isFinishTime) {
+
+ try {
+ // process finish time
+ String time = new String(ch, start, length);
+ SimpleDateFormat formatter = new SimpleDateFormat(
+ "yyyy-MM-dd'T'HH:mm:ss");
+ if (isCase) {
+ int duration = (int) (formatter.parse(time).getTime() - formatter
+ .parse(caseStartTime).getTime()) / 1000;
+ curCaseResult.setTime(duration);
+ } else if (isSuite) {
+ int duration = (int) (formatter.parse(time).getTime() - formatter
+ .parse(suiteStartTime).getTime()) / 1000;
+ curSuiteResult.setTime(duration);
+ }
+ } catch (Exception e) {
+ TFWLaunchPlugin.log(e);
+ e.printStackTrace();
+ }
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/src/com/nokia/testfw/launch/monitor/TailFileInputStream.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.launch.monitor;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.RandomAccessFile;
+
+/**
+ * an input stream, which load contents from file on the fly like 'tail -f'
+ * command on linux
+ *
+ */
+public class TailFileInputStream extends InputStream {
+
+ RandomAccessFile file;
+ long offset;
+
+ /**
+ *
+ * @param file
+ * , the file object
+ * @throws IOException
+ */
+ public TailFileInputStream(String filename) throws IOException {
+ super();
+ file = new RandomAccessFile(filename, "r");
+ offset = file.length();
+ file.seek(offset);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.io.InputStream#read()
+ */
+ @Override
+ public int read() throws IOException {
+ checkTail();
+ byte b[] = new byte[1];
+ int len = read(b, 0, 1);
+ if (len < 0)
+ return len;
+ else
+ return b[0];
+ }
+
+ public int read(byte[] b) throws IOException {
+ checkTail();
+ return read(b, 0, b.length);
+ }
+
+ public int read(byte[] b, int off, int len) throws IOException {
+ checkTail();
+ int read = file.read(b, off, len);
+ if (read > -1) {
+ offset = offset + read;
+ }
+ return read;
+ }
+
+ @Override
+ public long skip(long n) throws IOException {
+ checkTail();
+ long skip = (long) file.skipBytes((int) n);
+ offset = offset + skip;
+ return skip;
+ }
+
+ @Override
+ public int available() throws IOException {
+ checkTail();
+ long available = file.length() - offset;
+ if (available > 0) {
+ if (available > Integer.MAX_VALUE) {
+ return Integer.MAX_VALUE;
+ } else {
+ return (int) available;
+ }
+ } else {
+ return 0;
+ }
+ }
+
+ private void checkTail() throws IOException {
+ if (file.length() < offset) {
+ reset();
+ }
+ }
+
+ public void reset() throws IOException {
+ offset = 0L;
+ file.seek(offset);
+ }
+
+ @Override
+ public void close() throws IOException {
+ file.close();
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/src/com/nokia/testfw/launch/processor/STFProcessor.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,278 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+/**
+ * @author ferao
+ *
+ */
+package com.nokia.testfw.launch.processor;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Date;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+
+import com.nokia.testfw.core.model.result.TestResult.TestStatus;
+import com.nokia.testfw.core.model.result.TestCaseResult;
+import com.nokia.testfw.core.model.result.TestResult;
+import com.nokia.testfw.core.model.result.TestRunResult;
+import com.nokia.testfw.core.utils.STFScriptUtils;
+import com.nokia.testfw.launch.LaunchConfigurationConstants;
+import com.nokia.testfw.launch.TFWLaunchPlugin;
+import com.nokia.testfw.launch.monitor.TailFileInputStream;
+import com.nokia.testfw.resultview.model.IDataProcessor;
+
+public class STFProcessor implements IDataProcessor {
+
+ public static final String DEFAULT_LOG = "c:\\logs\\TestFramework\\testengine\\testengine.html";
+ public static final String START_TEST_CASE = ".... Starting testcase";
+ public static final String END_TEST_CASE = "finished with verdict";
+ public static final String END_CASE_TIME_DELIMITER = ".... TestCase ";
+ public static final String INFO_START_FLAG = "[";
+ public static final String INFO_END_FLAG = "]";
+ public static final String RESULT_MESSAGE = "Message";
+ public static final String FILE = "FILE";
+ public static final String LINE = "LINE";
+ public static final String TEST_START = "############################################################";
+ public static final String TEST_FINISHED = "---------------- Log Ended ----------------";
+ public static final String DATE_FORMAT = "dd.MMM.yyyy HH:mm:ss.SSS";
+
+ public void close() throws IOException {
+ if (iInputStream != null) {
+ iInputStream.close();
+ }
+ }
+
+ public void initTestResult(TestRunResult result, ILaunchConfiguration config) {
+ ArrayList<String> testCases = STFScriptUtils
+ .getTestCasesFromScript(getScriptPath(config));
+ for (String caseName : testCases) {
+ addTestCase(result, caseName);
+ }
+ }
+
+ public ILaunchConfiguration createRetestLaunchConfiguration(
+ ILaunchConfiguration oldConfiguration, TestResult[] retestResults) {
+ return oldConfiguration;
+ }
+
+ public InputStream getInputStream(ILaunchConfiguration config) {
+ if (iInputStream == null)
+ iInputStream = createTailFileInputStream(getLogPath(config));
+ ;
+ return iInputStream;
+ }
+
+ public boolean isDealType(ILaunchConfiguration config) {
+ if (config == null)
+ return false;
+
+ // test whether the launch defines the STF attributes
+ String idStr = null;
+ try {
+ idStr = config.getAttribute(
+ LaunchConfigurationConstants.SCRIPT_HOST_PATH,
+ (String) null);
+ } catch (CoreException e) {
+ TFWLaunchPlugin.log(e);
+ }
+ if (idStr == null)
+ return false;
+ return true;
+ }
+
+ public void process(TestRunResult result, String info) {
+ BufferedReader reader = new BufferedReader(new StringReader(info));
+ String line;
+ int index;
+ try {
+ while ((line = reader.readLine()) != null) {
+ if ((index = line.indexOf(TEST_START)) > -1) {
+ result.testStarted();
+ } else if ((index = line.indexOf(START_TEST_CASE)) > -1) {
+ String lInfo = line.substring(
+ index + START_TEST_CASE.length()).trim();
+ startTestCase(result, lInfo, getDate(
+ line.substring(0, index)).getTime());
+ } else if ((index = line.indexOf(END_TEST_CASE)) > -1) {
+ int delimiterIndex = line.indexOf(END_CASE_TIME_DELIMITER);
+ double time = -1;
+ if (delimiterIndex > -1) {
+ time = getDate(line.substring(0, delimiterIndex))
+ .getTime();
+ }
+ String lInfo = line.substring(
+ delimiterIndex + END_CASE_TIME_DELIMITER.length())
+ .trim();
+ endTestCase(result, lInfo, time);
+ } else if ((index = line.indexOf(TEST_FINISHED)) > -1) {
+ result.testFinished();
+ }
+ }
+ } catch (IOException e) {
+ TFWLaunchPlugin.log(e);
+ }
+ }
+
+ // private methods
+ private String getLogPath(ILaunchConfiguration config) {
+ if (iLogFile == null) {
+ try {
+ String epocRoot = config.getAttribute(
+ "com.nokia.cdt.debug.cw.symbian.Epoc_Root",
+ (String) null);
+ File logFile = new File(
+ epocRoot
+ + "/epoc32/winscw/c/logs/TestFramework/testengine/testengine.html");
+ File logDir = new File(epocRoot
+ + "/epoc32/winscw/c/logs/TestFramework/testengine");
+ if (!logDir.exists()) {
+ logDir.mkdir();
+ }
+ try {
+ if (!logFile.exists()) {
+ logFile.createNewFile();
+ }
+ } catch (IOException e) {
+ TFWLaunchPlugin.log(e);
+ }
+ iLogFile = logFile.getAbsolutePath();
+ } catch (CoreException e) {
+ TFWLaunchPlugin.log(e);
+ }
+ }
+ return iLogFile;
+ }
+
+ private String getScriptPath(ILaunchConfiguration config) {
+ String scriptPath = null;
+ try {
+ String tmp = config.getAttribute(
+ LaunchConfigurationConstants.SCRIPT_HOST_PATH,
+ (String) null);
+ File scriptFile = new File(tmp);
+ scriptPath = scriptFile.getAbsolutePath();
+ } catch (CoreException e) {
+ TFWLaunchPlugin.log(e);
+ }
+ return scriptPath;
+ }
+
+ private TailFileInputStream createTailFileInputStream(String filepath) {
+ TailFileInputStream tailStream = null;
+ try {
+ tailStream = new TailFileInputStream(filepath);
+ } catch (IOException e) {
+ TFWLaunchPlugin.log(e);
+ }
+ return tailStream;
+ }
+
+ private TestCaseResult startTestCase(TestRunResult result, String info,
+ double time) {
+ return result.updateCaseStatus(null, getValue(info),
+ TestStatus.STARTED, time);
+ }
+
+ private TestCaseResult endTestCase(TestRunResult result, String info,
+ double time) {
+ TestStatus status = null;
+
+ // Get case name.
+ String caseName = getValue(info);
+
+ // Get error code.
+ int errIndex = info.indexOf(END_TEST_CASE);
+ if ("0".equalsIgnoreCase(getValue(info.substring(errIndex
+ + END_TEST_CASE.length())))) {
+ status = TestStatus.SUCCESS;
+ } else {
+ status = TestStatus.FAILURE;
+ }
+
+ // Get error msg.
+ int msgIndex = info.indexOf(RESULT_MESSAGE);
+ String msg = info.substring(msgIndex + RESULT_MESSAGE.length());
+
+ double timeSpent = -1;
+ TestResult[] caseResult = result.getResults();
+ for (TestResult cur : caseResult) {
+ if (cur.getName().equalsIgnoreCase(caseName)) {
+ timeSpent = (time - cur.getTime()) / 1000;
+ failedTestCase(cur, msg);
+ }
+ }
+
+ return result.updateCaseStatus(null, caseName, status, timeSpent);
+ }
+
+ private String getValue(String content) {
+ int startIndex = content.indexOf(INFO_START_FLAG);
+ int endIndex = content.indexOf(INFO_END_FLAG);
+ if (startIndex < endIndex) {
+ return content.substring(startIndex + 1, endIndex);
+ } else {
+ return null;
+ }
+ }
+
+ private Date getDate(String info) {
+ Date date = null;
+ DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
+ try {
+ date = dateFormat.parse(info);
+ } catch (java.text.ParseException e) {
+ TFWLaunchPlugin.log(e);
+ }
+ return date;
+ }
+
+ private TestCaseResult addTestCase(TestRunResult result, String info) {
+ // String lTestCaseName = getValue(info);
+ return result.addTestCase(null, info);
+ }
+
+ private void failedTestCase(TestResult result, String msg) {
+ int index;
+ if ((index = msg.indexOf(FILE)) > -1) {
+ String lcontent = msg.substring(index + FILE.length());
+ String file = getValue(lcontent);
+ result.setFile(file);
+ if ((index = msg.indexOf(LINE)) > -1) {
+ lcontent = msg.substring(index + LINE.length());
+ String line = getValue(lcontent);
+ result.setLine(Integer.valueOf(line));
+ }
+ } else {
+ String message = msg.substring(msg.indexOf(INFO_START_FLAG)
+ + INFO_START_FLAG.length(), msg.lastIndexOf(INFO_END_FLAG));
+ result.setMessage(message);
+ }
+ }
+
+ // private members
+ private String iLogFile = null;
+ private InputStream iInputStream = null;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/src/com/nokia/testfw/launch/processor/SUTProcessor.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,286 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.launch.processor;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+
+import com.nokia.testfw.core.model.result.TestResult.TestStatus;
+import com.nokia.testfw.core.model.result.TestCaseResult;
+import com.nokia.testfw.core.model.result.TestResult;
+import com.nokia.testfw.core.model.result.TestRunResult;
+import com.nokia.testfw.launch.LaunchConfigurationConstants;
+import com.nokia.testfw.launch.TFWLaunchPlugin;
+import com.nokia.testfw.launch.monitor.TailFileInputStream;
+import com.nokia.testfw.resultview.model.IDataProcessor;
+
+/**
+ * @author k21wang
+ *
+ */
+public class SUTProcessor implements IDataProcessor {
+
+ public final static String LIST_TEST_CASE = "TestCase";
+
+ public final static String START_TEST_CASE = "StartCase";
+
+ public final static String END_TEST_CASE = "EndCase";
+
+ public final static String TEST_FAILED = "Test Failed";
+
+ public final static String RESULT = "Result";
+
+ public final static String TIME = "Time";
+
+ public final static String FILE = "File";
+
+ public final static String LINE = "Line";
+
+ public final static String MSG = "Msg";
+
+ public final static String REASON = "Reason";
+
+ public final static String TEST_STARTED = "SymbianUnitTest v";
+
+ public final static String TEST_FINISHED = "SymbianUnitTest finished";
+
+ private String iLogPath = null;
+
+ private InputStream iInputStream = null;
+
+ private TestCaseResult iLastTestCaseResult;
+
+ public void process(TestRunResult result, String info) {
+
+ BufferedReader reader = new BufferedReader(new StringReader(info));
+ String line;
+ int index;
+ try {
+ while ((line = reader.readLine()) != null) {
+ if ((index = line.indexOf(LIST_TEST_CASE)) > -1) {
+ String lInfo = line.substring(
+ index + LIST_TEST_CASE.length()).trim();
+ addTestCase(result, lInfo);
+ } else if ((index = line.indexOf(START_TEST_CASE)) > -1) {
+ String lInfo = line.substring(
+ index + START_TEST_CASE.length()).trim();
+ iLastTestCaseResult = startTestCase(result, lInfo);
+ } else if ((index = line.indexOf(END_TEST_CASE)) > -1) {
+ String lInfo = line.substring(
+ index + END_TEST_CASE.length()).trim();
+ endTestCase(result, lInfo);
+ } else if ((index = line.indexOf(TEST_FAILED)) > -1) {
+ String lInfo = line.substring(index + TEST_FAILED.length())
+ .trim();
+ failedTestCase(result, lInfo);
+ } else if ((index = line.indexOf(TEST_STARTED)) > -1) {
+ result.testStarted();
+ } else if ((index = line.indexOf(TEST_FINISHED)) > -1) {
+ result.testFinished();
+ }
+ }
+ } catch (IOException e) {
+ TFWLaunchPlugin.log(e);
+ }
+
+ }
+
+ private TestCaseResult addTestCase(TestRunResult result, String info) {
+ String lTestCaseName = getValue(info);
+ return result.addTestCase(null, lTestCaseName);
+ }
+
+ private TestCaseResult startTestCase(TestRunResult result, String info) {
+ String lTestCaseName = getValue(info);
+ return result.updateCaseStatus(null, lTestCaseName, TestStatus.STARTED,
+ -1);
+ }
+
+ private TestCaseResult endTestCase(TestRunResult result, String info) {
+ if (iLastTestCaseResult == null)
+ return null;
+ int index;
+ TestStatus status = null;
+ if ((index = info.indexOf(RESULT)) > -1) {
+ String lcontent = info.substring(index + RESULT.length());
+ String lresult = getValue(lcontent);
+ if ("pass".equalsIgnoreCase(lresult)) {
+ status = TestStatus.SUCCESS;
+ } else {
+ status = TestStatus.FAILURE;
+ }
+ }
+ double time = 0;
+ if ((index = info.indexOf(TIME)) > -1) {
+ String lcontent = info.substring(index + TIME.length());
+ String ltime = getValue(lcontent);
+ time = Double.valueOf(ltime) / 1000;
+ }
+ return result.updateCaseStatus(null, iLastTestCaseResult.getName(),
+ status, time);
+ }
+
+ private TestCaseResult failedTestCase(TestRunResult result, String info) {
+ if (iLastTestCaseResult == null)
+ return null;
+ int index;
+ if ((index = info.indexOf(FILE)) > -1) {
+ String lcontent = info.substring(index + FILE.length());
+ String file = getValue(lcontent);
+ iLastTestCaseResult.setFile(file);
+ }
+
+ if ((index = info.indexOf(LINE)) > -1) {
+ String lcontent = info.substring(index + LINE.length());
+ String line = getValue(lcontent);
+ iLastTestCaseResult.setLine(Integer.valueOf(line));
+ }
+ String message = null;
+ if ((index = info.indexOf(MSG)) > -1) {
+ String lcontent = info.substring(index + MSG.length());
+ message = getValue(lcontent);
+ }
+ if ((index = info.indexOf(REASON)) > -1) {
+ String lcontent = info.substring(index + REASON.length());
+ message = getValue(lcontent);
+ }
+ iLastTestCaseResult.setMessage(message);
+ return iLastTestCaseResult;
+ }
+
+ private String getValue(String content) {
+ int startIndex = content.indexOf('[');
+ int endIndex = content.indexOf(']');
+ if (startIndex < endIndex) {
+ return content.substring(startIndex + 1, endIndex);
+ } else {
+ return null;
+ }
+ }
+
+ public InputStream getInputStream(ILaunchConfiguration config) {
+ if (iInputStream == null) {
+ String location = getLogPath(config);
+ File logFile = new File(location);
+ if (!logFile.exists()) {
+ try {
+ logFile.getParentFile().mkdirs();
+ logFile.createNewFile();
+ } catch (IOException e) {
+ TFWLaunchPlugin.log(e);
+ }
+ }
+ iInputStream = createTailFileInputStream(location);
+ }
+ return iInputStream;
+ }
+
+ private String getLogPath(ILaunchConfiguration config) {
+ if (iLogPath == null) {
+ try {
+ String epocRoot = config.getAttribute(
+ "com.nokia.cdt.debug.cw.symbian.Epoc_Root",
+ (String) null);
+ File logFile = new File(epocRoot
+ + "/epoc32/winscw/c/logs/sut/sut_log.txt");
+ iLogPath = logFile.getAbsolutePath();
+ } catch (CoreException e) {
+ TFWLaunchPlugin.log(e);
+ }
+ }
+ return iLogPath;
+ }
+
+ private TailFileInputStream createTailFileInputStream(String filepath) {
+ TailFileInputStream tailStream = null;
+ try {
+ tailStream = new TailFileInputStream(filepath);
+ } catch (IOException e) {
+ TFWLaunchPlugin.log(e);
+ }
+ return tailStream;
+ }
+
+ public void close() throws IOException {
+ if (iInputStream != null) {
+ iInputStream.close();
+ }
+ }
+
+ public boolean isDealType(ILaunchConfiguration config) {
+ if (config == null)
+ return false;
+
+ // test whether the launch defines the SymbianUnitTest attributes
+ String dllStr = null;
+ try {
+ dllStr = config.getAttribute(LaunchConfigurationConstants.DLLNAME,
+ (String) null);
+ } catch (CoreException e) {
+ TFWLaunchPlugin.log(e);
+ }
+ if (dllStr == null)
+ return false;
+ return true;
+ }
+
+ public ILaunchConfiguration createRetestLaunchConfiguration(
+ ILaunchConfiguration oldConfiguration, TestResult[] retestResults) {
+ ILaunchConfigurationWorkingCopy newConfiguration = null;
+ try {
+ newConfiguration = oldConfiguration.copy("retest");
+ StringBuilder lTestCases = new StringBuilder();
+ lTestCases.append(retestResults[0].getName());
+ for (int i = 1; i < retestResults.length; i++) {
+ lTestCases.append(",").append(retestResults[i].getName());
+ }
+ newConfiguration.setAttribute(
+ LaunchConfigurationConstants.TESTCASENAME, lTestCases
+ .toString());
+ String lArguments = newConfiguration.getAttribute(
+ "org.eclipse.cdt.launch.PROGRAM_ARGUMENTS", (String) null);
+
+ StringBuilder lArgumentsBuilder = new StringBuilder();
+ for (String segment : lArguments.split("\\s")) {
+ if (!segment.startsWith("-c=")) {
+ if (lArgumentsBuilder.length() == 0) {
+ lArgumentsBuilder.append(segment);
+ } else {
+ lArgumentsBuilder.append(" ").append(segment);
+ }
+ }
+ }
+ lArgumentsBuilder.append(" -c=").append(lTestCases.toString());
+ newConfiguration.setAttribute(
+ "org.eclipse.cdt.launch.PROGRAM_ARGUMENTS",
+ lArgumentsBuilder.toString());
+ } catch (CoreException e) {
+ TFWLaunchPlugin.log(e);
+ }
+ return newConfiguration;
+ }
+
+ public void initTestResult(TestRunResult result, ILaunchConfiguration config) {
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/src/com/nokia/testfw/launch/ui/STFEmulationConfigTagGroup.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.launch.ui;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.EnvironmentTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
+
+import com.nokia.cdt.debug.cw.symbian.SettingsData;
+import com.nokia.cdt.internal.debug.launch.ui.DebuggerTab;
+import com.nokia.cdt.internal.debug.launch.ui.ExceptionsTab;
+import com.nokia.cdt.internal.debug.launch.ui.ExecutablesTab;
+import com.nokia.testfw.launch.TFWLaunchPlugin;
+
+@SuppressWarnings("restriction")
+public class STFEmulationConfigTagGroup extends
+ AbstractLaunchConfigurationTabGroup {
+
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ if (mode.equals("debug")) {
+ ILaunchConfigurationTab tabs[] = { new STFEmulatorMainTab(),
+ new EnvironmentTab(), new DebuggerTab(),
+ new ExecutablesTab(true), new ExceptionsTab(),
+ new SourceLookupTab(), new CommonTab() };
+ setTabs(tabs);
+ } else if (mode.equals("run")) {
+ ILaunchConfigurationTab tabs[] = { new STFEmulatorMainTab(),
+ new EnvironmentTab(), new CommonTab() };
+ setTabs(tabs);
+ }
+
+ }
+
+ public void setDefaults(ILaunchConfigurationWorkingCopy config) {
+ super.setDefaults(config);
+ IProject project = TFWLaunchPlugin.getSelectedProject();
+ SettingsData
+ .setDefaults(
+ config,
+ "com.nokia.cdt.debug.cw.symbian.SettingsData.LaunchConfig_Emulator",
+ project);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/src/com/nokia/testfw/launch/ui/STFEmulatorMainTab.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.launch.ui;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.eclipse.cdt.core.model.ICProject; //import org.eclipse.cdt.debug.core.CDebugUtils;
+import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
+import com.nokia.carbide.cdt.builder.DefaultViewConfiguration;
+import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo;
+import com.nokia.carbide.cpp.epoc.engine.BldInfViewRunnableAdapter;
+import com.nokia.carbide.cpp.epoc.engine.EpocEnginePlugin;
+import com.nokia.carbide.cpp.epoc.engine.model.bldinf.IBldInfView;
+import com.nokia.carbide.cpp.epoc.engine.model.bldinf.IExport;
+import com.nokia.carbide.cpp.epoc.engine.preprocessor.AllNodesViewFilter;
+import com.nokia.cdt.internal.debug.launch.ui.EmulationMainTab;
+import com.nokia.cdt.internal.debug.launch.ui.Messages;
+import com.nokia.testfw.launch.TFWLaunchPlugin;
+import com.nokia.testfw.launch.LaunchConfigurationConstants;
+
+public class STFEmulatorMainTab extends EmulationMainTab {
+ protected Combo testScriptCombo;
+ private ICProject targetProject;
+
+ protected void createHostAppGroup(Composite parent, int colSpan) {
+ Composite projComp = new Composite(parent, 0);
+ GridLayout projLayout = new GridLayout();
+ projLayout.numColumns = 2;
+ projLayout.marginHeight = 0;
+ projLayout.marginWidth = 0;
+ projComp.setLayout(projLayout);
+ GridData gd = new GridData(768);
+ gd.horizontalSpan = colSpan;
+ projComp.setLayoutData(gd);
+ hostLabel = new Label(projComp, 0);
+ hostLabel.setText("Test script on device: ");
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ hostLabel.setLayoutData(gd);
+ hostLabel.setToolTipText(Messages.getString("EmulationMainTab.3"));
+
+ testScriptCombo = new Combo(projComp, SWT.DROP_DOWN);
+ gd = new GridData(768);
+ testScriptCombo.setLayoutData(gd);
+ testScriptCombo
+ .setToolTipText(Messages.getString("EmulationMainTab.3"));
+ testScriptCombo.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent evt) {
+ updateLaunchConfigurationDialog();
+ }
+
+ });
+
+ hostBrowse = createPushButton(projComp, Messages
+ .getString("EmulationMainTab.4"), null);
+ hostBrowse.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent evt) {
+ FileDialog dialog = new FileDialog(getShell(), 0);
+ dialog.setFilterExtensions(new String[] { "*.cfg" });
+ dialog.setText(Messages.getString("EmulationMainTab.5"));
+ dialog.setFilterPath(CarbideBuilderPlugin.getBuildManager()
+ .getProjectInfo(targetProject.getProject())
+ .getDefaultConfiguration().getSDK().getEPOCROOT());
+ String result = dialog.open();
+ if (result != null && (new File(result)).exists()) {
+ hostText.setText(new Path(result).lastSegment());
+ updateLaunchConfigurationDialog();
+ }
+ }
+ });
+
+ hostText = new Text(projComp, SWT.Hide);
+ // this host exe text is invisible, set by parent class
+ hostText.setVisible(false);
+ }
+
+ public void initializeFrom(ILaunchConfiguration config) {
+ super.initializeFrom(config);
+ try {
+ String pathStr = config
+ .getAttribute(
+ "com.freescale.cdt.debug.cw.core.settings.DebuggerCommonData.Host App Path",
+ "");
+ IPath path = new Path(pathStr);
+ hostText.setText(path.removeLastSegments(1).append("stf.exe")
+ .toOSString());
+
+ targetProject = AbstractCLaunchDelegate.getCProject(config);
+ // ICProject targetProject = CDebugUtils.getCProject(config);
+
+ if (targetProject != null) {
+ Map<String, String> scriptMap = getScripts(targetProject
+ .getProject());
+ for (String script : scriptMap.keySet()) {
+ testScriptCombo.add(script);
+ testScriptCombo.setData(script, scriptMap.get(script));
+ }
+ }
+
+ String script = config.getAttribute(
+ LaunchConfigurationConstants.SCRIPT_DEVICE_PATH,
+ (String) null);
+ if (script == null) {
+ if (testScriptCombo.getItemCount() > 0) {
+ testScriptCombo.select(0);
+ }
+ } else {
+ testScriptCombo.setText(script);
+ }
+ } catch (CoreException e) {
+ IStatus lStatus = new Status(IStatus.ERROR,
+ STFEmulatorMainTab.class.getName(),
+ "Exception was thrown while show Emulator Launch.", e);
+ TFWLaunchPlugin.getDefault().getLog().log(lStatus);
+ }
+ }
+
+ private Map<String, String> getScripts(IProject project) {
+ final TreeMap<String, String> lScriptMap = new TreeMap<String, String>();
+ if (project != null) {
+ ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager()
+ .getProjectInfo(project);
+ final IPath projPath = project.getLocation();
+ if (cpi != null) {
+ EpocEnginePlugin.runWithBldInfView(cpi
+ .getWorkspaceRelativeBldInfPath(),
+ new DefaultViewConfiguration(project, null,
+ new AllNodesViewFilter()),
+ new BldInfViewRunnableAdapter() {
+ public Object run(IBldInfView infView) {
+ List<IExport> list = infView.getTestExports();
+ for (IExport export : list) {
+ if ("cfg"
+ .equalsIgnoreCase(export
+ .getTargetPath()
+ .getFileExtension())) {
+ String target = export.getTargetPath()
+ .toString();
+ int offset = target.toLowerCase()
+ .indexOf("/winscw/");
+ if (offset > -1) {
+ String source = export
+ .getSourcePath().toString();
+ target = target.substring(offset
+ + "/winscw/".length());
+ target = target.replaceFirst("/",
+ ":/").replace('/', '\\');
+ lScriptMap.put(target, projPath
+ .append(source).toString());
+ }
+ }
+ }
+ return null;
+ }
+ });
+ }
+ }
+ return lScriptMap;
+ }
+
+ public boolean isValid(ILaunchConfiguration config) {
+ if (testScriptCombo.getText().trim().length() > 0) {
+ setErrorMessage(null);
+ return super.isValid(config);
+ } else {
+ setErrorMessage("must specify the test script.");
+ return false;
+ }
+ }
+
+ public void performApply(ILaunchConfigurationWorkingCopy config) {
+ super.performApply(config);
+ config
+ .setAttribute(
+ "com.freescale.cdt.debug.cw.core.settings.DebuggerCommonData.Host App Path",
+ hostText.getText());
+ StringBuilder sb = new StringBuilder("-s ");
+ sb.append(testScriptCombo.getText());
+ sb
+ .append(" -NOPROMPT -log CreateLogDirectories YES -log EmulatorFormat HTML -log EmulatorOutput FILE -log EmulatorBasePath C:\\LOGS\\TestFramework\\");
+
+ config.setAttribute("org.eclipse.cdt.launch.PROGRAM_ARGUMENTS", sb
+ .toString());
+ config.setAttribute(LaunchConfigurationConstants.SCRIPT_DEVICE_PATH,
+ testScriptCombo.getText());
+ config.setAttribute(LaunchConfigurationConstants.SCRIPT_HOST_PATH,
+ (String) testScriptCombo.getData(testScriptCombo.getText()));
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/src/com/nokia/testfw/launch/ui/SUTEmulationConfigTagGroup.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.launch.ui;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.EnvironmentTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
+
+import com.nokia.cdt.debug.cw.symbian.SettingsData;
+import com.nokia.cdt.internal.debug.launch.ui.DebuggerTab;
+import com.nokia.cdt.internal.debug.launch.ui.ExceptionsTab;
+import com.nokia.cdt.internal.debug.launch.ui.ExecutablesTab;
+import com.nokia.testfw.launch.TFWLaunchPlugin;
+
+@SuppressWarnings("restriction")
+public class SUTEmulationConfigTagGroup extends
+ AbstractLaunchConfigurationTabGroup {
+
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ if (mode.equals("debug")) {
+ ILaunchConfigurationTab tabs[] = { new SUTEmulatorMainTab(),
+ new EnvironmentTab(), new DebuggerTab(),
+ new ExecutablesTab(true), new ExceptionsTab(),
+ new SourceLookupTab(), new CommonTab() };
+ setTabs(tabs);
+ } else if (mode.equals("run")) {
+ ILaunchConfigurationTab tabs[] = { new SUTEmulatorMainTab(),
+ new EnvironmentTab(), new CommonTab() };
+ setTabs(tabs);
+ }
+
+ }
+
+ public void setDefaults(ILaunchConfigurationWorkingCopy config) {
+ super.setDefaults(config);
+ IProject project = TFWLaunchPlugin.getSelectedProject();
+ SettingsData
+ .setDefaults(
+ config,
+ SettingsData.LaunchConfig_Emulator,
+ project);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/src/com/nokia/testfw/launch/ui/SUTEmulatorMainTab.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,223 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.launch.ui;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.cdt.core.model.ICProject; //import org.eclipse.cdt.debug.core.CDebugUtils;
+import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
+import com.nokia.carbide.cdt.builder.EpocEngineHelper;
+import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration;
+import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo;
+import com.nokia.cdt.internal.debug.launch.ui.EmulationMainTab;
+import com.nokia.cdt.internal.debug.launch.ui.Messages;
+import com.nokia.testfw.launch.TFWLaunchPlugin;
+import com.nokia.testfw.launch.LaunchConfigurationConstants;
+
+public class SUTEmulatorMainTab extends EmulationMainTab {
+ protected Combo testDllCombo;
+ protected Text testCaseText;
+
+ protected void createHostAppGroup(Composite parent, int colSpan) {
+ Composite projComp = new Composite(parent, 0);
+ GridLayout projLayout = new GridLayout();
+ projLayout.numColumns = 2;
+ projLayout.marginHeight = 0;
+ projLayout.marginWidth = 0;
+ projComp.setLayout(projLayout);
+ GridData gd = new GridData(768);
+ gd.horizontalSpan = colSpan;
+ projComp.setLayoutData(gd);
+ hostLabel = new Label(projComp, 0);
+ // hostLabel.setText(Messages.getString("EmulationMainTab.2"));
+ hostLabel.setText("Test dll:");
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ hostLabel.setLayoutData(gd);
+ hostLabel.setToolTipText(Messages.getString("EmulationMainTab.3"));
+
+ testDllCombo = new Combo(projComp, SWT.DROP_DOWN);
+ gd = new GridData(768);
+ testDllCombo.setLayoutData(gd);
+ testDllCombo.setToolTipText(Messages.getString("EmulationMainTab.3"));
+ testDllCombo.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent evt) {
+ updateLaunchConfigurationDialog();
+ }
+
+ });
+
+ hostBrowse = createPushButton(projComp, Messages
+ .getString("EmulationMainTab.4"), null);
+ hostBrowse.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent evt) {
+ FileDialog dialog = new FileDialog(getShell(), 0);
+ dialog.setFilterExtensions(new String[] { "*.dll" });
+ dialog.setText(Messages.getString("EmulationMainTab.5"));
+ String result = dialog.open();
+ if (result != null && (new File(result)).exists()) {
+ hostText.setText(new Path(result).lastSegment());
+ updateLaunchConfigurationDialog();
+ }
+ }
+ });
+
+ Label lTestCaseLabel = new Label(projComp, 0);
+ lTestCaseLabel.setText("Test case:");
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ lTestCaseLabel.setLayoutData(gd);
+ lTestCaseLabel.setToolTipText(Messages.getString("EmulationMainTab.3"));
+
+ testCaseText = new Text(projComp, 2052);
+ gd = new GridData(768);
+ gd.horizontalSpan = 2;
+ testCaseText.setLayoutData(gd);
+ testCaseText.setToolTipText(Messages.getString("EmulationMainTab.3"));
+ testCaseText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent evt) {
+ updateLaunchConfigurationDialog();
+ }
+
+ });
+
+ hostText = new Text(projComp, SWT.Hide);
+ // this host exe text is invisible, set by parent class
+ hostText.setVisible(false);
+ }
+
+ public void initializeFrom(ILaunchConfiguration config) {
+ super.initializeFrom(config);
+ try {
+ String pathStr = config
+ .getAttribute(
+ "com.freescale.cdt.debug.cw.core.settings.DebuggerCommonData.Host App Path",
+ "");
+ IPath path = new Path(pathStr);
+ hostText.setText(path.removeLastSegments(1).append(
+ "symbianunittest.exe").toOSString());
+
+ ICProject targetProject = AbstractCLaunchDelegate
+ .getCProject(config);
+ // ICProject targetProject = CDebugUtils.getCProject(config);
+
+ if (targetProject != null) {
+ gatherDlls(targetProject.getProject());
+ }
+
+ String dlls = config.getAttribute(
+ LaunchConfigurationConstants.DLLNAME, (String) null);
+ if (dlls == null) {
+ if (testDllCombo.getItemCount() > 0) {
+ testDllCombo.select(testDllCombo.getItemCount() - 1);
+ }
+ } else {
+ testDllCombo.setText(dlls);
+ }
+ String cases = config.getAttribute(
+ LaunchConfigurationConstants.TESTCASENAME, (String) null);
+ if (cases != null) {
+ testCaseText.setText(cases);
+ }
+ } catch (CoreException e) {
+ IStatus lStatus = new Status(IStatus.ERROR,
+ SUTEmulatorMainTab.class.getName(),
+ "Exception was thrown while show Emulator Launch.", e);
+ TFWLaunchPlugin.getDefault().getLog().log(lStatus);
+ }
+ }
+
+ private void gatherDlls(IProject project) {
+ if (project != null) {
+ ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager()
+ .getProjectInfo(project);
+ if (cpi != null) {
+ ICarbideBuildConfiguration buildConfig = cpi
+ .getDefaultConfiguration();
+ List<IPath> exePaths = new ArrayList<IPath>(0);
+ List<IPath> mmpPaths = new ArrayList<IPath>(0);
+ EpocEngineHelper.getPathToAllExecutables(buildConfig,
+ new ArrayList<IPath>(), exePaths,
+ new ArrayList<IPath>(), mmpPaths);
+ if (exePaths.size() > 0) {
+ for (int i = 0; i < exePaths.size(); i++) {
+ String fileExt = exePaths.get(i).getFileExtension();
+ if (fileExt == null
+ || fileExt.compareToIgnoreCase("dll") != 0)
+ continue;
+ testDllCombo.add(exePaths.get(i).lastSegment());
+ }
+ }
+ }
+ }
+ }
+
+ public boolean isValid(ILaunchConfiguration config) {
+ if (testDllCombo.getText().trim().length() > 0) {
+ setErrorMessage(null);
+ return super.isValid(config);
+ } else {
+ setErrorMessage("must specify the test dll.");
+ return false;
+ }
+ }
+
+ public void performApply(ILaunchConfigurationWorkingCopy config) {
+ super.performApply(config);
+ config
+ .setAttribute(
+ "com.freescale.cdt.debug.cw.core.settings.DebuggerCommonData.Host App Path",
+ hostText.getText());
+ StringBuilder sb = new StringBuilder("-noprompt -o=txt -t=");
+ sb.append(testDllCombo.getText());
+ if (testCaseText.getText().trim().length() > 0) {
+ sb.append(" -c=").append(testCaseText.getText());
+ }
+ config.setAttribute("org.eclipse.cdt.launch.PROGRAM_ARGUMENTS", sb
+ .toString());
+ config.setAttribute(LaunchConfigurationConstants.DLLNAME, testDllCombo
+ .getText());
+ config.setAttribute(LaunchConfigurationConstants.TESTCASENAME,
+ testCaseText.getText());
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.launch/src/schema/testRunProcessors.exsd Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,126 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="com.nokia.testfw.launch" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="com.nokia.testfw.launch" id="testRunProcessors" name="Test Run Processors"/>
+ </appinfo>
+ <documentation>
+ Extension point to register additional test run processors. A test run processor is notified about the execution of a test run.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ <documentation>
+ a fully qualified identifier of the target extension point
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="testRunProcessor"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+ a fully qualified identifier of the target extension point
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="testRunProcessor">
+ <annotation>
+ <documentation>
+ Deprecated: Register the new test run listener
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ Test run class implementing com.nokia.testfw.resultview.model.IDataProcessor
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":com.nokia.testfw.resultview.model.IDataProcessor"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 1.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ The following is an example of a test run listener contribution:
+
+<p>
+<pre>
+ <extension point="com.nokia.testfw.launch.testRunProcessors">
+ <testRunListener class="com.example.SampleTestRunProcessor"/>
+ </extension>
+</pre>
+</p>
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiInfo"/>
+ </appinfo>
+ <documentation>
+ Test run listeners must must implement the com.nokia.testfw.resultview.model.IDataProcessor interface.
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+ </documentation>
+ </annotation>
+
+</schema>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.resultview/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.resultview/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.resultview</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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.resultview/.settings/org.eclipse.jdt.core.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,12 @@
+#Wed Dec 23 11:14:08 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+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.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.resultview/META-INF/MANIFEST.MF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Resultview Plug-in
+Bundle-SymbolicName: com.nokia.testfw.resultview;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: com.nokia.testfw.resultview.ResultViewPlugin
+Bundle-Vendor: Nokia
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.debug.core,
+ org.eclipse.jface.text,
+ org.eclipse.ui,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.editors,
+ org.eclipse.ui.workbench.texteditor,
+ com.nokia.testfw.core,
+ org.eclipse.debug.ui
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: com.nokia.testfw.resultview,
+ com.nokia.testfw.resultview.model,
+ com.nokia.testfw.resultview.view
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.resultview/build.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ icons/
+javacSource=1.5
+javacTarget=1.5
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/act16/history_list.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/act16/relaunch_disable.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/act16/relaunch_enable.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/act16/relaunchf_disable.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/act16/relaunchf_enable.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/act16/remove_all.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/act16/tsuitefail.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/act16/tsuiteok.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/act16/tsuiterun.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/main16/stf.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/obj16/test.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/obj16/testfail.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/obj16/testok.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/obj16/testrun.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/obj16/testskip.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/ovr16/failure.gif has changed
Binary file testdev/ite/src/com.nokia.testfw.resultview/icons/full/ovr16/success.gif has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.resultview/plugin.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.views">
+ <category id="com.nokia.s60tools.testFrameworks.views" name="Test Frameworks" parentCategory="com.nokia.s60tools" />
+ <view
+ category="com.nokia.s60tools/com.nokia.s60tools.testFrameworks.views"
+ class="com.nokia.testfw.resultview.view.TestRunnerViewPart"
+ icon="icons/full/main16/stf.gif"
+ id="com.nokia.testfw.resultview.testrunnerview"
+ name="Test Result View"
+ restorable="true">
+ </view>
+ </extension>
+
+</plugin>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.resultview/src/com/nokia/testfw/resultview/ResultViewPlugin.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,157 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.resultview;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Hashtable;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class ResultViewPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "com.nokia.testfw.resultview";
+
+ private static final String IMAGE_PATH = "icons/full/";
+
+ // The shared instance
+ private static ResultViewPlugin plugin;
+
+ private static Hashtable<String, Image> images;
+
+ /**
+ * The constructor
+ */
+ public ResultViewPlugin() {
+ images = new Hashtable<String, Image>();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ //dispose image
+ for (Image image : images.values()) {
+ if (!image.isDisposed()) {
+ image.dispose();
+ }
+ }
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static ResultViewPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * retrieve an image based on its name (from the plug-in standard image folder)
+ * @param imageName
+ * @return <code>ImageDescriptor</code> of the image if found or the standard missing image descvritor
+ */
+ public static ImageDescriptor getImageDescriptor(String imageName) {
+ return getImageDescriptor(ResultViewPlugin.getDefault().getBundle(), imageName);
+ }
+
+ public static Image getImage(String imageName) {
+ Image image = images.get(imageName);
+ if (image == null) {
+ ImageDescriptor desc = getImageDescriptor(imageName);
+ image = desc.createImage();
+ images.put(imageName, image);
+ }
+ return image;
+ }
+
+ /**
+ * retrieve an image based on its name (from the plug-in standard image folder)
+ * @param imageName
+ * @return <code>ImageDescriptor</code> of the image if found or the standard missing image descriptor
+ */
+ public static final ImageDescriptor getImageDescriptor(Bundle bundle,
+ String imageName) {
+ URL url = getImageUrl(bundle, imageName);
+
+ return (url != null) ? ImageDescriptor.createFromURL(url)
+ : ImageDescriptor.getMissingImageDescriptor();
+ }
+
+
+ /**
+ * retrieve the URL of an image file based on its name (from the plug-in standard image folder)
+ * @param imageName
+ * @return <code>URL</code> of the image if found or null if not found
+ */
+// private static URL getImageUrl(String imageName) {
+// return getImageUrl(ResultViewPlugin.getDefault().getBundle(), imageName);
+// }
+
+ public static final URL getImageUrl(Bundle bundle, String imageName) {
+ if (bundle == null) {
+ bundle = ResultViewPlugin.getDefault().getBundle();
+ }
+
+ try {
+ URL baseURL = bundle.getEntry("/");
+ return new URL(baseURL, IMAGE_PATH + imageName);
+ } catch (MalformedURLException e) {
+ // LOG.warn("image URL invalid (image probably missing)", e);
+ return null;
+ }
+ }
+
+ public static void log(Throwable e) {
+ log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, "Error", e)); //$NON-NLS-1$
+ }
+
+ public static void log(IStatus status) {
+ getDefault().getLog().log(status);
+ }
+
+ public static void log(int status, String msg) {
+ Status s = new Status(status, PLUGIN_ID, status, msg, null);
+ log(s);
+ }
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.resultview/src/com/nokia/testfw/resultview/WorkspaceUtils.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.resultview;
+
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class WorkspaceUtils {
+
+ /**
+ * open specified file in associate editor, move cursor to the right position
+ * @return true, the file opened successfully
+ */
+ public static boolean openFile(String fileName, int line, int column) {
+ //find file in workspace
+ IFile file = findFileByName(fileName);
+ if (file == null) {
+ ResultViewPlugin.log(IStatus.WARNING, "can't find file to open:" + fileName);
+ return false;
+ }
+
+ try {
+// //open editor
+ IWorkbenchPage page =
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IEditorPart part = IDE.openEditor(page, file, true);
+ selectLine(part, line);
+ //todo: find a way to locate line and column
+
+// HashMap map = new HashMap();
+// map.put(IMarker.LINE_NUMBER, new Integer(line));
+// IMarker marker = file.createMarker(IMarker.TEXT);
+// marker.setAttributes(map);
+// marker.delete();
+
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+
+ return false;
+ }
+
+ private static void selectLine(IEditorPart editorPart, int lineNumber) {
+ if (lineNumber > 0 && editorPart instanceof ITextEditor) {
+ ITextEditor textEditor = (ITextEditor)editorPart;
+ IEditorInput input = editorPart.getEditorInput();
+
+ int offset = 0;
+ int length = 0;
+ IDocumentProvider provider = textEditor.getDocumentProvider();
+ try {
+ provider.connect(input);
+ } catch (CoreException e) {
+ // unable to link
+ e.printStackTrace();
+ return;
+ }
+ IDocument document = provider.getDocument(input);
+ try {
+ IRegion region= document.getLineInformation(lineNumber - 1);
+ offset = region.getOffset();
+ length = region.getLength();
+ } catch (BadLocationException e) {
+ // unable to link
+ e.printStackTrace();
+ }
+ provider.disconnect(input);
+ if (offset >= 0 && length >=0) {
+ textEditor.selectAndReveal(offset, length);
+ }
+ }
+ }
+
+ /**
+ * find flie by name.
+ * this will loop up all files in workspace opened project and return the first matched
+ * file
+ * @return the file or null
+ */
+ private static IFile findFileByName(String fileName) {
+ IProject[] projects =
+ ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for (IProject project : projects) {
+ if (!project.isOpen()) {
+ continue;
+ }
+ IFile file = findFileByName(project, fileName);
+ if (file != null) {
+ return file;
+ }
+ }
+ return null;
+ }
+
+ private static IFile findFileByName(IContainer container, String fileName) {
+ IResource file = null;
+ file = container.findMember(fileName);
+ if (file != null && file instanceof IFile) {
+ return (IFile)file;
+ }
+ try {
+ for (IResource res:container.members()) {
+ if (res instanceof IContainer) {
+ file = findFileByName((IContainer)res, fileName);
+ if (file != null) {
+ return (IFile)file;
+ }
+ }
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ return null;
+ }
+ return null;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.resultview/src/com/nokia/testfw/resultview/model/IDataProcessor.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.resultview.model;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.debug.core.ILaunchConfiguration;
+
+import com.nokia.testfw.core.model.result.TestResult;
+import com.nokia.testfw.core.model.result.TestRunResult;
+
+public interface IDataProcessor {
+
+ public boolean isDealType(ILaunchConfiguration config);
+
+ public void initTestResult(TestRunResult result,
+ ILaunchConfiguration config);
+
+ public InputStream getInputStream(ILaunchConfiguration config);
+
+ public void process(TestRunResult result, String info);
+
+ public void close() throws IOException;
+
+ public ILaunchConfiguration createRetestLaunchConfiguration(
+ ILaunchConfiguration configuration, TestResult[] retestResults);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.resultview/src/com/nokia/testfw/resultview/model/TestRunSession.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.resultview.model;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.DateFormat;
+import java.util.Date;
+
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+
+import com.nokia.testfw.core.model.result.TestResult;
+import com.nokia.testfw.core.model.result.TestRunResult;
+import com.nokia.testfw.resultview.ResultViewPlugin;
+
+/**
+ * @author k21wang
+ *
+ */
+public class TestRunSession extends TestRunResult {
+ /**
+ * The launch, or <code>null</code> if this session was run externally.
+ */
+ private final ILaunch iLaunch;
+
+ private String iName;
+
+ public ILaunch getLaunch() {
+ return iLaunch;
+ }
+
+ private final IDataProcessor iProcessor;
+
+ private boolean iClosed = false;
+
+ public void close() {
+ iClosed = true;
+ try {
+ if (iProcessor != null)
+ iProcessor.close();
+ } catch (IOException e) {
+ ResultViewPlugin.log(e);
+ }
+ }
+
+ public TestRunSession(ILaunch launch, IDataProcessor processor) {
+ super();
+ iLaunch = launch;
+ iProcessor = processor;
+ iStartTime = DateFormat.getDateTimeInstance().format(new Date());
+ }
+
+ public void init(ILaunchConfiguration configuration) {
+ iProcessor.initTestResult(this, configuration);
+ }
+
+ public void update(String info) {
+ iProcessor.process(this, info);
+ }
+
+ /**
+ * @return <code>true</code> if the session has been stopped or terminated
+ */
+ public boolean isClosed() {
+ return iClosed;
+ }
+
+ /**
+ * @return the iLogPath
+ */
+ public InputStream getInputStream() {
+ return iProcessor.getInputStream(iLaunch.getLaunchConfiguration());
+ }
+
+ public ILaunchConfiguration getRetestLaunchConfiguration(
+ ILaunchConfiguration configuration, TestResult[] results) {
+ return iProcessor.createRetestLaunchConfiguration(configuration,
+ results);
+ }
+
+ String iStartTime;
+
+ public String getStartTime() {
+ return iStartTime;
+ }
+
+ public String getName() {
+ if (iName == null) {
+ iName = "[" + iLaunch.getLaunchConfiguration().getName()
+ + "] start time: " + getStartTime();
+ }
+ return iName;
+ }
+
+ public void testFinished() {
+ close();
+ super.testFinished();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.resultview/src/com/nokia/testfw/resultview/view/CounterPanel.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,175 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.resultview.view;
+
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+
+import com.nokia.testfw.core.model.result.TestRunResult;
+import com.nokia.testfw.resultview.ResultViewPlugin;
+
+public class CounterPanel extends Composite {
+ private Image passedIcon = ResultViewPlugin.getImage("ovr16/success.gif"); //$NON-NLS-1$
+ private Image failedIcon = ResultViewPlugin.getImage("ovr16/failure.gif"); //$NON-NLS-1$
+
+ protected CLabel suiteLabel;
+ protected CLabel passedLabel;
+ protected CLabel failedLabel;
+ int totalTests;
+ int runedTests;
+ int passed;
+ int failed;
+
+ public CounterPanel(Composite parent) {
+ super(parent, SWT.WRAP);
+
+ GridLayout gl = new GridLayout(1, false);
+ gl.marginWidth = 0;
+ gl.marginHeight = 0;
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ setLayout(gl);
+ setLayoutData(gd);
+ createCounters();
+ }
+
+ public void dispose() {
+ // if (!passedIcon.isDisposed()) {
+ // passedIcon.dispose();
+ // }
+ // if (!failedIcon.isDisposed()) {
+ // failedIcon.dispose();
+ // }
+ super.dispose();
+ }
+
+ private void createCounters() {
+ Composite comp = new Composite(this, SWT.NONE);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 3;
+ gridLayout.makeColumnsEqualWidth = true;
+ gridLayout.marginWidth = 0;
+ gridLayout.verticalSpacing = 0;
+ gridLayout.horizontalSpacing = 5;
+ comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ comp.setLayout(gridLayout);
+
+ suiteLabel = createLabel(comp, "Runs: 0/0", null);
+ passedLabel = createLabel(comp, "Passed: 0", passedIcon);
+ failedLabel = createLabel(comp, "Failed: 0", failedIcon);
+
+ }
+
+ private CLabel createLabel(Composite parent, String text, Image image) {
+ CLabel label = new CLabel(parent, SWT.NONE);
+ if (null != image) {
+ label.setImage(image);
+ }
+ label.setText(text);
+ label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING
+ | GridData.FILL_HORIZONTAL));
+ label.setFont(JFaceResources.getDialogFont());
+
+ return label;
+ }
+
+ /**
+ * start counter by set total tests
+ */
+ public void setTotalTests(int totalTests) {
+ this.totalTests = totalTests;
+ runedTests = 0;
+ redrawCounter();
+ }
+
+ /**
+ * update counter by adding a passed test to the counter
+ */
+ public void addPassedTest() {
+ passed++;
+ runedTests++;
+ redrawCounter();
+
+ }
+
+ /**
+ * update counter by adding a failed test to the counter
+ */
+ public void addFailedTest() {
+ failed++;
+ runedTests++;
+ redrawCounter();
+ }
+
+ /**
+ * reset all counters to 0 and redraw counter
+ */
+ public void reset() {
+ totalTests = 0;
+ runedTests = 0;
+ passed = 0;
+ failed = 0;
+ redrawCounter();
+ }
+
+ /**
+ * update counters to assigned value and redraw
+ *
+ * @param totalTests
+ * @param runnedTests
+ * @param passed
+ * @param failed
+ */
+ public void setCounter(int totalTests, int runnedTests, int passed,
+ int failed) {
+ this.totalTests = totalTests;
+ this.runedTests = runnedTests;
+ this.passed = passed;
+ this.failed = failed;
+ redrawCounter();
+ }
+
+ public void addCounter() {
+ totalTests++;
+ redrawCounter();
+ }
+
+ private void redrawCounter() {
+ suiteLabel.setText("Runs: " + runedTests + "/" + totalTests);
+ passedLabel.setText("Passed: " + passed);
+ failedLabel.setText("Failed: " + failed);
+ }
+
+ /**
+ * initialize the progress bar with a test result
+ *
+ * @param result
+ * @see TestRunResult
+ */
+ public void init(TestRunResult result) {
+ totalTests = result.getTestCount();
+ runedTests = result.getPassedTestCount() + result.getfailedTestCount();
+ passed = result.getPassedTestCount();
+ failed = result.getfailedTestCount();
+ redrawCounter();
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.resultview/src/com/nokia/testfw/resultview/view/FailureTrace.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.resultview.view;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+
+import com.nokia.testfw.core.model.result.TestResult;
+
+/**
+ * A pane that shows a stack trace of a failed test.
+ */
+public class FailureTrace {
+ private Table iTable;
+ private TestResult iResult;
+
+ public FailureTrace(Composite parent) {
+
+ iTable = new Table(parent, SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL);
+ }
+
+ /**
+ * Returns the composite used to present the trace
+ *
+ * @return The composite
+ */
+ public Table getTable() {
+ return iTable;
+ }
+
+ public void setTestResult(TestResult result) {
+ iResult = result;
+ updateTable();
+ }
+
+ public TestResult getTestResult() {
+ return iResult;
+ }
+
+ /**
+ * Refresh the table from the trace.
+ */
+ public boolean update(TestResult result) {
+ if (iResult != result)
+ return false;
+ updateTable();
+ return true;
+ }
+
+ private void updateTable() {
+ iTable.removeAll();
+ if (iResult == null) {
+ return;
+ }
+ String trace = iResult.getMessage();
+ if (trace == null || trace.trim().equals("")) { //$NON-NLS-1$
+ return;
+ }
+ trace = trace.trim();
+ StringBuilder location = new StringBuilder();
+ if (iResult.getFile() != null) {
+ location.append(iResult.getFile());
+ if (iResult.getLine() > -1) {
+ location.append("(").append(iResult.getLine()).append(")");
+ }
+ }
+ iTable.setRedraw(false);
+ if (trace.length() > 0) {
+ TableItem item = new TableItem(iTable, SWT.None);
+ item.setText("Reason:");
+ item = new TableItem(iTable, SWT.None);
+ item.setForeground(getShell().getDisplay().getSystemColor(
+ SWT.COLOR_RED));
+ item.setText(" " + trace);
+ }
+ if (location.length() > 0) {
+ TableItem item = new TableItem(iTable, SWT.None);
+ item.setText("Location:");
+ item = new TableItem(iTable, SWT.None);
+ item.setForeground(getShell().getDisplay().getSystemColor(
+ SWT.COLOR_BLUE));
+ item.setText(" " + location.toString());
+ }
+ iTable.setRedraw(true);
+ }
+
+ public Shell getShell() {
+ return iTable.getShell();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.resultview/src/com/nokia/testfw/resultview/view/TestProgressBar.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,203 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.resultview.view;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+
+import com.nokia.testfw.core.model.result.TestRunResult;
+
+/**
+ * A progress bar with a red/green indication for success or failure.
+ */
+public class TestProgressBar extends Canvas {
+ private static final int DEFAULT_WIDTH = 160;
+ private static final int DEFAULT_HEIGHT = 16;
+
+ int totalCount = 0;
+ int currentCount = 0;
+ boolean error = false;
+ boolean stopped = false;
+
+ int fColorBarWidth = 0;
+ private Color fOKColor;
+ private Color fFailureColor;
+ private Color fStoppedColor;
+
+ public TestProgressBar(Composite parent) {
+ super(parent, SWT.NONE);
+
+ addControlListener(new ControlAdapter() {
+ public void controlResized(ControlEvent e) {
+ fColorBarWidth = scale(currentCount);
+ redraw();
+ }
+ });
+ addPaintListener(new PaintListener() {
+ public void paintControl(PaintEvent e) {
+ paint(e);
+ }
+ });
+ addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ fFailureColor.dispose();
+ fOKColor.dispose();
+ fStoppedColor.dispose();
+ }
+ });
+
+ Display display = parent.getDisplay();
+ fFailureColor = new Color(display, 159, 63, 63);
+ fOKColor = new Color(display, 95, 191, 95);
+ fStoppedColor = new Color(display, 120, 120, 120);
+ }
+
+ public void setTestCounts(int counts) {
+ totalCount = counts;
+ fColorBarWidth = scale(currentCount);
+ paintStep(1, fColorBarWidth);
+ }
+
+ public void addTestCount() {
+ setTestCounts(totalCount + 1);
+ }
+
+ public void reset() {
+ error = false;
+ stopped = false;
+ currentCount = 0;
+ fColorBarWidth = 0;
+ totalCount = 0;
+ redraw();
+ }
+
+ private void paintStep(int startX, int endX) {
+ GC gc = new GC(this);
+ setStatusColor(gc);
+ Rectangle rect = getClientArea();
+ startX = Math.max(1, startX);
+ gc.fillRectangle(startX, 1, endX - startX, rect.height - 2);
+ gc.dispose();
+ }
+
+ private void setStatusColor(GC gc) {
+ if (stopped) {
+ gc.setBackground(fStoppedColor);
+ } else if (error) {
+ gc.setBackground(fFailureColor);
+ } else {
+ gc.setBackground(fOKColor);
+ }
+ }
+
+ public void stopTest() {
+ stopped = true;
+ redraw();
+ }
+
+ private int scale(int value) {
+ if (totalCount > 0) {
+ Rectangle r = getClientArea();
+ if (r.width != 0) {
+ return Math.max(0, value * (r.width - 2) / totalCount);
+ }
+ }
+
+ return value;
+ }
+
+ private void drawBevelRect(GC gc, int x, int y, int w, int h,
+ Color topleft, Color bottomright) {
+ gc.setForeground(topleft);
+ gc.drawLine(x, y, x + w - 1, y);
+ gc.drawLine(x, y, x, y + h - 1);
+
+ gc.setForeground(bottomright);
+ gc.drawLine(x + w, y, x + w, y + h);
+ gc.drawLine(x, y + h, x + w, y + h);
+ }
+
+ private void paint(PaintEvent event) {
+ GC gc = event.gc;
+ Display disp = getDisplay();
+
+ Rectangle rect = getClientArea();
+ gc.fillRectangle(rect);
+ drawBevelRect(gc, rect.x, rect.y, rect.width - 1, rect.height - 1, disp
+ .getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW), disp
+ .getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
+
+ setStatusColor(gc);
+ fColorBarWidth = Math.min(rect.width - 2, fColorBarWidth);
+ gc.fillRectangle(1, 1, fColorBarWidth, rect.height - 2);
+ }
+
+ public Point computeSize(int wHint, int hHint, boolean changed) {
+ checkWidget();
+ Point size = new Point(DEFAULT_WIDTH, DEFAULT_HEIGHT);
+ if (wHint != SWT.DEFAULT) {
+ size.x = wHint;
+ }
+ if (hHint != SWT.DEFAULT) {
+ size.y = hHint;
+ }
+
+ return size;
+ }
+
+ public void step(boolean passed) {
+ currentCount++;
+ int x = fColorBarWidth;
+
+ fColorBarWidth = scale(currentCount);
+ if (!error && !passed) {
+ error = true;
+ x = 1;
+ }
+ if (currentCount == totalCount) {
+ fColorBarWidth = getClientArea().width - 1;
+ }
+ paintStep(x, fColorBarWidth);
+ }
+
+ /**
+ * initialize the progress bar with a test result
+ *
+ * @param result
+ * @see TestRunResult
+ */
+ public void init(TestRunResult result) {
+ totalCount = result.getTestCount();
+ currentCount = result.getPassedTestCount()
+ + result.getfailedTestCount() + result.getSkippedTestCount();
+ error = result.getfailedTestCount() > 0 ? true : false;
+ redraw();
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.resultview/src/com/nokia/testfw/resultview/view/TestResultTree.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.resultview.view;
+
+import java.util.Hashtable;
+import java.util.Stack;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+
+import com.nokia.testfw.core.model.result.TestCaseResult;
+import com.nokia.testfw.core.model.result.TestResult;
+import com.nokia.testfw.core.model.result.TestRunResult;
+import com.nokia.testfw.core.model.result.TestSuiteResult;
+import com.nokia.testfw.resultview.ResultViewPlugin;
+
+public class TestResultTree {
+ private static final Image passedIcon = ResultViewPlugin
+ .getImage("obj16/testok.gif"); //$NON-NLS-1$
+ private static final Image failedIcon = ResultViewPlugin
+ .getImage("obj16/testfail.gif"); //$NON-NLS-1$
+ private static final Image testIcon = ResultViewPlugin
+ .getImage("obj16/test.gif"); //$NON-NLS-1$
+ private static final Image skipIcon = ResultViewPlugin
+ .getImage("obj16/testskip.gif"); //$NON-NLS-1$
+ private static final Image runIcon = ResultViewPlugin
+ .getImage("obj16/testrun.gif"); //$NON-NLS-1$
+
+ Tree tree;
+ Hashtable<String, TreeItem> treeItems;
+
+ public TestResultTree(Composite parent) {
+ treeItems = new Hashtable<String, TreeItem>();
+ tree = new Tree(parent, SWT.V_SCROLL | SWT.SINGLE);
+ GridData gridData = new GridData(GridData.FILL_BOTH
+ | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
+
+ tree.setLayoutData(gridData);
+ }
+
+ public Tree getTree() {
+ return tree;
+ }
+
+ /**
+ * initial the tree with empty test result
+ */
+ public void init(TestRunResult runResult) {
+ // create a root node
+ for (TestResult result : runResult.getResults()) {
+ createTreeItems(null, result);
+ }
+ }
+
+ /**
+ * update one test case result
+ *
+ * @param result
+ */
+ public void update(TestCaseResult result) {
+ // since it is using same result object, just redraw the tree
+ TreeItem item = treeItems.get(result.getUniqueName());
+ updateTreeItem(item);
+ // make sure to show this item in the tree
+ tree.showItem(item);
+ // update parent suite is any
+ TestSuiteResult suite;
+ TestResult child = result;
+ while ((suite = child.getParent()) != null) {
+ updateTreeItem(treeItems.get(suite.getUniqueName()));
+ child = suite;
+ }
+ }
+
+ public boolean addTestCase(TestCaseResult result) {
+ if (treeItems.get(result.getUniqueName()) != null)
+ return false;
+
+ TestSuiteResult parent = result.getParent();
+ if (parent == null) {
+ createNewTreeItem(null, result);
+ } else {
+ Stack<TestResult> stack = new Stack<TestResult>();
+ TreeItem parentItem = null;
+ stack.push(result);
+ while (parent != null) {
+ parentItem = treeItems.get(parent.getUniqueName());
+ if (parentItem == null) {
+ stack.push(parent);
+ } else {
+ break;
+ }
+ parent = parent.getParent();
+ }
+ while (!stack.isEmpty()) {
+ TestResult test = stack.pop();
+ parentItem = createNewTreeItem(parentItem, test);
+ }
+ }
+ return true;
+ }
+
+ /**
+ * reset the result tree and clean it is contents
+ */
+ public void reset() {
+ tree.removeAll();
+ treeItems.clear();
+ }
+
+ /**
+ * create one tree item to show a testcase(suite) result
+ *
+ * @param testResult
+ */
+ protected void createTreeItems(TreeItem parent, TestResult testResult) {
+ TreeItem item = createNewTreeItem(parent, testResult);
+ // create items for its children is any
+ if (testResult instanceof TestSuiteResult) {
+ TestSuiteResult suite = (TestSuiteResult) testResult;
+ for (TestResult child : suite.getChildren()) {
+ createTreeItems(item, child);
+ }
+ }
+ }
+
+ private TreeItem createNewTreeItem(TreeItem parentItem, TestResult result) {
+ TreeItem treeItem = null;
+ if (parentItem == null) {
+ treeItem = new TreeItem(tree, SWT.NONE);
+ } else {
+ treeItem = new TreeItem(parentItem, SWT.NONE);
+ }
+ treeItem.setData(result);
+ treeItem.setExpanded(true);
+ updateTreeItem(treeItem);
+ // set to show all items. may change to only show suite later
+ tree.showItem(treeItem);
+ treeItems.put(result.getUniqueName(), treeItem);
+ return treeItem;
+ }
+
+ private void updateTreeItem(TreeItem item) {
+ TestResult result = (TestResult) item.getData();
+ item.setText(result.getDesc());
+
+ switch (result.getStatus()) {
+ case SUCCESS:
+ item.setImage(passedIcon);
+ break;
+ case FAILURE:
+ item.setImage(failedIcon);
+ break;
+ case SKIP:
+ item.setImage(skipIcon);
+ break;
+ case STARTED:
+ item.setImage(runIcon);
+ break;
+ default:
+ item.setImage(testIcon);
+ }
+
+ }
+
+ // // handle the double click selection
+ // private void setupSelection() {
+ // tree.addListener(SWT.Selection, new Listener() {
+ //
+ // public void handleEvent(Event event) {
+ // TreeItem item = tree.getSelection()[0];
+ // if (item == null) {
+ // return;
+ // }
+ // TestResult result = (TestResult) item.getData();
+ // if (result == null) {
+ // ResultViewPlugin.log(IStatus.WARNING,
+ // "can't find selected test result");
+ // }
+ // // find the file
+ // if (result.getFile() == null) {
+ // ResultViewPlugin.log(IStatus.OK,
+ // "no locaiton information associated with the test");
+ // return;
+ // }
+ // // find file in workspace
+ // WorkspaceUtils.openFile(result.getFile(), result.getLine(),
+ // result.getColumn());
+ // }
+ //
+ // });
+ // }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.resultview/src/com/nokia/testfw/resultview/view/TestRunnerViewPart.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,641 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.resultview.view;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Vector;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.custom.ViewForm;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.MenuAdapter;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.part.ViewPart;
+
+import com.nokia.testfw.core.model.result.TestCaseResult;
+import com.nokia.testfw.core.model.result.TestResult;
+import com.nokia.testfw.core.model.result.TestResultListener;
+import com.nokia.testfw.core.model.result.TestRunResult;
+import com.nokia.testfw.core.model.result.TestResult.TestStatus;
+import com.nokia.testfw.resultview.ResultViewPlugin;
+import com.nokia.testfw.resultview.WorkspaceUtils;
+import com.nokia.testfw.resultview.model.TestRunSession;
+
+/**
+ * This class is test result view. it also provide action menu to stop or re-run
+ * test execution.
+ *
+ * User need to call init() to initialize the view the a particular test result.
+ * During the initialization, the view will register a TestResultLister to
+ * continue receive any changes from the test result.
+ *
+ * <p>
+ * Notice: the view controls use the same objects defined in the got from the
+ * TestRunResult.
+ * <p>
+ *
+ * It support ways to update:
+ * <li>batch update</li> after all test cases execution, update the result view
+ * by pass whole test result.
+ * <p>
+ * <li>dynamic update</li>
+ * during test execution, use listener to track test progress and update the
+ * result view dynamically.
+ *
+ * @author xiaoma
+ *
+ */
+public class TestRunnerViewPart extends ViewPart {
+
+ public static final String NAME = "com.nokia.testfw.resultview.testrunnerview";
+ private static final Image ICON_STF = ResultViewPlugin
+ .getImage("main16/stf.gif"); //$NON-NLS-1$
+ private static final ImageDescriptor ICON_LAUNCH_ENABLE = ResultViewPlugin
+ .getImageDescriptor("act16/relaunch_enable.gif"); //$NON-NLS-1$
+ private static final ImageDescriptor ICON_LAUNCH_DISABLE = ResultViewPlugin
+ .getImageDescriptor("act16/relaunch_disable.gif"); //$NON-NLS-1$
+
+ private static final ImageDescriptor ICON_LAUNCHF_ENABLE = ResultViewPlugin
+ .getImageDescriptor("act16/relaunchf_enable.gif"); //$NON-NLS-1$
+ private static final ImageDescriptor ICON_LAUNCHF_DISABLE = ResultViewPlugin
+ .getImageDescriptor("act16/relaunchf_disable.gif"); //$NON-NLS-1$
+
+ private static final ImageDescriptor ICON_HISTORY_LIST = ResultViewPlugin
+ .getImageDescriptor("act16/history_list.gif"); //$NON-NLS-1$
+ private static final ImageDescriptor ICON_SESSION_RUNNING = ResultViewPlugin
+ .getImageDescriptor("act16/tsuiterun.gif"); //$NON-NLS-1$
+ private static final ImageDescriptor ICON_SESSION_OK = ResultViewPlugin
+ .getImageDescriptor("act16/tsuiteok.gif"); //$NON-NLS-1$
+ private static final ImageDescriptor ICON_SESSION_FAIL = ResultViewPlugin
+ .getImageDescriptor("act16/tsuitefail.gif"); //$NON-NLS-1$
+
+ public CounterPanel counterPanel;
+ public TestProgressBar progressBar;
+ // protected SashForm sashForm;
+ public TestResultTree resultTree;
+ private SashForm iSashForm;
+ public Table resultTable;
+ private Vector<TestRunSession> iTrackedTestRunSessions = new Vector<TestRunSession>();
+ private TestRunSession iCurrentSelectSession = null;
+ private Display display;
+ private TestResultListener iResultListener;
+ private FailureTrace iFailureTrace;
+ private RerunLastAction iRerunLastAction;
+ private RerunLastFailedAction iRerunLastFailedAction;
+ private CLabel iSessionTitle;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets
+ * .Composite)
+ */
+ public void createPartControl(Composite parent) {
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+ parent.setLayout(gridLayout);
+ display = parent.getDisplay();
+
+ configureToolBar();
+ // create test session name
+ iSessionTitle = new CLabel(parent, SWT.SHADOW_OUT);
+ iSessionTitle.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
+ | GridData.HORIZONTAL_ALIGN_FILL));
+ // create counter panel
+ createProgressCountPanel(parent);
+
+ iSashForm = createSashForm(parent);
+ iSashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ iResultListener = new TestResultListener() {
+
+ public void testCaseStateChange(final TestCaseResult result,
+ final TestStatus status) {
+ display.asyncExec(new Runnable() {
+ public void run() {
+ if (resultTree.getTree().isDisposed())
+ return;
+ switch (status) {
+ case SUCCESS:
+ counterPanel.addPassedTest();
+ progressBar.step(true);
+ break;
+ case FAILURE:
+ counterPanel.addFailedTest();
+ progressBar.step(false);
+ break;
+ case SKIP:
+ progressBar.step(true);
+ break;
+ }
+ resultTree.update(result);
+ iFailureTrace.update(result);
+ }
+ });
+ }
+
+ public void testFinished() {
+ display.asyncExec(new Runnable() {
+ public void run() {
+ if (resultTree.getTree().isDisposed())
+ return;
+ progressBar.stopTest();
+ iRerunLastAction.setEnabled(true);
+ if (iCurrentSelectSession.getfailedTestCount() > 0) {
+ iRerunLastFailedAction.setEnabled(true);
+ }
+ }
+ });
+ }
+
+ public void testStarted() {
+ // display.asyncExec(new Runnable() {
+ // @Override
+ // public void run() {
+ // progressBar.reset();
+ // counterPanel.reset();
+ // resultTree.reset();
+ // }
+ // });
+ }
+
+ public void addTestCase(final TestCaseResult result) {
+ display.asyncExec(new Runnable() {
+ public void run() {
+ if (resultTree.addTestCase(result)) {
+ progressBar.addTestCount();
+ counterPanel.addCounter();
+ }
+ }
+ });
+ }
+
+ };
+ }
+
+ protected Composite createProgressCountPanel(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ composite.setLayout(layout);
+ counterPanel = new CounterPanel(composite);
+ counterPanel.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
+ | GridData.HORIZONTAL_ALIGN_FILL));
+
+ progressBar = new TestProgressBar(composite);
+ progressBar.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
+ | GridData.HORIZONTAL_ALIGN_FILL));
+
+ composite.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
+ | GridData.HORIZONTAL_ALIGN_FILL));
+ return composite;
+ }
+
+ protected void createResultTree(Composite parent) {
+ resultTree = new TestResultTree(parent);
+ }
+
+ private SashForm createSashForm(Composite parent) {
+ SashForm lSashForm = new SashForm(parent, SWT.HORIZONTAL);
+
+ ViewForm top = new ViewForm(lSashForm, SWT.NONE);
+
+ Composite empty = new Composite(top, SWT.NONE);
+ empty.setLayout(new Layout() {
+ protected Point computeSize(Composite composite, int wHint,
+ int hHint, boolean flushCache) {
+ return new Point(1, 1); // (0, 0) does not work with
+ // super-intelligent ViewForm
+ }
+
+ protected void layout(Composite composite, boolean flushCache) {
+ }
+ });
+ top.setTopLeft(empty); // makes ViewForm draw the horizontal separator
+ // line ...
+ resultTree = new TestResultTree(top);
+ final Tree tree = resultTree.getTree();
+ tree.addListener(SWT.MouseDoubleClick, new Listener() {
+ public void handleEvent(Event event) {
+ Item[] sels = tree.getSelection();
+ if (sels != null && sels.length > 0) {
+ openTestFile((TestResult) sels[0].getData());
+ }
+ }
+ });
+ tree.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent keyevent) {
+ if (keyevent.keyCode == SWT.CR
+ || keyevent.keyCode == SWT.KEYPAD_CR) {
+ Item[] sels = tree.getSelection();
+ if (sels != null && sels.length > 0) {
+ openTestFile((TestResult) sels[0].getData());
+ }
+ }
+ }
+ });
+ Menu menu = new Menu(tree);
+ final MenuItem item = new MenuItem(menu, SWT.None);
+ item.setText("Retest");
+ item.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent arg0) {
+ TreeItem[] items = tree.getSelection();
+ if (items != null && items.length > 0) {
+ HashSet<TestResult> results = new HashSet<TestResult>();
+ for (TreeItem item : items) {
+ results.add((TestResult) item.getData());
+ }
+ rerunTestRun((TestResult[]) results
+ .toArray(new TestResult[0]));
+ }
+ }
+ });
+ menu.addMenuListener(new MenuAdapter() {
+ public void menuShown(MenuEvent menuevent) {
+ TreeItem[] items = tree.getSelection();
+ if (items == null || items.length == 0) {
+ item.setEnabled(false);
+ } else {
+ item.setEnabled(true);
+ }
+ }
+ });
+ tree.setMenu(menu);
+ top.setContent(tree);
+
+ ViewForm bottom = new ViewForm(lSashForm, SWT.NONE);
+
+ CLabel label = new CLabel(bottom, SWT.NONE);
+ label.setText("Failure information:");
+ label.setImage(ICON_STF);
+ bottom.setTopLeft(label);
+ ToolBar failureToolBar = new ToolBar(bottom, SWT.FLAT | SWT.WRAP);
+ bottom.setTopCenter(failureToolBar);
+ iFailureTrace = new FailureTrace(bottom);
+ resultTable = iFailureTrace.getTable();
+ resultTable.addListener(SWT.MouseDown, new Listener() {
+ public void handleEvent(Event event) {
+ openTestFile(iFailureTrace.getTestResult());
+ }
+ });
+ resultTable.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent keyevent) {
+ if (keyevent.keyCode == SWT.CR
+ || keyevent.keyCode == SWT.KEYPAD_CR) {
+ openTestFile(iFailureTrace.getTestResult());
+ }
+ }
+ });
+ bottom.setContent(resultTable);
+
+ tree.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ iFailureTrace.setTestResult((TestResult) event.item.getData());
+ }
+ });
+
+ lSashForm.setWeights(new int[] { 50, 50 });
+ return lSashForm;
+ }
+
+ private void configureToolBar() {
+ IActionBars actionBars = getViewSite().getActionBars();
+ IToolBarManager toolBar = actionBars.getToolBarManager();
+ toolBar.add(iRerunLastAction = new RerunLastAction());
+ toolBar.add(iRerunLastFailedAction = new RerunLastFailedAction());
+ toolBar.add(new Separator());
+ toolBar.add(new HistoryDropDownAction());
+
+ actionBars.updateActionBars();
+ }
+
+ private void openTestFile(TestResult result) {
+ if (result == null) {
+ ResultViewPlugin.log(IStatus.WARNING,
+ "can't find selected test result");
+ return;
+ }
+ // find the file
+ if (result.getFile() == null) {
+ ResultViewPlugin.log(IStatus.OK,
+ "no locaiton information associated with the test");
+ return;
+ }
+ // find file in workspace
+ WorkspaceUtils.openFile(result.getFile(), result.getLine(), result
+ .getColumn());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
+ */
+ @Override
+ public void setFocus() {
+ iSashForm.setFocus();
+ }
+
+ public void clear() {
+ reset();
+ iTrackedTestRunSessions.clear();
+ }
+
+ private void reset() {
+ if (iCurrentSelectSession != null) {
+ iCurrentSelectSession.removeResultListener(iResultListener);
+ }
+ progressBar.reset();
+ counterPanel.reset();
+ resultTree.reset();
+ resultTable.removeAll();
+ iCurrentSelectSession = null;
+ }
+
+ public void addTestRunSession(TestRunSession session) {
+ iTrackedTestRunSessions.add(session);
+ show(session);
+ }
+
+ /**
+ * Initialize the result view with tests Please notice, those tests may not
+ * been executed yet. create result listener to get update events
+ *
+ * @param result
+ * @see TestRunResult
+ */
+ private void show(TestRunSession session) {
+ reset();
+ // init progress bar
+ progressBar.init(session);
+ // init counter
+ counterPanel.init(session);
+ // init tree
+ resultTree.init(session);
+ // during initialize, we will create test result lister to monitor
+ // any updates on the test run result
+ session.addResultListener(iResultListener);
+ iSessionTitle.setText(session.getName());
+ iCurrentSelectSession = session;
+
+ if (session.isClosed()) {
+ iRerunLastAction.setEnabled(true);
+ if (session.getfailedTestCount() > 0) {
+ iRerunLastFailedAction.setEnabled(true);
+ }
+ } else {
+ iRerunLastAction.setEnabled(false);
+ iRerunLastFailedAction.setEnabled(false);
+ }
+ }
+
+ public boolean isCreated() {
+ return counterPanel != null;
+ }
+
+ private class ClearTerminatedAction extends Action {
+ public ClearTerminatedAction() {
+ setText("&Clear Terminated");
+
+ boolean enabled = false;
+ for (Iterator<TestRunSession> iter = iTrackedTestRunSessions
+ .iterator(); iter.hasNext();) {
+ TestRunSession testRunSession = iter.next();
+ if (testRunSession.isClosed()) {
+ enabled = true;
+ break;
+ }
+ }
+ setEnabled(enabled);
+ }
+
+ public void run() {
+ for (Iterator<TestRunSession> iter = iTrackedTestRunSessions
+ .iterator(); iter.hasNext();) {
+ TestRunSession testRunSession = iter.next();
+ if (testRunSession.isClosed()) {
+ iter.remove();
+ }
+ }
+ if (!iTrackedTestRunSessions.isEmpty()) {
+ show(iTrackedTestRunSessions.lastElement());
+ } else {
+ reset();
+ }
+ }
+ }
+
+ private class RerunLastAction extends Action {
+ public RerunLastAction() {
+ setText("Rerun Test");
+ setToolTipText("Rerun Test");
+ setDisabledImageDescriptor(ICON_LAUNCH_DISABLE);
+ setHoverImageDescriptor(ICON_LAUNCH_ENABLE);
+ setImageDescriptor(ICON_LAUNCH_ENABLE);
+ setEnabled(false);
+ setActionDefinitionId("com.nokia.testfw.resultview.testrunnerview.reruntest");
+ }
+
+ public void run() {
+ rerunTestRun();
+ }
+ }
+
+ private class RerunLastFailedAction extends Action {
+ public RerunLastFailedAction() {
+ setText("Rerun Test - Failures");
+ setToolTipText("Rerun Test - Failures");
+ setDisabledImageDescriptor(ICON_LAUNCHF_DISABLE);
+ setHoverImageDescriptor(ICON_LAUNCHF_ENABLE);
+ setImageDescriptor(ICON_LAUNCHF_ENABLE);
+ setEnabled(false);
+ setActionDefinitionId("com.nokia.testfw.resultview.testrunnerview.rerunFailedFirst");
+ }
+
+ public void run() {
+ rerunTestFailed();
+ }
+ }
+
+ private class HistoryAction extends Action {
+ private TestRunSession iSession;
+
+ public HistoryAction(TestRunSession session) {
+ super("", AS_RADIO_BUTTON); //$NON-NLS-1$
+ iSession = session;
+
+ setText(session.getName());
+ if (session.isClosed()) {
+ if (session.getfailedTestCount() > 0) {
+ setImageDescriptor(ICON_SESSION_FAIL);
+ } else {
+ setImageDescriptor(ICON_SESSION_OK);
+ }
+ } else {
+ setImageDescriptor(ICON_SESSION_RUNNING);
+ }
+ }
+
+ public void run() {
+ show(iSession);
+ }
+ }
+
+ private class HistoryDropDownAction extends Action {
+
+ public HistoryDropDownAction() {
+ super("Test Run History...", IAction.AS_DROP_DOWN_MENU);
+ setImageDescriptor(ICON_HISTORY_LIST);
+
+ setMenuCreator(new IMenuCreator() {
+ private Menu iMenu;
+
+ public Menu getMenu(Menu menu) {
+ return null;
+ }
+
+ public Menu getMenu(Control parent) {
+ if (iMenu != null) {
+ iMenu.dispose();
+ }
+ final MenuManager manager = new MenuManager();
+ manager.setRemoveAllWhenShown(true);
+ manager.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager2) {
+ for (TestRunSession session : iTrackedTestRunSessions) {
+ HistoryAction action = new HistoryAction(
+ session);
+ action
+ .setChecked(session == iCurrentSelectSession);
+ manager2.add(action);
+ }
+ manager2.add(new Separator());
+ manager2.add(new ClearTerminatedAction());
+ }
+ });
+
+ iMenu = manager.createContextMenu(parent);
+
+ // workaround for
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=129973
+ final Display display = parent.getDisplay();
+ iMenu.addMenuListener(new MenuAdapter() {
+ public void menuHidden(final MenuEvent e) {
+ display.asyncExec(new Runnable() {
+ public void run() {
+ manager.removeAll();
+ if (iMenu != null) {
+ iMenu.dispose();
+ iMenu = null;
+ }
+ }
+ });
+ }
+ });
+ return iMenu;
+ }
+
+ public void dispose() {
+ if (iMenu != null) {
+ iMenu.dispose();
+ iMenu = null;
+ }
+ }
+ });
+ }
+
+ }
+
+ private void rerunTestRun() {
+
+ if (iCurrentSelectSession == null)
+ return;
+ ILaunch launch = iCurrentSelectSession.getLaunch();
+ if (launch == null)
+ return;
+ ILaunchConfiguration launchConfiguration = launch
+ .getLaunchConfiguration();
+ if (launchConfiguration == null)
+ return;
+
+ DebugUITools.launch(launchConfiguration, launch.getLaunchMode());
+ }
+
+ private void rerunTestRun(TestResult[] results) {
+ if (iCurrentSelectSession == null)
+ return;
+
+ ILaunch launch = iCurrentSelectSession.getLaunch();
+ if (launch != null && launch.getLaunchConfiguration() != null) {
+ ILaunchConfiguration launchConfiguration = launch
+ .getLaunchConfiguration();
+ if (launchConfiguration != null) {
+ launchConfiguration = iCurrentSelectSession
+ .getRetestLaunchConfiguration(launchConfiguration,
+ results);
+ DebugUITools
+ .launch(launchConfiguration, launch.getLaunchMode());
+ }
+ }
+ }
+
+ private void rerunTestFailed() {
+ if (!iCurrentSelectSession.isClosed())
+ return;
+ rerunTestRun(iCurrentSelectSession.getFailedResults().toArray(
+ new TestResult[0]));
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.stf.configeditor</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.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/META-INF/MANIFEST.MF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: STF Configuration Editor plug-in
+Bundle-SymbolicName: com.nokia.testfw.stf.configeditor;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: com.nokia.testfw.stf.configeditor.Activator
+Bundle-Vendor: Nokia
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.jface.text,
+ org.eclipse.core.resources,
+ org.eclipse.ui.editors,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.ui.forms,
+ org.eclipse.compare
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: org.eclipse.cdt.core.model
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/build.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,8 @@
+javacSource=1.5
+javacTarget=1.5
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ icons/
Binary file testdev/ite/src/com.nokia.testfw.stf.configeditor/icons/bannerStif.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.configeditor/icons/stif_16.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.configeditor/icons/stif_bannered.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/plugin.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ class="com.nokia.testfw.stf.configeditor.editors.ConfigEditor"
+ contributorClass="com.nokia.testfw.stf.configeditor.editors.ConfigEditorContributor"
+ default="true"
+ extensions="ini"
+ icon="icons/stif_16.png"
+ id="com.nokia.testfw.stf.configeditor.editors.MultiPageEditor"
+ name="STF Configuration Editor">
+ </editor>
+ </extension>
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
+ name="Carbide Extensions"
+ id="com.nokia.s60tools">
+ </category>
+ <wizard
+ category="com.nokia.s60tools"
+ class="com.nokia.testfw.stf.configeditor.wizards.NewStifConfigWizard"
+ icon="icons/stif_16.png"
+ id="com.nokia.testfw.stf.configeditor.wizards.NewStifConfigWizard"
+ name="STF configuration file">
+ <description>Adds a new configuration file to a chosen test module</description>
+ </wizard>
+ </extension>
+
+</plugin>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/STIFConfigEditor.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,5 @@
+#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
+
+ContentAssistProposal.description = Provides Content Assistance
+ContentAssistProposal.label = Content assist
+ContentAssistProposal.tooltip = Content assist
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/TestFramework.ini Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,217 @@
+#
+# This is STIF initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+# - Set Test Reporting mode. TestReportMode's possible values are:
+# + 'Summary': Summary of the tested test cases.
+# + 'Environment': Hardware and software info.
+# + 'TestCases': Test case report.
+# + 'FullReport': Set of all above ones.
+# + Example 'TestReportMode= Summary TestCases'
+#
+# - CreateTestReport setting controls report creation mode
+# + YES, Test report will created.
+# + NO, No Test report.
+#
+# - File path indicates the base path of the test report.
+# - File name indicates the name of the test report.
+#
+# - File format indicates the type of the test report.
+# + TXT, Test report file will be txt type, for example 'TestReport.txt'.
+# + HTML, Test report will be html type, for example 'TestReport.html'.
+# + XML, Test report will be xml type, for example 'TestReport.xml'.
+# Note, that xml format is available only when output is set to FILE.
+#
+# - File output indicates output source of the test report.
+# + FILE, Test report logging to file.
+# + RDEBUG, Test report logging to using rdebug.
+#
+# - File Creation Mode indicates test report overwriting if file exist.
+# + OVERWRITE, Overwrites if the Test report file exist.
+# + APPEND, Continue logging after the old Test report information if
+# report exist.
+# - Sets a device reset module's dll name(Reboot).
+# + If Nokia specific reset module is not available or it is not correct one
+# StifHWResetStub module may use as a template for user specific reset
+# module.
+# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation
+# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02
+#
+
+[Engine_Defaults]
+
+TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment',
+ # 'TestCases' or 'FullReport'
+
+CreateTestReport= YES # Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT # Possible values: TXT, HTML or XML
+TestReportOutput= FILE # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+DisableMeasurement= stifmeasurementdisablenone # Possible values are:
+ # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
+ # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
+ # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
+ # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
+
+Timeout= 0 # Default timeout value for each test case. In milliseconds
+#UITestingSupport= YES # Possible values: YES or NO
+#SeparateProcesses= YES # Possible values: YES or NO (default: NO)
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= demomodule
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIF logging overwrite parameters for Logger.
+# Hardware and emulator environment logging path and styles can
+# be configured from here to overwrite the Logger's implemented values.
+#
+# Settings description:
+# - Indicates option for creation log directory/directories. If log directory/directories
+# is/are not created by user they will make by software.
+# + YES, Create log directory/directories if not allready exist.
+# + NO, Log directory/directories not created. Only created one is used.
+#
+# - Overwrite emulator path setting.
+# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined
+# Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+# will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+# - Overwrite emulator's logging format.
+# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+# + HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+# - Overwrited emulator logging output source.
+# + FILE, Logging to file(s).
+# + RDEBUG, Logging to using rdebug(s).
+#
+# - Overwrite hardware path setting (Same description as above in emulator path).
+# - Overwrite hardware's logging format(Same description as above in emulator format).
+# - Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+# - File Creation Mode indicates file overwriting if file exist.
+# + OVERWRITE, Overwrites if file(s) exist.
+# + APPEND, Continue logging after the old logging information if file(s) exist.
+#
+# - Will thread id include to the log filename.
+# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+# + NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+# - Will time stamps include the to log file.
+# + YES, Time stamp added to each line in log file(s). Time stamp is
+# for example'12.Nov.2003 115958 LOGGING INFO'
+# + NO, No time stamp(s).
+#
+# - Will line breaks include to the log file.
+# + YES, Each logging event includes line break and next log event is in own line.
+# + NO, No line break(s).
+#
+# - Will event ranking include to the log file.
+# + YES, Event ranking number added to each line in log file(s). Ranking number
+# depends on environment's tics, for example(includes time stamp also)
+# '012 12.Nov.2003 115958 LOGGING INFO'
+# + NO, No event ranking.
+#
+# - Will write log file in unicode format.
+# + YES, Log file will be written in unicode format
+# + NO, Log will be written as normal, not unicode, file.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#'
+#NOTE: TestEngine and TestServer logging settings cannot change here
+
+#CreateLogDirectories= YES # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML # Possible values: TXT or HTML
+#EmulatorOutput= FILE # Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML # Possible values: TXT or HTML
+#HardwareOutput= FILE # Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES # Possible values: YES or NO
+#WithTimeStamp= YES # Possible values: YES or NO
+#WithLineBreak= YES # Possible values: YES or NO
+#WithEventRanking= YES # Possible values: YES or NO
+
+#FileUnicode= YES # Possible values: YES or NO
+#AddTestCaseTitle= YES # Possible values: YES or NO
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set filters to be used by ConsoleUI.
+# If you want to use filter with ConsoleUI, simply remove comments
+# from section below and provide valid filter entries.
+# Each filter line has to start with "filter= " keyword.
+# Filter can contain special wildcard characters:
+# * which stands for none or any literal;
+# ? which stands for single character.
+# Filters are not case-sensitive.
+
+#[Filters]
+#filter= *math*
+#filter= *radio*
+#[End_Filters]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configeditor/Activator.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configeditor;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "com.nokia.testfw.stf.configeditor";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configeditor/editors/ConfigEditor.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,2699 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.testfw.stf.configeditor.editors;
+
+import java.util.ArrayList;
+import java.lang.StringBuffer;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.editors.text.TextEditor;
+import org.eclipse.ui.forms.widgets.ColumnLayout;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.ide.IGotoMarker;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.MultiPageEditorPart;
+import org.eclipse.swt.graphics.Color;
+
+import com.nokia.testfw.stf.configeditor.wizards.NewModuleWizard;
+import com.nokia.testfw.stf.configmanager.ConfigDefaults;
+import com.nokia.testfw.stf.configmanager.ConfigManager;
+import com.nokia.testfw.stf.configmanager.ConfigUtil;
+import com.nokia.testfw.stf.configmanager.FileCreationMode;
+import com.nokia.testfw.stf.configmanager.MeasurementModule;
+import com.nokia.testfw.stf.configmanager.OutputFileFormat;
+import com.nokia.testfw.stf.configmanager.OutputType;
+import com.nokia.testfw.stf.configmanager.ParseProblem;
+import com.nokia.testfw.stf.configmanager.SectionElementType;
+import com.nokia.testfw.stf.configmanager.TestReportMode;
+import com.nokia.testfw.stf.configmanager.YesNo;
+
+/**
+ * STIF configuration file editor.
+ *
+ */
+public class ConfigEditor extends MultiPageEditorPart implements
+ IResourceChangeListener, IGotoMarker, SelectionListener,
+ ModifyListener, ISelectionChangedListener {
+ /**
+ * Config source view control
+ */
+ private TextEditor sourceEditor;
+
+ /**
+ * Eclipse form toolkit used to create other controls
+ */
+ private FormToolkit toolkit;
+ /**
+ * Global settings view control
+ */
+ private ScrolledForm globalSettingsMainForm;
+ /**
+ * Modules view pages
+ */
+ private ScrolledForm modulesMainForm;
+ /**
+ * Source view page index
+ */
+ private int sourcePageIndex = -1;
+ /**
+ * Global settings page index
+ */
+ private int globalSettingsPageIndex = -1;
+ /**
+ * Modules page index
+ */
+ private int modulesPageIndex = -1;
+ /**
+ * <code>TestReportMode</code> value control
+ */
+ private CCombo testReportModeValue = null;
+ /**
+ * <code>CreateTestReport = Yes</code> value control
+ */
+ private Button createTestReportYesButton = null;
+ /**
+ * <code>CreateTestReport = No</code> value control
+ */
+ private Button createTestReportNoButton = null;
+ /**
+ * <code>TestReportFilePath</code> value control
+ */
+ private Text testReportFilePathValue = null;
+ /**
+ * <code>TestReportFileName</code> value control
+ */
+ private Text testReportFileNameValue = null;
+ /**
+ * <code>TestReportFormat = Txt</code> value control
+ */
+ private Button testReportFormatTxtButton = null;
+ /**
+ * <code>TestReportFormat = Html</code> value control
+ */
+ private Button testReportFormatHtmlButton = null;
+ /**
+ * <code>TestReportOutput = File</code> value control
+ */
+ private Button testReportOutputFileButton = null;
+ /**
+ * <code>TestReportOutput = RDebug</code> value control
+ */
+ private Button testReportOutputRDebugButton = null;
+ /**
+ * <code>TestReportFileCreationMode = Overwrite</code> value control
+ */
+ private Button testReportFileCreationModeOverwriteButton = null;
+ /**
+ * <code>TestReportFileCreationMode = Append</code> value control
+ */
+ private Button testReportFileCreationModeAppendButton = null;
+ /**
+ * <code>DeviceResetDllName</code> value control
+ */
+ private Text deviceResetDllNameValue = null;
+ /**
+ * <code>DisableMeasurement</code> value control
+ */
+ private List disableMeasurementValue = null;
+ /**
+ * <code>Timeout</code> value control
+ */
+ private Spinner timeoutValue = null;
+ /**
+ * <code>UITestingSupport = Yes</code> value control
+ */
+ private Button uiTestingSupportYesButton = null;
+ /**
+ * <code>UITestingSupport = No</code> value control
+ */
+ private Button uiTestingSupportNoButton = null;
+ /**
+ * <code>SeparateProcesses = Yes</code> value control
+ */
+ private Button separateProcessYesButton = null;
+ /**
+ * <code>SeparateProcesses = No</code> value control
+ */
+ private Button separateProcessNoButton = null;
+ /**
+ * <code>CreateLogDirectories = Yes</code> value control
+ */
+ private Button createLogDirectoriesYesButton = null;
+ /**
+ * <code>CreateLogDirectories = No</code> value control
+ */
+ private Button createLogDirectoriesNoButton = null;
+ /**
+ * <code>EmulatorBasePath</code> value control
+ */
+ private Text emulatorBasePathValue = null;
+ /**
+ * <code>HardwareBasePath</code> value control
+ */
+ private Text hardwareBasePathValue = null;
+ /**
+ * <code>LogFileCreationMode = Overwrite</code> value control
+ */
+ Button logFileCreationModeOverwriteButton = null;
+ /**
+ * <code>LogFileCreationMode = Append</code> value control
+ */
+ Button logFileCreationModeAppendButton = null;
+ /**
+ * <code>ThreadIdToLogFile = Yes</code> value control
+ */
+ private Button threadIdToLogFileYesButton = null;
+ /**
+ * <code>ThreadIdToLogFile = No</code> value control
+ */
+ private Button threadIdToLogFileNoButton = null;
+ /**
+ * <code>withTimeStamp = Yes</code> value control
+ */
+ private Button withTimeStampYesButton = null;
+ /**
+ * <code>WithTimeStamp = No</code> value control
+ */
+ private Button withTimeStampNoButton = null;
+ /**
+ * <code>WithLineBreak = Yes</code> value control
+ */
+ private Button withLineBreakYesButton = null;
+ /**
+ * <code>WithLineBreak = No</code> value control
+ */
+ private Button withLineBreakNoButton = null;
+ /**
+ * <code>WithEventRanking = Yes</code> value control
+ */
+ private Button withEventRankingYesButton = null;
+ /**
+ * <code>WithEventRanking = No</code> value control
+ */
+ private Button withEventRankingNoButton = null;
+ /**
+ * <code>FileUnicode = Yes</code> value control
+ */
+ private Button fileUnicodeYesButton = null;
+ /**
+ * <code>FileUnicode = No</code> value control
+ */
+ private Button fileUnicodeNoButton = null;
+ /**
+ * <code>EmulatorLogOutput = File</code> value control
+ */
+ private Button emulatorLogOutputFileButton = null;
+ /**
+ * <code>EmulatorLogOutput = RDebug</code> value control
+ */
+ private Button emulatorLogOutputRDebugButton = null;
+ /**
+ * <code>EmulatorLogFormat = Txt</code> value control
+ */
+ private Button emulatorLogFormatTxtButton = null;
+ /**
+ * <code>EmulatorLogFormat = Html</code> value control
+ */
+ private Button emulatorLogFormatHtmlButton = null;
+ /**
+ * <code>HardwareLogOutput = File</code> value control
+ */
+ private Button hardwareLogOutputFileButton = null;
+ /**
+ * <code>HardwareLogOutput = RDebug</code> value control
+ */
+ private Button hardwareLogOutputRDebugButton = null;
+ /**
+ * <code>HardwareLogFormat = Txt</code> value control
+ */
+ private Button hardwareLogFormatTxtButton = null;
+ /**
+ * <code>HardwareLogFormat = Html</code> value control
+ */
+ private Button hardwareLogFormatHtmlButton = null;
+ /**
+ * Modules tree view control
+ */
+ private TreeViewer modulesTreeViewer = null;
+ /**
+ * Modules tree root node
+ */
+ private ModulesTreeNode modulesTreeRoot = null;
+ /**
+ * Add module button
+ */
+ private Button addModuleButton = null;
+ /**
+ * Add testcase file button
+ */
+ private Button addTestCaseFileButton = null;
+ /**
+ * Add ini file button
+ */
+ private Button addIniFileButton = null;
+ /**
+ * Edit button
+ */
+ private Button editButton = null;
+ /**
+ * Remove button
+ */
+ private Button removeButton = null;
+ /**
+ * Config manager
+ */
+ private ConfigManager configManager = null;
+ /**
+ * List of problem markers
+ */
+ private java.util.List<IMarker> problemMarkers = null;
+ /**
+ * Add testcase title button
+ */
+ private Button addTestCaseTitleYesButton = null;
+ /**
+ * Add testcase title button
+ */
+ private Button addTestCaseTitleNoButton = null;
+ /**
+ * Creates a STIf configuration editor
+ */
+
+ private Label testReportModeLabel;
+ private Label createTestReportLabel;
+ private Label testReportFilePathLabel;
+ private Label testReportFileNameLabel;
+ private Label testReportFormatLabel;
+ private Label testReportOutputLabel;
+ private Label testReportFileCreationModeLabel;
+ private Label deviceResetDllNameLabel;
+ private Label disableMeasurementLabel;
+ private Label timeoutLabel;
+ private Label uiTestingSupportLabel;
+ private Label separateProcessLabel;
+
+ private Label createLogDirectoriesLabel;
+ private Label emulatorBasePathLabel;
+ private Label emulatorLogFormatLabel;
+ private Label emulatorLogOutputLabel;
+ private Label hardwareBasePathLabel;
+ private Label hardwareLogFormatLabel;
+ private Label hardwareLogOutputLabel;
+ private Label logFileCreationModeLabel;
+ private Label threadIdToLogFileLabel;
+ private Label withTimeStampLabel;
+ private Label withLineBreakLabel;
+ private Label withEventRankingLabel;
+ private Label fileUnicodeLabel;
+ private Label addTestcaseTitleLabel;
+
+ public ConfigEditor() {
+ super();
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
+ }
+
+ /**
+ * Creates global settings page
+ */
+ void createGlobalSettingsPage() {
+ globalSettingsMainForm = toolkit.createScrolledForm(getContainer());
+ globalSettingsMainForm.setText("STF global settings");
+
+ ColumnLayout overviewMainFormLayout = new ColumnLayout();
+ overviewMainFormLayout.maxNumColumns = 2;
+
+ Section engineDefaultsSection = toolkit.createSection(
+ globalSettingsMainForm.getBody(), Section.TITLE_BAR);
+ engineDefaultsSection.setText("Engine defaults");
+
+ Composite engineDefaultsSectionClient = toolkit
+ .createComposite(engineDefaultsSection);
+
+ TableWrapLayout engineDefaultsSectionLayout = new TableWrapLayout();
+ engineDefaultsSectionLayout.verticalSpacing = 10;
+ engineDefaultsSectionLayout.numColumns = 2;
+ engineDefaultsSectionClient.setLayout(engineDefaultsSectionLayout);
+
+ engineDefaultsSection.setClient(engineDefaultsSectionClient);
+
+ createEngineDefaultsSectionControls(engineDefaultsSectionClient);
+
+ // Logger defaults
+ Section loggerDefaultsSection = toolkit.createSection(
+ globalSettingsMainForm.getBody(), Section.TITLE_BAR);
+
+ loggerDefaultsSection.setText("Logger defaults");
+
+ Composite loggerDefaultsSectionClient = toolkit
+ .createComposite(loggerDefaultsSection);
+
+ TableWrapLayout loggerDefaultsSectionLayout = new TableWrapLayout();
+ loggerDefaultsSectionLayout.verticalSpacing = 10;
+ loggerDefaultsSectionLayout.numColumns = 2;
+ loggerDefaultsSectionClient.setLayout(loggerDefaultsSectionLayout);
+
+ loggerDefaultsSection.setClient(loggerDefaultsSectionClient);
+ createLoggerDefaultsSectionControls(loggerDefaultsSectionClient);
+
+ // Final initializations
+ globalSettingsMainForm.getBody().setLayout(overviewMainFormLayout);
+ engineDefaultsSectionClient.setData(FormToolkit.KEY_DRAW_BORDER,
+ FormToolkit.TEXT_BORDER);
+ toolkit.paintBordersFor(engineDefaultsSectionClient);
+ loggerDefaultsSectionClient.setData(FormToolkit.KEY_DRAW_BORDER,
+ FormToolkit.TEXT_BORDER);
+ toolkit.paintBordersFor(loggerDefaultsSectionClient);
+
+ globalSettingsPageIndex = addPage(globalSettingsMainForm);
+ setPageText(globalSettingsPageIndex, "Global settings");
+ }
+
+ /**
+ * Creates engine defaults panel controls
+ *
+ * @param engineDefaultsSectionClient
+ * engine defaults panel
+ */
+ void createEngineDefaultsSectionControls(
+ Composite engineDefaultsSectionClient) {
+ // Test report mode controls
+ testReportModeLabel = toolkit.createLabel(engineDefaultsSectionClient,
+ "Test report mode:");
+ testReportModeValue = new CCombo(engineDefaultsSectionClient,
+ SWT.READ_ONLY | SWT.NONE);
+ toolkit.adapt(testReportModeValue, true, true);
+ testReportModeValue.setLayoutData(new TableWrapData(
+ TableWrapData.FILL_GRAB));
+ testReportModeValue.addSelectionListener(this);
+
+ // Create test report controls
+ createTestReportLabel = toolkit.createLabel(
+ engineDefaultsSectionClient, "Create test report:");
+ Composite createTestReportGroup = toolkit
+ .createComposite(engineDefaultsSectionClient);
+ GridLayout createTestReportGroupLayout = new GridLayout();
+ createTestReportGroupLayout.marginHeight = 0;
+ createTestReportGroupLayout.numColumns = 2;
+ createTestReportGroup.setLayout(createTestReportGroupLayout);
+ createTestReportYesButton = toolkit.createButton(createTestReportGroup,
+ "Yes", SWT.RADIO | SWT.SELECTED);
+ createTestReportYesButton.setSelection(true);
+ createTestReportYesButton.addSelectionListener(this);
+ createTestReportNoButton = toolkit.createButton(createTestReportGroup,
+ "No", SWT.RADIO);
+
+ // Test report file path
+ testReportFilePathLabel = toolkit.createLabel(
+ engineDefaultsSectionClient, "Test report file path:");
+ testReportFilePathValue = toolkit.createText(
+ engineDefaultsSectionClient, "C:\\LOGS\\TestFramework\\");
+ testReportFilePathValue.setLayoutData(new TableWrapData(
+ TableWrapData.FILL_GRAB));
+ testReportFilePathValue.addSelectionListener(this);
+ testReportFilePathValue.addModifyListener(this);
+
+ // Test report file name
+ testReportFileNameLabel = toolkit.createLabel(
+ engineDefaultsSectionClient, "Test report file name:");
+ testReportFileNameValue = toolkit.createText(
+ engineDefaultsSectionClient, "TestReport");
+ testReportFileNameValue.setLayoutData(new TableWrapData(
+ TableWrapData.FILL_GRAB));
+ testReportFileNameValue.addSelectionListener(this);
+ testReportFileNameValue.addModifyListener(this);
+
+ // Test report format controls
+ testReportFormatLabel = toolkit.createLabel(
+ engineDefaultsSectionClient, "Test report format:");
+ Composite testReportFormatGroup = toolkit
+ .createComposite(engineDefaultsSectionClient);
+ GridLayout testReportFormatGroupLayout = new GridLayout();
+ testReportFormatGroupLayout.marginHeight = 0;
+ testReportFormatGroupLayout.numColumns = 2;
+ testReportFormatGroup.setLayout(testReportFormatGroupLayout);
+ testReportFormatTxtButton = toolkit.createButton(testReportFormatGroup,
+ "Txt", SWT.RADIO);
+ testReportFormatTxtButton.setSelection(true);
+ testReportFormatTxtButton.addSelectionListener(this);
+ testReportFormatHtmlButton = toolkit.createButton(
+ testReportFormatGroup, "Html", SWT.RADIO);
+
+ // Test report output controls
+ testReportOutputLabel = toolkit.createLabel(
+ engineDefaultsSectionClient, "Test report output:");
+ Composite testReportOutputGroup = toolkit
+ .createComposite(engineDefaultsSectionClient);
+ GridLayout testReportOutputGroupLayout = new GridLayout();
+ testReportOutputGroupLayout.marginHeight = 0;
+ testReportOutputGroupLayout.numColumns = 2;
+ testReportOutputGroup.setLayout(testReportOutputGroupLayout);
+ testReportOutputFileButton = toolkit.createButton(
+ testReportOutputGroup, "File", SWT.RADIO);
+ testReportOutputFileButton.setSelection(true);
+ testReportOutputFileButton.addSelectionListener(this);
+ testReportOutputRDebugButton = toolkit.createButton(
+ testReportOutputGroup, "RDebug", SWT.RADIO);
+
+ // Test report file creation mode controls
+ testReportFileCreationModeLabel = toolkit.createLabel(
+ engineDefaultsSectionClient, "Test report file creation mode:");
+ Composite testReportFileCreationModeGroup = toolkit
+ .createComposite(engineDefaultsSectionClient);
+ GridLayout testReportFileCreationModeGroupLayout = new GridLayout();
+ testReportFileCreationModeGroupLayout.marginHeight = 0;
+ testReportFileCreationModeGroupLayout.numColumns = 2;
+ testReportFileCreationModeGroup
+ .setLayout(testReportFileCreationModeGroupLayout);
+ testReportFileCreationModeOverwriteButton = toolkit.createButton(
+ testReportFileCreationModeGroup, "Overwrite", SWT.RADIO);
+ testReportFileCreationModeOverwriteButton.setSelection(true);
+ testReportFileCreationModeOverwriteButton.addSelectionListener(this);
+ testReportFileCreationModeAppendButton = toolkit.createButton(
+ testReportFileCreationModeGroup, "Append", SWT.RADIO);
+
+ // Device reset dll name controls
+ deviceResetDllNameLabel = toolkit.createLabel(
+ engineDefaultsSectionClient, "Device reset dll name:");
+ deviceResetDllNameValue = toolkit.createText(
+ engineDefaultsSectionClient, "StifResetForNokia.dll");
+ deviceResetDllNameValue.setLayoutData(new TableWrapData(
+ TableWrapData.FILL_GRAB));
+ deviceResetDllNameValue.addSelectionListener(this);
+ deviceResetDllNameValue.addModifyListener(this);
+
+ // Disable measurement controls
+ disableMeasurementLabel = toolkit.createLabel(
+ engineDefaultsSectionClient, "Disable measurement:");
+ disableMeasurementValue = new List(engineDefaultsSectionClient,
+ SWT.READ_ONLY);
+ toolkit.adapt(disableMeasurementValue, true, true);
+ disableMeasurementValue.setLayoutData(new TableWrapData(
+ TableWrapData.FILL_GRAB));
+ disableMeasurementValue.setData(FormToolkit.KEY_DRAW_BORDER,
+ FormToolkit.TREE_BORDER);
+ disableMeasurementValue.addSelectionListener(this);
+
+ // Timeout= 0
+ timeoutLabel = toolkit.createLabel(engineDefaultsSectionClient,
+ "Timeout:");
+ timeoutValue = new Spinner(engineDefaultsSectionClient, SWT.NONE);
+ toolkit.adapt(timeoutValue, true, true);
+ timeoutValue.setMaximum(Integer.MAX_VALUE);
+ timeoutValue.setData(FormToolkit.KEY_DRAW_BORDER,
+ FormToolkit.TEXT_BORDER);
+ timeoutValue.addSelectionListener(this);
+ timeoutValue.addModifyListener(this);
+ timeoutValue.addListener(SWT.Verify, new Listener() {
+ public void handleEvent(Event event) {
+ if(event.type==SWT.Verify){
+ int start = event.start;
+ int end = event.end;
+ String timeoutStringValue;
+ timeoutStringValue = timeoutValue.getText();
+ StringBuffer buffer = new StringBuffer(timeoutStringValue.trim());
+ timeoutStringValue = buffer.replace(start, end, event.text).toString();
+
+ if(timeoutStringValue.trim().length()==0){
+ return;
+ }
+
+ try{
+ Integer.parseInt(timeoutStringValue.trim());
+ }
+ catch(Exception e){
+ MessageBox box = new MessageBox(new Shell(), SWT.ICON_ERROR);
+ box.setText("Incorrect value!");
+ box.setMessage("Input value is outof range(2147483647).");
+ box.open();
+ }
+ }
+ }
+ });
+
+ // UITestingSupport
+ uiTestingSupportLabel = toolkit.createLabel(
+ engineDefaultsSectionClient, "UI testing support");
+ Composite uiTestingSupportGroup = toolkit
+ .createComposite(engineDefaultsSectionClient);
+ GridLayout uiTestingSupportGroupLayout = new GridLayout();
+ uiTestingSupportGroupLayout.numColumns = 2;
+ uiTestingSupportGroupLayout.marginHeight = 0;
+ uiTestingSupportGroup.setLayout(uiTestingSupportGroupLayout);
+ uiTestingSupportYesButton = toolkit.createButton(uiTestingSupportGroup,
+ "Yes", SWT.RADIO | SWT.SELECTED);
+ uiTestingSupportYesButton.setSelection(false);
+ uiTestingSupportYesButton.addSelectionListener(this);
+ uiTestingSupportNoButton = toolkit.createButton(uiTestingSupportGroup,
+ "No", SWT.RADIO);
+ uiTestingSupportNoButton.setSelection(true);
+ uiTestingSupportNoButton.addSelectionListener(this);
+
+ // SeparateProcesses
+ separateProcessLabel = toolkit.createLabel(engineDefaultsSectionClient,
+ "Separate processes");
+ Composite separateProcessesGroup = toolkit
+ .createComposite(engineDefaultsSectionClient);
+ GridLayout separateProcessesGroupLayout = new GridLayout();
+ separateProcessesGroupLayout.numColumns = 2;
+ separateProcessesGroupLayout.marginHeight = 0;
+ separateProcessesGroup.setLayout(separateProcessesGroupLayout);
+ separateProcessYesButton = toolkit.createButton(separateProcessesGroup,
+ "Yes", SWT.RADIO | SWT.SELECTED);
+ separateProcessYesButton.setSelection(false);
+ separateProcessYesButton.addSelectionListener(this);
+ separateProcessNoButton = toolkit.createButton(separateProcessesGroup,
+ "No", SWT.RADIO);
+ separateProcessNoButton.setSelection(true);
+ separateProcessNoButton.addSelectionListener(this);
+ }
+
+ /**
+ * Creates logger defaults panel controls
+ *
+ * @param loggerDefaultsSectionClient
+ * logger defaults panel
+ */
+ void createLoggerDefaultsSectionControls(
+ Composite loggerDefaultsSectionClient) {
+ // Create log directories controls
+ createLogDirectoriesLabel = toolkit.createLabel(
+ loggerDefaultsSectionClient, "Create log directories:");
+ Composite createLogDirectoriesGroup = toolkit
+ .createComposite(loggerDefaultsSectionClient);
+ GridLayout createLogDirectoriesGroupLayout = new GridLayout();
+ createLogDirectoriesGroupLayout.marginHeight = 0;
+ createLogDirectoriesGroupLayout.numColumns = 2;
+ createLogDirectoriesGroup.setLayout(createLogDirectoriesGroupLayout);
+ createLogDirectoriesYesButton = toolkit.createButton(
+ createLogDirectoriesGroup, "Yes", SWT.RADIO | SWT.SELECTED);
+ createLogDirectoriesYesButton.setSelection(false);
+ createLogDirectoriesYesButton.addSelectionListener(this);
+ createLogDirectoriesNoButton = toolkit.createButton(
+ createLogDirectoriesGroup, "No", SWT.RADIO);
+ createLogDirectoriesNoButton.setSelection(true);
+ createLogDirectoriesNoButton.addSelectionListener(this);
+
+ // Emulator base path controls
+ emulatorBasePathLabel = toolkit.createLabel(
+ loggerDefaultsSectionClient, "Emulator base path:");
+ emulatorBasePathValue = toolkit.createText(loggerDefaultsSectionClient,
+ "C:\\LOGS\\TestFramework\\");
+ emulatorBasePathValue.setLayoutData(new TableWrapData(
+ TableWrapData.FILL_GRAB));
+ emulatorBasePathValue.addSelectionListener(this);
+ emulatorBasePathValue.addModifyListener(this);
+
+ // Emulator log format controls
+ emulatorLogFormatLabel = toolkit.createLabel(
+ loggerDefaultsSectionClient, "Emulator log format:");
+ Composite emulatorLogFormatGroup = toolkit
+ .createComposite(loggerDefaultsSectionClient);
+ GridLayout emulatorLogFormatGroupLayout = new GridLayout();
+ emulatorLogFormatGroupLayout.marginHeight = 0;
+ emulatorLogFormatGroupLayout.numColumns = 2;
+ emulatorLogFormatGroup.setLayout(emulatorLogFormatGroupLayout);
+ emulatorLogFormatTxtButton = toolkit.createButton(
+ emulatorLogFormatGroup, "Txt", SWT.RADIO);
+ emulatorLogFormatTxtButton.setSelection(true);
+ emulatorLogFormatTxtButton.addSelectionListener(this);
+ emulatorLogFormatHtmlButton = toolkit.createButton(
+ emulatorLogFormatGroup, "Html", SWT.RADIO);
+
+ // Emulator log output controls
+ emulatorLogOutputLabel = toolkit.createLabel(
+ loggerDefaultsSectionClient, "Emulator log output:");
+ Composite emulatorLogOutputGroup = toolkit
+ .createComposite(loggerDefaultsSectionClient);
+ GridLayout emulatorLogOutputGroupLayout = new GridLayout();
+ emulatorLogOutputGroupLayout.marginHeight = 0;
+ emulatorLogOutputGroupLayout.numColumns = 2;
+ emulatorLogOutputGroup.setLayout(emulatorLogOutputGroupLayout);
+ emulatorLogOutputFileButton = toolkit.createButton(
+ emulatorLogOutputGroup, "File", SWT.RADIO);
+ emulatorLogOutputFileButton.setSelection(true);
+ emulatorLogOutputFileButton.addSelectionListener(this);
+ emulatorLogOutputRDebugButton = toolkit.createButton(
+ emulatorLogOutputGroup, "RDebug", SWT.RADIO);
+
+ // Hardware base path controls
+ hardwareBasePathLabel = toolkit.createLabel(
+ loggerDefaultsSectionClient, "Hardware base path:");
+ hardwareBasePathValue = toolkit.createText(loggerDefaultsSectionClient,
+ "C:\\LOGS\\TestFramework\\");
+ hardwareBasePathValue.setLayoutData(new TableWrapData(
+ TableWrapData.FILL_GRAB));
+ hardwareBasePathValue.addSelectionListener(this);
+ hardwareBasePathValue.addModifyListener(this);
+
+ // Hardware log format controls
+ hardwareLogFormatLabel = toolkit.createLabel(
+ loggerDefaultsSectionClient, "Hardware log format:");
+ Composite hardwareLogFormatGroup = toolkit
+ .createComposite(loggerDefaultsSectionClient);
+ GridLayout hardwareLogFormatGroupLayout = new GridLayout();
+ hardwareLogFormatGroupLayout.marginHeight = 0;
+ hardwareLogFormatGroupLayout.numColumns = 2;
+ hardwareLogFormatGroup.setLayout(hardwareLogFormatGroupLayout);
+ hardwareLogFormatTxtButton = toolkit.createButton(
+ hardwareLogFormatGroup, "Txt", SWT.RADIO);
+ hardwareLogFormatTxtButton.setSelection(true);
+ hardwareLogFormatTxtButton.addSelectionListener(this);
+ hardwareLogFormatHtmlButton = toolkit.createButton(
+ hardwareLogFormatGroup, "Html", SWT.RADIO);
+
+ // Hardware log output controls
+ hardwareLogOutputLabel = toolkit.createLabel(
+ loggerDefaultsSectionClient, "Hardware log output:");
+ Composite hardwareLogOutputGroup = toolkit
+ .createComposite(loggerDefaultsSectionClient);
+ GridLayout hardwareLogOutputGroupLayout = new GridLayout();
+ hardwareLogOutputGroupLayout.marginHeight = 0;
+ hardwareLogOutputGroupLayout.numColumns = 2;
+ hardwareLogOutputGroup.setLayout(hardwareLogOutputGroupLayout);
+ hardwareLogOutputFileButton = toolkit.createButton(
+ hardwareLogOutputGroup, "File", SWT.RADIO);
+ hardwareLogOutputFileButton.setSelection(true);
+ hardwareLogOutputFileButton.addSelectionListener(this);
+ hardwareLogOutputRDebugButton = toolkit.createButton(
+ hardwareLogOutputGroup, "RDebug", SWT.RADIO);
+
+ // Log creation mode controls
+ logFileCreationModeLabel = toolkit.createLabel(
+ loggerDefaultsSectionClient, "Log creation mode:");
+ Composite logFileCreationModeGroup = toolkit
+ .createComposite(loggerDefaultsSectionClient);
+ GridLayout logFileCreationModeGroupLayout = new GridLayout();
+ logFileCreationModeGroupLayout.marginHeight = 0;
+ logFileCreationModeGroupLayout.numColumns = 2;
+ logFileCreationModeGroup.setLayout(logFileCreationModeGroupLayout);
+ logFileCreationModeOverwriteButton = toolkit.createButton(
+ logFileCreationModeGroup, "Overwrite", SWT.RADIO);
+ logFileCreationModeOverwriteButton.setSelection(true);
+ logFileCreationModeOverwriteButton.addSelectionListener(this);
+ logFileCreationModeAppendButton = toolkit.createButton(
+ logFileCreationModeGroup, "Append", SWT.RADIO);
+
+ // Thread id to log file controls
+ threadIdToLogFileLabel = toolkit.createLabel(
+ loggerDefaultsSectionClient, "Put thread id to log file:");
+ Composite threadIdToLogFileGroup = toolkit
+ .createComposite(loggerDefaultsSectionClient);
+ GridLayout threadIdToLogFileGroupLayout = new GridLayout();
+ threadIdToLogFileGroupLayout.marginHeight = 0;
+ threadIdToLogFileGroupLayout.numColumns = 2;
+ threadIdToLogFileGroup.setLayout(threadIdToLogFileGroupLayout);
+ threadIdToLogFileYesButton = toolkit.createButton(
+ threadIdToLogFileGroup, "Yes", SWT.RADIO | SWT.SELECTED);
+ threadIdToLogFileYesButton.setSelection(false);
+ threadIdToLogFileYesButton.addSelectionListener(this);
+ threadIdToLogFileNoButton = toolkit.createButton(
+ threadIdToLogFileGroup, "No", SWT.RADIO);
+ threadIdToLogFileNoButton.setSelection(true);
+
+ // WithTimeStamp
+ withTimeStampLabel = toolkit.createLabel(loggerDefaultsSectionClient,
+ "With time stamp:");
+ Composite withTimeStampGroup = toolkit
+ .createComposite(loggerDefaultsSectionClient);
+ GridLayout withTimeStampGroupLayout = new GridLayout();
+ withTimeStampGroupLayout.marginHeight = 0;
+ withTimeStampGroupLayout.numColumns = 2;
+ withTimeStampGroup.setLayout(withTimeStampGroupLayout);
+ withTimeStampYesButton = toolkit.createButton(withTimeStampGroup,
+ "Yes", SWT.RADIO | SWT.SELECTED);
+ withTimeStampYesButton.setSelection(true);
+ withTimeStampYesButton.addSelectionListener(this);
+ withTimeStampNoButton = toolkit.createButton(withTimeStampGroup, "No",
+ SWT.RADIO);
+
+ // With line break
+ withLineBreakLabel = toolkit.createLabel(loggerDefaultsSectionClient,
+ "With line break:");
+ Composite withLineBreakGroup = toolkit
+ .createComposite(loggerDefaultsSectionClient);
+ GridLayout withLineBreakGroupLayout = new GridLayout();
+ withLineBreakGroupLayout.marginHeight = 0;
+ withLineBreakGroupLayout.numColumns = 2;
+ withLineBreakGroup.setLayout(withLineBreakGroupLayout);
+ withLineBreakYesButton = toolkit.createButton(withLineBreakGroup,
+ "Yes", SWT.RADIO | SWT.SELECTED);
+ withLineBreakYesButton.setSelection(true);
+ withLineBreakYesButton.addSelectionListener(this);
+ withLineBreakNoButton = toolkit.createButton(withLineBreakGroup, "No",
+ SWT.RADIO);
+
+ // With event ranking
+ withEventRankingLabel = toolkit.createLabel(
+ loggerDefaultsSectionClient, "With event ranking:");
+ Composite withEventRankingGroup = toolkit
+ .createComposite(loggerDefaultsSectionClient);
+ GridLayout withEventRankingGroupLayout = new GridLayout();
+ withEventRankingGroupLayout.marginHeight = 0;
+ withEventRankingGroupLayout.numColumns = 2;
+ withEventRankingGroup.setLayout(withEventRankingGroupLayout);
+ withEventRankingYesButton = toolkit.createButton(withEventRankingGroup,
+ "Yes", SWT.RADIO | SWT.SELECTED);
+ withEventRankingYesButton.setSelection(false);
+ withEventRankingYesButton.addSelectionListener(this);
+ withEventRankingNoButton = toolkit.createButton(withEventRankingGroup,
+ "No", SWT.RADIO);
+ withEventRankingNoButton.setSelection(true);
+
+ // File Unicode
+ fileUnicodeLabel = toolkit.createLabel(loggerDefaultsSectionClient,
+ "File unicode:");
+ Composite fileUnicodeGroup = toolkit
+ .createComposite(loggerDefaultsSectionClient);
+ GridLayout fileUnicodeGroupLayout = new GridLayout();
+ fileUnicodeGroupLayout.marginHeight = 0;
+ fileUnicodeGroupLayout.numColumns = 2;
+ fileUnicodeGroup.setLayout(fileUnicodeGroupLayout);
+ fileUnicodeYesButton = toolkit.createButton(fileUnicodeGroup, "Yes",
+ SWT.RADIO | SWT.SELECTED);
+ fileUnicodeYesButton.addSelectionListener(this);
+ fileUnicodeNoButton = toolkit.createButton(fileUnicodeGroup, "No",
+ SWT.RADIO);
+ fileUnicodeNoButton.setSelection(true);
+
+ addTestcaseTitleLabel = toolkit.createLabel(
+ loggerDefaultsSectionClient, "Add testcase title:");
+ Composite addTestcaseTitleGroup = toolkit
+ .createComposite(loggerDefaultsSectionClient);
+ GridLayout addTestcaseTitleGroupLayout = new GridLayout();
+ addTestcaseTitleGroupLayout.marginHeight = 0;
+ addTestcaseTitleGroupLayout.numColumns = 2;
+ addTestcaseTitleGroup.setLayout(addTestcaseTitleGroupLayout);
+ addTestCaseTitleYesButton = toolkit.createButton(addTestcaseTitleGroup,
+ "Yes", SWT.RADIO);
+ addTestCaseTitleYesButton.addSelectionListener(this);
+ addTestCaseTitleNoButton = toolkit.createButton(addTestcaseTitleGroup,
+ "No", SWT.RADIO | SWT.SELECTED);
+ addTestCaseTitleNoButton.setSelection(true);
+ addTestCaseTitleNoButton.setSelection(true);
+ }
+
+ /**
+ * Creates modules page
+ */
+ void createModulesPage() {
+ modulesMainForm = toolkit.createScrolledForm(getContainer());
+ modulesMainForm.setText("STF modules settings");
+
+ ColumnLayout modulesMainFormLayout = new ColumnLayout();
+ modulesMainFormLayout.maxNumColumns = 1;
+
+ Section modulesSection = toolkit.createSection(modulesMainForm
+ .getBody(), Section.TITLE_BAR);
+ modulesSection.setText("Modules");
+
+ Composite modulesSectionClient = toolkit
+ .createComposite(modulesSection);
+
+ TableWrapLayout modulesSectionLayout = new TableWrapLayout();
+ modulesSectionLayout.numColumns = 2;
+ modulesSectionClient.setLayout(modulesSectionLayout);
+ modulesSectionClient.setLayoutData(new TableWrapData(
+ TableWrapData.FILL_GRAB));
+
+ modulesSection.setClient(modulesSectionClient);
+
+ modulesTreeViewer = new TreeViewer(modulesSectionClient, SWT.SINGLE);
+ toolkit.adapt(modulesTreeViewer.getTree(), true, true);
+ TableWrapData modulesTreeViewerLayoutData = new TableWrapData(
+ TableWrapData.FILL_GRAB);
+ modulesTreeViewerLayoutData.valign = TableWrapData.FILL;
+ modulesTreeViewer.getTree().setLayoutData(modulesTreeViewerLayoutData);
+ modulesTreeViewer.addSelectionChangedListener(this);
+
+ Composite buttonsGroup = toolkit.createComposite(modulesSectionClient);
+ TableWrapData buttonsGroupLayoutData = new TableWrapData();
+ buttonsGroupLayoutData.heightHint = SWT.MAX;
+ buttonsGroupLayoutData.valign = TableWrapData.FILL;
+ buttonsGroup.setLayoutData(buttonsGroupLayoutData);
+ TableWrapLayout buttonsGroupLayout = new TableWrapLayout();
+ buttonsGroupLayout.numColumns = 1;
+ buttonsGroupLayout.topMargin = 0;
+ buttonsGroup.setLayout(buttonsGroupLayout);
+
+ addModuleButton = toolkit.createButton(buttonsGroup, "Add module",
+ SWT.PUSH);
+ addModuleButton
+ .setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
+ addModuleButton.addSelectionListener(this);
+
+ addTestCaseFileButton = toolkit.createButton(buttonsGroup,
+ "Add test case file", SWT.PUSH);
+ addTestCaseFileButton.setLayoutData(new TableWrapData(
+ TableWrapData.FILL_GRAB));
+ addTestCaseFileButton.addSelectionListener(this);
+
+ addIniFileButton = toolkit.createButton(buttonsGroup, "Add ini file",
+ SWT.PUSH);
+ addIniFileButton.setLayoutData(new TableWrapData(
+ TableWrapData.FILL_GRAB));
+ addIniFileButton.addSelectionListener(this);
+
+ editButton = toolkit.createButton(buttonsGroup, "Edit", SWT.PUSH);
+ editButton.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
+ editButton.addSelectionListener(this);
+
+ removeButton = toolkit.createButton(buttonsGroup, "Remove", SWT.PUSH);
+ removeButton.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
+ removeButton.addSelectionListener(this);
+
+ // Final initializations
+ modulesMainForm.getBody().setLayout(modulesMainFormLayout);
+ modulesSectionClient.setData(FormToolkit.KEY_DRAW_BORDER,
+ FormToolkit.TEXT_BORDER);
+ toolkit.paintBordersFor(modulesSectionClient);
+
+ modulesPageIndex = addPage(modulesMainForm);
+ setPageText(modulesPageIndex, "Modules");
+
+ modulesTreeRoot = new ModulesTreeNode();
+ modulesTreeViewer.setContentProvider(new ModulesTreeContentProvider());
+ modulesTreeViewer.setLabelProvider(new ModulesTreeLabelProvider());
+ modulesTreeViewer.setInput(modulesTreeRoot);
+ }
+
+ /**
+ * Creates config source page
+ */
+ void createSourcePage() {
+ try {
+ sourceEditor = new ConfigSourceEditor();
+ sourcePageIndex = addPage(sourceEditor, getEditorInput());
+ setPageText(sourcePageIndex, "Source");
+
+ } catch (PartInitException e) {
+ ErrorDialog.openError(getSite().getShell(),
+ "Error creating STF source config editor", null, e
+ .getStatus());
+ }
+ }
+
+ /**
+ * Creates the pages of the STIF config editor
+ */
+ protected void createPages() {
+ // Create config editor pages
+ toolkit = new FormToolkit(getContainer().getDisplay());
+ createModulesPage();
+ createGlobalSettingsPage();
+ createSourcePage();
+ // Parse config and update config editor pages
+ loadConfig();
+ }
+
+ /**
+ * Loads config, updates controls value and problem markers
+ */
+ private void loadConfig() {
+ // Get text from source editor
+ String config = sourceEditor.getDocumentProvider().getDocument(
+ sourceEditor.getEditorInput()).get();
+ // Parse config
+ configManager = new ConfigManager();
+ configManager.parseConfig(config);
+
+ // Update problem markers
+ updateProblemMarkers();
+
+ // update values in controls
+ updateControlsValue();
+ }
+
+ /**
+ * Updates engine defaults panel contols value
+ */
+ private void updateEngineDefaultsControlsValue() {
+ Color red = toolkit.getColors().createColor("red", new RGB(255, 0, 0));
+ Color black = toolkit.getColors()
+ .createColor("black", new RGB(0, 0, 0));
+ Color gray = toolkit.getColors().createColor("gray",
+ new RGB(170, 170, 170));
+
+ testReportModeLabel.setForeground(black);
+ createTestReportLabel.setForeground(black);
+ testReportFilePathLabel.setForeground(black);
+ testReportFileNameLabel.setForeground(black);
+ testReportFormatLabel.setForeground(black);
+ testReportOutputLabel.setForeground(black);
+ testReportFileCreationModeLabel.setForeground(black);
+ deviceResetDllNameLabel.setForeground(black);
+ disableMeasurementLabel.setForeground(black);
+ timeoutLabel.setForeground(black);
+ uiTestingSupportLabel.setForeground(black);
+ separateProcessLabel.setForeground(black);
+
+ TestReportMode testReportMode = configManager.getTestReportMode();
+ if (testReportMode == TestReportMode.NOT_DEFINED
+ || testReportMode == TestReportMode.UNKNOWN) {
+ if (testReportMode == TestReportMode.NOT_DEFINED) {
+ testReportModeLabel.setForeground(gray);
+ }
+ if (testReportMode == TestReportMode.UNKNOWN) {
+ testReportModeLabel.setForeground(red);
+ }
+ testReportMode = ConfigDefaults.getTestReportModeDefaultValue();
+ }
+
+ String[] testReportModeNames = ConfigUtil.getTestReportModeNames();
+ String testReportModeName = ConfigUtil
+ .getTestReportModeName(testReportMode);
+ int selection = -1;
+ testReportModeValue.removeAll();
+ for (int i = 0; i < testReportModeNames.length; i++) {
+ testReportModeValue.add(testReportModeNames[i]);
+ if (testReportModeNames[i].equals(testReportModeName)) {
+ selection = i;
+ }
+ }
+ if (selection != -1) {
+ testReportModeValue.select(selection);
+ }
+
+ // CreateTestReport
+ YesNo createTestReport = configManager.getCreateTestReport();
+ if ((createTestReport == YesNo.NOT_DEFINED)
+ || (createTestReport == YesNo.UNKNOWN)) {
+ if (createTestReport == YesNo.NOT_DEFINED) {
+ createTestReportLabel.setForeground(gray);
+ }
+ if (createTestReport == YesNo.UNKNOWN) {
+ createTestReportLabel.setForeground(red);
+ }
+ createTestReport = ConfigDefaults.getCreateTestReportDefaultValue();
+ }
+ if (createTestReport == YesNo.YES) {
+ createTestReportYesButton.setSelection(true);
+ createTestReportNoButton.setSelection(false);
+ } else if (createTestReport == YesNo.NO) {
+ createTestReportYesButton.setSelection(false);
+ createTestReportNoButton.setSelection(true);
+ }
+
+ // TestReportFilePath
+ String testReportFilePath = configManager.getTestReportFilePath();
+ if (testReportFilePath == null) {
+ testReportFilePath = ConfigDefaults
+ .getTestReportFilePathDefaultValue();
+ testReportFilePathLabel.setForeground(gray);
+ }
+ testReportFilePathValue.removeModifyListener(this);
+ testReportFilePathValue.setText(testReportFilePath);
+ testReportFilePathValue.addModifyListener(this);
+
+ // TestReportFileName
+ String testReportFileName = configManager.getTestReportFileName();
+ if (testReportFileName == null) {
+ testReportFileName = ConfigDefaults
+ .getTestReportFileNameDefaultValue();
+ testReportFileNameLabel.setForeground(gray);
+ }
+ testReportFileNameValue.removeModifyListener(this);
+ testReportFileNameValue.setText(testReportFileName);
+ testReportFileNameValue.addModifyListener(this);
+
+ // TestReportFormat
+ OutputFileFormat testReportFormat = configManager.getTestReportFormat();
+ if ((testReportFormat == OutputFileFormat.NOT_DEFINED)
+ || (testReportFormat == OutputFileFormat.UNKNOWN)) {
+ if (testReportFormat == OutputFileFormat.NOT_DEFINED) {
+ testReportFormatLabel.setForeground(gray);
+ }
+ if (testReportFormat == OutputFileFormat.UNKNOWN) {
+ testReportFormatLabel.setForeground(red);
+ }
+ testReportFormat = ConfigDefaults.getTestReportFormatDefaultValue();
+ }
+ if (testReportFormat == OutputFileFormat.TXT) {
+ testReportFormatTxtButton.setSelection(true);
+ testReportFormatHtmlButton.setSelection(false);
+ } else if (testReportFormat == OutputFileFormat.HTML) {
+ testReportFormatTxtButton.setSelection(false);
+ testReportFormatHtmlButton.setSelection(true);
+ }
+
+ // TestReportOutput
+ OutputType testReportOutput = configManager.getTestReportOutput();
+ if ((testReportOutput == OutputType.NOT_DEFINED)
+ || (testReportOutput == OutputType.UNKNOWN)) {
+ if (testReportOutput == OutputType.NOT_DEFINED) {
+ testReportOutputLabel.setForeground(gray);
+ }
+ if (testReportOutput == OutputType.UNKNOWN) {
+ testReportOutputLabel.setForeground(red);
+ }
+ testReportOutput = ConfigDefaults.getTestReportOutputDefaultValue();
+ }
+ if (testReportOutput == OutputType.FILE) {
+ testReportOutputFileButton.setSelection(true);
+ testReportOutputRDebugButton.setSelection(false);
+ } else if (testReportOutput == OutputType.RDEBUG) {
+ testReportOutputFileButton.setSelection(false);
+ testReportOutputRDebugButton.setSelection(true);
+ }
+
+ // TestReportFileCreationMode
+ FileCreationMode testReportFileCreationMode = configManager
+ .getTestReportFileCreationMode();
+ if ((testReportFileCreationMode == FileCreationMode.NOT_DEFINED)
+ || (testReportFileCreationMode == FileCreationMode.UNKNOWN)) {
+ if (testReportFileCreationMode == FileCreationMode.NOT_DEFINED) {
+ testReportFileCreationModeLabel.setForeground(gray);
+ }
+ if (testReportFileCreationMode == FileCreationMode.UNKNOWN) {
+ testReportFileCreationModeLabel.setForeground(red);
+ }
+ testReportFileCreationMode = ConfigDefaults
+ .getTestReportFileCreationModeDefaultValue();
+ }
+ if (testReportFileCreationMode == FileCreationMode.APPEND) {
+ testReportFileCreationModeOverwriteButton.setSelection(false);
+ testReportFileCreationModeAppendButton.setSelection(true);
+ } else if (testReportFileCreationMode == FileCreationMode.OVERWRITE) {
+ testReportFileCreationModeOverwriteButton.setSelection(true);
+ testReportFileCreationModeAppendButton.setSelection(false);
+ }
+
+ // DeviceResetDllName
+ String deviceResetDllName = configManager.getDeviceResetDllName();
+ if (deviceResetDllName == null) {
+ deviceResetDllName = ConfigDefaults
+ .getDeviceResetDllNameDefaultValue();
+ deviceResetDllNameLabel.setForeground(gray);
+ }
+ deviceResetDllNameValue.removeModifyListener(this);
+ deviceResetDllNameValue.setText(deviceResetDllName);
+ deviceResetDllNameValue.addModifyListener(this);
+
+ // DisableMeasurement
+ MeasurementModule disableMeasurement = configManager
+ .getDisableMeasurement();
+ if ((disableMeasurement == MeasurementModule.NOT_DEFINED)
+ || (disableMeasurement == MeasurementModule.UNKNOWN)) {
+ if (disableMeasurement == MeasurementModule.NOT_DEFINED) {
+ disableMeasurementLabel.setForeground(gray);
+ }
+ if (disableMeasurement == MeasurementModule.UNKNOWN) {
+ disableMeasurementLabel.setForeground(red);
+ }
+ disableMeasurement = ConfigDefaults
+ .getDisableMeasurementDefaultValue();
+ }
+ String[] measurementModuleNames = ConfigUtil
+ .getMeasurementModuleNames();
+ String measurementModuleName = ConfigUtil
+ .getMeasurementModuleName(disableMeasurement);
+ selection = -1;
+ disableMeasurementValue.removeAll();
+ for (int i = 0; i < measurementModuleNames.length; i++) {
+ disableMeasurementValue.add(measurementModuleNames[i]);
+ if (measurementModuleNames[i].equals(measurementModuleName)) {
+ selection = i;
+ }
+ }
+ if (selection != -1) {
+ disableMeasurementValue.select(selection);
+ }
+
+ // Timeout
+ Integer timeout = configManager.getTimeout();
+ if (timeout == null) {
+ timeout = ConfigDefaults.getTimeoutDefaultValue();
+ }
+ timeoutValue.setSelection(timeout);
+
+ // UITestingSupport
+ YesNo uiTestingSupport = configManager.getUITestingSupport();
+ if ((uiTestingSupport == YesNo.NOT_DEFINED)
+ || (uiTestingSupport == YesNo.UNKNOWN)) {
+ if (uiTestingSupport == YesNo.NOT_DEFINED) {
+ uiTestingSupportLabel.setForeground(gray);
+ }
+ if (uiTestingSupport == YesNo.UNKNOWN) {
+ uiTestingSupportLabel.setForeground(red);
+ }
+ uiTestingSupport = ConfigDefaults.getUITestingSupportDefaultValue();
+ }
+ if (uiTestingSupport == YesNo.YES) {
+ uiTestingSupportYesButton.setSelection(true);
+ uiTestingSupportNoButton.setSelection(false);
+ } else if (uiTestingSupport == YesNo.NO) {
+ uiTestingSupportYesButton.setSelection(false);
+ uiTestingSupportNoButton.setSelection(true);
+ }
+
+ // SeparateProcesses
+ YesNo separateProcesses = configManager.getSeparateProcesses();
+ if ((separateProcesses == YesNo.NOT_DEFINED)
+ || (separateProcesses == YesNo.UNKNOWN)) {
+ if (separateProcesses == YesNo.NOT_DEFINED) {
+ separateProcessLabel.setForeground(gray);
+ }
+ if (separateProcesses == YesNo.UNKNOWN) {
+ separateProcessLabel.setForeground(red);
+ }
+ separateProcesses = ConfigDefaults
+ .getSeparateProcessesDefaultValue();
+ }
+ if (separateProcesses == YesNo.YES) {
+ separateProcessYesButton.setSelection(true);
+ separateProcessNoButton.setSelection(false);
+ } else if (separateProcesses == YesNo.NO) {
+ separateProcessYesButton.setSelection(false);
+ separateProcessNoButton.setSelection(true);
+ }
+ }
+
+ /**
+ * Updates logger defaults panel controls value
+ */
+ private void updateLoggerDefaultsControlsValue() {
+ Color red = toolkit.getColors().createColor("red", new RGB(255, 0, 0));
+ Color black = toolkit.getColors()
+ .createColor("black", new RGB(0, 0, 0));
+ Color gray = toolkit.getColors().createColor("gray",
+ new RGB(170, 170, 170));
+
+ createLogDirectoriesLabel.setForeground(black);
+ emulatorBasePathLabel.setForeground(black);
+ emulatorLogFormatLabel.setForeground(black);
+ emulatorLogOutputLabel.setForeground(black);
+ hardwareBasePathLabel.setForeground(black);
+ hardwareLogFormatLabel.setForeground(black);
+ hardwareLogOutputLabel.setForeground(black);
+ logFileCreationModeLabel.setForeground(black);
+ threadIdToLogFileLabel.setForeground(black);
+ withTimeStampLabel.setForeground(black);
+ withLineBreakLabel.setForeground(black);
+ fileUnicodeLabel.setForeground(black);
+ addTestcaseTitleLabel.setForeground(black);
+ withEventRankingLabel.setForeground(black);
+
+ // CreateLogDirectories
+ YesNo createLogDirectories = configManager.getCreateLogDirectories();
+ if ((createLogDirectories == YesNo.NOT_DEFINED)
+ || (createLogDirectories == YesNo.UNKNOWN)) {
+ if (createLogDirectories == YesNo.NOT_DEFINED) {
+ createLogDirectoriesLabel.setForeground(gray);
+ }
+ if (createLogDirectories == YesNo.UNKNOWN) {
+ createLogDirectoriesLabel.setForeground(red);
+ }
+ createLogDirectories = ConfigDefaults
+ .getCreateLogDirectoriesDefaultValue();
+ }
+ if (createLogDirectories == YesNo.YES) {
+ createLogDirectoriesYesButton.setSelection(true);
+ createLogDirectoriesNoButton.setSelection(false);
+ } else if (createLogDirectories == YesNo.NO) {
+ createLogDirectoriesYesButton.setSelection(false);
+ createLogDirectoriesNoButton.setSelection(true);
+ }
+
+ // EmulatorBasePath
+ String emulatorLogBasePath = configManager.getEmulatorBasePath();
+ if (emulatorLogBasePath == null) {
+ emulatorLogBasePath = ConfigDefaults
+ .getEmulatorBasePathDefaultValue();
+ emulatorBasePathLabel.setForeground(gray);
+ }
+ emulatorBasePathValue.removeModifyListener(this);
+ emulatorBasePathValue.setText(emulatorLogBasePath);
+ emulatorBasePathValue.addModifyListener(this);
+
+ // EmulatorFormat
+ OutputFileFormat emulatorFormat = configManager.getEmulatorLogFormat();
+ if ((emulatorFormat == OutputFileFormat.NOT_DEFINED)
+ || (emulatorFormat == OutputFileFormat.UNKNOWN)) {
+ if (emulatorFormat == OutputFileFormat.NOT_DEFINED) {
+ emulatorLogFormatLabel.setForeground(gray);
+ }
+ if (emulatorFormat == OutputFileFormat.UNKNOWN) {
+ emulatorLogFormatLabel.setForeground(red);
+ }
+ emulatorFormat = ConfigDefaults.getEmulatorLogFormatDefaultValue();
+ }
+ if (emulatorFormat == OutputFileFormat.TXT) {
+ emulatorLogFormatTxtButton.setSelection(true);
+ emulatorLogFormatHtmlButton.setSelection(false);
+ } else if (emulatorFormat == OutputFileFormat.HTML) {
+ emulatorLogFormatTxtButton.setSelection(false);
+ emulatorLogFormatHtmlButton.setSelection(true);
+ }
+
+ // EmulatorOutput emulatorOutput
+ OutputType emulatorOutput = configManager.getEmulatorLogOutput();
+ if ((emulatorOutput == OutputType.NOT_DEFINED)
+ || (emulatorOutput == OutputType.UNKNOWN)) {
+ if (emulatorOutput == OutputType.NOT_DEFINED) {
+ emulatorLogOutputLabel.setForeground(gray);
+ }
+ if (emulatorOutput == OutputType.UNKNOWN) {
+ emulatorLogOutputLabel.setForeground(red);
+ }
+ emulatorOutput = ConfigDefaults.getEmulatorLogOutputDefaultValue();
+ }
+ if (emulatorOutput == OutputType.FILE) {
+ emulatorLogOutputFileButton.setSelection(true);
+ emulatorLogOutputRDebugButton.setSelection(false);
+ } else if (emulatorOutput == OutputType.RDEBUG) {
+ emulatorLogOutputFileButton.setSelection(false);
+ emulatorLogOutputRDebugButton.setSelection(true);
+ }
+
+ // HardwareBasePath
+ String hardwareLogBasePath = configManager.getHardwareBasePath();
+ if (hardwareLogBasePath == null) {
+ hardwareLogBasePath = ConfigDefaults
+ .getHardwareBasePathDefaultValue();
+ hardwareBasePathLabel.setForeground(gray);
+ }
+ hardwareBasePathValue.removeModifyListener(this);
+ hardwareBasePathValue.setText(hardwareLogBasePath);
+ hardwareBasePathValue.addModifyListener(this);
+
+ // HardwareFormat
+ OutputFileFormat hardwareFormat = configManager.getHardwareLogFormat();
+ if ((hardwareFormat == OutputFileFormat.NOT_DEFINED)
+ || (hardwareFormat == OutputFileFormat.UNKNOWN)) {
+ if (hardwareFormat == OutputFileFormat.NOT_DEFINED) {
+ hardwareLogFormatLabel.setForeground(gray);
+ }
+ if (hardwareFormat == OutputFileFormat.UNKNOWN) {
+ hardwareLogFormatLabel.setForeground(red);
+ }
+ hardwareFormat = ConfigDefaults.getHardwareLogFormatDefaultValue();
+ }
+ if (hardwareFormat == OutputFileFormat.TXT) {
+ hardwareLogFormatTxtButton.setSelection(true);
+ hardwareLogFormatHtmlButton.setSelection(false);
+ } else if (emulatorFormat == OutputFileFormat.HTML) {
+ hardwareLogFormatTxtButton.setSelection(false);
+ hardwareLogFormatHtmlButton.setSelection(true);
+ }
+
+ // EmulatorOutput emulatorOutput
+ OutputType hardwareOutput = configManager.getHardwareLogOutput();
+ if ((hardwareOutput == OutputType.NOT_DEFINED)
+ || (hardwareOutput == OutputType.UNKNOWN)) {
+ if (hardwareOutput == OutputType.NOT_DEFINED) {
+ hardwareLogOutputLabel.setForeground(gray);
+ }
+ if (hardwareOutput == OutputType.UNKNOWN) {
+ hardwareLogOutputLabel.setForeground(red);
+ }
+ hardwareOutput = ConfigDefaults.getHardwareLogOutputDefaultValue();
+ }
+ if (hardwareOutput == OutputType.FILE) {
+ hardwareLogOutputFileButton.setSelection(true);
+ hardwareLogOutputRDebugButton.setSelection(false);
+ } else if (emulatorOutput == OutputType.RDEBUG) {
+ hardwareLogOutputFileButton.setSelection(false);
+ hardwareLogOutputRDebugButton.setSelection(true);
+ }
+
+ // FileCreationMode
+ FileCreationMode logFileCreationMode = configManager
+ .getLogFileCreationMode();
+ if ((logFileCreationMode == FileCreationMode.NOT_DEFINED)
+ || (logFileCreationMode == FileCreationMode.UNKNOWN)) {
+ if (logFileCreationMode == FileCreationMode.NOT_DEFINED) {
+ logFileCreationModeLabel.setForeground(gray);
+ }
+ if (logFileCreationMode == FileCreationMode.UNKNOWN) {
+ logFileCreationModeLabel.setForeground(red);
+ }
+ logFileCreationMode = ConfigDefaults
+ .getLogFileCreationModeDefaultValue();
+ }
+ if (logFileCreationMode == FileCreationMode.APPEND) {
+ logFileCreationModeOverwriteButton.setSelection(false);
+ logFileCreationModeAppendButton.setSelection(true);
+ } else if (logFileCreationMode == FileCreationMode.OVERWRITE) {
+ logFileCreationModeOverwriteButton.setSelection(true);
+ logFileCreationModeAppendButton.setSelection(false);
+ }
+
+ // ThreadIdToLogFile
+ YesNo threadIdToLogFile = configManager.getThreadIdToLogFile();
+ if ((threadIdToLogFile == YesNo.NOT_DEFINED)
+ || (threadIdToLogFile == YesNo.UNKNOWN)) {
+ if (threadIdToLogFile == YesNo.NOT_DEFINED) {
+ threadIdToLogFileLabel.setForeground(gray);
+ }
+ if (threadIdToLogFile == YesNo.UNKNOWN) {
+ threadIdToLogFileLabel.setForeground(red);
+ }
+ threadIdToLogFile = ConfigDefaults
+ .getThreadIdToLogFileDefaultValue();
+ }
+ if (threadIdToLogFile == YesNo.YES) {
+ threadIdToLogFileYesButton.setSelection(true);
+ threadIdToLogFileNoButton.setSelection(false);
+ } else if (threadIdToLogFile == YesNo.NO) {
+ threadIdToLogFileYesButton.setSelection(false);
+ threadIdToLogFileNoButton.setSelection(true);
+ }
+
+ // WithTimeStamp
+ YesNo withTimeStamp = configManager.getWithTimeStamp();
+ if ((withTimeStamp == YesNo.NOT_DEFINED)
+ || (withTimeStamp == YesNo.UNKNOWN)) {
+ if (withTimeStamp == YesNo.NOT_DEFINED) {
+ withTimeStampLabel.setForeground(gray);
+ }
+ if (withTimeStamp == YesNo.UNKNOWN) {
+ withTimeStampLabel.setForeground(red);
+ }
+ withTimeStamp = ConfigDefaults.getWithTimeStampDefaultValue();
+ }
+ if (withTimeStamp == YesNo.YES) {
+ withTimeStampYesButton.setSelection(true);
+ withTimeStampNoButton.setSelection(false);
+ } else if (withTimeStamp == YesNo.NO) {
+ withTimeStampYesButton.setSelection(false);
+ withTimeStampNoButton.setSelection(true);
+ }
+
+ // WithLineBreak
+ YesNo withLineBreak = configManager.getWithLineBreak();
+ if ((withLineBreak == YesNo.NOT_DEFINED)
+ || (withLineBreak == YesNo.UNKNOWN)) {
+ if (withLineBreak == YesNo.NOT_DEFINED) {
+ withLineBreakLabel.setForeground(gray);
+ }
+ if (withLineBreak == YesNo.UNKNOWN) {
+ withLineBreakLabel.setForeground(red);
+ }
+ withLineBreak = ConfigDefaults.getWithLineBreakDefaultValue();
+ }
+ if (withLineBreak == YesNo.YES) {
+ withLineBreakYesButton.setSelection(true);
+ withLineBreakNoButton.setSelection(false);
+ } else if (withLineBreak == YesNo.NO) {
+ withLineBreakYesButton.setSelection(false);
+ withLineBreakNoButton.setSelection(true);
+ }
+
+ // WithEventRanking
+ YesNo withEventRanking = configManager.getWithEventRanking();
+ if ((withEventRanking == YesNo.NOT_DEFINED)
+ || (withEventRanking == YesNo.UNKNOWN)) {
+ if (withEventRanking == YesNo.NOT_DEFINED) {
+ withEventRankingLabel.setForeground(gray);
+ }
+ if (withEventRanking == YesNo.UNKNOWN) {
+ withEventRankingLabel.setForeground(red);
+ }
+ withEventRanking = ConfigDefaults.getWithEventRankingDefaultValue();
+ }
+ if (withEventRanking == YesNo.YES) {
+ withEventRankingYesButton.setSelection(true);
+ withEventRankingNoButton.setSelection(false);
+ } else if (withEventRanking == YesNo.NO) {
+ withEventRankingYesButton.setSelection(false);
+ withEventRankingNoButton.setSelection(true);
+ }
+
+ // FileUnicode
+ YesNo fileUnicode = configManager.getFileUnicode();
+ if ((fileUnicode == YesNo.NOT_DEFINED)
+ || (fileUnicode == YesNo.UNKNOWN)) {
+ if (fileUnicode == YesNo.NOT_DEFINED) {
+ fileUnicodeLabel.setForeground(gray);
+ }
+ if (fileUnicode == YesNo.UNKNOWN) {
+ fileUnicodeLabel.setForeground(red);
+ }
+ fileUnicode = ConfigDefaults.getFileUnicodeDefaultValue();
+ }
+ if (fileUnicode == YesNo.YES) {
+ fileUnicodeYesButton.setSelection(true);
+ fileUnicodeNoButton.setSelection(false);
+ } else if (fileUnicode == YesNo.NO) {
+ fileUnicodeYesButton.setSelection(false);
+ fileUnicodeNoButton.setSelection(true);
+ }
+
+ // AddTestCaseTile
+ YesNo addTestcaseTitle = configManager.getAddTestcaseTitle();
+ if ((addTestcaseTitle == YesNo.NOT_DEFINED)
+ || (addTestcaseTitle == YesNo.UNKNOWN)) {
+ if (addTestcaseTitle == YesNo.NOT_DEFINED) {
+ addTestcaseTitleLabel.setForeground(gray);
+ }
+ if (addTestcaseTitle == YesNo.UNKNOWN) {
+ addTestcaseTitleLabel.setForeground(red);
+ }
+ addTestcaseTitle = ConfigDefaults.getAddTestCaseTitleDefaultValue();
+ }
+ if (addTestcaseTitle == YesNo.YES) {
+ addTestCaseTitleYesButton.setSelection(true);
+ addTestCaseTitleNoButton.setSelection(false);
+ } else if (addTestcaseTitle == YesNo.NO) {
+ addTestCaseTitleYesButton.setSelection(false);
+ addTestCaseTitleNoButton.setSelection(true);
+ }
+ }
+
+ /**
+ * Updates modules panel controls value
+ */
+ private void updateModulesControlsValue() {
+ modulesTreeRoot.removeAllChildreans();
+
+ int modulesCount = configManager.getModulesCount();
+ for (int i = 0; i < modulesCount; i++) {
+ String moduleName = configManager.getModuleName(i);
+ if ((moduleName == null) || (moduleName.length() == 0)) {
+ continue;
+ }
+
+ ModulesTreeNode moduleNode = new ModulesTreeNode(modulesTreeRoot);
+ moduleNode.setType(SectionElementType.MODULE_NAME);
+ moduleNode.setIndex(i);
+ moduleNode.setValue(moduleName);
+
+ String iniFileName = configManager.getModuleIniFile(i);
+ if ((iniFileName != null) && (iniFileName.length() != 0)) {
+ ModulesTreeNode iniFileNode = new ModulesTreeNode(moduleNode);
+ iniFileNode.setType(SectionElementType.INI_FILE);
+ iniFileNode.setIndex(0);
+ iniFileNode.setValue(iniFileName);
+ }
+
+ int configFilesCount = configManager.getModuleTestcaseFilesCount(i);
+ for (int k = 0; k < configFilesCount; k++) {
+ String configFileName = configManager.getModuleTestCaseFile(i,
+ k);
+ if ((configFileName == null) || (configFileName.length() == 0)) {
+ continue;
+ }
+
+ ModulesTreeNode configFileNode = new ModulesTreeNode(moduleNode);
+ configFileNode.setType(SectionElementType.TEST_CASE_FILE);
+ configFileNode.setIndex(k);
+ configFileNode.setValue(configFileName);
+ }
+ }
+
+ modulesTreeViewer.refresh();
+ }
+
+ /**
+ * Updates global settings and modules pages controls value
+ */
+ private void updateControlsValue() {
+ updateEngineDefaultsControlsValue();
+ updateLoggerDefaultsControlsValue();
+ updateModulesControlsValue();
+ }
+
+ /**
+ * Updates problem markers
+ */
+ private void updateProblemMarkers() {
+ clearProblemMarkers();
+ createProblemMarkers(configManager.getParseProblems(), getResource());
+ }
+
+ /**
+ * Creates problem markers
+ *
+ * @param problems
+ * list of problems
+ * @param resource
+ * resource used to create markers
+ */
+ private void createProblemMarkers(ArrayList<ParseProblem> problems,
+ IResource resource) {
+ if ((problems == null) || (resource == null)) {
+ return;
+ }
+
+ // Create new problem markers if some problems occures during parsing
+ if (problems != null) {
+ try {
+ int problemsCount = problems.size();
+ problemMarkers = new ArrayList<IMarker>();
+ for (int i = 0; i < problemsCount; i++) {
+ IMarker marker = resource.createMarker(IMarker.PROBLEM);
+ marker.setAttribute(IMarker.LINE_NUMBER,
+ problems.get(i).lineNumber);
+ marker.setAttribute(IMarker.MESSAGE,
+ problems.get(i).description);
+ if (problems.get(i).type == ParseProblem.ProblemType.ERROR) {
+ marker.setAttribute(IMarker.PRIORITY,
+ IMarker.PRIORITY_HIGH);
+ marker.setAttribute(IMarker.SEVERITY,
+ IMarker.SEVERITY_ERROR);
+ } else if (problems.get(i).type == ParseProblem.ProblemType.WARNING) {
+ marker.setAttribute(IMarker.PRIORITY,
+ IMarker.PRIORITY_HIGH);
+ marker.setAttribute(IMarker.SEVERITY,
+ IMarker.SEVERITY_WARNING);
+ }
+ problemMarkers.add(marker);
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * Removes problem markers
+ *
+ * @param resource
+ */
+ private void clearProblemMarkers() {
+ if (problemMarkers == null) {
+ return;
+ }
+
+ try {
+ for (int i = 0; i < problemMarkers.size(); i++) {
+ problemMarkers.get(i).delete();
+ }
+ problemMarkers.clear();
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * The <code>MultiPageEditorPart</code> implementation of this
+ * <code>IWorkbenchPart</code> method disposes all nested editors
+ */
+ public void dispose() {
+ clearProblemMarkers();
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
+ super.dispose();
+ }
+
+ /**
+ * Saves the editor document
+ */
+ public void doSave(IProgressMonitor monitor) {
+ getEditor(sourcePageIndex).doSave(monitor);
+ loadConfig();
+ }
+
+ /**
+ * Saves the editor document as another file
+ */
+ public void doSaveAs() {
+ IEditorPart editor = getEditor(sourcePageIndex);
+ editor.doSaveAs();
+ setPageText(sourcePageIndex, editor.getTitle());
+ setInput(editor.getEditorInput());
+ loadConfig();
+ }
+
+ /*
+ * (non-Javadoc) Method declared on IEditorPart
+ */
+ public void gotoMarker(IMarker marker) {
+ setActivePage(sourcePageIndex);
+ IDE.gotoMarker(getEditor(sourcePageIndex), marker);
+ }
+
+ /**
+ * Gets resource associated with editor input
+ *
+ * @return
+ */
+ protected IResource getResource() {
+ IEditorInput input = sourceEditor.getEditorInput();
+ IResource resource = (IResource) input.getAdapter(IFile.class);
+ if (resource == null) {
+ resource = (IResource) input.getAdapter(IResource.class);
+ if (resource == null) {
+ resource = ResourcesPlugin.getWorkspace().getRoot();
+
+ }
+ }
+ return resource;
+ }
+
+ /**
+ * The <code>MultiPageEditorExample</code> implementation of this method
+ * checks that the input is an instance of <code>IFileEditorInput</code>.
+ */
+ public void init(IEditorSite site, IEditorInput editorInput)
+ throws PartInitException {
+
+ super.init(site, editorInput);
+ }
+
+ /*
+ * (non-Javadoc) Method declared on IEditorPart.
+ */
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * Updates the contents of modules/general settings page when it is
+ * activated.
+ */
+ protected void pageChange(int pageIndex) {
+ super.pageChange(pageIndex);
+ if ((pageIndex == modulesPageIndex)
+ || (pageIndex == globalSettingsPageIndex)) {
+ loadConfig();
+ }
+ }
+
+ /**
+ * Closes all project files on project close.
+ */
+ public void resourceChanged(final IResourceChangeEvent event) {
+ if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ IWorkbenchPage[] pages = getSite().getWorkbenchWindow()
+ .getPages();
+ for (int i = 0; i < pages.length; i++) {
+ if (((FileEditorInput) sourceEditor.getEditorInput())
+ .getFile().getProject().equals(
+ event.getResource())) {
+ IEditorPart editorPart = pages[i]
+ .findEditor(sourceEditor.getEditorInput());
+ pages[i].closeEditor(editorPart, true);
+ }
+ }
+ }
+ });
+ }
+ }
+
+ /*
+ * (non-Javadoc) Method declared on SelectionListener
+ */
+ public void widgetDefaultSelected(SelectionEvent event) {
+ handleSelection(event);
+ }
+
+ /*
+ * (non-Javadoc) Method declared on ModifyListener
+ */
+ public void modifyText(ModifyEvent event) {
+ handleModifyText(event);
+ }
+
+ /*
+ * (non-Javadoc) Method declared on SelectionListener
+ */
+ public void widgetSelected(SelectionEvent event) {
+ handleSelection(event);
+ }
+
+ /**
+ * Handles text controls modification event
+ *
+ * @param event
+ * event
+ */
+ private void handleModifyText(ModifyEvent event) {
+ Color black = toolkit.getColors()
+ .createColor("black", new RGB(0, 0, 0));
+
+ Object source = event.getSource();
+
+ // Engine defaults section
+ if (source == testReportFilePathValue) {
+ testReportFilePathLabel.setForeground(black);
+ onTestReportFilePathChange();
+ } else if (source == testReportFileNameValue) {
+ testReportFileNameLabel.setForeground(black);
+ onTestReportFileNameChange();
+ } else if (source == deviceResetDllNameValue) {
+ deviceResetDllNameLabel.setForeground(black);
+ onDeviceResetDllNameChange();
+ }
+ // Logger defaults section
+ else if (source == emulatorBasePathValue) {
+ emulatorBasePathLabel.setForeground(black);
+ onEmulatorBasePathChange();
+ } else if (source == hardwareBasePathValue) {
+ hardwareBasePathLabel.setForeground(black);
+ onHardwareBasePathChange();
+ } else if (source == timeoutValue) {
+ onTimeoutChange();
+ }
+ }
+
+ /**
+ * Handles controls selection event
+ *
+ * @param event
+ * event
+ */
+ private void handleSelection(SelectionEvent event) {
+ Color black = toolkit.getColors()
+ .createColor("black", new RGB(0, 0, 0));
+ Object source = event.getSource();
+
+ // Engine defaults section
+ if (source == testReportModeValue) {
+ testReportModeLabel.setForeground(black);
+ onTestReportModeChange();
+ } else if ((source == createTestReportYesButton)
+ || (source == createTestReportNoButton)) {
+ createTestReportLabel.setForeground(black);
+ onCreateTestReportChange(source);
+ } else if (source == testReportFilePathValue) {
+ testReportFilePathLabel.setForeground(black);
+ onTestReportFilePathChange();
+ } else if (source == testReportFileNameValue) {
+ testReportFileNameLabel.setForeground(black);
+ onTestReportFileNameChange();
+ } else if ((source == testReportFormatTxtButton)
+ || (source == testReportFormatHtmlButton)) {
+ testReportFormatLabel.setForeground(black);
+ onTestReportFormatChange(source);
+ } else if ((source == testReportOutputFileButton)
+ || (source == testReportOutputRDebugButton)) {
+ testReportOutputLabel.setForeground(black);
+ onTestReportOutputChange(source);
+ } else if ((source == testReportFileCreationModeOverwriteButton)
+ || (source == testReportFileCreationModeAppendButton)) {
+ testReportFileCreationModeLabel.setForeground(black);
+ onTestReportFileCreationModeChange(source);
+ } else if (source == deviceResetDllNameValue) {
+ deviceResetDllNameLabel.setForeground(black);
+ onDeviceResetDllNameChange();
+ } else if (source == disableMeasurementValue) {
+ disableMeasurementLabel.setForeground(black);
+ onDisableMeasurementChange();
+ } else if (source == timeoutValue) {
+ onTimeoutChange();
+ } else if ((source == uiTestingSupportYesButton)
+ || (source == uiTestingSupportNoButton)) {
+ uiTestingSupportLabel.setForeground(black);
+ onUITestingSupportButtonSelect();
+ } else if ((source == separateProcessYesButton)
+ || (source == separateProcessNoButton)) {
+ separateProcessLabel.setForeground(black);
+ onSeparateProcessesButtonSelect();
+ }
+ // Logger defaults section
+ else if ((source == createLogDirectoriesYesButton)
+ || (source == createLogDirectoriesNoButton)) {
+ createLogDirectoriesLabel.setForeground(black);
+ onCreateLogDirectoriesChange(source);
+ } else if (source == emulatorBasePathValue) {
+ emulatorBasePathLabel.setForeground(black);
+ onEmulatorBasePathChange();
+ } else if ((source == emulatorLogFormatTxtButton)
+ || (source == emulatorLogFormatHtmlButton)) {
+ emulatorLogFormatLabel.setForeground(black);
+ onEmulatorLogFormatChange(source);
+ } else if ((source == emulatorLogOutputFileButton)
+ || (source == emulatorLogOutputRDebugButton)) {
+ emulatorLogOutputLabel.setForeground(black);
+ onEmulatorLogOutputChange(source);
+ } else if (source == hardwareBasePathValue) {
+ hardwareBasePathLabel.setForeground(black);
+ onHardwareBasePathChange();
+ } else if ((source == hardwareLogFormatTxtButton)
+ || (source == hardwareLogFormatHtmlButton)) {
+ hardwareLogFormatLabel.setForeground(black);
+ onHarwdareLogFormatChange(source);
+ } else if ((source == hardwareLogOutputFileButton)
+ || (source == hardwareLogOutputRDebugButton)) {
+ hardwareLogOutputLabel.setForeground(black);
+ onHardwareLogOutputChange(source);
+ } else if ((source == logFileCreationModeOverwriteButton)
+ || (source == logFileCreationModeAppendButton)) {
+ logFileCreationModeLabel.setForeground(black);
+ onLogFileCreationModeChange(source);
+ } else if ((source == threadIdToLogFileYesButton)
+ || (source == threadIdToLogFileNoButton)) {
+ threadIdToLogFileLabel.setForeground(black);
+ onThreadIdToLogFileChange(source);
+ } else if ((source == withTimeStampYesButton)
+ || (source == withTimeStampNoButton)) {
+ withTimeStampLabel.setForeground(black);
+ onWithTimeStampChange(source);
+ } else if ((source == withLineBreakYesButton)
+ || (source == withLineBreakNoButton)) {
+ withLineBreakLabel.setForeground(black);
+ onWithLineBreakChange(source);
+ } else if ((source == withEventRankingYesButton)
+ || (source == withEventRankingNoButton)) {
+ withEventRankingLabel.setForeground(black);
+ onWithEventRankingChange(source);
+ } else if ((source == fileUnicodeYesButton)
+ || (source == fileUnicodeNoButton)) {
+ fileUnicodeLabel.setForeground(black);
+ onFileUnicodeChange(source);
+ } else if ((source == addTestCaseTitleYesButton)
+ || (source == addTestCaseTitleNoButton)) {
+ addTestcaseTitleLabel.setForeground(black);
+ onAddTestcaseTitleChange(source);
+ }
+ // Modules page
+ else if (source == modulesTreeViewer) {
+ onModulesTreeElementSelect();
+ } else if (source == addModuleButton) {
+ onAddModuleButtonSelect();
+ } else if (source == addIniFileButton) {
+ onAddIniFileToModuleButtonSelect();
+ } else if (source == addTestCaseFileButton) {
+ onAddTestCaseFileToModuleButtonSelect();
+ } else if (source == editButton) {
+ onEditButtonSelect();
+ } else if (source == removeButton) {
+ onRemoveButtonSelect();
+ }
+ }
+
+ /**
+ * Handles <code>FileUnicode</code> value change
+ *
+ * @param source
+ * event source
+ */
+ private void onFileUnicodeChange(Object source) {
+ if (fileUnicodeYesButton.getSelection() == true) {
+ configManager.setFileUnicode(YesNo.YES);
+ } else if (fileUnicodeNoButton.getSelection() == true) {
+ configManager.setFileUnicode(YesNo.NO);
+ } else {
+ return;
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>AddTestCaseTitle</code> value change
+ *
+ * @param source
+ * event source
+ */
+ private void onAddTestcaseTitleChange(Object source) {
+ if (addTestCaseTitleYesButton.getSelection()) {
+ configManager.setAddTestcaseTitle(YesNo.YES);
+ } else if (addTestCaseTitleNoButton.getSelection()) {
+ configManager.setAddTestcaseTitle(YesNo.NO);
+ } else
+ return;
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>WithEventRanking</code> value change
+ *
+ * @param source
+ * event source
+ */
+ private void onWithEventRankingChange(Object source) {
+ if (withEventRankingYesButton.getSelection() == true) {
+ configManager.setWithEventRanking(YesNo.YES);
+ } else if (withEventRankingNoButton.getSelection() == true) {
+ configManager.setWithEventRanking(YesNo.NO);
+ } else {
+ return;
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>onWithTimeStampChange</code> value change
+ *
+ * @param source
+ * source
+ */
+ private void onWithTimeStampChange(Object source) {
+ if (withTimeStampYesButton.getSelection() == true) {
+ configManager.setWithTimeStamp(YesNo.YES);
+ } else if (withTimeStampNoButton.getSelection() == true) {
+ configManager.setWithTimeStamp(YesNo.NO);
+ } else {
+ return;
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>ThreadIdToLogFile</code> value change
+ *
+ * @param source
+ * event source
+ */
+ private void onThreadIdToLogFileChange(Object source) {
+ if (threadIdToLogFileYesButton.getSelection() == true) {
+ configManager.setThreadIdToLogFile(YesNo.YES);
+ } else if (threadIdToLogFileNoButton.getSelection() == true) {
+ configManager.setThreadIdToLogFile(YesNo.NO);
+ } else {
+ return;
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>LogFileCreationMode</code> value change
+ *
+ * @param source
+ * event source
+ */
+ private void onLogFileCreationModeChange(Object source) {
+ if (logFileCreationModeAppendButton.getSelection() == true) {
+ configManager.setLogFileCreationMode(FileCreationMode.APPEND);
+ } else if (logFileCreationModeOverwriteButton.getSelection() == true) {
+ configManager.setLogFileCreationMode(FileCreationMode.OVERWRITE);
+ } else {
+ return;
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>HardwareLogOutput</code> value change
+ *
+ * @param source
+ * event source
+ */
+ private void onHardwareLogOutputChange(Object source) {
+ if (hardwareLogOutputFileButton.getSelection() == true) {
+ configManager.setHardwareLogOutput(OutputType.FILE);
+ } else if (hardwareLogOutputRDebugButton.getSelection() == true) {
+ configManager.setHardwareLogOutput(OutputType.RDEBUG);
+ } else {
+ return;
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>HarwdareLogFormat</code> value change
+ *
+ * @param source
+ */
+ private void onHarwdareLogFormatChange(Object source) {
+ if (hardwareLogFormatTxtButton.getSelection() == true) {
+ configManager.setHardwareLogFormat(OutputFileFormat.TXT);
+ } else if (hardwareLogFormatHtmlButton.getSelection() == true) {
+ configManager.setHardwareLogFormat(OutputFileFormat.HTML);
+ } else {
+ return;
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>HardwareBasePath</code> value change
+ */
+ private void onHardwareBasePathChange() {
+ configManager.setHardwareBasePath(hardwareBasePathValue.getText());
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>EmulatorLogFormat</code> value change
+ *
+ * @param source
+ * event source
+ */
+ private void onEmulatorLogFormatChange(Object source) {
+ if (emulatorLogFormatTxtButton.getSelection() == true) {
+ configManager.setEmulatorLogFormat(OutputFileFormat.TXT);
+ } else if (emulatorLogFormatHtmlButton.getSelection() == true) {
+ configManager.setEmulatorLogFormat(OutputFileFormat.HTML);
+ } else {
+ return;
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>EmulatorLogOutput</code> value change
+ *
+ * @param source
+ * event source
+ */
+ private void onEmulatorLogOutputChange(Object source) {
+ if (emulatorLogOutputFileButton.getSelection() == true) {
+ configManager.setEmulatorLogOutput(OutputType.FILE);
+ } else if (emulatorLogOutputRDebugButton.getSelection() == true) {
+ configManager.setEmulatorLogOutput(OutputType.RDEBUG);
+ } else {
+ return;
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>EmulatorBasePath</code> value change
+ */
+ private void onEmulatorBasePathChange() {
+ configManager.setEmulatorBasePath(emulatorBasePathValue.getText());
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>CreateLogDirectories</code> value change
+ *
+ * @param source
+ * event source
+ */
+ private void onCreateLogDirectoriesChange(Object source) {
+ if (createLogDirectoriesYesButton.getSelection() == true) {
+ configManager.setCreateLogDirectories(YesNo.YES);
+ } else if (createLogDirectoriesNoButton.getSelection() == true) {
+ configManager.setCreateLogDirectories(YesNo.NO);
+ } else {
+ return;
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>WithLineBreak</code> value change
+ *
+ * @param source
+ * event source
+ */
+ private void onWithLineBreakChange(Object source) {
+ if (withLineBreakYesButton.getSelection() == true) {
+ configManager.setWithLineBreak(YesNo.YES);
+ } else if (withLineBreakNoButton.getSelection() == true) {
+ configManager.setWithLineBreak(YesNo.NO);
+ } else {
+ return;
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>Timeout</code> value change
+ */
+ private void onTimeoutChange() {
+ configManager.setTimeout(timeoutValue.getSelection());
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>DisableMeasurement</code> value change
+ */
+ private void onDisableMeasurementChange() {
+ String module = disableMeasurementValue.getItem(disableMeasurementValue
+ .getSelectionIndex());
+ configManager.setDisableMeasurementModule(ConfigUtil
+ .getMeasurementModuleByName(module));
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>DeviceResetDllName</code> value change
+ */
+ private void onDeviceResetDllNameChange() {
+ configManager.setDeviceResetDllName(deviceResetDllNameValue.getText());
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>TestReportFileCreationMode</code> value change
+ *
+ * @param source
+ * event source
+ */
+ private void onTestReportFileCreationModeChange(Object source) {
+ if (testReportFileCreationModeAppendButton.getSelection() == true) {
+ configManager
+ .setTestReportFileCreationMode(FileCreationMode.APPEND);
+ } else if (testReportFileCreationModeOverwriteButton.getSelection() == true) {
+ configManager
+ .setTestReportFileCreationMode(FileCreationMode.OVERWRITE);
+ } else {
+ return;
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>TestReportOutput</code> value change
+ *
+ * @param source
+ * event source
+ */
+ private void onTestReportOutputChange(Object source) {
+ if (testReportOutputFileButton.getSelection() == true) {
+ configManager.setTestReportOutput(OutputType.FILE);
+ } else if (testReportOutputRDebugButton.getSelection() == true) {
+ configManager.setTestReportOutput(OutputType.RDEBUG);
+ } else {
+ return;
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>TestReportFormat</code> value change
+ *
+ * @param source
+ * event source
+ */
+ private void onTestReportFormatChange(Object source) {
+ if (testReportFormatTxtButton.getSelection() == true) {
+ configManager.setTestReportFormat(OutputFileFormat.TXT);
+ } else if (testReportFormatHtmlButton.getSelection() == true) {
+ configManager.setTestReportFormat(OutputFileFormat.HTML);
+ } else {
+ return;
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>TestReportFileName</code> value change
+ */
+ private void onTestReportFileNameChange() {
+ configManager.setTestReportFileName(testReportFileNameValue.getText());
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>TestReportFilePath</code> value change
+ */
+ private void onTestReportFilePathChange() {
+ configManager.setTestReportFilePath(testReportFilePathValue.getText());
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>TestReportMode</code> value change
+ */
+ private void onTestReportModeChange() {
+ String mode = testReportModeValue.getItem(testReportModeValue
+ .getSelectionIndex());
+ configManager.setTestReportMode(ConfigUtil
+ .getTestReportModeByName(mode));
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>CreateTestReport</code> value change
+ *
+ * @param source
+ */
+ private void onCreateTestReportChange(Object source) {
+ if (createTestReportYesButton.getSelection() == true) {
+ configManager.setCreateTestReport(YesNo.YES);
+ } else if (createTestReportNoButton.getSelection() == true) {
+ configManager.setCreateTestReport(YesNo.NO);
+ } else {
+ return;
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles selection change in modules tree.
+ *
+ * Depend which tree element is selected proper buttons in modules page are
+ * enabled or disabled.
+ */
+ private void onModulesTreeElementSelect() {
+ TreeSelection selection = (TreeSelection) modulesTreeViewer
+ .getSelection();
+ ModulesTreeNode selectedItem = (ModulesTreeNode) selection
+ .getFirstElement();
+
+ if (selectedItem == null) {
+ addModuleButton.setEnabled(true);
+ addIniFileButton.setEnabled(false);
+ addTestCaseFileButton.setEnabled(false);
+ editButton.setEnabled(false);
+ removeButton.setEnabled(false);
+ return;
+ }
+
+ switch (selectedItem.getType()) {
+ case MODULE_NAME: {
+ addModuleButton.setEnabled(true);
+ addTestCaseFileButton.setEnabled(true);
+ editButton.setEnabled(true);
+ removeButton.setEnabled(true);
+
+ addIniFileButton.setEnabled(true);
+ java.util.List<ModulesTreeNode> childrens = selectedItem
+ .getChildrens();
+ if (childrens != null) {
+ for (int i = 0; i < childrens.size(); i++) {
+ if (childrens.get(i).getType() == SectionElementType.INI_FILE) {
+ addIniFileButton.setEnabled(false);
+ }
+ }
+ }
+ }
+ break;
+ case INI_FILE: {
+ addModuleButton.setEnabled(true);
+ addIniFileButton.setEnabled(false);
+ addTestCaseFileButton.setEnabled(true);
+ editButton.setEnabled(true);
+ removeButton.setEnabled(true);
+ }
+ break;
+ case TEST_CASE_FILE: {
+ addModuleButton.setEnabled(true);
+ addIniFileButton.setEnabled(true);
+ java.util.List<ModulesTreeNode> subNodes = selectedItem.getParent()
+ .getChildrens();
+ for (int i = 0; i < subNodes.size(); i++) {
+ if (subNodes.get(i).getType() == SectionElementType.INI_FILE) {
+ addIniFileButton.setEnabled(false);
+ break;
+ }
+ }
+ addTestCaseFileButton.setEnabled(true);
+ editButton.setEnabled(true);
+ removeButton.setEnabled(true);
+ }
+ break;
+ }
+ }
+
+ /**
+ * Handles <code>Add module</code> button selection
+ *
+ * Adds new module to config file and modules tree
+ */
+ private void onAddModuleButtonSelect() {
+ NewModuleWizard moduleWizard = new NewModuleWizard(configManager);
+ moduleWizard.init(null, null);
+ WizardDialog dialog = new WizardDialog(modulesMainForm.getShell(),
+ moduleWizard);
+ dialog.create();
+ dialog.open();
+ int ret = dialog.getReturnCode();
+
+ if (ret == WizardDialog.OK) {
+ ModulesTreeNode moduleNode = new ModulesTreeNode();
+ moduleNode.setType(SectionElementType.MODULE_NAME);
+ moduleNode.setIndex(modulesTreeRoot.getChildrens().size());
+ moduleNode.setValue(configManager.getModuleName(moduleNode
+ .getIndex()));
+ moduleNode.setParent(modulesTreeRoot);
+
+ modulesTreeViewer.refresh();
+
+ syncSourceWithViews();
+ }
+ }
+
+ /**
+ * Handles <code>Add ini file</code> button selection
+ *
+ * Adds new ini file to selected module
+ */
+ private void onAddIniFileToModuleButtonSelect() {
+ InputDialog iniFileDialog = new InputDialog(modulesMainForm.getShell(),
+ "Add ini file", "Ini file path",
+ "C:\\TestFramework\\Example.ini", null);
+ int ret = iniFileDialog.open();
+ if (ret == InputDialog.OK) {
+ TreeSelection selection = (TreeSelection) modulesTreeViewer
+ .getSelection();
+ ModulesTreeNode selectedItem = (ModulesTreeNode) selection
+ .getFirstElement();
+
+ if (selectedItem != null) {
+ ModulesTreeNode parent = selectedItem;
+ if (selectedItem.getType() != SectionElementType.MODULE_NAME) {
+ parent = selectedItem.getParent();
+ }
+
+ ModulesTreeNode iniFileNode = new ModulesTreeNode();
+ iniFileNode.setType(SectionElementType.INI_FILE);
+ iniFileNode.setIndex(0);
+ iniFileNode.setValue(iniFileDialog.getValue());
+
+ configManager.addIniFileToModule(parent.getIndex(),
+ iniFileDialog.getValue());
+
+ // Put ini file as first in module tree node
+ java.util.List<ModulesTreeNode> subNodes = parent
+ .getChildrens();
+ parent.removeAllChildreans();
+ iniFileNode.setParent(parent);
+ for (int i = 0; i < subNodes.size(); i++) {
+ parent.addChildren(subNodes.get(i));
+ }
+
+ // refresh modules tree view
+ modulesTreeViewer.refresh();
+ modulesTreeViewer.expandToLevel(parent, 1);
+ // Refresh modules add, rem, edit,.. states
+ onModulesTreeElementSelect();
+
+ // Synchronize source code with views state
+ syncSourceWithViews();
+ }
+ }
+ }
+
+ /**
+ * Handles <code>Add testcase file</code> button selection
+ *
+ * Adds new testcase file to selected module
+ */
+ private void onAddTestCaseFileToModuleButtonSelect() {
+ InputDialog testCaseFileDialog = new InputDialog(modulesMainForm
+ .getShell(), "Add testcase file", "Testcase file path",
+ "C:\\TestFramework\\Example.cfg", null);
+ int ret = testCaseFileDialog.open();
+ if (ret == InputDialog.OK) {
+ TreeSelection selection = (TreeSelection) modulesTreeViewer
+ .getSelection();
+ ModulesTreeNode selectedItem = (ModulesTreeNode) selection
+ .getFirstElement();
+
+ if (selectedItem != null) {
+ ModulesTreeNode parent = selectedItem;
+ if (selectedItem.getType() != SectionElementType.MODULE_NAME) {
+ parent = selectedItem.getParent();
+ }
+
+ ModulesTreeNode testCaseFileNode = new ModulesTreeNode();
+ testCaseFileNode.setType(SectionElementType.TEST_CASE_FILE);
+ int index = -1;
+ java.util.List<ModulesTreeNode> subNodes = parent
+ .getChildrens();
+ for (int i = 0; i < subNodes.size(); i++) {
+ if (subNodes.get(i).getType() == SectionElementType.TEST_CASE_FILE) {
+ if (subNodes.get(i).getValue().toLowerCase().equals(
+ testCaseFileDialog.getValue().toLowerCase())) {
+ MessageBox box = new MessageBox(new Shell(),
+ SWT.ICON_ERROR);
+ box
+ .setText("Impossible to add duplicate test case file");
+ box.setMessage("Test case file already exist.");
+ box.open();
+ return;
+ }
+ if (index < subNodes.get(i).getIndex()) {
+ index = subNodes.get(i).getIndex();
+ }
+ }
+ }
+ index++;
+ testCaseFileNode.setIndex(index);
+
+ testCaseFileNode.setValue(testCaseFileDialog.getValue());
+ testCaseFileNode.setParent(parent);
+
+ configManager.addTestCaseFileToModule(parent.getIndex(),
+ testCaseFileDialog.getValue());
+
+ modulesTreeViewer.refresh();
+ modulesTreeViewer.expandToLevel(parent, 1);
+ onModulesTreeElementSelect();
+
+ syncSourceWithViews();
+ }
+ }
+ }
+
+ /**
+ * Handles <code>Edit<code> button selection.
+ *
+ * Depends on which modules tree element is selected
+ * proper edit dialog window apperas. After that selected
+ * element value is updated in config source and modules tree.
+ */
+ private void onEditButtonSelect() {
+ TreeSelection selection = (TreeSelection) modulesTreeViewer
+ .getSelection();
+ ModulesTreeNode selectedItem = (ModulesTreeNode) selection
+ .getFirstElement();
+
+ if (selectedItem == null) {
+ return;
+ }
+
+ if (selectedItem.getType() == SectionElementType.MODULE_NAME) {
+ int moduleIndex = selectedItem.getIndex();
+
+ InputDialog moduleNameDialog = new InputDialog(modulesMainForm
+ .getShell(), "Change module name", "Module name",
+ selectedItem.getValue(), null);
+
+ if (moduleNameDialog.open() == InputDialog.OK) {
+ selectedItem.setValue(moduleNameDialog.getValue());
+ configManager
+ .updateModule(moduleIndex, selectedItem.getValue());
+ modulesTreeViewer.refresh();
+ syncSourceWithViews();
+ }
+ } else if (selectedItem.getType() == SectionElementType.INI_FILE) {
+ int moduleIndex = selectedItem.getParent().getIndex();
+
+ InputDialog iniFileDialog = new InputDialog(modulesMainForm
+ .getShell(), "Change ini file path", "Ini file path",
+ selectedItem.getValue(), null);
+
+ if (iniFileDialog.open() == InputDialog.OK) {
+ selectedItem.setValue(iniFileDialog.getValue());
+ configManager.updateIniFileInModule(moduleIndex, selectedItem
+ .getValue());
+ modulesTreeViewer.refresh();
+ syncSourceWithViews();
+ }
+ } else if (selectedItem.getType() == SectionElementType.TEST_CASE_FILE) {
+ int moduleIndex = selectedItem.getParent().getIndex();
+ int configFileIndex = selectedItem.getIndex();
+
+ InputDialog testCaseFileDialog = new InputDialog(modulesMainForm
+ .getShell(), "Change testcase file path",
+ "Testcase file path", selectedItem.getValue(), null);
+
+ if (testCaseFileDialog.open() == InputDialog.OK) {
+ selectedItem.setValue(testCaseFileDialog.getValue());
+ configManager.updateTestCaseFileInModule(moduleIndex,
+ configFileIndex, selectedItem.getValue());
+ modulesTreeViewer.refresh();
+ syncSourceWithViews();
+ }
+ }
+
+ }
+
+ /**
+ * Handles <code>Remove</code> button selection.
+ *
+ * Removes selected element from config and modules tree.
+ */
+ private void onRemoveButtonSelect() {
+ TreeSelection selection = (TreeSelection) modulesTreeViewer
+ .getSelection();
+ ModulesTreeNode selectedItem = (ModulesTreeNode) selection
+ .getFirstElement();
+
+ if (selectedItem == null) {
+ return;
+ }
+
+ if (selectedItem.getType() == SectionElementType.MODULE_NAME) {
+ int moduleIndex = selectedItem.getIndex();
+ configManager.removeModule(moduleIndex);
+
+ // Fix modules indices
+ ModulesTreeNode parent = selectedItem.getParent();
+ selectedItem.dispose();
+ for (int i = 0; i < parent.getChildrens().size(); i++) {
+ int index = parent.getChildrens().get(i).getIndex();
+ if (index > selectedItem.getIndex()) {
+ parent.getChildrens().get(i).setIndex(index - 1);
+ }
+ }
+
+ modulesTreeViewer.refresh();
+ syncSourceWithViews();
+ } else if (selectedItem.getType() == SectionElementType.INI_FILE) {
+ int moduleIndex = selectedItem.getParent().getIndex();
+ configManager.removeIniFileFromModule(moduleIndex);
+
+ selectedItem.dispose();
+
+ modulesTreeViewer.refresh();
+ syncSourceWithViews();
+ } else if (selectedItem.getType() == SectionElementType.TEST_CASE_FILE) {
+ int moduleIndex = selectedItem.getParent().getIndex();
+ int configFileIndex = selectedItem.getIndex();
+ configManager.removeTestCaseFileFromModule(moduleIndex,
+ configFileIndex);
+
+ // Fix module testcase files indices
+ ModulesTreeNode parent = selectedItem.getParent();
+ selectedItem.dispose();
+ for (int i = 0; i < parent.getChildrens().size(); i++) {
+ int index = parent.getChildrens().get(i).getIndex();
+ if (index > selectedItem.getIndex()) {
+ parent.getChildrens().get(i).setIndex(index - 1);
+ }
+ }
+
+ modulesTreeViewer.refresh();
+ syncSourceWithViews();
+ }
+ }
+
+ /**
+ * Handles <code>UI testing support</code> button selection
+ *
+ * Changes value of UITestingSupport option
+ */
+ private void onUITestingSupportButtonSelect() {
+ if (uiTestingSupportYesButton.getSelection()) {
+ configManager.setUITestingSupport(YesNo.YES);
+ } else if (uiTestingSupportNoButton.getSelection()) {
+ configManager.setUITestingSupport(YesNo.NO);
+ }
+ syncSourceWithViews();
+ }
+
+ /**
+ * Handles <code>Separate processes</code> button selection
+ *
+ * Changes value of SeparateProcesses option
+ */
+ private void onSeparateProcessesButtonSelect() {
+ if (separateProcessYesButton.getSelection()) {
+ configManager.setSeparateProcesses(YesNo.YES);
+ } else if (separateProcessNoButton.getSelection()) {
+ configManager.setSeparateProcesses(YesNo.NO);
+ }
+ syncSourceWithViews();
+ }
+
+ /*
+ * (non-Javadoc) Method declared on ISelectionChangedListener
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ if (event.getSource() == modulesTreeViewer) {
+ onModulesTreeElementSelect();
+ }
+ }
+
+ /**
+ * Synchronizes config source with modules nad general settings pages
+ * controls value.
+ */
+ private void syncSourceWithViews() {
+ String oldConfig = sourceEditor.getDocumentProvider().getDocument(
+ sourceEditor.getEditorInput()).get();
+ String newConfig = configManager.getConfigSource();
+
+ if (oldConfig == null) {
+ oldConfig = "";
+ }
+ if (newConfig == null) {
+ newConfig = "";
+ }
+
+ int diffLeftPos = 0;
+ int diffRightPos = 0;
+
+ for (int i = 0; (i < newConfig.length()) && (i < oldConfig.length()); i++) {
+ diffLeftPos = i;
+ if (newConfig.charAt(i) != oldConfig.charAt(i)) {
+ break;
+ }
+ }
+
+ String newStr = newConfig.substring(diffLeftPos, newConfig.length());
+
+ if ((oldConfig.length() != 0) && (newConfig.length() != 0)) {
+ for (int k = 0; (oldConfig.length() - k >= diffLeftPos)
+ && (newConfig.length() - k >= diffLeftPos); k++) {
+ diffRightPos = k;
+ if (newConfig.charAt(newConfig.length() - 1 - k) != oldConfig
+ .charAt(oldConfig.length() - 1 - k)) {
+ break;
+ }
+ }
+ }
+
+ newStr = newStr.substring(0, newStr.length() - diffRightPos);
+
+ try {
+ int insPos = diffLeftPos;
+ int insLenght = oldConfig.length() - diffRightPos - diffLeftPos;
+ sourceEditor.getDocumentProvider().getDocument(
+ sourceEditor.getEditorInput()).replace(insPos, insLenght,
+ newStr);
+ configManager.parseConfig(sourceEditor.getDocumentProvider()
+ .getDocument(sourceEditor.getEditorInput()).get());
+ updateProblemMarkers();
+ } catch (BadLocationException e) {
+ e.printStackTrace();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configeditor/editors/ConfigEditorContributor.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configeditor.editors;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.ide.IDEActionFactory;
+import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorActionConstants;
+
+/**
+ * Manages the installation/deinstallation of global actions for editors.
+ * Responsible for the redirection of global actions to the active editor.
+ * Contributor replaces the contributors for the individual editors in the editor.
+ */
+public class ConfigEditorContributor extends MultiPageEditorActionBarContributor {
+ private IEditorPart activeEditorPart;
+ /**
+ * Creates a multi-page contributor.
+ */
+ public ConfigEditorContributor() {
+ super();
+ createActions();
+ }
+ /**
+ * Returns the action registed with the given text editor.
+ * @return IAction or null if editor is null.
+ */
+ protected IAction getAction(ITextEditor editor, String actionID) {
+ return (editor == null ? null : editor.getAction(actionID));
+ }
+
+ /* (non-JavaDoc)
+ * Method declared in AbstractMultiPageEditorActionBarContributor.
+ */
+ public void setActivePage(IEditorPart part) {
+ if (activeEditorPart == part)
+ return;
+
+ activeEditorPart = part;
+
+ IActionBars actionBars = getActionBars();
+ if (actionBars != null) {
+
+ ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null;
+
+ actionBars.setGlobalActionHandler(
+ ActionFactory.DELETE.getId(),
+ getAction(editor, ITextEditorActionConstants.DELETE));
+ actionBars.setGlobalActionHandler(
+ ActionFactory.UNDO.getId(),
+ getAction(editor, ITextEditorActionConstants.UNDO));
+ actionBars.setGlobalActionHandler(
+ ActionFactory.REDO.getId(),
+ getAction(editor, ITextEditorActionConstants.REDO));
+ actionBars.setGlobalActionHandler(
+ ActionFactory.CUT.getId(),
+ getAction(editor, ITextEditorActionConstants.CUT));
+ actionBars.setGlobalActionHandler(
+ ActionFactory.COPY.getId(),
+ getAction(editor, ITextEditorActionConstants.COPY));
+ actionBars.setGlobalActionHandler(
+ ActionFactory.PASTE.getId(),
+ getAction(editor, ITextEditorActionConstants.PASTE));
+ actionBars.setGlobalActionHandler(
+ ActionFactory.SELECT_ALL.getId(),
+ getAction(editor, ITextEditorActionConstants.SELECT_ALL));
+ actionBars.setGlobalActionHandler(
+ ActionFactory.FIND.getId(),
+ getAction(editor, ITextEditorActionConstants.FIND));
+ actionBars.setGlobalActionHandler(
+ IDEActionFactory.BOOKMARK.getId(),
+ getAction(editor, IDEActionFactory.BOOKMARK.getId()));
+ actionBars.updateActionBars();
+ }
+ }
+ /**
+ * Creates editor actions
+ */
+ private void createActions() {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToMenu(org.eclipse.jface.action.IMenuManager)
+ */
+ public void contributeToMenu(IMenuManager manager) {
+
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(org.eclipse.jface.action.IToolBarManager)
+ */
+ public void contributeToToolBar(IToolBarManager manager) {
+
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configeditor/editors/ConfigSourceEditor.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configeditor.editors;
+
+import java.util.ResourceBundle;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.ui.editors.text.TextEditor;
+import org.eclipse.ui.texteditor.ContentAssistAction;
+import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
+
+/**
+ * Config source editor
+ *
+ */
+public class ConfigSourceEditor extends TextEditor {
+ /**
+ * Creates config source editor
+ */
+ public ConfigSourceEditor() {
+ super();
+ setSourceViewerConfiguration( new ConfigSourceEditorConfiguration() );
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.editors.text.TextEditor#createActions()
+ */
+ protected void createActions() {
+ ResourceBundle resourceBundle = ResourceBundle.getBundle( "STIFConfigEditor" );
+ Action action = new ContentAssistAction(resourceBundle, "ContentAssistProposal.", this);
+ String id = ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS;
+ action.setActionDefinitionId(id);
+ setAction("ContentAssistProposal", action);
+ markAsStateDependentAction("ContentAssistProposal", true);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configeditor/editors/ConfigSourceEditorConfiguration.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configeditor.editors;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.presentation.IPresentationReconciler;
+import org.eclipse.jface.text.presentation.PresentationReconciler;
+import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+
+/**
+ * Config source editor configuration
+ *
+ */
+public class ConfigSourceEditorConfiguration extends SourceViewerConfiguration {
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer)
+ */
+ public IPresentationReconciler getPresentationReconciler( ISourceViewer sourceViewer ) {
+ PresentationReconciler pr = new PresentationReconciler();
+ DefaultDamagerRepairer ddr = new DefaultDamagerRepairer( new ConfigSourceScaner() );
+ pr.setRepairer(ddr, IDocument.DEFAULT_CONTENT_TYPE);
+ pr.setDamager(ddr, IDocument.DEFAULT_CONTENT_TYPE);
+ return pr;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getContentAssistant(org.eclipse.jface.text.source.ISourceViewer)
+ */
+ public IContentAssistant getContentAssistant( ISourceViewer sourceViewer ) {
+ ContentAssistant contentAssistant = new ContentAssistant();
+
+
+ IContentAssistProcessor contentAssistProcessor = new ConfigSourceEditorContentAssistProcessor();
+ contentAssistant.setContentAssistProcessor( contentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE);
+ contentAssistant.setInformationControlCreator(getInformationControlCreator( sourceViewer ));
+ contentAssistant.enableAutoActivation(true);
+ contentAssistant.setAutoActivationDelay(500);
+
+ return contentAssistant;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configeditor/editors/ConfigSourceEditorContentAssistProcessor.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configeditor.editors;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.CompletionProposal;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+
+import com.nokia.testfw.stf.configmanager.ConfigUtil;
+import com.nokia.testfw.stf.configmanager.SectionElementType;
+
+/**
+ * Config source editor content assistant
+ *
+ */
+public class ConfigSourceEditorContentAssistProcessor implements IContentAssistProcessor {
+ /**
+ * List of STIF config keywords
+ */
+ private List<String> keywords = null;
+
+ /**
+ * Creates content assistant
+ */
+ public ConfigSourceEditorContentAssistProcessor() {
+ keywords = new ArrayList<String>();
+
+ SectionElementType[] engineDefaultsElements = ConfigUtil.getAllowedEngineDefaultsSectionElements();
+ for ( int i = 0; i < engineDefaultsElements.length; i++) {
+ keywords.add( ConfigUtil.getEngineDefaultsSectionElementTag(engineDefaultsElements[ i ]) );
+ }
+
+ SectionElementType[] loggerDefaultsElements = ConfigUtil.getAllowedLoggerDefaultsSectionElements();
+ for ( int i = 0; i < loggerDefaultsElements.length; i++) {
+ keywords.add( ConfigUtil.getLoggerDefaultsSectionElementTag(loggerDefaultsElements[ i ]) );
+ }
+
+ SectionElementType[] moduleElements = ConfigUtil.getAllowedModuleSectionElements();
+ for ( int i = 0; i < moduleElements.length; i++) {
+ keywords.add( ConfigUtil.getModuleSectionElementTag(moduleElements[ i ]) );
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int)
+ */
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
+ int offset) {
+
+ String source = viewer.getDocument().get();
+ int startOffset = offset;
+ for ( int i = offset - 1; i >= 0; i-- ) {
+ if ( Character.isWhitespace(source.charAt( i )) ) {
+ break;
+ }
+ startOffset = i;
+ }
+
+ List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
+ String token = source.substring( startOffset, offset );
+ for ( int i = 0; i < keywords.size(); i++ ) {
+ String keyword = keywords.get( i );
+ if ( keyword.startsWith( token ) ) {
+ CompletionProposal proposal = new CompletionProposal(
+ keyword,startOffset, offset - startOffset, keyword.length() );
+ proposals.add( proposal );
+ }
+ }
+
+ return proposals.toArray(new ICompletionProposal[0]);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer, int)
+ */
+ public IContextInformation[] computeContextInformation(ITextViewer viewer,
+ int offset) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
+ */
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters()
+ */
+ public char[] getContextInformationAutoActivationCharacters() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator()
+ */
+ public IContextInformationValidator getContextInformationValidator() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
+ */
+ public String getErrorMessage() {
+ return null;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configeditor/editors/ConfigSourceScaner.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configeditor.editors;
+
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IWhitespaceDetector;
+import org.eclipse.jface.text.rules.IWordDetector;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WhitespaceRule;
+import org.eclipse.jface.text.rules.WordRule;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Display;
+
+import com.nokia.testfw.stf.configmanager.ConfigUtil;
+import com.nokia.testfw.stf.configmanager.SectionElementType;
+
+/**
+ * Config source scaner. Defines syntax highlighting rules used by {@link ConfigSourceEditor}.
+ *
+ */
+public class ConfigSourceScaner extends RuleBasedScanner {
+ private Color KEYWORD_COLOR = null;
+ private Color COMMENT_COLOR = null;
+ private Color SECTION_COLOR = null;
+
+ /**
+ * Creates config source scaner
+ */
+ public ConfigSourceScaner() {
+ WordRule rule = new WordRule(new IWordDetector() {
+ public boolean isWordStart(char c) {
+ return Character.isJavaIdentifierStart(c);
+ }
+ public boolean isWordPart(char c) {
+ if ( c == '=' ) {
+ return true;
+ }
+ return Character.isJavaIdentifierPart(c);
+ }
+ });
+
+ SECTION_COLOR = Display.getCurrent().getSystemColor( SWT.COLOR_BLUE );
+ KEYWORD_COLOR = Display.getCurrent().getSystemColor( SWT.COLOR_BLACK );
+ COMMENT_COLOR = Display.getCurrent().getSystemColor( SWT.COLOR_DARK_GRAY );
+
+ Token section = new Token(new TextAttribute( SECTION_COLOR, null, SWT.BOLD));
+ Token keyword = new Token(new TextAttribute( KEYWORD_COLOR, null, SWT.BOLD));
+ Token comment = new Token(new TextAttribute( COMMENT_COLOR ));
+
+ //add tokens for each reserved word
+ SectionElementType[] engineDefaultsElements = ConfigUtil.getAllowedEngineDefaultsSectionElements();
+ for ( int i = 0; i < engineDefaultsElements.length; i++) {
+ rule.addWord( ConfigUtil.getEngineDefaultsSectionElementTag(engineDefaultsElements[ i ]),
+ keyword );
+ }
+
+ SectionElementType[] loggerDefaultsElements = ConfigUtil.getAllowedLoggerDefaultsSectionElements();
+ for ( int i = 0; i < loggerDefaultsElements.length; i++) {
+ rule.addWord( ConfigUtil.getLoggerDefaultsSectionElementTag(loggerDefaultsElements[ i ]),
+ keyword );
+ }
+
+ SectionElementType[] moduleElements = ConfigUtil.getAllowedModuleSectionElements();
+ for ( int i = 0; i < moduleElements.length; i++) {
+ rule.addWord( ConfigUtil.getModuleSectionElementTag(moduleElements[ i ]), keyword );
+ }
+
+ setRules(new IRule[] {
+ rule,
+ new SingleLineRule("[", "]", section ),
+ new EndOfLineRule("#", comment ),
+ new EndOfLineRule("\\\\", comment ),
+ new WhitespaceRule(new IWhitespaceDetector() {
+ public boolean isWhitespace(char c) {
+ return Character.isWhitespace(c);
+ }
+ }),
+ });
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configeditor/editors/ModulesTreeContentProvider.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configeditor.editors;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+/**
+ * Provides content for modules tree control.
+ *
+ */
+public class ModulesTreeContentProvider implements ITreeContentProvider
+{
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+ */
+ public Object[] getChildren(Object parentElement) {
+ if ( parentElement instanceof ModulesTreeNode ) {
+ return ((ModulesTreeNode)parentElement).getChildrens().toArray();
+
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+ */
+ public Object getParent(Object element) {
+ if ( element instanceof ModulesTreeNode ) {
+ return ((ModulesTreeNode)element).getParent();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+ */
+ public boolean hasChildren(Object element) {
+ if ( element instanceof ModulesTreeNode ) {
+ return ((ModulesTreeNode)element).hasChildren();
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ public void dispose() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configeditor/editors/ModulesTreeLabelProvider.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configeditor.editors;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.graphics.Image;
+
+import com.nokia.testfw.stf.configmanager.SectionElementType;
+
+/**
+ * Provides labels for modules tree nodes.
+ *
+ */
+public class ModulesTreeLabelProvider implements ILabelProvider {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+ */
+ public Image getImage(Object element) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ public String getText(Object element) {
+ if ( element instanceof ModulesTreeNode ) {
+ ModulesTreeNode node = (ModulesTreeNode)element;
+ if ( node.getType() == SectionElementType.MODULE_NAME ) {
+ return node.getValue();
+ } else if ( node.getType() == SectionElementType.INI_FILE ) {
+ return "IniFile= " + node.getValue();
+ } else if ( node.getType() == SectionElementType.TEST_CASE_FILE ) {
+ return "TestCaseFile= " + node.getValue();
+ }
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
+ */
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+ */
+ public void dispose() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
+ */
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
+ */
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configeditor/editors/ModulesTreeNode.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,197 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configeditor.editors;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.nokia.testfw.stf.configmanager.SectionElementType;
+
+/**
+ * Modules tree node
+ *
+ */
+public class ModulesTreeNode {
+ /**
+ * Node type
+ */
+ private SectionElementType type;
+ /**
+ * Node value
+ */
+ private String value;
+ /**
+ * Index in config source.
+ *
+ * Depens on node <code>type</code> it represents module index in config
+ * file or testcase file entry index in <code>[New_Module]...[End_Module]</code>
+ * section of config file.
+ */
+ private int index;
+ /**
+ * Parent node
+ */
+ ModulesTreeNode parent = null;
+ /**
+ * List of node childrens
+ */
+ private List<ModulesTreeNode> childrens = null;
+ /**
+ * Creates node
+ */
+ public ModulesTreeNode() {
+ childrens = new ArrayList<ModulesTreeNode>();
+ }
+
+ /**
+ * Creates node
+ * @param parent parent node
+ */
+ public ModulesTreeNode(ModulesTreeNode parent) {
+ childrens = new ArrayList<ModulesTreeNode>();
+ if ( parent != null ) {
+ this.parent = parent;
+ parent.childrens.add(this);
+ }
+ }
+
+ /**
+ * Gets node childrens
+ * @return list of node childrens
+ */
+ public List<ModulesTreeNode> getChildrens() {
+ return childrens;
+ }
+
+ /**
+ * Adds child node
+ * @param node child node to add
+ */
+ public void addChildren( ModulesTreeNode node ) {
+ if ( node != null ) {
+ node.parent = this;
+ childrens.add( node );
+ }
+ }
+
+ /**
+ * Removes child node
+ * @param node node to remove
+ */
+ public void removeChildrean( ModulesTreeNode node ) {
+ childrens.remove( node );
+ node.parent = null;
+ }
+
+ /**
+ * Disposes node
+ */
+ public void dispose() {
+ if ( parent != null ) {
+ parent.childrens.remove(this);
+ this.parent = null;
+ }
+ }
+
+ /**
+ * Gets index value
+ * @return index value
+ */
+ public int getIndex() {
+ return index;
+ }
+
+ /**
+ * Sets new index value
+ * @param index new index value
+ */
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+ /**
+ * Gets parent node
+ * @return parent node
+ */
+ public ModulesTreeNode getParent() {
+ return parent;
+ }
+
+ /**
+ * Sets new parent node
+ * @param parent parent node
+ */
+ public void setParent( ModulesTreeNode parent ) {
+ if ( parent != null ) {
+ this.parent = parent;
+ parent.childrens.add( this );
+ }
+ }
+
+ /**
+ * Gets node type
+ * @return node type
+ */
+ public SectionElementType getType() {
+ return type;
+ }
+
+ /**
+ * Sets new node type value
+ * @param type new node type value
+ */
+ public void setType(SectionElementType type) {
+ this.type = type;
+ }
+
+ /**
+ * Gets node value
+ * @return node value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets new node value
+ * @param value new node value
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Checks if node has childreans
+ * @return <b><code>true</code></b> if node has childrens, <b><code>false</code></b>
+ * if node does not have childrens
+ */
+ public boolean hasChildren() {
+ if ( ( childrens != null ) && ( childrens.size() != 0 ) ) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Removes all children nodes
+ */
+ public void removeAllChildreans() {
+ childrens = new ArrayList<ModulesTreeNode>();
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configeditor/wizards/HelpContextIDs.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configeditor.wizards;
+
+/**
+ * New module wizard
+ *
+ */
+
+public class HelpContextIDs {
+ private static final String helpIndex = "com.nokia.s60tools.stif.help";
+ public static final String helpForConfigurationFileWizard = helpIndex + ".Configuration_File_Wizard";
+ public static final String helpForConfigurationFileEditor = helpIndex + ".Configuration_File_Editor";
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configeditor/wizards/NewModuleWizard.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configeditor.wizards;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import com.nokia.testfw.stf.configeditor.Activator;
+import com.nokia.testfw.stf.configmanager.ConfigManager;
+
+/**
+ * New module wizard
+ *
+ */
+public class NewModuleWizard extends Wizard implements INewWizard {
+ /**
+ * Wizard page
+ */
+ private NewModuleWizardPage page = null;
+ /**
+ * Workbench selection
+ */
+ private ISelection selection = null;
+ /**
+ * STIF config manager
+ */
+ private ConfigManager configManager = null;
+
+ /**
+ * Creates wizard
+ */
+ public NewModuleWizard( ConfigManager configManager ) {
+ super();
+ ImageDescriptor imgDesc = Activator.getImageDescriptor("icons/stif_bannered.png");
+ setDefaultPageImageDescriptor( imgDesc );
+ setNeedsProgressMonitor(true);
+ this.configManager = configManager;
+ }
+
+ /**
+ * Adds page to the wizard.
+ */
+ public void addPages() {
+ page = new NewModuleWizardPage(selection);
+ addPage(page);
+ }
+
+ /**
+ * This method is called when 'Finish' button is pressed in
+ * the wizard. We will create an operation and run it
+ * using wizard as execution context.
+ */
+ public boolean performFinish() {
+ final String moduleName = page.getModuleName();
+ IRunnableWithProgress op = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException {
+ doFinish( moduleName, monitor);
+ monitor.done();
+ }
+ };
+ try {
+ getContainer().run(true, false, op);
+ } catch (InterruptedException e) {
+ return false;
+ } catch (InvocationTargetException e) {
+ Throwable realException = e.getTargetException();
+ MessageDialog.openError(getShell(), "Error", realException.getMessage());
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Executes add module operation
+ * @param moduleName module names
+ * @param monitor progress monitor
+ */
+ private void doFinish( String moduleName, IProgressMonitor monitor) {
+ // create a sample file
+ monitor.beginTask("Adding module:" + moduleName, 1);
+ configManager.addModule(moduleName);
+ monitor.worked(1);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ }
+
+ /**
+ * Gets module name
+ * @return module name
+ */
+ public String getModuleName() {
+ if ( page!= null ) {
+ return page.getModuleName();
+ }
+ return null;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configeditor/wizards/NewModuleWizardPage.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,178 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configeditor.wizards;
+
+import org.eclipse.jface.dialogs.IPageChangedListener;
+import org.eclipse.jface.dialogs.PageChangedEvent;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+/**
+ * New module wizard page
+ *
+ */
+public class NewModuleWizardPage extends WizardPage implements IPageChangedListener {
+ private Text otherNameValue = null;
+ private Button testScripterButton = null;
+ //private Button testCombinerButton = null;
+ private Button otherNameButton = null;
+
+ ISelection selection = null;
+
+ /**
+ * Creates wizard page
+ * @param Workbench selection
+ */
+ public NewModuleWizardPage(ISelection selection) {
+ super("wizardPage");
+ setTitle("New module");
+ setDescription("This wizard creates a new module entry in initialization file of STF.");
+ this.selection = selection;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite mainPanel = new Composite(parent, SWT.NULL);
+ TableWrapLayout mainPanelLayout = new TableWrapLayout();
+ mainPanel.setLayout(mainPanelLayout);
+ mainPanelLayout.numColumns = 2;
+
+ testScripterButton = new Button(mainPanel, SWT.RADIO);
+ testScripterButton.setText("TestScripter");
+ testScripterButton.setSelection( true );
+ TableWrapData testScripterButtonLayoutData = new TableWrapData( TableWrapData.FILL_GRAB );
+ testScripterButtonLayoutData.colspan = 2;
+ testScripterButton.setLayoutData( testScripterButtonLayoutData );
+
+// testCombinerButton = new Button(mainPanel, SWT.RADIO);
+// testCombinerButton.setText("TestCombiner");
+// TableWrapData testCombinerButtonLayoutData = new TableWrapData( TableWrapData.FILL_GRAB );
+// testCombinerButtonLayoutData.colspan = 2;
+// testCombinerButton.setLayoutData( testCombinerButtonLayoutData );
+
+ otherNameButton = new Button(mainPanel, SWT.RADIO);
+ otherNameButton.setText("Other:");
+
+ otherNameValue = new Text(mainPanel, SWT.BORDER | SWT.SINGLE);
+ otherNameValue.setEnabled( false );
+ otherNameValue.setLayoutData( new TableWrapData(TableWrapData.FILL_GRAB) );
+
+ SelectionListener selectEventHandler = new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ dialogChanged();
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ dialogChanged();
+ }};
+
+ testScripterButton.addSelectionListener(selectEventHandler);
+// testCombinerButton.addSelectionListener(selectEventHandler);
+ otherNameButton.addSelectionListener(selectEventHandler);
+ otherNameValue.addModifyListener( new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ dialogChanged();
+ }});
+
+ initialize();
+ dialogChanged();
+ setControl(mainPanel);
+
+ /**
+ * We want to be informed about pageChanged event in order to set focus to a control from the NewTestModulePage
+ */
+ WizardDialog dialog = (WizardDialog)getContainer();
+ dialog.addPageChangedListener(this);
+
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this.getControl(), HelpContextIDs.helpForConfigurationFileEditor);;
+ }
+
+ /**
+ * Tests if the current workbench selection is a suitable container to use.
+ */
+ private void initialize() {
+ }
+
+ /**
+ * Ensures that proper module name is defined
+ */
+ private void dialogChanged() {
+ if ( testScripterButton.getSelection() == true ) {
+ otherNameValue.setEnabled(false);
+ updateStatus(null);
+ }
+// if ( testCombinerButton.getSelection() == true ) {
+// otherNameValue.setEnabled(false);
+// updateStatus(null);
+// }
+ if ( otherNameButton.getSelection() == true ) {
+ otherNameValue.setEnabled(true);
+ if ( otherNameValue.getText() == "" ) {
+ updateStatus( "Module name must be specified." );
+ } else {
+ updateStatus(null);
+ }
+ }
+
+ }
+
+ /**
+ * Updates wizard execution status
+ * @param message
+ */
+ private void updateStatus(String message) {
+ setErrorMessage(message);
+ setPageComplete(message == null);
+ }
+
+ /**
+ * Gets new module name
+ * @return module name
+ */
+ public String getModuleName() {
+ if ( testScripterButton.getSelection() == true ) {
+ return "testscripter";
+ } /*else if ( testCombinerButton.getSelection() == true ) {
+ return "testcombiner";
+ } */else if ( otherNameButton.getSelection() == true ) {
+ return otherNameValue.getText();
+ }
+ return null;
+ }
+
+ public void pageChanged(PageChangedEvent ev) {
+ if(ev.getSelectedPage() instanceof NewModuleWizardPage){
+ otherNameButton.setFocus();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configeditor/wizards/NewStifConfigWizard.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,182 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configeditor.wizards;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+
+import com.nokia.testfw.stf.configeditor.Activator;
+
+/**
+ * New STIF configuration file wizard
+ *
+ */
+public class NewStifConfigWizard extends Wizard implements INewWizard {
+ /**
+ * Wizard page
+ */
+ private NewStifConfigWizardPage page;
+ /**
+ * Workbench selection
+ */
+ private ISelection selection;
+
+ /**
+ * Creates NewStifConfigWizard.
+ */
+ public NewStifConfigWizard() {
+ super();
+ ImageDescriptor imgDesc = Activator.getImageDescriptor("icons/stif_bannered.png");
+ setDefaultPageImageDescriptor( imgDesc );
+ setNeedsProgressMonitor(true);
+ }
+
+ /**
+ * Adds page to the wizard.
+ */
+ public void addPages() {
+ page = new NewStifConfigWizardPage(selection);
+ addPage(page);
+ }
+
+ /**
+ * This method is called when 'Finish' button is pressed in
+ * the wizard. We will create an operation and run it
+ * using wizard as execution context.
+ */
+ public boolean performFinish() {
+ final String containerName = page.getContainerName();
+ final String fileName = page.getFileName();
+ IRunnableWithProgress op = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException {
+ try {
+ doFinish(containerName, fileName, monitor);
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+ try {
+ getContainer().run(true, false, op);
+ } catch (InterruptedException e) {
+ return false;
+ } catch (InvocationTargetException e) {
+ Throwable realException = e.getTargetException();
+ MessageDialog.openError(getShell(), "Error", realException.getMessage());
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * The worker method. It will find the container, create the
+ * file if missing or just replace its contents, and open
+ * the editor on the newly created file.
+ */
+ private void doFinish(
+ String containerName,
+ String fileName,
+ IProgressMonitor monitor)
+ throws CoreException {
+ // create a sample file
+ monitor.beginTask("Creating " + fileName, 2);
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IResource resource = root.findMember(new Path(containerName));
+ if (!resource.exists() || !(resource instanceof IContainer)) {
+ throwCoreException("Container \"" + containerName + "\" does not exist.");
+ }
+ IContainer container = (IContainer) resource;
+ final IFile file = container.getFile(new Path(fileName));
+ try {
+ InputStream stream = openContentStream();
+ if (file.exists()) {
+ file.setContents(stream, true, true, monitor);
+ } else {
+ file.create(stream, true, monitor);
+ }
+ stream.close();
+ } catch (IOException e) {
+ }
+ monitor.worked(1);
+ monitor.setTaskName("Opening file for editing...");
+ getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ IWorkbenchPage page =
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ try {
+ IDE.openEditor(page, file, true);
+ } catch (PartInitException e) {
+ }
+ }
+ });
+ monitor.worked(1);
+ }
+
+ /**
+ * Initialize file contents with a sample text.
+ */
+ private InputStream openContentStream() {
+ InputStream is = getClass().getResourceAsStream("/TestFramework.ini");
+ return is;
+ }
+
+ /**
+ * Throws core exception
+ * @param message exception message
+ * @throws CoreException throwed exception
+ */
+ private void throwCoreException(String message) throws CoreException {
+ IStatus status =
+ new Status(IStatus.ERROR, "com.nokia.s60tools.stif.configeditor", IStatus.OK, message, null);
+ throw new CoreException(status);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configeditor/wizards/NewStifConfigWizardPage.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,283 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configeditor.wizards;
+
+import java.io.File;
+
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ISourceRoot;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.IPageChangedListener;
+import org.eclipse.jface.dialogs.PageChangedEvent;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+
+//import com.nokia.testfw.codegen.ui.Messages;
+
+/**
+ * The "New" wizard page allows setting the container for the new file as well
+ * as the file name. The page will only accept file name without the extension
+ * OR with the extension that matches the expected one (ini).
+ */
+public class NewStifConfigWizardPage extends WizardPage implements IPageChangedListener {
+ /**
+ * Container name
+ */
+ private Text containerText;
+ /**
+ * File name
+ */
+ private Text fileText;
+ /**
+ * Workbench selection
+ */
+ private ISelection selection;
+ /**
+ * File name prefix
+ */
+ private static final String filenamepre = "TestFramework_";
+
+ /**
+ * Creates wizard page
+ * @param selection Workbench selection
+ */
+ public NewStifConfigWizardPage(ISelection selection) {
+ super("wizardPage");
+ setTitle("New STF config file");
+ setDescription("This wizard creates a new STF config file.");
+ this.selection = selection;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ container.setLayout(layout);
+ layout.numColumns = 3;
+ layout.verticalSpacing = 9;
+
+ Label label = new Label(container, SWT.NULL);
+ label.setText("&Container:");
+
+ containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ containerText.setLayoutData(gd);
+ containerText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ dialogChanged(true);
+ }
+ });
+
+ Button button = new Button(container, SWT.PUSH);
+ button.setText("Browse...");
+ button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleBrowse();
+ }
+ });
+ label = new Label(container, SWT.NULL);
+ label.setText("&File name:");
+
+ fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ fileText.setLayoutData(gd);
+ fileText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ dialogChanged(false);
+ }
+ });
+ initialize();
+ dialogChanged(false);
+ setControl(container);
+
+ /**
+ * We want to be informed about pageChanged event in order to set focus to a control from the NewTestModulePage
+ */
+ WizardDialog dialog = (WizardDialog)getContainer();
+ dialog.addPageChangedListener(this);
+
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this.getControl(), HelpContextIDs.helpForConfigurationFileWizard);
+ }
+
+ /**
+ * Tests if the current workbench selection is a suitable container to use.
+ */
+ private void initialize() {
+ IStructuredSelection ssel = (IStructuredSelection) selection;
+ Object obj = null;
+ String projectname = null;
+ if (selection != null && selection.isEmpty() == false
+ && selection instanceof IStructuredSelection) {
+
+ if (ssel.size() > 1)
+ return;
+ obj = ssel.getFirstElement();
+ if (obj instanceof IResource) {
+ IContainer container;
+ if (obj instanceof IContainer)
+ container = (IContainer) obj;
+ else
+ container = ((IResource) obj).getParent();
+ projectname = container.getProject().getName();
+ containerText.setText(container.getFullPath().toString());
+ }
+ if(obj instanceof ISourceRoot){
+ projectname = ((ISourceRoot) obj).getCProject().toString();
+ containerText.setText(((ISourceRoot) obj).getPath().toString());
+ }
+ if(obj instanceof ICElement){
+ projectname = ((ICElement) obj).getElementName();
+ containerText.setText(((ICElement) obj).getPath().toString());
+ }
+
+ }
+ if(obj == null || projectname == null){
+ fileText.setText(filenamepre);
+ return;
+ }
+
+ if(projectname.length()>0){
+ fileText.setText(filenamepre+projectname);
+ }
+ }
+
+ /**
+ * Uses the standard container selection dialog to choose the new value for
+ * the container field.
+ */
+ private void handleBrowse() {
+ ContainerSelectionDialog dialog = new ContainerSelectionDialog(
+ getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
+ "Select new file container");
+ if (dialog.open() == ContainerSelectionDialog.OK) {
+ Object[] result = dialog.getResult();
+ if (result.length == 1) {
+ containerText.setText(((Path) result[0]).toString());
+ }
+ }
+ }
+
+ /**
+ * Ensures that both text fields are set.
+ */
+ private void dialogChanged(boolean aConNameChangeFlag) {
+ IResource container = ResourcesPlugin.getWorkspace().getRoot()
+ .findMember(new Path(getContainerName()));
+ String fileName = getNoExtFileName();
+ String projectname = null;
+
+ if (getContainerName().length() == 0) {
+ updateStatus("File container must be specified or wrong file container");
+ return;
+ }
+ if (container == null
+ || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
+ updateStatus("File container must exist");
+ return;
+ }
+ if (!container.isAccessible()) {
+ updateStatus("Project must be writable");
+ return;
+ }
+ if (fileName.length() == 0) {
+ updateStatus("File name must be specified");
+ return;
+ }
+ if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
+ updateStatus("File name must be valid");
+ return;
+ }
+ int dotLoc = fileName.indexOf(".");
+ if (dotLoc != -1) {
+ updateStatus("File name must be valid");
+ return;
+ }
+
+ projectname = container.getProject().getName();
+
+ if(aConNameChangeFlag == true){
+ if(fileName.compareTo(filenamepre + projectname) != 0){
+ fileName = filenamepre + projectname;
+ fileText.setText(filenamepre + projectname);
+ }
+ }
+
+ File file = new File(container.getLocation().append(fileName).toString()+".ini");
+ if(file.exists()){
+ updateStatus("File already exist");
+ return;
+ }
+ updateStatus(null);
+ }
+
+ /**
+ * Updates progress status
+ * @param message progress message
+ */
+ private void updateStatus(String message) {
+ setErrorMessage(message);
+ setPageComplete(message == null);
+ }
+
+ /**
+ * Gets container name
+ * @return container name
+ */
+ public String getContainerName() {
+ return containerText.getText();
+ }
+
+ /**
+ * Gets file name
+ * @return file name
+ */
+ public String getFileName() {
+ return fileText.getText()+".ini";
+ }
+
+ public String getNoExtFileName() {
+ return fileText.getText();
+ }
+
+ public void pageChanged(PageChangedEvent ev) {
+ if(ev.getSelectedPage() instanceof NewStifConfigWizardPage){
+ containerText.setFocus();
+ }
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configmanager/ConfigDefaults.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,333 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configmanager;
+
+/**
+ * STIF config defaults.
+ *
+ * Defines STIF configuration file elemens default value.
+ *
+ */
+public class ConfigDefaults {
+ /**
+ * <code>HardwareLogOutput</code> default value
+ */
+ private static final OutputType DEFAULT_HARDWARE_LOG_OUTPUT = OutputType.FILE;
+ /**
+ * <code>HardwareLogFormat</code> default value
+ */
+ private static final OutputFileFormat DEFAULT_HARDWARE_LOG_FORMAT = OutputFileFormat.HTML;
+ /**
+ * <code>EmulatorLogOutput</code> default value
+ */
+ private static final OutputType DEFAULT_EMULATOR_LOG_OUTPUT = OutputType.FILE;
+ /**
+ * <code>EmulatorLogFormat</code> default value
+ */
+ private static final OutputFileFormat DEFAULT_EMULATOR_LOG_FORMAT = OutputFileFormat.TXT;
+ /**
+ * <code>LogFileCreationMode</code> default value
+ */
+ private static final FileCreationMode DEFAULT_LOG_FILE_CREATION_MODE = FileCreationMode.OVERWRITE;
+ /**
+ * <code>HardwareLogBasePath</code> default value
+ */
+ private static final String DEFAULT_HARDWARE_LOG_BASE_PATH = "C:\\LOGS\\TestFramework\\";
+ /**
+ * <code>EmulatorLogBasePath</code> default value
+ */
+ private static final String DEFAULT_EMULATOR_LOG_BASE_PATH = "C:\\LOGS\\TestFramework\\";
+ /**
+ * <code>LogFileUnicode</code> default value
+ */
+ private static final YesNo DEFAULT_LOG_FILE_UNICODE = YesNo.NO;
+ /**
+ * <code>LogWithEventRanking</code> default value
+ */
+ private static final YesNo ADD_TESTCASE_TITLE = YesNo.NO;
+ /**
+ * <code>AddTestCaseTitle</code> default value
+ */
+ private static final YesNo DEFAULT_LOG_WITH_EVENT_RANKING = YesNo.YES;
+ /**
+ * <code>LogWithLineBreak</code> default value
+ */
+ private static final YesNo DEFAULT_LOG_WITH_LINE_BREAK = YesNo.YES;
+ /**
+ * <code>LogWithTimeStamp</code> default value
+ */
+ private static final YesNo DEFAULT_LOG_WITH_TIME_STAMP = YesNo.YES;
+ /**
+ * <code>ThreadIdToFile</code> default value
+ */
+ private static final YesNo DEFAULT_THREAD_ID_TO_LOG_FILE = YesNo.YES;
+ /**
+ * <code>CreateLogDirectories</code> default value
+ */
+ private static final YesNo DEFAULT_CREATE_LOG_DIRECTORIES = YesNo.YES;
+ /**
+ * <code>DisableMeasurment</code> default value
+ */
+ private static final MeasurementModule DEFAULT_DISABLE_MEASUREMENT = MeasurementModule.STIF_MEASUREMENT_DISABLE_NONE;
+ /**
+ * <code>TestReportFormat</code> default value
+ */
+ private static final OutputFileFormat DEFAULT_TEST_REPORT_FORMAT = OutputFileFormat.TXT;
+ /**
+ * <code>TestReportMode</code> default value
+ */
+ private static final TestReportMode DEFAULT_TEST_RAPORT_MODE = TestReportMode.FULL_REPORT;
+ /**
+ * <code>CreateTestReport</code> default value
+ */
+ private static final YesNo DEFAULT_CREATE_TEST_RAPORT = YesNo.YES;
+ /**
+ * <code>TestReportFilePath</code> default value
+ */
+ private static final String DEFAULT_TEST_RAPORT_FILE_PATH = "C:\\LOGS\\TestFramework\\";
+ /**
+ * <code>TestReportFileName</code> default value
+ */
+ private static final String DEFAULT_TEST_RAPORT_FILE_NAME = "TestReport";
+ /**
+ * <code>TestReportOutput</code> default value
+ */
+ private static final OutputType DEFAULT_TEST_REPORT_OUTPUT = OutputType.FILE;
+ /**
+ * <code>TestReportFileCreationMode</code> default value
+ */
+ private static final FileCreationMode DEFAULT_TEST_RAPORT_FILE_CREATION_MODE = FileCreationMode.OVERWRITE;
+ /**
+ * <code>DeviceResetDllName</code> default value
+ */
+ private static final String DEFAULT_DEVICE_RESET_DLL_NAME = "StifResetForNokia.dll";
+ /**
+ * <code>Timeout</code> default value
+ */
+ private static final Integer DEFAULT_TIMEOUT = new Integer( 0 );
+
+ /**
+ * Gets <code>TestReportMode</code> default value
+ * @return <code>TestReportMode</code> default value
+ */
+ public static TestReportMode getTestReportModeDefaultValue() {
+ return DEFAULT_TEST_RAPORT_MODE;
+ }
+
+ /**
+ * Gets <code>CreateTestReport</code> default value
+ * @return <code>CreateTestReport</code> default value
+ */
+ public static YesNo getCreateTestReportDefaultValue() {
+ return DEFAULT_CREATE_TEST_RAPORT;
+ }
+
+ /**
+ * Gets <code>TestReportFileName</code> default value
+ * @return <code>TestReportFileName</code> default value
+ */
+ public static String getTestReportFileNameDefaultValue() {
+ return DEFAULT_TEST_RAPORT_FILE_NAME;
+ }
+
+ /**
+ * Gets <code>TestReportFilePath</code> default value
+ * @return <code>TestReportFilePath</code> default value
+ */
+ public static String getTestReportFilePathDefaultValue() {
+ return DEFAULT_TEST_RAPORT_FILE_PATH;
+ }
+
+ /**
+ * Gets <code>TestReportFormat</code> default value
+ * @return <code>TestReportFormat</code> default value
+ */
+ public static OutputFileFormat getTestReportFormatDefaultValue() {
+ return DEFAULT_TEST_REPORT_FORMAT;
+ }
+
+ /**
+ * Gets <code>TestReportOutput</code> default value
+ * @return <code>TestReportOutput</code> default value
+ */
+ public static OutputType getTestReportOutputDefaultValue() {
+ return DEFAULT_TEST_REPORT_OUTPUT;
+ }
+
+ /**
+ * Gets <code>TestReportFileCreationMode</code> default value
+ * @return <code>TestReportFileCreationMode</code> default value
+ */
+ public static FileCreationMode getTestReportFileCreationModeDefaultValue() {
+ return DEFAULT_TEST_RAPORT_FILE_CREATION_MODE;
+ }
+
+ /**
+ * Gets <code>DeviceResetDllName</code> default value
+ * @return <code>DeviceResetDllName</code> default value
+ */
+ public static String getDeviceResetDllNameDefaultValue() {
+ return DEFAULT_DEVICE_RESET_DLL_NAME;
+ }
+
+ /**
+ * Gets <code>Timeout</code> default value
+ * @return <code>Timeout</code> default value
+ */
+ public static Integer getTimeoutDefaultValue() {
+ return DEFAULT_TIMEOUT;
+ }
+
+ /**
+ * Gets <code>DisableMeasurement</code> default value
+ * @return <code>DisableMeasurement</code> default value
+ */
+ public static MeasurementModule getDisableMeasurementDefaultValue() {
+ return DEFAULT_DISABLE_MEASUREMENT;
+ }
+
+ /**
+ * Gets <code>CreateLogDirectories</code> default value
+ * @return <code>CreateLogDirectories</code> default value
+ */
+ public static YesNo getCreateLogDirectoriesDefaultValue() {
+ return DEFAULT_CREATE_LOG_DIRECTORIES;
+ }
+
+ /**
+ * Gets <code>ThreadIdToLogFile</code> default value
+ * @return <code>ThreadIdToLogFile</code> default value
+ */
+ public static YesNo getThreadIdToLogFileDefaultValue() {
+ return DEFAULT_THREAD_ID_TO_LOG_FILE;
+ }
+
+ /**
+ * Gets <code>WithTimeStamp</code> default value
+ * @return <code>WithTimeStamp</code> default value
+ */
+ public static YesNo getWithTimeStampDefaultValue() {
+ return DEFAULT_LOG_WITH_TIME_STAMP;
+ }
+
+ /**
+ * Gets <code>WithLineBreak</code> default value
+ * @return <code>WithLineBreak</code> default value
+ */
+ public static YesNo getWithLineBreakDefaultValue() {
+ return DEFAULT_LOG_WITH_LINE_BREAK;
+ }
+
+ /**
+ * Gets <code>WithEventRanking</code> default value
+ * @return <code>WithEventRanking</code> default value
+ */
+ public static YesNo getWithEventRankingDefaultValue() {
+ return DEFAULT_LOG_WITH_EVENT_RANKING;
+ }
+
+ /**
+ * Gets <code>FileUnicode</code> default value
+ * @return <code>FileUnicode</code> default value
+ */
+ public static YesNo getFileUnicodeDefaultValue() {
+ return DEFAULT_LOG_FILE_UNICODE;
+ }
+
+ /**
+ * Gets <code>AddTestCaseTitle</code> default value
+ * @return <code>AddTestCaseTitle</code> default value
+ */
+ public static YesNo getAddTestCaseTitleDefaultValue() {
+ return ADD_TESTCASE_TITLE;
+ }
+
+ /**
+ * Gets <code>EmulatorBasePath</code> default value
+ * @return <code>EmulatorBasePath</code> default value
+ */
+ public static String getEmulatorBasePathDefaultValue() {
+ return DEFAULT_EMULATOR_LOG_BASE_PATH;
+ }
+
+ /**
+ * Gets <code>HardwareBasePath</code> default value
+ * @return <code>HardwareBasePath</code> default value
+ */
+ public static String getHardwareBasePathDefaultValue() {
+ return DEFAULT_HARDWARE_LOG_BASE_PATH;
+ }
+
+ /**
+ * Gets <code>LogFileCreationMode</code> default value
+ * @return <code>LogFileCreationMode</code> default value
+ */
+ public static FileCreationMode getLogFileCreationModeDefaultValue() {
+ return DEFAULT_LOG_FILE_CREATION_MODE;
+ }
+
+ /**
+ * Gets <code>EmulatorLogFormat</code> default value
+ * @return <code>EmulatorLogFormat</code> default value
+ */
+ public static OutputFileFormat getEmulatorLogFormatDefaultValue() {
+ return DEFAULT_EMULATOR_LOG_FORMAT;
+ }
+
+ /**
+ * Gets <code>EmulatorLogOutput</code> default value
+ * @return <code>EmulatorLogOutput</code> default value
+ */
+ public static OutputType getEmulatorLogOutputDefaultValue() {
+ return DEFAULT_EMULATOR_LOG_OUTPUT;
+ }
+
+ /**
+ * Gets <code>HardwareLogFormat</code> default value
+ * @return <code>HardwareLogFormat</code> default value
+ */
+ public static OutputFileFormat getHardwareLogFormatDefaultValue() {
+ return DEFAULT_HARDWARE_LOG_FORMAT;
+ }
+
+ /**
+ * Gets <code>HardwareLogOutput</code> default value
+ * @return <code>HardwareLogOutput</code> default value
+ */
+ public static OutputType getHardwareLogOutputDefaultValue() {
+ return DEFAULT_HARDWARE_LOG_OUTPUT;
+ }
+
+ /**
+ * Gets <code>UITestingSupport</code> default value
+ * @return <code>UITestingSupport</code> default value
+ */
+ public static YesNo getUITestingSupportDefaultValue(){
+ return YesNo.YES;
+ }
+
+ /**
+ * Gets <code>SeparateProcesses</code> default value
+ * @return <code>SeparateProcesses</code> default value
+ */
+ public static YesNo getSeparateProcessesDefaultValue(){
+ return YesNo.YES;
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configmanager/ConfigManager.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1547 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configmanager;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+
+
+/**
+ * STIF configuration file menagment tool
+ *
+ */
+public class ConfigManager {
+
+ /**
+ * STIF configuration file section standard representation
+ *
+ */
+ private static class Section {
+ /**
+ * Section begin line number
+ */
+ public int beginLine = -1;
+ /**
+ * Section end line number
+ */
+ public int endLine = -1;
+ /**
+ * List of section elements
+ */
+ public ArrayList<SectionElement> elements = null;
+ }
+
+ /**
+ * STIF configuration file module section representation
+ *
+ */
+ private static class ModuleSection {
+ /**
+ * Section begine line number
+ */
+ public int beginLine = -1;
+ /**
+ * Section end line number
+ */
+ public int endLine = -1;
+ /**
+ * Module name element
+ */
+ SectionElement name = null;
+ /**
+ * Module ini file element
+ */
+ SectionElement iniFile = null;
+ /**
+ * List of module testcase files
+ */
+ public ArrayList<SectionElement> testCaseFiles = null;
+ }
+
+ /**
+ * STIF configuration file section element representation
+ *
+ */
+ private static class SectionElement {
+
+ /**
+ * Element line number
+ */
+ public int lineNumber = -1;
+ /**
+ * Element type
+ */
+ public SectionElementType type = SectionElementType.UNDEFINED;
+ /**
+ * Element value
+ */
+ public String value = "";
+ }
+
+ /**
+ * Module section type id
+ */
+ private static final int MODULE_SECTION = 3;
+ /**
+ * Logger defaults section id
+ */
+ private static final int LOGGER_DEFAULTS_SECTION = 2;
+ /**
+ * Engine defaults section id
+ */
+ private static final int ENGINE_DEFAULTS_SECTION = 1;
+ /**
+ * Element outside section id
+ */
+ private static final int OUTSIDE_SECTION = 0;
+ /**
+ * Engine defaults section begine tag
+ */
+ private static final String ENGINE_DEFAULTS_SECTION_BEGIN_TAG = "[Engine_Defaults]";
+ /**
+ * Engine defaults section end tag
+ */
+ private static final String ENGINE_DEFAULTS_SECTION_END_TAG = "[End_Defaults]";
+ /**
+ * Module section begine tag
+ */
+ private static final String MODULE_SECTION_BEGIN_TAG = "[New_Module]";
+ /**
+ * Module sectio end tag
+ */
+ private static final String MODULE_SECTION_END_TAG = "[End_Module]";
+ /**
+ * Logger defaults section begine tag
+ */
+ private static final String LOGGER_DEFAULTS_SECTION_BEGIN_TAG = "[Logger_Defaults]";
+ /**
+ * Logger defaults section end tag
+ */
+ private static final String LOGGER_DEFAULTS_SECTION_END_TAG = "[End_Logger_Defaults]";
+ /**
+ * Configuration file source
+ */
+ private String configSource = null;
+ /**
+ * List of modules present in configuration file
+ */
+ private ArrayList<ModuleSection> modules = null;
+ /**
+ * Representation of engine defaults section present in configuration file
+ */
+ private Section engineDefaults = null;
+ /**
+ * Representation of logger defaults section present in configuration file
+ */
+ private Section loggerDefaults = null;
+ /**
+ * List of problems which apperas during configuration file parsing
+ */
+ private ArrayList<ParseProblem> parseProblems = null;
+
+ /**
+ * Parese STIF configuration file
+ * @param config configuration file source
+ */
+ public void parseConfig( String config )
+ {
+ engineDefaults = new Section();
+ modules = new ArrayList<ModuleSection>();
+ loggerDefaults = new Section();
+ parseProblems = new ArrayList<ParseProblem>();
+ configSource = config;
+
+ // Create config reader to be able to read lines from config
+ BufferedReader configReader = new BufferedReader(new StringReader(configSource));
+
+ // Config parsing
+ int lineNumber = 0;
+ int sectionType = OUTSIDE_SECTION; // Current section type:
+ // 0 - outside section
+ // 1 - Engine defaults section
+ // 2 - Logger defaults section
+ // 3 - Module section
+
+ try {
+ while( true )
+ {
+ // Get line from config
+ String line = configReader.readLine();
+ if ( line == null ) {
+ // End of config, stop parsing
+ break;
+ }
+ // Remove white spaces at the begining end end of line
+
+ line = line.trim();
+ lineNumber++;
+
+ // Remove comments from line
+ int commentStartPos = -1;
+ if( sectionType == OUTSIDE_SECTION )
+ {
+ // Outside section only # comments are allowed
+ commentStartPos = line.indexOf('#');
+ if ( commentStartPos != -1 ) {
+ line = line.substring(0,commentStartPos);
+ }
+ }
+ else
+ {
+ // Inside section # and // comments are allowed
+ commentStartPos = line.indexOf("//");
+ if ( commentStartPos != -1 ) {
+ line = line.substring(0,commentStartPos);
+ }
+ commentStartPos = line.indexOf('#');
+ if ( commentStartPos != -1 ) {
+ line = line.substring(0,commentStartPos);
+ }
+ }
+ // If line is emepty parse next line
+ line = line.trim();
+ if ( line.length() == 0 ) {
+ continue;
+ }
+
+
+ boolean newSectionFound = false;
+ int newSectionType = -1;
+ int tagLength = 0;
+ if(line.startsWith(ENGINE_DEFAULTS_SECTION_BEGIN_TAG)) {
+ newSectionFound = true;
+ newSectionType = ENGINE_DEFAULTS_SECTION;
+ tagLength = ENGINE_DEFAULTS_SECTION_BEGIN_TAG.length();
+ engineDefaults.beginLine = lineNumber;
+ engineDefaults.elements = new ArrayList<SectionElement>();
+ } else if (line.startsWith(LOGGER_DEFAULTS_SECTION_BEGIN_TAG)) {
+ newSectionFound = true;
+ newSectionType = LOGGER_DEFAULTS_SECTION;
+ tagLength = LOGGER_DEFAULTS_SECTION_BEGIN_TAG.length();
+ loggerDefaults.beginLine = lineNumber;
+ loggerDefaults.elements = new ArrayList<SectionElement>();
+ } else if (line.startsWith(MODULE_SECTION_BEGIN_TAG)) {
+ newSectionFound = true;
+ newSectionType = MODULE_SECTION;
+ tagLength = MODULE_SECTION_BEGIN_TAG.length();
+ ModuleSection module = new ModuleSection();
+ module.beginLine = lineNumber;
+ module.testCaseFiles = new ArrayList<SectionElement>();
+ modules.add(module);
+ }
+ if ( newSectionFound == true ) {
+ if ( sectionType != OUTSIDE_SECTION ) {
+ String message = "";
+ if ( sectionType == ENGINE_DEFAULTS_SECTION ) {
+ message = "Engine_Defaults section is not closed";
+ } else if ( sectionType == LOGGER_DEFAULTS_SECTION ) {
+ message = "Logger_Defaults section is not closed";
+ } else if ( sectionType == MODULE_SECTION ) {
+ message = "Module section is not closed";
+ }
+ addParseProblem( ParseProblem.ProblemType.ERROR, lineNumber, message );
+ }
+ sectionType = newSectionType;
+ String afterTag = line.substring(tagLength,line.length());
+ if ( afterTag != null ) {
+ afterTag = afterTag.trim();
+ if ( afterTag.length() != 0 ) {
+ String message = "Unknown text after section definition: " + afterTag;
+ addParseProblem( ParseProblem.ProblemType.WARNING, lineNumber, message );
+ }
+ }
+ continue;
+ } else if ( sectionType == OUTSIDE_SECTION ) {
+ String message = "Unknown section type: " + line;
+ addParseProblem( ParseProblem.ProblemType.ERROR, lineNumber, message );
+ continue;
+ }
+
+ switch( sectionType ) {
+ case ENGINE_DEFAULTS_SECTION:
+ {
+ if (line.startsWith(ENGINE_DEFAULTS_SECTION_END_TAG)) {
+ sectionType = OUTSIDE_SECTION;
+ engineDefaults.endLine = lineNumber;
+ continue;
+ }
+
+ boolean found = false;
+ SectionElementType[] allowedElements = ConfigUtil.getAllowedEngineDefaultsSectionElements();
+ for ( int s = 0; s < allowedElements.length; s ++ ) {
+ String tag = ConfigUtil.getEngineDefaultsSectionElementTag(
+ allowedElements[ s ] );
+ if ( line.startsWith(tag) ) {
+ SectionElement element = new SectionElement();
+ element.type = allowedElements[ s ];
+ element.value = line.substring(tag.length(),line.length()).trim();
+ element.lineNumber = lineNumber;
+ if ( !( ConfigUtil.hasProperValue( element.type, element.value ) ) ) {
+ String message = tag.substring( 0, tag.length() - 1 ) + " - Invalid element value: " + element.value;
+ addParseProblem( ParseProblem.ProblemType.ERROR, lineNumber, message );
+ }
+ engineDefaults.elements.add(element);
+ found = true;
+ break;
+ }
+ }
+ if ( !found ) {
+ String message = "Unknown keyword in Engine_Defaults section: " + line;
+ addParseProblem( ParseProblem.ProblemType.ERROR, lineNumber, message );
+ }
+ }
+ break;
+ case LOGGER_DEFAULTS_SECTION:
+ {
+ if (line.startsWith(LOGGER_DEFAULTS_SECTION_END_TAG)) {
+ sectionType = OUTSIDE_SECTION;
+ loggerDefaults.endLine = lineNumber;
+ continue;
+ }
+
+ boolean found = false;
+ SectionElementType[] allowedElements = ConfigUtil.getAllowedLoggerDefaultsSectionElements();
+ for ( int s = 0; s < allowedElements.length; s ++ ) {
+ String tag = ConfigUtil.getLoggerDefaultsSectionElementTag(
+ allowedElements[ s ] );
+ if ( line.startsWith(tag) ) {
+ SectionElement element = new SectionElement();
+ element.type = allowedElements[ s ];
+ element.value = line.substring(tag.length(),line.length()).trim();
+ element.lineNumber = lineNumber;
+ if ( !( ConfigUtil.hasProperValue( element.type, element.value ) ) ) {
+ String message = tag.substring( 0, tag.length() - 1 ) + " - Invalid element value: " + element.value;
+ addParseProblem( ParseProblem.ProblemType.ERROR, lineNumber, message );
+ }
+ loggerDefaults.elements.add(element);
+ found = true;
+ break;
+ }
+ }
+ if ( !found ) {
+ String message = "Unknown keyword in Logger_Defaults section: " + line;
+ addParseProblem( ParseProblem.ProblemType.ERROR, lineNumber, message );
+ }
+ }
+ break;
+ case MODULE_SECTION:
+ {
+ ModuleSection module = modules.get(modules.size() - 1);
+ if (line.startsWith(MODULE_SECTION_END_TAG)) {
+ sectionType = OUTSIDE_SECTION;
+ if( module != null ) {
+ module.endLine = lineNumber;
+ }
+ continue;
+ }
+
+ boolean found = false;
+ SectionElementType[] allowedElements = ConfigUtil.getAllowedModuleSectionElements();
+ for ( int s = 0; s < allowedElements.length; s ++ ) {
+ String tag = ConfigUtil.getModuleSectionElementTag(
+ allowedElements[ s ] );
+ if ( line.startsWith(tag) ) {
+ SectionElement element = new SectionElement();
+ element.type = allowedElements[ s ];
+ element.value = line.substring(tag.length(),line.length()).trim();
+ element.lineNumber = lineNumber;
+
+ if ( !( ConfigUtil.hasProperValue( element.type, element.value ) ) ) {
+ String message = tag.substring( 0, tag.length() - 1 ) + " - Invalid element value: " + element.value;
+ addParseProblem( ParseProblem.ProblemType.ERROR, lineNumber, message );
+ }
+ if ( element.type == SectionElementType.MODULE_NAME ) {
+ module.name = element;
+ } else if ( element.type == SectionElementType.INI_FILE ) {
+ module.iniFile = element;
+ } else if ( element.type == SectionElementType.TEST_CASE_FILE ) {
+ module.testCaseFiles.add(element);
+ }
+ found = true;
+ break;
+ }
+ }
+ if ( !found ) {
+ String message = "Unknown keyword in New_module section: " + line;
+ addParseProblem( ParseProblem.ProblemType.ERROR, lineNumber, message );
+ }
+ }
+ break;
+ }
+ }
+ if ( sectionType != OUTSIDE_SECTION ) {
+ String message = "";
+ if ( sectionType == ENGINE_DEFAULTS_SECTION ) {
+ message = "Engine_Defaults section is not closed";
+ } else if ( sectionType == LOGGER_DEFAULTS_SECTION ) {
+ message = "Logger_Defaults section is not closed";
+ } else if ( sectionType == MODULE_SECTION ) {
+ message = "Module section is not closed";
+ }
+ addParseProblem( ParseProblem.ProblemType.ERROR, lineNumber, message );
+ }
+
+ } catch (IOException e) {
+ // do nothing, end of config reached
+ }
+ }
+
+ /**
+ * Adds new problem to parsing problems list
+ * @param type type of problem
+ * @param lineNumber line number in which problem occurs
+ * @param message problem description
+ */
+ private void addParseProblem( ParseProblem.ProblemType type, int lineNumber, String message ) {
+ ParseProblem problem = new ParseProblem();
+ problem.type = type;
+ problem.lineNumber = lineNumber;
+ problem.description = message;
+ parseProblems.add(problem);
+ }
+
+ /**
+ * Gets list of problems which apperas during configuration file parsing
+ * @return list of parse problems
+ */
+ public ArrayList<ParseProblem> getParseProblems() {
+ return parseProblems;
+ }
+
+ /**
+ * Gets engine default section element value
+ * @param elementType type of elements which value will be returned
+ * @return element value
+ */
+ private String getEngineDefaultsElementValue( SectionElementType elementType ) {
+ if ( engineDefaults.elements == null ) {
+ return null;
+ }
+
+ int elementsCount = engineDefaults.elements.size();
+ for ( int i = 0; i < elementsCount; i++ ) {
+ SectionElement element = engineDefaults.elements.get(i);
+ if ( element.type == elementType ) {
+ return element.value;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Sets engine defaults section element value
+ * @param elementType type of elements which value will be updated
+ * @param value new element value
+ */
+ private void setEngineDefaultsElementValue( SectionElementType elementType, String value ) {
+ if ( engineDefaults.elements == null ) {
+ if ( engineDefaults.beginLine == -1 ) {
+ // Create {Engine_Defaults] section
+ createSection(1, ENGINE_DEFAULTS_SECTION_BEGIN_TAG, ENGINE_DEFAULTS_SECTION_END_TAG);
+ parseConfig(configSource);
+ } else {
+ engineDefaults.elements = new ArrayList<SectionElement>();
+ }
+ }
+
+ SectionElement element = null;
+ // Check if element exists in config file
+ int elementsCount = engineDefaults.elements.size();
+ for ( int i = 0; i < elementsCount; i++ ) {
+ SectionElement tmpElement = engineDefaults.elements.get(i);
+ if ( tmpElement.type == elementType ) {
+ // We found element. Stop searching.
+ element = tmpElement;
+ break;
+ }
+ }
+
+ if ( element == null ) {
+ element = new SectionElement();
+ element.type = elementType;
+ element.value = value;
+ element.lineNumber = engineDefaults.endLine;
+
+ // Create new element
+ createElement( element.lineNumber,
+ ConfigUtil.getEngineDefaultsSectionElementTag(element.type), value );
+
+ } else {
+ // Update existing element
+ updateElement( element.lineNumber,
+ ConfigUtil.getEngineDefaultsSectionElementTag(element.type), value );
+ }
+ }
+
+ /**
+ * Sets logger defaults section element value
+ * @param elementType type of elements which value will be updated
+ * @param value new element value
+ */
+ private void setLoggerDefaultsElementValue( SectionElementType elementType, String value ) {
+ if ( loggerDefaults.elements == null ) {
+ if ( loggerDefaults.beginLine == -1 ) {
+ // Create {Engine_Defaults] section
+ createSection(1, LOGGER_DEFAULTS_SECTION_BEGIN_TAG, LOGGER_DEFAULTS_SECTION_END_TAG);
+ parseConfig(configSource);
+ } else {
+ loggerDefaults.elements = new ArrayList<SectionElement>();
+ }
+ }
+
+ SectionElement element = null;
+ // Check if element exists in config file
+ int elementsCount = loggerDefaults.elements.size();
+ for ( int i = 0; i < elementsCount; i++ ) {
+ SectionElement tmpElement = loggerDefaults.elements.get(i);
+ if ( tmpElement.type == elementType ) {
+ // We found element. Stop searching.
+ element = tmpElement;
+ break;
+ }
+ }
+
+ if ( element == null ) {
+ element = new SectionElement();
+ element.type = elementType;
+ element.value = value;
+ element.lineNumber = loggerDefaults.endLine;
+ if ( element.lineNumber == -1 ) {
+ element.lineNumber = loggerDefaults.beginLine + 1;
+ }
+
+ // Create new element
+ createElement( element.lineNumber,
+ ConfigUtil.getLoggerDefaultsSectionElementTag(element.type), value );
+
+ } else {
+ // Update existing element
+ updateElement( element.lineNumber,
+ ConfigUtil.getLoggerDefaultsSectionElementTag(element.type), value );
+ }
+ }
+
+ /**
+ * Creates new element in configuration source
+ * @param lineNumber new element position
+ * @param tag new element tag
+ * @param value new element value
+ */
+ private void createElement( int lineNumber, String tag, String value ) {
+ BufferedReader configSourceReader = new BufferedReader(new StringReader(configSource));
+ StringWriter newConfigSourceWriter = new StringWriter();
+ BufferedWriter buf = new BufferedWriter( newConfigSourceWriter );
+
+ try {
+ int currentLineNumber = 0;
+ while( true ) {
+ currentLineNumber++;
+ String line = configSourceReader.readLine();
+ if ( line == null ) {
+ // End of config source
+ break;
+ }
+
+ if ( currentLineNumber == lineNumber ) {
+ String newElement = tag + " " + value + " ";
+ buf.write(newElement);
+ buf.newLine();
+ }
+
+ // write line to new config source buffer
+ buf.write(line);
+ buf.newLine();
+ }
+
+ // Flush data to config writer
+ buf.flush();
+ // replace old config by new one
+ configSource = newConfigSourceWriter.getBuffer().toString();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ parseConfig(configSource);
+ }
+
+ /**
+ * Updates element value in configuration source
+ * @param lineNumber element position
+ * @param tag element tag
+ * @param value new element value
+ */
+ private void updateElement( int lineNumber, String tag, String value ) {
+ BufferedReader configSourceReader = new BufferedReader(new StringReader(configSource));
+ StringWriter newConfigSourceWriter = new StringWriter();
+ BufferedWriter buf = new BufferedWriter( newConfigSourceWriter );
+
+ try {
+ int currentLineNumber = 0;
+ while( true ) {
+ currentLineNumber++;
+ String line = configSourceReader.readLine();
+ if ( line == null ) {
+ // End of config source
+ break;
+ }
+
+ if ( currentLineNumber == lineNumber ) {
+ String newLine = tag + " " + value + " ";
+ // find comments position
+ int commentTypeOnePos = line.indexOf('#');
+ int commentTypeTwoPos = line.indexOf("//");
+ int commentPos = -1;
+
+ if ( commentTypeOnePos > 0 ) {
+ commentPos = commentTypeOnePos;
+ }
+ if ( ( commentTypeOnePos > 0 ) && ( commentTypeOnePos < commentPos ) ) {
+ commentPos = commentTypeTwoPos;
+ }
+ if ( commentPos != -1 ) {
+ newLine += line.substring(commentTypeOnePos);
+ }
+ line = newLine;
+ }
+
+ // write line to new config source buffer
+ buf.write(line);
+ buf.newLine();
+ }
+
+ // Flush data to config writer
+ buf.flush();
+ // replace old config by new one
+ configSource = newConfigSourceWriter.getBuffer().toString();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Gets logger default section element value
+ * @param elementType type of elements which value will be returned
+ * @return element value
+ */
+ private String getLoggerDefaultsElementValue( SectionElementType elementType ) {
+ if ( loggerDefaults.elements == null ) {
+ return null;
+ }
+
+ int elementsCount = loggerDefaults.elements.size();
+ for ( int i = 0; i < elementsCount; i++ ) {
+ SectionElement element = loggerDefaults.elements.get(i);
+ if ( element.type == elementType )
+ {
+ return element.value;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Gets module name
+ * @param moduleIndex module index
+ * @return module name
+ */
+ public String getModuleName( int moduleIndex ) {
+
+ return modules.get(moduleIndex).name.value;
+ }
+
+ /**
+ * Gets module ini file name
+ * @param moduleIndex module index
+ * @return module ini file name
+ */
+ public String getModuleIniFile( int moduleIndex ) {
+ if ( modules.get(moduleIndex).iniFile == null )
+ {
+ return null;
+ }
+
+ return modules.get(moduleIndex).iniFile.value;
+ }
+
+ /**
+ * Gets module testcase file name
+ * @param moduleIndex module index
+ * @param configFileIndex testcase file index
+ * @return testcase file name
+ */
+ public String getModuleTestCaseFile( int moduleIndex, int configFileIndex ) {
+ if ( ( modules.get(moduleIndex).testCaseFiles == null ) ||
+ (modules.get(moduleIndex).testCaseFiles.get(configFileIndex) == null) ) {
+ return null;
+ }
+
+ return modules.get(moduleIndex).testCaseFiles.get(configFileIndex).value;
+ }
+
+ /**
+ * Gets available modules count
+ * @return modules count
+ */
+ public int getModulesCount(){
+ return modules.size();
+ }
+
+ /**
+ * Gets module testcase files conunt
+ * @param moduleIndex module index
+ * @return testcase files count
+ */
+ public int getModuleTestcaseFilesCount( int moduleIndex ) {
+ if ( modules.get(moduleIndex).testCaseFiles == null ) {
+ return 0;
+ }
+
+ return modules.get(moduleIndex).testCaseFiles.size();
+ }
+
+ /**
+ * Gets <code>TestReportMode</code> element value
+ * @return <code>TestReportMode</code> element value
+ */
+ public TestReportMode getTestReportMode() {
+ String mode = getEngineDefaultsElementValue(SectionElementType.TEST_REPORT_MODE);
+ if ( mode == null )
+ {
+ return TestReportMode.NOT_DEFINED;
+ }
+
+ mode = mode.trim();
+ return ConfigUtil.getTestReportModeByName( mode );
+ }
+
+ /**
+ * Sets <code>TestReportMode</code> element value
+ * @param mode new <code>TestReportMode</code> element value
+ */
+ public void setTestReportMode( TestReportMode mode ) {
+ String modeStr = ConfigUtil.getTestReportModeName( mode );
+ setEngineDefaultsElementValue( SectionElementType.TEST_REPORT_MODE, modeStr );
+ }
+
+ /**
+ * Gets <code>CreateTestReport</code> element value
+ * @return <code>CreateTestReport</code> element value
+ */
+ public YesNo getCreateTestReport() {
+ String value = getEngineDefaultsElementValue( SectionElementType.CREATE_TEST_REPORT);
+ return ConfigUtil.getYesNoValueByName(value);
+ }
+
+ /**
+ * Sets <code>CreateTestReport</code> element value
+ * @param value new <code>CreateTestReport</code> element value
+ */
+ public void setCreateTestReport( YesNo value ) {
+ String valueStr = ConfigUtil.getYesNoValueName(value);
+ setEngineDefaultsElementValue( SectionElementType.CREATE_TEST_REPORT , valueStr );
+ }
+
+ /**
+ * Gets <code>TestReportFilePath</code> element value
+ * @return <code>TestReportFilePath</code> element value
+ */
+ public String getTestReportFilePath() {
+ return getEngineDefaultsElementValue( SectionElementType.TEST_REPORT_FILE_PATH);
+ }
+
+ /**
+ * Sets <code>TestReportFilePath</code> element value
+ * @param path new <code>TestReportFilePath</code> element value
+ */
+ public void setTestReportFilePath( String path ) {
+ setEngineDefaultsElementValue( SectionElementType.TEST_REPORT_FILE_PATH , path );
+ }
+
+ /**
+ * Gets <code>TestReportFileName</code> element value
+ * @return <code>TestReportFileName</code> element value
+ */
+ public String getTestReportFileName() {
+ return getEngineDefaultsElementValue(SectionElementType.TEST_REPORT_FILE_NAME);
+ }
+
+ /**
+ * Sets <code>TestReportFileName</code> element value
+ * @param name new <code>TestReportFileName</code> element value
+ */
+ public void setTestReportFileName( String name ) {
+ setEngineDefaultsElementValue( SectionElementType.TEST_REPORT_FILE_NAME , name );
+ }
+
+ /**
+ * Gets <code>TestReportFormat</code> element value
+ * @return <code>TestReportFormat</code> element value
+ */
+ public OutputFileFormat getTestReportFormat() {
+ String format = getEngineDefaultsElementValue(SectionElementType.TEST_REPORT_FORMAT);
+ if ( format == null )
+ {
+ return OutputFileFormat.NOT_DEFINED;
+ }
+ format = format.trim();
+ return ConfigUtil.getOutputFileFormatByName(format);
+ }
+
+ /**
+ * Sets <code>TestReportFormat</code> element value
+ * @param value new <code>TestReportFormat</code> element value
+ */
+ public void setTestReportFormat( OutputFileFormat value ) {
+ String valueStr = ConfigUtil.getOutputFileFormatName( value );
+ setEngineDefaultsElementValue(SectionElementType.TEST_REPORT_FORMAT, valueStr );
+ }
+
+ /**
+ * Gets <code>TestReportOutput</code> element value
+ * @return <code>TestReportOutput</code> element value
+ */
+ public OutputType getTestReportOutput() {
+ String output = getEngineDefaultsElementValue(SectionElementType.TEST_REPORT_OUTPUT);
+ if ( output == null )
+ {
+ return OutputType.NOT_DEFINED;
+ }
+ output = output.trim();
+ return ConfigUtil.getOutputTypeByName(output);
+ }
+
+ /**
+ * Sets <code>TestReportOutput</code> element value
+ * @param value new <code>TestReportOutput</code> element value
+ */
+ public void setTestReportOutput( OutputType value ) {
+ String valueStr = ConfigUtil.getOutputTypeName( value );
+ setEngineDefaultsElementValue(SectionElementType.TEST_REPORT_OUTPUT, valueStr );
+ }
+
+
+ /**
+ * Gets <code>TestReportFileCreationMode</code> element value
+ * @return <code>TestReportFileCreationMode</code> element value
+ */
+ public FileCreationMode getTestReportFileCreationMode() {
+ String mode = getEngineDefaultsElementValue(SectionElementType.TEST_REPORT_CREATION_MODE);
+ if ( mode == null )
+ {
+ return FileCreationMode.NOT_DEFINED;
+ }
+ mode = mode.trim();
+ return ConfigUtil.getFileCreationModeByName(mode);
+ }
+
+ /**
+ * Sets <code>TestReportFileCreationMode</code> element value
+ * @param value new <code>TestReportFileCreationMode</code> element value
+ */
+ public void setTestReportFileCreationMode( FileCreationMode value ) {
+ String valueStr = ConfigUtil.getFileCreationModeName( value );
+ setEngineDefaultsElementValue(SectionElementType.TEST_REPORT_CREATION_MODE, valueStr );
+ }
+
+ /**
+ * Gets <code>DeviceResetDllName</code> element value
+ * @return <code>DeviceResetDllName</code> element value
+ */
+ public String getDeviceResetDllName() {
+ return getEngineDefaultsElementValue(SectionElementType.DEVICE_RESET_DLL_NAME);
+ }
+
+ /**
+ * Sets <code>DeviceResetDllName</code> element value
+ * @param value new <code>DeviceResetDllName</code> element value
+ */
+ public void setDeviceResetDllName( String value ) {
+ setEngineDefaultsElementValue(SectionElementType.DEVICE_RESET_DLL_NAME, value);
+ }
+
+ /**
+ * Gets <code>Timeout</code> element value
+ * @return <code>Timeout</code> element value
+ */
+ public Integer getTimeout() {
+ String timeout = getEngineDefaultsElementValue(SectionElementType.TIMEOUT);
+ if ( timeout == null )
+ {
+ return null;
+ }
+ timeout = timeout.trim();
+ return new Integer(timeout);
+ }
+
+ /**
+ * Sets <code>Timeout</code> element value
+ * @param value new <code>Timeout</code> element value
+ */
+ public void setTimeout( Integer value ) {
+ setEngineDefaultsElementValue(SectionElementType.TIMEOUT, value.toString() );
+ }
+
+ /**
+ * Gets <code>UITestingSupport</code> element value
+ * @return <code>UITestingSupport</code> element value
+ */
+ public YesNo getUITestingSupport() {
+ return ConfigUtil.getYesNoValueByName(getEngineDefaultsElementValue(SectionElementType.UI_TESTING_SUPPORT));
+ }
+
+ /**
+ * Sets <code>UITestingSupport</code> element value
+ * @param value new <code>UITestingSupport</code> element value
+ */
+ public void setUITestingSupport( YesNo value ){
+ setEngineDefaultsElementValue(SectionElementType.UI_TESTING_SUPPORT, value.toString());
+ }
+
+ /**
+ * Gets <code>SeparateProcesses</code> element value
+ * @return <code>SeparateProcesses</code> element value
+ */
+ public YesNo getSeparateProcesses() {
+ return ConfigUtil.getYesNoValueByName(getEngineDefaultsElementValue(SectionElementType.SEPARATE_PROCESSES));
+ }
+
+ /**
+ * Sets <code>UITestingSupport</code> element value
+ * @param value new <code>UITestingSupport</code> element value
+ */
+ public void setSeparateProcesses(YesNo value ){
+ setEngineDefaultsElementValue(SectionElementType.SEPARATE_PROCESSES, value.toString());
+ }
+
+ /**
+ * Gets <code>DisableMeasurement</code> element value
+ * @return <code>DisableMeasurement</code> element value
+ */
+ public MeasurementModule getDisableMeasurement() {
+ String module = getEngineDefaultsElementValue(SectionElementType.DISABLE_MEASUREMENT);
+ if ( module == null )
+ {
+ return MeasurementModule.NOT_DEFINED;
+ }
+
+ module = module.trim();
+ return ConfigUtil.getMeasurementModuleByName( module );
+ }
+
+ /**
+ * Sets <code>DisableMeasurementModule</code> element value
+ * @param module new <code>DisableMeasurementModule</code> element value
+ */
+ public void setDisableMeasurementModule( MeasurementModule module ) {
+ String valueStr = ConfigUtil.getMeasurementModuleName( module );
+ setEngineDefaultsElementValue( SectionElementType.DISABLE_MEASUREMENT, valueStr );
+ }
+
+ /**
+ * Gets <code>CreateLogDirectories</code> element value
+ * @return <code>CreateLogDirectories</code> element value
+ */
+ public YesNo getCreateLogDirectories() {
+ String value = getLoggerDefaultsElementValue(SectionElementType.CREATE_LOG_DIRECTORIES);
+ return ConfigUtil.getYesNoValueByName(value);
+ }
+
+ /**
+ * Sets <code>CreateLogDirectories</code> element value
+ * @param value new <code>CreateLogDirectories</code> element value
+ */
+ public void setCreateLogDirectories( YesNo value ) {
+ String valueStr = ConfigUtil.getYesNoValueName( value );
+ setLoggerDefaultsElementValue(SectionElementType.CREATE_LOG_DIRECTORIES, valueStr );
+ }
+
+ /**
+ * Gets <code>ThreadIdToLogFile</code> element value
+ * @return <code>ThreadIdToLogFile</code> element value
+ */
+ public YesNo getThreadIdToLogFile() {
+ String value = getLoggerDefaultsElementValue(SectionElementType.THREAD_ID_TO_LOG_FILE);
+ return ConfigUtil.getYesNoValueByName(value);
+ }
+
+ /**
+ * Sets <code>CreateLogDirectories</code> element value
+ * @param value new <code>CreateLogDirectories</code> element value
+ */
+ public void setThreadIdToLogFile( YesNo value ) {
+ String valueStr = ConfigUtil.getYesNoValueName( value );
+ setLoggerDefaultsElementValue(SectionElementType.THREAD_ID_TO_LOG_FILE, valueStr );
+ }
+
+ /**
+ * Gets <code>WithTimeStamp</code> element value
+ * @return <code>WithTimeStamp</code> element value
+ */
+ public YesNo getWithTimeStamp() {
+ String value = getLoggerDefaultsElementValue(SectionElementType.WITH_TIME_STAMP);
+ return ConfigUtil.getYesNoValueByName(value);
+ }
+
+ /**
+ * Sets <code>WithTimeStamp</code> element value
+ * @param value new <code>WithTimeStamp</code> element value
+ */
+ public void setWithTimeStamp( YesNo value ) {
+ String valueStr = ConfigUtil.getYesNoValueName( value );
+ setLoggerDefaultsElementValue(SectionElementType.WITH_TIME_STAMP, valueStr );
+ }
+
+ /**
+ * Gets <code>WithLineBreak</code> element value
+ * @return <code>WithLineBreak</code> element value
+ */
+ public YesNo getWithLineBreak() {
+ String value = getLoggerDefaultsElementValue(SectionElementType.WITH_LINE_BREAK);
+ return ConfigUtil.getYesNoValueByName(value);
+ }
+
+ /**
+ * Sets <code>WithLineBreak</code> element value
+ * @param value new <code>WithLineBreak</code> element value
+ */
+ public void setWithLineBreak( YesNo value ) {
+ String valueStr = ConfigUtil.getYesNoValueName( value );
+ setLoggerDefaultsElementValue(SectionElementType.WITH_LINE_BREAK, valueStr );
+ }
+
+ /**
+ * Gets <code>WithEventRanking</code> element value
+ * @return <code>WithEventRanking</code> element value
+ */
+ public YesNo getWithEventRanking() {
+ String value = getLoggerDefaultsElementValue(SectionElementType.WITH_EVENT_RANKING);
+ return ConfigUtil.getYesNoValueByName(value);
+ }
+
+ /**
+ * Sets <code>WithEventRanking</code> element value
+ * @param value new <code>WithEventRanking</code> element value
+ */
+ public void setWithEventRanking( YesNo value ) {
+ String valueStr = ConfigUtil.getYesNoValueName( value );
+ setLoggerDefaultsElementValue(SectionElementType.WITH_EVENT_RANKING, valueStr );
+ }
+
+ /**
+ * Gets <code>FileUnicode</code> element value
+ * @return <code>FileUnicode</code> element value
+ */
+ public YesNo getFileUnicode() {
+ String value = getLoggerDefaultsElementValue(SectionElementType.LOG_FILE_UNICODE);
+ return ConfigUtil.getYesNoValueByName(value);
+ }
+
+ /**
+ * Sets <code>FileUnicode</code> element value
+ * @param value new <code>FileUnicode</code> element value
+ */
+ public void setFileUnicode( YesNo value ) {
+ String valueStr = ConfigUtil.getYesNoValueName( value );
+ setLoggerDefaultsElementValue(SectionElementType.LOG_FILE_UNICODE, valueStr );
+ }
+
+ public void setAddTestcaseTitle(YesNo value){
+ String valueStr = ConfigUtil.getYesNoValueName(value);
+ setLoggerDefaultsElementValue(SectionElementType.ADD_TESTCASE_TITLE, valueStr);
+ }
+
+ public YesNo getAddTestcaseTitle() {
+ String value = getLoggerDefaultsElementValue(SectionElementType.ADD_TESTCASE_TITLE);
+ return ConfigUtil.getYesNoValueByName(value);
+ }
+
+ /**
+ * Gets <code>EmulatorBasePath</code> element value
+ * @return <code>EmulatorBasePath</code> element value
+ */
+ public String getEmulatorBasePath() {
+ return getLoggerDefaultsElementValue(SectionElementType.EMULATOR_BASE_PATH);
+ }
+
+ /**
+ * Sets <code>EmulatorBasePath</code> element value
+ * @param value new <code>EmulatorBasePath</code> element value
+ */
+ public void setEmulatorBasePath( String value ) {
+ setLoggerDefaultsElementValue(SectionElementType.EMULATOR_BASE_PATH, value );
+ }
+
+ /**
+ * Gets <code>HardwareBasePath</code> element value
+ * @return <code>HardwareBasePath</code> element value
+ */
+ public String getHardwareBasePath() {
+ return getLoggerDefaultsElementValue(SectionElementType.HARDWARE_BASE_PATH);
+ }
+
+ /**
+ * Sets <code>HardwareBasePath</code> element value
+ * @param value new <code>HardwareBasePath</code> element value
+ */
+ public void setHardwareBasePath( String value ) {
+ setLoggerDefaultsElementValue(SectionElementType.HARDWARE_BASE_PATH, value );
+ }
+
+ /**
+ * Gets <code>LogFileCreationMode</code> element value
+ * @return <code>LogFileCreationMode</code> element value
+ */
+ public FileCreationMode getLogFileCreationMode() {
+ String mode = getLoggerDefaultsElementValue(SectionElementType.LOG_FILE_CREATION_MODE);
+ if ( mode == null )
+ {
+ return FileCreationMode.NOT_DEFINED;
+ }
+ mode = mode.trim();
+ return ConfigUtil.getFileCreationModeByName(mode);
+ }
+
+ /**
+ * Sets <code>LogFileCreationMode</code> element value
+ * @param value new <code>LogFileCreationMode</code> element value
+ */
+ public void setLogFileCreationMode( FileCreationMode value ) {
+ String valueStr = ConfigUtil.getFileCreationModeName( value );
+ setLoggerDefaultsElementValue(SectionElementType.LOG_FILE_CREATION_MODE, valueStr );
+ }
+
+ /**
+ * Gets <code>EmulatorLogFormat</code> element value
+ * @return <code>EmulatorLogFormat</code> element value
+ */
+ public OutputFileFormat getEmulatorLogFormat() {
+ String format = getLoggerDefaultsElementValue(SectionElementType.EMULATOR_LOG_FORMAT);
+ if ( format == null )
+ {
+ return OutputFileFormat.NOT_DEFINED;
+ }
+ format = format.trim();
+ return ConfigUtil.getOutputFileFormatByName(format);
+ }
+
+ /**
+ * Sets <code>EmulatorLogFormat</code> element value
+ * @param value new <code>EmulatorLogFormat</code> element value
+ */
+ public void setEmulatorLogFormat( OutputFileFormat value ) {
+ String valueStr = ConfigUtil.getOutputFileFormatName( value );
+ setLoggerDefaultsElementValue(SectionElementType.EMULATOR_LOG_FORMAT, valueStr );
+ }
+
+ /**
+ * Gets <code>EmulatorLogOutput</code> element value
+ * @return <code>EmulatorLogOutput</code> element value
+ */
+ public OutputType getEmulatorLogOutput() {
+ String output = getLoggerDefaultsElementValue(SectionElementType.EMULATOR_LOG_OUTPUT);
+ if ( output == null )
+ {
+ return OutputType.NOT_DEFINED;
+ }
+ output = output.trim();
+ return ConfigUtil.getOutputTypeByName(output);
+ }
+
+ /**
+ * Sets <code>EmulatorLogOutput</code> element value
+ * @param value new <code>EmulatorLogOutput</code> element value
+ */
+ public void setEmulatorLogOutput( OutputType value ) {
+ String valueStr = ConfigUtil.getOutputTypeName( value );
+ setLoggerDefaultsElementValue(SectionElementType.EMULATOR_LOG_OUTPUT, valueStr );
+ }
+
+ /**
+ * Gets <code>HardwareLogFormat</code> element value
+ * @return <code>HardwareLogFormat</code> element value
+ */
+ public OutputFileFormat getHardwareLogFormat() {
+ String format = getLoggerDefaultsElementValue(SectionElementType.HARDWARE_LOG_FORMAT);
+ if ( format == null )
+ {
+ return OutputFileFormat.NOT_DEFINED;
+ }
+ format = format.trim();
+ return ConfigUtil.getOutputFileFormatByName(format);
+ }
+
+ /**
+ * Sets <code>HardwareLogFormat</code> element value
+ * @param value new <code>HardwareLogFormat</code> element value
+ */
+ public void setHardwareLogFormat( OutputFileFormat value ) {
+ String valueStr = ConfigUtil.getOutputFileFormatName( value );
+ setLoggerDefaultsElementValue(SectionElementType.HARDWARE_LOG_FORMAT, valueStr );
+ }
+
+ /**
+ * Gets <code>HardwareLogOutput</code> element value
+ * @return <code>HardwareLogOutput</code> element value
+ */
+ public OutputType getHardwareLogOutput() {
+ String output = getLoggerDefaultsElementValue(SectionElementType.HARDWARE_LOG_OUTPUT);
+ if ( output == null )
+ {
+ return OutputType.NOT_DEFINED;
+ }
+ output = output.trim();
+ return ConfigUtil.getOutputTypeByName(output);
+ }
+
+ /**
+ * Sets <code>HardwareLogOutput</code> element value
+ * @param value new <code>HardwareLogOutput</code> element value
+ */
+ public void setHardwareLogOutput( OutputType value ) {
+ String valueStr = ConfigUtil.getOutputTypeName( value );
+ setLoggerDefaultsElementValue(SectionElementType.HARDWARE_LOG_OUTPUT, valueStr );
+ }
+
+ /**
+ * Gets configuration source
+ * @return configuration source
+ */
+ public String getConfigSource() {
+ return configSource;
+ }
+
+ /**
+ * Adds new module to configuration source
+ * @param name module name
+ * @return added module index
+ */
+ public int addModule( String name ) {
+ int moduleSectionPos = -1;
+ if ( modules != null ) {
+ if ( modules.size() != 0 ) {
+ ModuleSection module = modules.get(modules.size()-1);
+ if ( module.endLine != -1 ) {
+ moduleSectionPos = module.endLine + 1;
+ } else {
+ int lastLine = module.beginLine;
+ if ( module.name.lineNumber != -1 ) {
+ lastLine = module.name.lineNumber;
+ }
+ if ( ( module.iniFile != null ) &&
+ ( module.iniFile.lineNumber > lastLine ) ) {
+ lastLine = module.iniFile.lineNumber;
+ }
+ if ( module.testCaseFiles != null ) {
+ for( int i = 0; i < module.testCaseFiles.size(); i++ ) {
+ if ( module.testCaseFiles.get(i).lineNumber > lastLine ) {
+ lastLine = module.testCaseFiles.get(i).lineNumber;
+ }
+ }
+ }
+ moduleSectionPos = lastLine + 1;
+ }
+ }
+ }
+ if ( moduleSectionPos == -1 ) {
+ if ( engineDefaults.endLine != -1 ) {
+ moduleSectionPos = engineDefaults.endLine + 1;
+ } else {
+ moduleSectionPos = 1;
+ }
+ }
+
+ String moduleNameTag = ConfigUtil.getModuleSectionElementTag(SectionElementType.MODULE_NAME);
+ createSection( moduleSectionPos, MODULE_SECTION_BEGIN_TAG, MODULE_SECTION_END_TAG );
+ createElement( moduleSectionPos + 2, moduleNameTag, name );
+ parseConfig( configSource );
+ return modules.size() - 1;
+ }
+
+ /**
+ * Removes module from configuration source
+ * @param moduleIndex module index
+ */
+ public void removeModule( int moduleIndex ) {
+ if ( ( modules == null ) || ( moduleIndex < 0 ) || ( modules.size() < moduleIndex ) ) {
+ return;
+ }
+ ModuleSection moduleSection = modules.get(moduleIndex);
+ if ( ( moduleSection == null ) || (moduleSection.beginLine < 1 ) ||
+ ( moduleSection.endLine < 1 ) || ( moduleSection.endLine < moduleSection.beginLine ) ) {
+ return;
+ }
+ removeBlock(moduleSection.beginLine, moduleSection.endLine);
+ parseConfig( configSource );
+ }
+
+ /**
+ * Updates module name value
+ * @param moduleIndex module index
+ * @param newName new module name
+ */
+ public void updateModule( int moduleIndex, String newName ) {
+ if ( ( modules == null ) || ( moduleIndex < 0 ) || ( modules.size() < moduleIndex ) ) {
+ return;
+ }
+ ModuleSection moduleSection = modules.get(moduleIndex);
+ if ( ( moduleSection == null ) || (moduleSection.name == null ) ||
+ ( moduleSection.name.lineNumber < 1 ) ) {
+ return;
+ }
+
+ String tag = ConfigUtil.getModuleSectionElementTag(SectionElementType.MODULE_NAME);
+ updateElement(moduleSection.name.lineNumber, tag, newName );
+ parseConfig( configSource );
+ }
+
+ /**
+ * Adds new ini file to module
+ * @param moduleIndex module index
+ * @param iniFilePath ini file path
+ */
+ public void addIniFileToModule( int moduleIndex, String iniFilePath ) {
+ if ( ( modules == null ) || ( moduleIndex < 0 ) || ( modules.size() < moduleIndex ) ) {
+ return;
+ }
+ ModuleSection moduleSection = modules.get(moduleIndex);
+ if ( moduleSection.iniFile != null ) {
+ return;
+ }
+ int lineNumber = moduleSection.beginLine;
+ if ( ( moduleSection.name != null ) && ( moduleSection.name.lineNumber > 0 ) ) {
+ lineNumber = moduleSection.name.lineNumber;
+ }
+ lineNumber++;
+
+ String tag = ConfigUtil.getModuleSectionElementTag(SectionElementType.INI_FILE);
+ createElement( lineNumber, tag, iniFilePath );
+ parseConfig( configSource );
+ }
+
+ /**
+ * Removes ini file from module
+ * @param moduleIndex module index
+ */
+ public void removeIniFileFromModule( int moduleIndex ) {
+ if ( ( modules == null ) || ( moduleIndex < 0 ) || ( modules.size() < moduleIndex ) ) {
+ return;
+ }
+ ModuleSection moduleSection = modules.get(moduleIndex);
+ if ( ( moduleSection == null ) || ( moduleSection.iniFile == null ) ||
+ (moduleSection.iniFile.lineNumber < 1 ) ) {
+ return;
+ }
+ removeBlock(moduleSection.iniFile.lineNumber, moduleSection.iniFile.lineNumber);
+ parseConfig( configSource );
+ }
+
+ /**
+ * Updates module ini file path value
+ * @param moduleIndex module index
+ * @param iniFilePath new ini file path
+ */
+ public void updateIniFileInModule( int moduleIndex, String iniFilePath ) {
+ if ( ( modules == null ) || ( moduleIndex < 0 ) || ( modules.size() < moduleIndex ) ) {
+ return;
+ }
+ ModuleSection moduleSection = modules.get(moduleIndex);
+ if ( ( moduleSection == null ) || ( moduleSection.iniFile == null ) ||
+ (moduleSection.iniFile.lineNumber < 1 ) ) {
+ return;
+ }
+
+ String tag = ConfigUtil.getModuleSectionElementTag(SectionElementType.INI_FILE);
+ updateElement(moduleSection.iniFile.lineNumber, tag, iniFilePath );
+ parseConfig( configSource );
+ }
+
+ /**
+ * Adds new testcase file path to module
+ * @param moduleIndex module index
+ * @param testcaseFilePath testcase file path
+ */
+ public void addTestCaseFileToModule( int moduleIndex, String testcaseFilePath ) {
+ if ( ( modules == null ) || ( moduleIndex < 0 ) || ( modules.size() < moduleIndex ) ) {
+ return;
+ }
+ ModuleSection moduleSection = modules.get(moduleIndex);
+
+ int lineNumber = moduleSection.beginLine;
+ if ( ( moduleSection.name != null ) && ( moduleSection.name.lineNumber > 0 ) ) {
+ lineNumber = moduleSection.name.lineNumber;
+ }
+ if ( ( moduleSection.iniFile != null ) && ( moduleSection.iniFile.lineNumber > 0 ) ) {
+ lineNumber = moduleSection.iniFile.lineNumber;
+ }
+ for ( int i = 0; i < moduleSection.testCaseFiles.size(); i++ ) {
+ if ( lineNumber < moduleSection.testCaseFiles.get(i).lineNumber ) {
+ lineNumber = moduleSection.testCaseFiles.get(i).lineNumber;
+ }
+ }
+ lineNumber++;
+
+ String tag = ConfigUtil.getModuleSectionElementTag(SectionElementType.TEST_CASE_FILE);
+ createElement( lineNumber, tag, testcaseFilePath );
+ parseConfig( configSource );
+ }
+
+ /**
+ * Remove testcase file from module
+ * @param moduleIndex module index
+ * @param configFileIndex testcase file path index
+ */
+ public void removeTestCaseFileFromModule( int moduleIndex, int configFileIndex ) {
+ if ( ( modules == null ) || ( moduleIndex < 0 ) || ( modules.size() < moduleIndex ) ) {
+ return;
+ }
+ ModuleSection moduleSection = modules.get(moduleIndex);
+ if ( ( moduleSection == null ) || ( moduleSection.testCaseFiles == null ) ||
+ (moduleSection.testCaseFiles.size() < configFileIndex ) ) {
+ return;
+ }
+
+ SectionElement configFile = moduleSection.testCaseFiles.get(configFileIndex);
+ if ( ( configFile == null ) || ( configFile.lineNumber < 1 ) ) {
+ return;
+ }
+
+ removeBlock(configFile.lineNumber, configFile.lineNumber);
+ parseConfig( configSource );
+ }
+
+ /**
+ * Updates testcase file path value
+ * @param moduleIndex module index
+ * @param testcaseFileIndex testcase file path index
+ * @param testcaseFilePath new testcase file path
+ */
+ public void updateTestCaseFileInModule( int moduleIndex, int testcaseFileIndex, String testcaseFilePath ) {
+ if ( ( modules == null ) || ( moduleIndex < 0 ) || ( modules.size() < moduleIndex ) ) {
+ return;
+ }
+ ModuleSection moduleSection = modules.get(moduleIndex);
+ if ( ( moduleSection == null ) || ( moduleSection.testCaseFiles == null ) ||
+ (moduleSection.testCaseFiles.size() < testcaseFileIndex ) ) {
+ return;
+ }
+
+ SectionElement configFile = moduleSection.testCaseFiles.get( testcaseFileIndex );
+ if ( ( configFile == null ) || ( configFile.lineNumber < 1 ) ) {
+ return;
+ }
+
+ String tag = ConfigUtil.getModuleSectionElementTag(SectionElementType.TEST_CASE_FILE);
+ updateElement( configFile.lineNumber, tag, testcaseFilePath );
+ parseConfig( configSource );
+ }
+
+ /**
+ * Removes block of text from configuration source
+ * @param startLineNumber block begine line
+ * @param endLineNumber block end line
+ */
+ private void removeBlock( int startLineNumber, int endLineNumber ) {
+ BufferedReader configSourceReader = new BufferedReader(new StringReader(configSource));
+ StringWriter newConfigSourceWriter = new StringWriter();
+ BufferedWriter buf = new BufferedWriter( newConfigSourceWriter );
+
+ try {
+ int currentLineNumber = 0;
+ while( true ) {
+ currentLineNumber++;
+ String line = configSourceReader.readLine();
+ if ( line == null ) {
+ break;
+ }
+ if ( ( currentLineNumber >= startLineNumber ) &&
+ ( currentLineNumber <= endLineNumber ) ) {
+ continue;
+ }
+
+ buf.write(line);
+ buf.newLine();
+ }
+
+ // Flush data to config writer
+ buf.flush();
+ // replace old config by new one
+ configSource = newConfigSourceWriter.getBuffer().toString();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ parseConfig(configSource);
+ }
+
+ /**
+ * Create new section in configuration source
+ * @param lineNumber section position
+ * @param sectionBeginTag section begine tag
+ * @param sectionEndTag section end tag
+ */
+ private void createSection( int lineNumber, String sectionBeginTag, String sectionEndTag ) {
+ BufferedReader configSourceReader = new BufferedReader(new StringReader(configSource));
+ StringWriter newConfigSourceWriter = new StringWriter();
+ BufferedWriter buf = new BufferedWriter( newConfigSourceWriter );
+
+ try {
+ int currentLineNumber = 0;
+ boolean added = false;
+ boolean eof = false;
+ while( true ) {
+ currentLineNumber++;
+ String line = configSourceReader.readLine();
+ if ( line == null ) {
+ // End of config source
+ eof = true;
+ }
+
+ if ( ( currentLineNumber == lineNumber ) ||
+ ( ( !added ) && ( eof == true ) ) ) {
+ buf.newLine();
+ buf.write(sectionBeginTag);
+ buf.newLine();
+ buf.write(sectionEndTag);
+ buf.newLine();
+ added = true;
+ }
+ if ( eof == true ) {
+ break;
+ }
+
+ // write line to new config source buffer
+ buf.write(line);
+ buf.newLine();
+ }
+
+ // Flush data to config writer
+ buf.flush();
+ // replace old config by new one
+ configSource = newConfigSourceWriter.getBuffer().toString();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ parseConfig(configSource);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configmanager/ConfigUtil.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,544 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configmanager;
+
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+/**
+ * STIF configuration utility class
+ *
+ */
+public class ConfigUtil {
+ private static final String TEST_REPORT_MODE_TAG = "TestReportMode=";
+ private static final String CREATE_TEST_REPORT_TAG = "CreateTestReport=";
+ private static final String TEST_REPORT_FILE_PATH_TAG = "TestReportFilePath=";
+ private static final String TEST_REPORT_FILE_NAME_TAG = "TestReportFileName=";
+ private static final String TEST_REPORT_FORMAT_TAG = "TestReportFormat=";
+ private static final String TEST_REPORT_OUTPUT_TAG = "TestReportOutput=";
+ private static final String TEST_REPORT_CREATION_METHOD_TAG = "TestReportFileCreationMode=";
+ private static final String DEVICE_RESET_DLL_NAME_TAG = "DeviceResetDllName=";
+ private static final String DISABLE_MEASUREMENT_TAG = "DisableMeasurement=";
+ private static final String TIMEOUT_TAG = "Timeout=";
+ private static final String UI_TESTING_SUPPORT_TAG = "UITestingSupport=";
+ private static final String SEPARATE_PROCESSES_TAG = "SeparateProcesses=";
+
+ private static final String CREATE_LOG_DIRECTORIES_TAG = "CreateLogDirectories=";
+ private static final String EMULATOR_BASE_PATH_TAG = "EmulatorBasePath=";
+ private static final String EMULATOR_FORMAT_TAG = "EmulatorFormat=";
+ private static final String EMULATOR_OUTPUT_TAG = "EmulatorOutput=";
+ private static final String HARDWARE_BASE_PATH_TAG = "HardwareBasePath=";
+ private static final String HARDWARE_FORMAT_TAG = "HardwareFormat=";
+ private static final String HARDWARE_OUTPUT_TAG = "HardwareOutput=";
+ private static final String FILE_CREATION_MODE_TAG = "FileCreationMode=";
+ private static final String THREAD_ID_TO_LOG_FILE_TAG = "ThreadIdToLogFile=";
+ private static final String WITH_TIME_STAMP_TAG = "WithTimeStamp=";
+ private static final String WITH_LINE_BREAK_TAG = "WithLineBreak=";
+ private static final String WITH_EVENT_RANKING_TAG = "WithEventRanking=";
+ private static final String FILE_UNICODE_TAG = "FileUnicode=";
+
+ private static final String MODULE_NAME_TAG = "ModuleName=";
+ private static final String MODULE_INI_FILE_TAG = "IniFile=";
+ private static final String MODULE_TEST_CASE_FILE_TAG = "TestCaseFile=";
+
+ private static final String ADD_TESTCASE_TITLE_TAG = "AddTestCaseTitle=";
+
+
+ private static Hashtable<TestReportMode,String> testReportModeNames = null;
+
+ private static Hashtable<MeasurementModule,String> measurementModuleNames = null;
+
+ private static Hashtable<SectionElementType,String> engineDefaultsElementTags = null;
+ private static Hashtable<SectionElementType,String> loggerDefaultsElementTags = null;
+ private static Hashtable<SectionElementType,String> moduleElementTags = null;
+
+ static {
+ testReportModeNames = new Hashtable<TestReportMode, String>();
+ testReportModeNames.put( TestReportMode.EMPTY, "Empty" );
+ testReportModeNames.put( TestReportMode.SUMMARY, "Summary" );
+ testReportModeNames.put( TestReportMode.ENVIRONMENT, "Environment" );
+ testReportModeNames.put( TestReportMode.TESTCASE, "TestCases" );
+ testReportModeNames.put( TestReportMode.FULL_REPORT, "FullReport" );
+
+ measurementModuleNames = new Hashtable<MeasurementModule, String>();
+ measurementModuleNames.put(MeasurementModule.STIF_MEASUREMENT_DISABLE_NONE, "stifmeasurementdisablenone" );
+ measurementModuleNames.put(MeasurementModule.STIF_MEASUREMENT_DISABLE_ALL, "stifmeasurementdisableall" );
+ measurementModuleNames.put(MeasurementModule.STIF_MEASUREMENT_PLUGIN_01, "stifmeasurementplugin01" );
+ measurementModuleNames.put(MeasurementModule.STIF_MEASUREMENT_PLUGIN_02, "stifmeasurementplugin02" );
+ measurementModuleNames.put(MeasurementModule.STIF_MEASUREMENT_PLUGIN_03, "stifmeasurementplugin03" );
+ measurementModuleNames.put(MeasurementModule.STIF_MEASUREMENT_PLUGIN_04, "stifmeasurementplugin04" );
+ measurementModuleNames.put(MeasurementModule.STIF_MEASUREMENT_PLUGIN_05, "stifmeasurementplugin05" );
+ measurementModuleNames.put(MeasurementModule.STIF_BAPPEA_PROFILER, "stifbappeaprofiler");
+
+ engineDefaultsElementTags = new Hashtable<SectionElementType, String>();
+ engineDefaultsElementTags.put(SectionElementType.TEST_REPORT_MODE, TEST_REPORT_MODE_TAG );
+ engineDefaultsElementTags.put(SectionElementType.CREATE_TEST_REPORT, CREATE_TEST_REPORT_TAG );
+ engineDefaultsElementTags.put(SectionElementType.TEST_REPORT_FILE_PATH, TEST_REPORT_FILE_PATH_TAG );
+ engineDefaultsElementTags.put(SectionElementType.TEST_REPORT_FILE_NAME, TEST_REPORT_FILE_NAME_TAG );
+ engineDefaultsElementTags.put(SectionElementType.TEST_REPORT_FORMAT, TEST_REPORT_FORMAT_TAG );
+ engineDefaultsElementTags.put(SectionElementType.TEST_REPORT_OUTPUT, TEST_REPORT_OUTPUT_TAG );
+ engineDefaultsElementTags.put(SectionElementType.TEST_REPORT_CREATION_MODE, TEST_REPORT_CREATION_METHOD_TAG );
+ engineDefaultsElementTags.put(SectionElementType.DEVICE_RESET_DLL_NAME, DEVICE_RESET_DLL_NAME_TAG );
+ engineDefaultsElementTags.put(SectionElementType.DISABLE_MEASUREMENT, DISABLE_MEASUREMENT_TAG );
+ engineDefaultsElementTags.put(SectionElementType.TIMEOUT, TIMEOUT_TAG );
+ engineDefaultsElementTags.put(SectionElementType.UI_TESTING_SUPPORT, UI_TESTING_SUPPORT_TAG);
+ engineDefaultsElementTags.put(SectionElementType.SEPARATE_PROCESSES, SEPARATE_PROCESSES_TAG);
+
+ loggerDefaultsElementTags = new Hashtable<SectionElementType, String>();
+ loggerDefaultsElementTags.put(SectionElementType.CREATE_LOG_DIRECTORIES, CREATE_LOG_DIRECTORIES_TAG );
+ loggerDefaultsElementTags.put(SectionElementType.EMULATOR_BASE_PATH, EMULATOR_BASE_PATH_TAG );
+ loggerDefaultsElementTags.put(SectionElementType.EMULATOR_LOG_FORMAT, EMULATOR_FORMAT_TAG );
+ loggerDefaultsElementTags.put(SectionElementType.EMULATOR_LOG_OUTPUT, EMULATOR_OUTPUT_TAG );
+ loggerDefaultsElementTags.put(SectionElementType.HARDWARE_BASE_PATH, HARDWARE_BASE_PATH_TAG );
+ loggerDefaultsElementTags.put(SectionElementType.HARDWARE_LOG_FORMAT, HARDWARE_FORMAT_TAG );
+ loggerDefaultsElementTags.put(SectionElementType.HARDWARE_LOG_OUTPUT, HARDWARE_OUTPUT_TAG );
+ loggerDefaultsElementTags.put(SectionElementType.LOG_FILE_CREATION_MODE, FILE_CREATION_MODE_TAG );
+ loggerDefaultsElementTags.put(SectionElementType.THREAD_ID_TO_LOG_FILE, THREAD_ID_TO_LOG_FILE_TAG );
+ loggerDefaultsElementTags.put(SectionElementType.WITH_TIME_STAMP, WITH_TIME_STAMP_TAG );
+ loggerDefaultsElementTags.put(SectionElementType.WITH_LINE_BREAK, WITH_LINE_BREAK_TAG );
+ loggerDefaultsElementTags.put(SectionElementType.WITH_EVENT_RANKING, WITH_EVENT_RANKING_TAG );
+ loggerDefaultsElementTags.put(SectionElementType.LOG_FILE_UNICODE, FILE_UNICODE_TAG );
+ loggerDefaultsElementTags.put(SectionElementType.ADD_TESTCASE_TITLE, ADD_TESTCASE_TITLE_TAG);
+
+ moduleElementTags = new Hashtable<SectionElementType, String>();
+ moduleElementTags.put(SectionElementType.MODULE_NAME, MODULE_NAME_TAG );
+ moduleElementTags.put(SectionElementType.INI_FILE, MODULE_INI_FILE_TAG );
+ moduleElementTags.put(SectionElementType.TEST_CASE_FILE, MODULE_TEST_CASE_FILE_TAG );
+ }
+
+ /**
+ * Converts string to YesNo value
+ * @param name text value
+ * @return translated YesNo type value
+ */
+ public static YesNo getYesNoValueByName( String name ) {
+ if ( name == null ) {
+ return YesNo.NOT_DEFINED;
+ }else if ( name.equals("YES") ) {
+ return YesNo.YES;
+ } else if ( name.equals("NO") ) {
+ return YesNo.NO;
+ }
+ return YesNo.UNKNOWN;
+ }
+
+ /**
+ * Converts YesNo type value to text
+ * @param value YesNo type value
+ * @return YesNo type value text representation
+ */
+ public static String getYesNoValueName( YesNo value ) {
+ if ( value == YesNo.YES ) {
+ return "YES";
+ } else if ( value == YesNo.NO ) {
+ return "NO";
+ }
+ return null;
+ }
+
+ /**
+ * Gets list of elements which are allowed to appear in engine defaults section
+ * @return list of allowed elements
+ */
+ public static SectionElementType[] getAllowedEngineDefaultsSectionElements() {
+ return (SectionElementType[])engineDefaultsElementTags.keySet().toArray(new SectionElementType[0]);
+ }
+
+ /**
+ * Gets list of elements which are allowed to appear in logger defaults section
+ * @return list of allowed elements
+ */
+ public static SectionElementType[] getAllowedLoggerDefaultsSectionElements() {
+ return (SectionElementType[])loggerDefaultsElementTags.keySet().toArray(new SectionElementType[0]);
+ }
+
+ /**
+ * Gets list of elements which are allowed to appear in module section
+ * @return list of allowed elements
+ */
+ public static SectionElementType[] getAllowedModuleSectionElements() {
+ return (SectionElementType[])moduleElementTags.keySet().toArray(new SectionElementType[0]);
+ }
+
+ /**
+ * Gets engine defaults section element tag
+ * @param element element type
+ * @return element tag
+ */
+ public static String getEngineDefaultsSectionElementTag( SectionElementType element ) {
+ return engineDefaultsElementTags.get(element);
+ }
+
+ /**
+ * Gets logger defaults section element tag
+ * @param element element type
+ * @return element tag
+ */
+ public static String getLoggerDefaultsSectionElementTag( SectionElementType element ) {
+ return loggerDefaultsElementTags.get(element);
+ }
+
+ /**
+ * Gets module section element tag
+ * @param element element type
+ * @return element tag
+ */
+ public static String getModuleSectionElementTag( SectionElementType element ) {
+ return moduleElementTags.get(element);
+ }
+
+
+ /**
+ * Gets allowed <code>TestReportMode</code> values text representations
+ * @return allowed <code>TestReportMode</code> values text representations
+ */
+ public static String[] getTestReportModeNames() {
+ Collection<String> names = testReportModeNames.values();
+ return (String[])names.toArray(new String[names.size()]);
+ }
+
+ /**
+ * Gets converted to text <code>TestReportMode</code> value
+ * @param mode <code>TestReportMode</code> value
+ * @return converted value
+ */
+ public static String getTestReportModeName( TestReportMode mode ) {
+ return testReportModeNames.get(mode);
+ }
+
+ /**
+ * Converts text to <code>TestReportMode</code> value
+ * @param name text value
+ * @return <code>TestReportMode</code> type value
+ */
+ public static TestReportMode getTestReportModeByName( String name ) {
+ Enumeration<TestReportMode> keys = testReportModeNames.keys();
+ while ( keys.hasMoreElements() ) {
+ TestReportMode key = keys.nextElement();
+ String value = testReportModeNames.get( key );
+ if ( value.equals(name) ) {
+ return key;
+ }
+ }
+ return TestReportMode.UNKNOWN;
+ }
+
+ /**
+ * Converts text to <code>OutputFileFormat</code> value
+ * @param name text value
+ * @return <code>OutputFileFormat</code> type value
+ */
+ public static OutputFileFormat getOutputFileFormatByName( String name ) {
+ if ( name == null ) {
+ return OutputFileFormat.NOT_DEFINED;
+ } else if ( name.equals("TXT") ) {
+ return OutputFileFormat.TXT;
+ } else if ( name.equals("HTML") ) {
+ return OutputFileFormat.HTML;
+ }
+ return OutputFileFormat.UNKNOWN;
+ }
+
+ /**
+ * Gets converted to text <code>OutputFileFormat</code> value
+ * @param value <code>OutputFileFormat</code> value
+ * @return converted value
+ */
+ public static String getOutputFileFormatName(OutputFileFormat value) {
+ if ( value == OutputFileFormat.TXT ) {
+ return "TXT";
+ } else if ( value == OutputFileFormat.HTML ) {
+ return "HTML";
+ }
+ return null;
+ }
+
+ /**
+ * Converts text to <code>OutputType</code> value
+ * @param name text value
+ * @return <code>OutputType</code> type value
+ */
+ public static OutputType getOutputTypeByName(String name) {
+ if ( name == null ) {
+ return OutputType.NOT_DEFINED;
+ } else if ( name.equals("FILE") ) {
+ return OutputType.FILE;
+ } else if ( name.equals("RDEBUG") ) {
+ return OutputType.RDEBUG;
+ }
+ return OutputType.UNKNOWN;
+ }
+
+ /**
+ * Gets converted to text <code>OutputType</code> value
+ * @param value <code>OutputType</code> value
+ * @return converted value
+ */
+ public static String getOutputTypeName(OutputType value) {
+ if ( value == OutputType.FILE ) {
+ return "FILE";
+ } else if ( value == OutputType.RDEBUG ) {
+ return "RDEBUG";
+ }
+ return null;
+ }
+
+ /**
+ * Converts text to <code>FileCreationMode</code> value
+ * @param name text value
+ * @return <code>FileCreationMode</code> type value
+ */
+ public static FileCreationMode getFileCreationModeByName(String name) {
+ if ( name == null ) {
+ return FileCreationMode.NOT_DEFINED;
+ } else if ( name.equals("OVERWRITE") ) {
+ return FileCreationMode.OVERWRITE;
+ } else if ( name.equals("APPEND") ) {
+ return FileCreationMode.APPEND;
+ }
+ return FileCreationMode.UNKNOWN;
+ }
+
+ /**
+ * Gets converted to text <code>FileCreationMode</code> value
+ * @param value <code>FileCreationMode</code> value
+ * @return converted value
+ */
+ public static String getFileCreationModeName(FileCreationMode value) {
+ if ( value == FileCreationMode.APPEND ) {
+ return "APPEND";
+ } else if ( value == FileCreationMode.OVERWRITE ) {
+ return "OVERWRITE";
+ }
+ return null;
+ }
+
+ /**
+ * Gets allowed <code>MeasurementModule</code> values text representations
+ * @return allowed <code>MeasurementModule</code> values text representations
+ */
+ public static String[] getMeasurementModuleNames() {
+ Collection<String> names = measurementModuleNames.values();
+ return (String[])names.toArray(new String[names.size()]);
+ }
+
+ /**
+ * Converts text to <code>MeasurementModule</code> value
+ * @param name text value
+ * @return <code>MeasurementModule</code> type value
+ */
+ public static MeasurementModule getMeasurementModuleByName(String name) {
+ if ( name == null ) {
+ return MeasurementModule.NOT_DEFINED;
+ }
+
+ Enumeration<MeasurementModule> keys = measurementModuleNames.keys();
+ while ( keys.hasMoreElements() ) {
+ MeasurementModule key = keys.nextElement();
+ String value = measurementModuleNames.get( key );
+ if ( value.equals(name) ) {
+ return key;
+ }
+ }
+ return MeasurementModule.UNKNOWN;
+ }
+
+ /**
+ * Gets converted to text <code>MeasurementModule</code> value
+ * @param module <code>MeasurementModule</code> value
+ * @return converted value
+ */
+ public static String getMeasurementModuleName(MeasurementModule module) {
+ return measurementModuleNames.get(module);
+ }
+
+ /**
+ * Checks if element has proper value
+ * @param elementType elemen type
+ * @param value element value
+ * @return <b><code>true</code></b> if element has proper value,
+ * <b><code>false</code></b> if value doesn't have proper value
+ */
+ public static boolean hasProperValue( SectionElementType elementType, String value ) {
+
+ switch( elementType ) {
+ // Engine defaults section
+ case TEST_REPORT_MODE:
+ return isProperTestReportModeValue( value );
+ case CREATE_TEST_REPORT:
+ return isProperYesNoValue( value );
+ case TEST_REPORT_FILE_PATH:
+ return true;
+ case TEST_REPORT_FILE_NAME:
+ return true;
+ case TEST_REPORT_FORMAT:
+ return isProperOutputFileFormatValue( value );
+ case TEST_REPORT_OUTPUT:
+ return isProperOutputTypeValue( value );
+ case TEST_REPORT_CREATION_MODE:
+ return isProperFileCreationModeValue( value );
+ case DEVICE_RESET_DLL_NAME:
+ return true;
+ case DISABLE_MEASUREMENT:
+ return isProperMeasurementModuleValue( value );
+ case TIMEOUT:
+ int timeout = 0;
+ try {
+ timeout = Integer.parseInt( value );
+ } catch ( NumberFormatException ex ) {
+ return false;
+ }
+ if ( timeout < 0 ) {
+ return false;
+ }
+ return true;
+ case UI_TESTING_SUPPORT:
+ return isProperYesNoValue( value );
+ case SEPARATE_PROCESSES:
+ return isProperYesNoValue( value );
+ // Loger defaults section
+ case CREATE_LOG_DIRECTORIES:
+ return isProperYesNoValue( value );
+ case EMULATOR_BASE_PATH:
+ return true;
+ case EMULATOR_LOG_FORMAT:
+ return isProperOutputFileFormatValue( value );
+ case EMULATOR_LOG_OUTPUT:
+ return isProperOutputTypeValue( value );
+ case HARDWARE_BASE_PATH:
+ return true;
+ case HARDWARE_LOG_FORMAT:
+ return isProperOutputFileFormatValue( value );
+ case HARDWARE_LOG_OUTPUT:
+ return isProperOutputTypeValue( value );
+ case LOG_FILE_CREATION_MODE:
+ return isProperFileCreationModeValue( value );
+ case THREAD_ID_TO_LOG_FILE:
+ return isProperYesNoValue( value );
+ case WITH_TIME_STAMP:
+ return isProperYesNoValue( value );
+ case WITH_LINE_BREAK:
+ return isProperYesNoValue( value );
+ case WITH_EVENT_RANKING:
+ return isProperYesNoValue( value );
+ case LOG_FILE_UNICODE:
+ return isProperYesNoValue( value );
+ // Module section
+ case MODULE_NAME:
+ if ( ( value.indexOf(" ") != -1 ) || ( value.indexOf("\t") != -1 ) ) {
+ return false;
+ }
+ return true;
+ case INI_FILE:
+ return true;
+ case TEST_CASE_FILE:
+ return true;
+ case ADD_TESTCASE_TITLE:
+ return isProperYesNoValue( value );
+ }
+
+ return false;
+ }
+
+ /**
+ * Checks if text is proper <code>YesNo</code> type value
+ * @param value
+ * @return <b><code>true</code></b> if text is proper value,
+ * <b><code>false</code></b> if text is not proper value
+ */
+ private static boolean isProperYesNoValue( String value ) {
+ YesNo yesNo = getYesNoValueByName( value );
+ if ( yesNo == YesNo.UNKNOWN ) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Checks if text is proper <code>OutputFileFormat</code> type value
+ * @param value
+ * @return <b><code>true</code></b> if text is proper value,
+ * <b><code>false</code></b> if text is not proper value
+ */
+ private static boolean isProperOutputFileFormatValue( String value ) {
+ OutputFileFormat format = getOutputFileFormatByName( value );
+ if ( format == OutputFileFormat.UNKNOWN ) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Checks if text is proper <code>FileCreationMode</code> type value
+ * @param value
+ * @return <b><code>true</code></b> if text is proper value,
+ * <b><code>false</code></b> if text is not proper value
+ */
+ private static boolean isProperFileCreationModeValue( String value ) {
+ FileCreationMode mode = getFileCreationModeByName( value );
+ if ( mode == FileCreationMode.UNKNOWN ) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Checks if text is proper <code>MeasurementModule</code> type value
+ * @param value
+ * @return <b><code>true</code></b> if text is proper value,
+ * <b><code>false</code></b> if text is not proper value
+ */
+ private static boolean isProperMeasurementModuleValue( String value ) {
+ MeasurementModule module = getMeasurementModuleByName( value );
+ if ( module == MeasurementModule.UNKNOWN ) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Checks if text is proper <code>OutputType</code> type value
+ * @param value
+ * @return <b><code>true</code></b> if text is proper value,
+ * <b><code>false</code></b> if text is not proper value
+ */
+ private static boolean isProperOutputTypeValue( String value ) {
+ OutputType type = getOutputTypeByName( value );
+ if ( type == OutputType.UNKNOWN ) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Checks if text is proper <code>ProperTestReportMode</code> type value
+ * @param value
+ * @return <b><code>true</code></b> if text is proper value,
+ * <b><code>false</code></b> if text is not proper value
+ */
+ private static boolean isProperTestReportModeValue( String value ) {
+ TestReportMode mode = getTestReportModeByName( value );
+ if ( mode == TestReportMode.UNKNOWN ) {
+ return false;
+ }
+ return true;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configmanager/FileCreationMode.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configmanager;
+
+/**
+ * File creation mode type
+ *
+ */
+public enum FileCreationMode {
+ /**
+ * Value not defined
+ */
+ NOT_DEFINED,
+ /**
+ * Unknown value
+ */
+ UNKNOWN,
+ /**
+ * Overwrite old file
+ */
+ OVERWRITE,
+ /**
+ * Append to old file
+ */
+ APPEND }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configmanager/MeasurementModule.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configmanager;
+
+/**
+ * Measurment modules type
+ *
+ */
+public enum MeasurementModule { NOT_DEFINED, UNKNOWN,
+ /**
+ * Do not disable any measurment module plugin
+ */
+ STIF_MEASUREMENT_DISABLE_NONE,
+ /**
+ * Disable all measurment module plugins
+ */
+ STIF_MEASUREMENT_DISABLE_ALL,
+ /**
+ * Disable measurment plugin 01
+ */
+ STIF_MEASUREMENT_PLUGIN_01,
+ /**
+ * Disable measurment plugin 02
+ */
+ STIF_MEASUREMENT_PLUGIN_02,
+ /**
+ * Disable measurment plugin 03
+ */
+ STIF_MEASUREMENT_PLUGIN_03,
+ /**
+ * Disable measurment plugin 04
+ */
+ STIF_MEASUREMENT_PLUGIN_04,
+ /**
+ * Disable measurment plugin 05
+ */
+ STIF_MEASUREMENT_PLUGIN_05,
+ /**
+ * Disable bappea profiler measurment module plugin
+ */
+ STIF_BAPPEA_PROFILER }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configmanager/OutputFileFormat.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configmanager;
+
+/**
+ * Output file format type
+ *
+ */
+public enum OutputFileFormat {
+ /**
+ * Output format not defined
+ */
+ NOT_DEFINED,
+ /**
+ * Unknown output format
+ */
+ UNKNOWN,
+ /**
+ * Txt format
+ */
+ TXT,
+ /**
+ * HTML format
+ */
+ HTML }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configmanager/OutputType.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configmanager;
+
+/**
+ * Output type
+ *
+ */
+public enum OutputType {
+ /**
+ * Not defined
+ */
+ NOT_DEFINED,
+ /**
+ * Unknown output type
+ */
+ UNKNOWN,
+ /**
+ * File output
+ */
+ FILE,
+ /**
+ * RDebug output
+ */
+ RDEBUG };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configmanager/ParseProblem.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configmanager;
+
+/**
+ * Parse problem representation
+ *
+ */
+public class ParseProblem {
+ /**
+ * Problem type
+ * @author Ireneusz Kapica
+ */
+ public enum ProblemType {
+ /**
+ * Error
+ */
+ ERROR,
+ /**
+ * Warning
+ */
+ WARNING };
+
+ /**
+ * Problem type
+ */
+ public ProblemType type;
+ /**
+ * Line number in which problem occurs
+ */
+ public int lineNumber;
+ /**
+ * Problem description
+ */
+ public String description;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configmanager/SectionElementType.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configmanager;
+
+/**
+ * Enum of section elements
+ *
+ */
+
+public enum SectionElementType { UNDEFINED,
+ TEST_REPORT_MODE,
+ CREATE_TEST_REPORT,
+ TEST_REPORT_FILE_PATH,
+ TEST_REPORT_FILE_NAME,
+ TEST_REPORT_FORMAT,
+ TEST_REPORT_OUTPUT,
+ TEST_REPORT_CREATION_MODE,
+ DEVICE_RESET_DLL_NAME,
+ DISABLE_MEASUREMENT,
+ TIMEOUT,
+ UI_TESTING_SUPPORT,
+ SEPARATE_PROCESSES,
+
+ CREATE_LOG_DIRECTORIES,
+ EMULATOR_BASE_PATH,
+ EMULATOR_LOG_FORMAT,
+ EMULATOR_LOG_OUTPUT,
+ HARDWARE_BASE_PATH,
+ HARDWARE_LOG_FORMAT,
+ HARDWARE_LOG_OUTPUT,
+ LOG_FILE_CREATION_MODE,
+ THREAD_ID_TO_LOG_FILE,
+ WITH_TIME_STAMP,
+ WITH_LINE_BREAK,
+ WITH_EVENT_RANKING,
+ LOG_FILE_UNICODE,
+ ADD_TESTCASE_TITLE,
+
+ MODULE_NAME,
+ INI_FILE,
+ TEST_CASE_FILE
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configmanager/TestReportMode.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configmanager;
+
+/**
+ * Test report mode type
+ *
+ */
+public enum TestReportMode {
+ /**
+ * Not defined
+ */
+ NOT_DEFINED,
+ /**
+ * Unknown
+ */
+ UNKNOWN,
+ /**
+ * Nothing will be reported
+ */
+ EMPTY,
+ /**
+ * Summary of the tested test cases
+ */
+ SUMMARY,
+ /**
+ * Hardware and software info
+ */
+ ENVIRONMENT,
+ /**
+ * Test case report
+ */
+ TESTCASE,
+ /**
+ * Full report
+ */
+ FULL_REPORT };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.configeditor/src/com/nokia/testfw/stf/configmanager/YesNo.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.configmanager;
+
+/**
+ * Yes/No value type
+ *
+ */
+public enum YesNo {
+ /**
+ * Not defined
+ */
+ NOT_DEFINED,
+ /**
+ * Unknown
+ */
+ UNKNOWN,
+ /**
+ * Yes value
+ */
+ YES,
+ /**
+ * No value
+ */
+ NO }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.stf.help</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/META-INF/MANIFEST.MF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ITE STF Help plug-in
+Bundle-SymbolicName: com.nokia.testfw.stf.help;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: com.nokia.testfw.stf.help.HelpPlugin
+Bundle-Vendor: Nokia
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Eclipse-LazyStart: true
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/about.html Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body>
+
+<h2>About This Content</h2>
+
+<p>February 4, 2009</p>
+
+<h3>Copyright</h3>
+<p>Copyright © 2007-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.<br>
+This component and the accompanying materials are made available under the <br/>
+terms of the License "Eclipse License v1.0" which accompanies this <br/>
+distribution, and is available at the URL: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.<p>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/book.css Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,186 @@
+/*
+ Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+ License: http://www.symbianfoundation.org/legal/epl-v10.html.
+
+*/
+
+/* Add whitespace around entire display to avoid crowding edges of view */
+/* 20070523-Removed top margin size to close gap between location breadcrumbs and page title */
+html {
+ margin: 0px 10px 10px 10px;
+ }
+
+/* Set default font to serif style, 12-pt and plain */
+body, p, table {
+ font-family: Georgia, "Times New Roman", Times, serif;
+ font-size: 12px;
+ font-weight: normal;
+}
+
+/* Use sans-serif fonts for all title styles */
+h1, h2, h3, h4, h5, h6, strong, em {
+ font-family: Helvetica, sans-serif;
+ color: #000000;
+ }
+
+h1 { font-size:20px }
+h2 { font-size:18px }
+h3 { font-size:16px }
+h4 { font-size:14px }
+h5 { font-size:12px }
+h6 { font-size:10px }
+
+/* For headlines at the top of a view, add space */
+/* 20070522-added gradiant to background to update visual style of docs */
+h1, h2, h3 {
+ background-image: url(html/images/green_fade_left_68_165_28.png);
+ background-repeat: no-repeat;
+ padding:10px 0px 10px 12px;
+ }
+
+li {
+ margin-bottom:8px;
+ margin-top:8px;
+ }
+
+/* Footer includes space and a gray line above the company logo */
+#footer {
+ padding-top:10px;
+ margin-top:20px;
+ border-top:1px solid #999;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ color: #03C;
+ }
+
+.listing {
+ font-family: "Courier New", Courier, mono;
+ color: #009;
+ background-color: #EEE;
+ padding: 10px 0px;
+ margin: 10px 0px;
+ }
+
+.code, pre {
+ font-family: "Courier New", Courier, mono;
+ font-size: 11px;
+ color: #333;
+ }
+
+.step {
+ /* background-color: #EEE; */
+ /* margin: 10px 0px; */
+ color: #333;
+ border-bottom:2px solid #EEE;
+ }
+
+.substep {
+ background-color: #EEE;
+ }
+
+
+/* Figure/Listing/Table titles are centered and gray */
+p.table {
+ color: #999;
+ font-weight: bold;
+ padding-top: 5px;
+ }
+
+table {
+ border: solid #999 1px;
+ table-layout: auto;
+ font-size: 12px;
+ }
+
+td, th {
+ border: solid #999 1px;
+ padding: 5px;
+ vertical-align:top;
+ }
+
+/* 20070522-replaced gray with green background to match gradiant color for title */
+th {
+ background-color:#ACD79B;
+ /* background-color:#999;
+ color:#FFF; */
+ }
+
+div.ol.p {
+ margin-left: 3em;
+ }
+
+/* Make all ordered/unordered list items appear in bold gray */
+div ol > li, div ul > li {
+ font-weight:bold;
+ color: #333;
+ }
+
+div ol > p, div ul > p, div li > p {
+ font-weight:normal;
+ }
+
+/* Make all H4 and H5 items appear in bold gray against a light green background */
+div h5, div h4 {
+ padding:5px 0px 5px 12px;
+ background-color:#ECFBEA;
+ /* background-color: #EEE; */
+ font-weight:bold;
+ color: #333;
+ }
+
+
+/* Notes stand out using a light top & bottom borders with dark gray text */
+p.note {
+ /* color: #03C; */
+ /* background-color: #FFFF99; */
+ color: #333;
+ padding: 5px;
+ margin-left: 1em;
+ margin-right: 1em;
+ border-top: solid #BBB thin;
+ border-bottom: solid #BBB thin;
+ }
+
+
+/* Figure/Listing/Table titles are centered and gray */
+p.figure {
+ color: #333;
+ text-align: center;
+ font-weight: bold;
+ }
+
+/* highly visible red background and white text for things that need fixing before release */
+/* SHOULD NOT BE PRESENT IN RELEASED PRODUCTS */
+.fix {
+ background-color: red;
+ font-weight: bold;
+ color: white;
+ }
+
+.question {
+ font-style:italic;
+ font-weight:bold;
+ color: #555;
+ }
+
+.titleSmall {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ }
+
+
+.plain {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+ font-style: normal;
+ line-height: normal;
+ font-weight: normal;
+ font-variant: normal;
+ color: #000000;
+ text-decoration: none;
+ }
+
+a:link { color: #0033CC }
+a:visited { color: #555555 }
+a:hover { color: #0033CC }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/build.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,10 @@
+bin.includes = about.html,\
+ book.css,\
+ html/,\
+ META-INF/,\
+ plugin.xml,\
+ toc.xml,\
+ tocgettingstarted.xml,\
+ tocConcepts.xml,\
+ tocReference.xml,\
+ tocTasks.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/concepts/ats.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Automatic Test System (ATS)</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Automatic Test System (ATS)</h2>
+<p>The Automatic Test System (ATS) provides an automated testing environment for Symbian OS devices. ATS supports booting the devices, flashing test images to them, copying the required files to devices, and executing the defined tests automatically on the target devices. Test execution results are also available from the ATS.</p>
+<p>The ATS Server is a PC where ATS is installed. The ATS Server is aware of the whole ATS network. </p>
+<p>The ATS Server connection is not needed for running tests in an emulator environment. The <i>atsserverinterface.exe</i> is used for this purpose and it is delivered as part of STF. </p>
+<p>The ATS Test Drop (or a test package) is a .zip file that contains the <i>test.xml</i> file, test binaries, test script file, and flash images for the target device if it is defined. </p>
+
+<h3>Related tasks</h3>
+<ul>
+ <li><a href="../tasks/preferences.htm">Setting TestDrop preferences</a></li>
+ <li><a href="../tasks/senddialog.htm">Sending a STF test drop to ATS</a></li>
+ <li><a href="../tasks/view_testdrop_results.htm">Viewing the TestDrop test results</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/concepts/concepts.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
+<title>Concepts</title>
+<link href="../../book.css" type="text/css" rel="StyleSheet">
+</head>
+<body>
+
+<h2>Concepts</h2>
+<p>The following concepts provide information on specific terminology, technologies, and processes related to STF:</p>
+<ul>
+ <li><a href="test_case.htm">Test cases</a></li>
+ <li><a href="test_class.htm">Test classes</a></li>
+ <li><a href="scripts.htm">Test scripts</a></li>
+ <li><a href="ats.htm">Automatic Test System (ATS)</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/concepts/scripts.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Test scripts</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Test scripts</h2>
+<p>In STF, you can create scripts that consist of a series of keywords and arguments, describing the operation of the test case. Scripts let you to create advanced combinations of test cases that can be implemented in various test classes. By using scripts you can reuse test classes and provide test cases with new arguments without a need of recompilation.</p>
+
+<p>A test case file may contain several test cases, the descriptions of which start with the tag <code>[Test]</code> and end with the tag <code>[Endtest]</code>. The test case is executed sequentially line by line. The test case itself is described with keywords, arguments, and argument-value pairs between the start and end tags.</p>
+<p>An example of a test case is shown below:</p>
+<p><code>[Test] <br>title Create, print, run example and delete<br>create TestScriptClass test<br>print Call Example method<br>test Example parameters<br>print Example method called, delete instance<br>delete test<br>[Endtest]</code></p>
+<p>Each mode has a keyword vocabulary. For more information, see the links below.</p>
+
+<h5>Related tasks</h5>
+<ul>
+ <li><a href="../tasks/creating_scripts.htm">Editing scripts</a></li>
+</ul>
+
+<h5>Related references</h5>
+<ul>
+ <li><a href="../references/script_keywords.htm">Script keywords</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/concepts/test_case.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Test cases</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Test cases</h2>
+<p>Test cases are unique tests that are run on components. The test cases either pass or fail in execution.</p>
+<p>In STF, the actual test cases are separated from the test case execution environment. Typically, test cases are specified in a test case file (also known as configuration file). Using a separate test case file allows you to modify test cases without modifying the software module that does the actual testing.</p>
+
+<p>In STF, test cases are typically collected into test classes.</p>
+
+<h5>Related concepts</h5>
+<ul>
+ <li><a href="../concepts/test_class.htm">Test classes</a></li>
+ <li><a href="../concepts/scripts.htm">Test scripts</a></li>
+</ul>
+
+<h5>Related tasks</h5>
+<ul>
+ <li><a href="../tasks/run_test_case.htm">Running the test cases</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/concepts/test_class.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Test classes</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Test classes</h2>
+<p>In STF, test cases are collected into separate classes, called <i>test class</i>, which contain the actual test case implementation.</p>
+<p>There can be several test cases implemented in one test class, and test cases can be defined, for example, by a test case file (a configuration file). In addition, STF supports running different test cases simultaneously from several test classes.</p>
+
+<h5>Related tasks</h5>
+<ul>
+ <li><a href="../tasks/creating_stf_project.htm">Creating STF project</a></li>
+ <li><a href="../tasks/import_of_project.htm">Importing STF project</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/gettingstarted/GS_index.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Getting started</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Getting started</h2>
+<p>The information in this section will help you to start using the basic features of the STF plugin.</p>
+<p>Topics in this section include:</p>
+<ul>
+ <li><a href="overview.htm">Overview</a></li>
+ <li><a href="walk_through.htm">Basic walk-through</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/gettingstarted/overview.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Overview</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Overview</h2>
+<p>STF is an advanced test harness for testing Symbian and S60 non-UI components. It is a toolkit designed for test case implementation and test cases execution.</p>
+<p>STF provides a framework for implementing test cases in separate test classes, meaning that:</p>
+<ul>
+ <li>test cases are implemented to separate test classes. </li>
+ <li>test class implement a common test class API.</li>
+ <li>test classes run independently in their own threads. </li>
+</ul>
+<p>STF is not an automatic test case creator, but it does enable you to concentrate on the actual test case implementation.</p>
+<p>The benefit of STF is to: “write once, test everywhere”. This means, for example, that test cases made during the development phase can be used in system testing, automatic release testing, and so on.</p>
+<p>The ITE Carbide plug-in lets you easily create STF test classes and test cases, as well as configure some of STF's options.</p>
+
+<h3>ATS TestDrop</h3>
+<p>STF also contains TestDrop functionality that lets you create test packages of STF projects and send them to the Automatic Test System (ATS) for execution. For more information, see <a href="../concepts/ats.htm">Automatic Test System (ATS)</a>.</p>
+
+<h5>Related concepts</h5>
+<ul>
+ <li><a href="../concepts/test_case.htm">Test cases</a></li>
+ <li><a href="../concepts/test_class.htm">Test classes</a></li>
+ <li><a href="../concepts/scripts.htm">Test scripts</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/gettingstarted/walk_through.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Basic walk-through</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Basic walk-through</h2>
+<p>This is the basic order of tasks when using STF:</p>
+<ol>
+ <li>start the tool, either by
+ <ul>
+ <li><a href="../tasks/creating_stf_project.htm">creating a new STF project, or</a></li>
+ <li><a href="../tasks/import_of_project.htm">importing an existing STF project</a> into the Carbide.c++ IDE.</li>
+ </ul>
+ </li>
+ <li><a href="../tasks/configuration_editor.htm#module">Add the test module</a> to the STF configuration file.</li>
+ <li><a href="../tasks/script_editor.htm">Add your test cases to the script file(a file containing STF test cases)</a> (when using the test class).</li>
+ <li>Using Carbide, <a href="../tasks/run_test_case.htm">run the test cases</a>.</li>
+ <li>(Optional) <a href="../tasks/senddialog.htm">Send a test drop to the ATS system</a> to remotely run the STF test cases.</li>
+</ol>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/images/ATSDropTestResults.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/images/Components.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/images/SendTestDropDialog.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/images/TestDropPreferences.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/images/TestDropTestResultView.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/images/TestDropTestResultViewer.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/images/TestDropTestResults.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/images/green_fade_left_68_165_28.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/images/testDrop_process.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/legal.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Legal</title>
+<link href="../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>License Information</h2>
+
+<h4>COPYRIGHTS</h4>
+
+<p>Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. This component and the accompanying materials are made available under the terms of the License "Symbian Foundation License v1.0" which accompanies this distribution, and is available at the URL <a href="http://www.eclipse.org/legal/epl-v10.html">"http://www.eclipse.org/legal/epl-v10.html"</a>.</p>
+<p>Initial Contributors:<br>
+Nokia Corporation - initial contribution</p>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/references/references.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<meta http-equiv="Content-Style-Type" content="text/css" />
+<title>References</title>
+<link rel="StyleSheet" href="../../book.css" type="text/css"/>
+</head>
+<body>
+
+<h2>References</h2>
+<p>The following references are available for this tool:</p>
+<ul>
+ <li><a href="script_keywords.htm">Script keywords</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/references/script_keywords.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,359 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Test Scripter keywords</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h3>Test Scripter keywords</h3>
+<table width="489" border="1" cellspacing="1" cellpadding="2" summary="keywords">
+<colgroup>
+<col width="33*">
+<col width="159*"></colgroup>
+<tbody>
+<tr>
+<td><p><b>Keyword</b></p></td>
+<td><p><b>Explanation and examples</b></p></td>
+</tr>
+<tr>
+<td><code>title</code></td>
+<td><p>Describes the test case. This is mandatory for every test case and must be the first keyword. The description is placed after the keyword. </p><code>title Create, print, run example and delete</code></td>
+</tr>
+<tr>
+<td><code>timeout</code></td>
+<td><p>Specifies a timeout value for a test case. The timeout value is given in milliseconds. For example, a timeout of 10 seconds would be marked as: </p><code>timeout 10000</code></td>
+</tr>
+<tr>
+<td><code>priority</code></td>
+<td><p>Specifies the priority value of the test case. The value can be either an integer or the string "high", "normal" or "low". Negative values are low and positive values are high.</p><p>For example, –100 is low, 0 is normal, 100 is high, 1000 is very high: </p><code>priority high<br>priority 100<br>priority –100<br>priority 0</code></td>
+</tr>
+<tr>
+<td><code>print</code></td>
+<td><p>Specifies a description to print, for example, to print progress information to the UI. The printed description is placed after the print keyword, as in the example in <a href="../concepts/scripts.htm">Test scripts</a>.</p></td>
+</tr>
+<tr>
+<td><code>setresultdescription</code></td>
+<td><p>Sets the description of the current executed test case. In case of an error situation, it will be shown in the test report.</p><code>setresultdescription object creation starts </code></td>
+</tr>
+<tr>
+<td><code>create</code></td>
+<td><p>Creates a new instance of a test class. This keyword has two mandatory arguments: </p>
+<ul>
+<li>Test class name : The test class name for the new object. It is the first argument.</li>
+<li>Test object name: The name of the created new instance of the test class.</li>
+</ul>
+<code>create TestScriptClass testObject</code></td>
+</tr>
+<tr>
+<td><code>createkernel</code></td>
+<td><p>Creates a new instance of a kernel test class. This keyword has two mandatory arguments: </p>
+<ul>
+<li>Kernel test class name: The kernel test class name for the new object. It is the first argument.</li>
+<li>Test object name: The name of the created new instance of the kernel test class.</li>
+</ul>
+<code>createkernel TSKernelTest testObject</code></td>
+</tr>
+<tr>
+<td><code>delete</code></td>
+<td><p>Deletes an instance of a test class. Keyword has one mandatory argument: </p>
+<ul>
+<li>Test object name: The name of the instance of the test class that is deleted.</li>
+</ul>
+<code>delete testObject</code></td>
+</tr>
+<tr>
+<td><code>allownextresult</code></td>
+<td><p>Adds valid result values for a method and for asynchronous commands. The arguments for this keyword are Symbian platform error codes. </p><p>The default value for the expected result is 0, and if a value is set with allownextresult, 0 is removed from the expected values. </p><p>A method may either return or leave with the specified result. Every method call removes all allowed results. That is, after every method call, the default value 0 is again the only expected result value. Multiple allownextresult keywords can be placed before a method call and before the waittestclass keyword.</p><code>allownextresult –1 <br>allownextresult –1 -5 -12</code></td>
+</tr>
+<tr>
+<td><code>allowerrorcodes</code></td>
+<td><p>Adds valid result values for a method and for asynchronous commands. The arguments for this keyword are Symbian platform error codes. </p><p>As a default the expected result is 0 and if new value is set with allowerrorcodes, 0 will remain as an expected value. A method may either return or leave with the specified results. Every method call removes all allowed results. That is, after every method call, the default value 0 is again the only expected result value. </p><p>Multiple allowerrorcodes keywords can be placed before a method call and before the waittestclass keyword.</p><code>allowerrorcodes –1 <br> allowerrorcodes –1 -5 -12</code></td>
+</tr>
+<tr>
+<td><code>waittestclass</code></td>
+<td><p>Pauses test case running until the specified test class object calls the Signal function to proceed with the test case execution again. Keyword has one mandatory argument: </p>
+<ul>
+<li>Test object name: The name of the instance of the test class, which must call Signal() to proceed with the test case execution.</li>
+</ul>
+<code>waittestclass testObject </code></td>
+</tr>
+<tr>
+<td><code>pause</code></td>
+<td><p>Pauses test case running for a specified timeout (in milliseconds). That is, no further lines of the test case file will be executed during that delay, but the thread is not halted; any user active objects may still be completed and their RunL() called.</p><p>For example, a pause of 10 seconds would be:</p><code>pause 10000</code></td>
+</tr>
+<tr>
+<td><code>loop</code><br><code>endloop</code></td>
+<td><p>Repeats a section of the test case file for the specified number of iterations. The section to be repeated is enclosed with the loop and endloop keywords. Nested loops are not supported. Available arguments are:</p>
+<ul>
+<li>Loop times: The loop count, that is, the number of times that the loop is executed. </li>
+<li>msec (optional): This keyword says that ‘Loop times’ argument stands for the time in milliseconds during which loop will be repeated. </li>
+</ul>
+<p>For example, to execute a loop for 5 times: </p><code>loop 5 // execute this 5 times <br>print LOOP_COUNTER // prints loop counter value, from 0 to -1. <br>endloop</code></td>
+</tr>
+<tr>
+<td><code>oomignorefailure</code></td>
+<td><p>Used for OOM testing. Defines if a test class’s building block execution result is checked or ignored. Possible values are ON or OFF: </p>
+<ul>
+<li>ON indicates that the building block execution result will be ignored.</li>
+<li>OFF (default) indicates that the building block execution result will be checked and errors will be handled.</li>
+</ul>
+<code>oomignorefailure on</code></td>
+</tr>
+<tr>
+<td><code>oomheapfailnext</code></td>
+<td><p>Used for OOM testing. Defines that heap allocation failure occurs in the test thread.</p>
+<ul>
+<li>Count value (rate): The failure rate. Heap allocation fails every time that is given as an argument. The given argument will be increased by one because the Test Scripter LOOP_COUNTER range starts from 0. The oomheapfailnext range starts from 1.</li>
+</ul>
+<code>oomheapfailnext 0</code></td>
+</tr>
+<tr>
+<td><code>oomheapsetfail</code></td>
+<td><p>Used for OOM testing. Defines that heap allocation failure occurs in the test thread. The user can define the failure type and count (rate).</p><ul>
+<li>The type of failure to be simulated. The values are: random, truerandom, deterministic, none and failnext. </li>
+<li>Count value (rate): The given argument will be increased by one because the Test Scripter LOOP_COUNTER range starts from 0. The oomheapsetfail range starts from 1.</li>
+</ul>
+<code>oomheapsetfail deterministic 2</code></td>
+</tr>
+<tr>
+<td><code>oomheaptonormal</code></td>
+<td><p>Used for OOM testing. Ends OOM testing and normal testing continues. This keyword can be used to initialize OOM parameters to the default ones. The oomheaptonormal keyword enables the test class’s building block execution result check and heap failures are not used anymore.</p></td>
+</tr>
+<tr>
+<td><code>testinterference</code></td>
+<td><p>Interferes the testing. It can take the following arguments: </p>
+<ul>
+<li>Object name</li>
+<li>Command (start or stop) </li>
+<li>Category</li>
+<li>Type</li>
+<li>Idle time (in milliseconds) </li>
+<li>Active time (in milliseconds) </li>
+<li>Set priority</li>
+</ul>
+<p>Example of usage: </p><code>#idle = 200 microseconds, active = 2<br> microseconds testinterference object1 start activeobject cpuload 0.2 0.002 <br>. . . <br>testinterference object1 stop</code></td>
+</tr>
+<tr>
+<td><code>callsub</code></td>
+<td><p>Makes TestScripter executing pointed section of script.</p><p>The section that will be called must start with [Sub name] and end with [EndSub] tags, where name is the identifier of the sub. The execution of the sub will continue until its end is reached. You can call a sub from another sub.</p><code>[Test] <br>title calldemo <br>print Starting... <br>callsub T1 <br>callsub T2 <br>print Finishing... <br>[Endtest]<br><br>[Sub T1] <br>print Inside T1 sub<br>callsub T11 <br>[EndSub] <br><br>[Sub T11] print Inside T11 sub <br>[EndSub] <br><br>[Sub T2] <br>print Inside T2 sub <br>[EndSub]</code></td>
+</tr>
+<tr>
+<td><code>request</code></td>
+<td><p>Requests an event. If someone wants to use an event, it must first be requested, and after that it can be waited. After the event is not used anymore, it must be released. The event name is a mandatory parameter.</p><code>request Event1</code></td>
+</tr>
+<tr>
+<td><code>wait</code></td>
+<td><p>Waits for an event. A request must be called before wait, and wait on the requested event blocks until the requested event is set. wait may proceed immediately if the requested event is a state event and already pending (for example, a phone call is already active). wait has one mandatory argument, which is the event name. </p><code>wait Event1</code></td>
+</tr>
+<tr>
+<td><code>release</code></td>
+<td><p>Releases an event. Every requested event must be released explicitly when it is not used anymore. release has one mandatory argument, which is the event name. </p><code>release Event1</code></td>
+</tr>
+<tr>
+<td><code>set</code></td>
+<td><p>Sets an event. Every set state event must be explicitly unset. The arguments are: </p>
+<ul>
+<li>Event: The event name. </li>
+<li>State (Optional): If a state is given, sets the state event, otherwise sets an indication event. A state event remains set until it is unset explicitly with the unset keyword. An indication event is set only once to every requester and implicitly unset after that.</li>
+</ul>
+<p>For example: </p><code>set Event1 <br>set Event2 state</code></td>
+</tr>
+<tr>
+<td><code>unset</code></td>
+<td><p>Unsets a state event. Every set state event must be unset. Indication events cannot be unset. Unset of a event blocks until everyone who has requested the specified event has released the event. The mandatory argument is the event name. </p><code>unset Event1</code></td>
+</tr>
+<tr>
+<td><code>bringtoforeground</code></td>
+<td><p>Brings the UI component container to foreground. </p></td>
+</tr>
+<tr>
+<td><code>sendtobackground</code></td>
+<td><p>Sends the UI component container to background. </p></td>
+</tr>
+<tr>
+<td><code>presskey</code></td>
+<td><p>Sends a key event to the tested UI component. It has one mandatory parameter, which is the key code (a single character or constant defined in the TKeyCode enumeration). </p><p>Also other, optional parameters can be used. </p><code>presskey a <br>presskey 1 <br>presskey EKeyDownArrow <br>presskey keycode=123 <br>presskey keycode=EKeyDownArrow <br>presskey x modifier=EModifierShift <br>presskey keyscancode=123 <br>presskey EKeyDevice0 // press left softkey<br> presskey local EKeyDevice0 // press left softkey <br>presskey global EKeyDevice0 // press left softkey </code></td>
+</tr>
+<tr>
+<td><code>typetext</code></td>
+<td><p>Sends text to the tested UI component. The text that should be sent to the UI components must be in double quotation marks.</p><code>typetext “Text to send”</code></td>
+</tr>
+<tr>
+<td><code>measurement</code></td>
+<td><p>Measures the testing. </p>
+<p>Arguments:</p>
+<ul>
+<li>Command for STF Test Measurement control.<p>The supported values are:<br>start for starting test measurement,<br>stop for stopping test measurement.<br>It also releases all allocated resources.</p></li>
+<li>STF Test measurement type.
+<p>The supported values are:<br>measurementplugin01,<br>measurementplugin02,<br>measurementplugin03,<br>measurementplugin04,<br>measurementplugin05,<br>bappeaprofiler</p></li>
+<li>STF Test measurement module configuring, etc. user and test measurement module specific.</li></ul>
+</td>
+</tr>
+<tr>
+<td><code>var</code></td>
+<td><p>Assigns a text value to a specified variable. It can be then used in other parts of the script.
+</p>
+<p>var Name Value</p></td>
+</tr>
+<tr>
+<td><code>sendpointerevent</code></td>
+<td><p>
+Sends pointer events to the tested UI component. </p>
+<p>Arguments:</p>
+<ul>
+<li>Event type: the pointer event type.<br>
+<p>The following pointer even types are surpported:<br>EButton1,<br>EButton2,<br>EButton3,<br>EPointerMove,<br>EPointerSwitchOn,<br>EButton1Down,<br>EButton1Up,<br>EButton2Down,<br>EButton2Up,<br>EButton3Down,<br>EButton3Up</p></li>
+<li>x: Pointer x co-ordinate</li>
+<li>y: Pointer y co-ordinate</li>
+</ul>
+<p>sendpointerevent EventType Xco-ordinate Yco-ordinate</p>
+</td>
+</tr>
+<tr>
+<td><code>using</code></td>
+<td><p>Loads an STF specific test harness library.</p>
+<p>Arguments:</p>
+<ul>
+<li>DLL name: The test harness library name.</li>
+<li>DLL object name: The alias of the created new instance of the test harness library.</li>
+</ul></td>
+</tr>
+<tr>
+<td><code>expectedpanic</code></td>
+<td><p>Declares a valid panic resume value for the test case.</p>
+<p>Arguments:</p>
+<ul>
+<li>Panic Number, an single integer, which represents the expected panic number</li>
+</ul>
+<p>expectedpanic XXXX</p>
+</td>
+</tr>
+<tr>
+<td><code>createshareobj</code></td>
+<td><p>Creates an object, wihch can be shared with other test cases in the same test script file.</p>
+<p>Arguments:</p>
+<ul>
+<li>Test Class Name: The test class name for the new object. This is the first argument.</li>
+<li>Test Object Name: the name of the created new instance of the test class</li>
+</ul>
+<p>createshareobj ClassName ObjName</p>
+</td>
+</tr>
+<tr>
+<td><code>restoreshareobj</code></td>
+<td><p>Restores an object, which has been created by the createshareobj keyword.</p>
+<p>Arguments:</p>
+<ul>
+<li>Test Object Name: the name of the instance of the test class</li>
+</ul>
+</td>
+</tr>
+<tr>
+<td><code>deleteshareobj</code></td>
+<td><p>Deletes an instance of a test class created with createshareobj.</p>
+<p>Arguments:</p>
+<ul>
+<li>Test Object Name: the name of the instance of the test class</li>
+</ul>
+</td>
+</tr>
+<tr>
+<td><code>file</code></td>
+<td><p>Specifies a data file name.</p>
+<p>Arguments:</p>
+<ul>
+<li>sectionfile.ini: the data file name</li>
+<li>da: a short name used in the script to reference the data file</li>
+</ul></td>
+</tr>
+<tr>
+<td><code>section</code></td>
+<td><p>Specifies which section in the data file will be referred to by the test case.</p>
+<p>Arguments:</p>
+<ul>
+<li>SectionName: The section name defined in the data file.</li>
+<li>SectionShortName: The short name (optional).</li>
+</ul>
+</td>
+</tr>
+<tr>
+<td><code>canceliferror</code></td>
+<td><p>Cancels the execution of the remaining test cases if one of the executed test cases has failed. This keyword is normally used to stop the test case execution when some of the test cases are long running.</p><code>[Test] <br>title Simple test case with canceliferror keyword <br>canceliferror <br>run testclass1 myConfig.cfg 1 // test case fails <br>run testclass2 mySecondConfig.cfg 2 // long running test case <br>[Endtest] </code></td>
+</tr>
+<tr>
+<td><code>run</code></td>
+<td><p>Starts a specified test case. It has several mandatory and optional arguments. The mandatory arguments are: </p>
+<ul>
+<li>testmodule: The test module name. </li>
+<li>configfile: The test case configuration file. </li>
+<li>test case number: The test case number to be executed from configfile.</li>
+</ul>
+<p>Optional arguments contain, for example, testid (identification for the test case), ini (initialization file for the test module) and category (normal, leave, panic, exception or timeout). </p><p>For example: </p><code>run netmodule net.cfg 5 testid=test1 expect=3 ini=ini.txt <br><br>run netmodule net.cfg -1 testid=test1 “title=My test case example”</code></td>
+</tr>
+<tr>
+<td><code>cancel</code></td>
+<td><p>Cancels a running test case. The test case is cancelled by immediately killing the thread that executes the test case. The keyword has one mandatory argument, the test ID. </p><code>cancel test1</code></td>
+</tr>
+<tr>
+<td><code>pausetest</code></td>
+<td><p>Pauses a test case. The test case is paused by pausing the thread that executes
+the test case. The pausetest keyword has one mandatory argument.</p>
+<p>pausetest testid time</p>
+<p>Arguments:</p>
+<ul>
+<li>testid: the test ID from the run command.</li>
+<li>time: (optional) Pause time in milliseconds. After this time, resume is called automatically (if not given, resume needs to be called explicitly).</li>
+</ul>
+<p>For example:</p>
+<p><code>pausetest test1 time=10</code></p>
+</td>
+</tr>
+<tr>
+<td><code>resume</code></td>
+<td><p>Resumes a paused test case. Has one mandatory argument, the test ID. </p><code>resume test1</code></td>
+</tr>
+<tr>
+<td><code>complete</code></td>
+<td><p>Waits and blocks a running test case. This keyword is used to have a started test case wait to complete and blocks until the test case has finished. Has one mandatory argument, the test ID. </p><code>complete test1</code></td>
+</tr>
+<tr>
+<td><code>allocate</code></td>
+<td><p>Allocates a slave, for example, for running a test case on a remote phone. It uses Remote Control Protocol (RPC). The slave must always be allocated first before it can be used.</p>
+<ul>
+<li>Slave type: The type of the slave. STF only supports slave phone. phone indicates that slave phone is also running STF. Other types must be handled by the slave implementation, that is, when implementing separate support for external network simulator. </li>
+<li>Slave name: A unique name for the slave.</li>
+</ul>
+<p>For example: </p><code>allocate phone MySlave</code></td>
+</tr>
+<tr>
+<td><code>free</code></td>
+<td><p>Frees a slave. Every allocated slave must be freed with free when it becomes unused. It has one mandatory argument, the slave name. </p><code>free MySlave</code></td>
+</tr>
+<tr>
+<td><code>remote</code></td>
+<td><p>Starts the execution of a test case in a slave and also requests and releases events from the slave. Other controlling for remote test cases is done with the same keywords as for the local test cases. </p>
+<ul>
+<li>Slave name: The slave name, the same that was given for allocate. </li>
+<li>Command name : The remote command name (supported: run, request, wait, set, unset, release).</li>
+</ul>
+<p>For example: </p><code>remote MySlave run netmodule net.cfg 5 testid=test1 expect=3 ini=ini.txt <br>remote MySlave request Event1 <br>remote MySlave wait Event1 <br>remote MySlave set Event1 <br>remote MySlave unsetEvent1 <br>remote MySlave release Event1</code></td>
+</tr>
+<tr>
+<td><code>INCLUDE</code></td>
+<td><p>Includes a file</p>
+<ul>
+<li>Must be written in capital letters and must start from the first column of the line.</li>
+<li>File name (with path and extension) must follow INCLUDE tr. Rest of line would be ignored.</li>
+<li>All files included from Unicode file should also be in Unicode format (and vice versa).</li>
+<li>Loops in includes are not allowed (for example incorrect situation is when file A includes file B and file B includes file A). In that case, the second include will be ignored, but STF parser will continue working).</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/release_notes.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,71 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
+<title>Release notes</title>
+<link href="../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Release notes</h2>
+
+<h4>STF of ITE 1.0.0</h4>
+<p>STF(Symbian Test Framework) plug-in is a part of ITE(Integrated Test Environment), which is a set of Carbide extensions that supports multiple test frameworks including STF and SUT(Symbian Unit Test).</p>
+<ul>
+ <li><a href="#description">Product description</a></li>
+ <li><a href="#features">Features</a></li>
+ <li><a href="#requirements">System requirements</a></li>
+ <li><a href="#compissues">Compatibility issues</a></li>
+ <li><a href="#issues">Known issues</a></li>
+</ul>
+
+<h3><a name="description"></a>Product description</h3>
+<p>STF is a test harness that is designed for testing Symbian non-UI components. It is a toolkit for test case implementation and test case execution.</p>
+<p>STF plug-in is an ITE Carbide.c++ Extension that enables you to create test classes and test cases with ease, as well as configure some of STF's options, such as global settings for the test environment.</p>
+<p>To start working with STF plug-in, in Carbide, go to <b>File > New > Other</b>, and in <b>Carbide Extensions > Test Frameworks</b> select Symbian Test Framework.</p>
+
+<h3><a name="features"></a>Features</h3>
+<p>STF lets you to do the following:</p>
+<ul>
+ <li>Create STF test classes</li>
+ <li>Add new test cases to test classes</li>
+ <li>Edit STF configuration files</li>
+ <li>Edit STF scripts</li>
+ <li>Run test classes on an emulator and on hardware (through the Automatic Test System (ATS) Server)</li>
+ <li>Get product help</li>
+</ul>
+
+<!--
+<h3><a name="enhancements"></a>Enhancements</h3>
+<ul>
+ <li><i>Fixed:</i> The Outline view of the Script Editor window displayed faulty content. </li>
+</ul>
+ -->
+
+<h3><a name="requirements"></a>System requirements</h3>
+<p>Basic requirements:</p>
+<ul>
+ <li>Windows 2000, Windows XP</li>
+ <li>Minimum Platform/SDK build PC.</li>
+ <li>Normal Platform/SDK build PC.</li>
+</ul>
+<p>Additional requirements:</p>
+<ul>
+ <li>STF needs to be installed on a Symbian platform environment. (With STF, you will also get the <i>atsinterface.exe</i> for remotely running the STF test cases.)</li>
+<li>ATS Server set up for running test classes on hardware.</li>
+</ul>
+
+<h3><a name="compissues"></a>Compatibility issues</h3>
+<ul>
+ <li>None</li>
+</ul>
+
+<h3><a name="issues"></a>Known issues</h3>
+<ul>
+ <li>None</li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/configuration_editor.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Editing the configuration file</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Editing the configuration file</h2>
+
+<h4>Before you start</h4>
+<p>STF has a configuration file that is used to set up the tool's functionality, for example, the default environment settings such as filepaths for test reports, and the test modules to be used. For the creation of this file, see <a href="configuration_wizard.htm">Setting up the STF configuration file</a>.</p>
+<p>By default, the .ini file is opened in Carbide's text editor. However, it is recommended to use the <b>STF Configuration Editor</b> to enter and modify the values. The changes made to the file in the Configuration Editor are updated to the .ini file in real time. </p><p>To open the configuration file for editing, do the following: </p>
+<ol>
+<li>In Project Explorer, select the .ini file of your choice. </li>
+<li>Right-click the file and select <b>Open With > STF Configuration Editor</b>. </li>
+<li>Do either of the following:
+<ul>
+<li>To add or modify test modules, test case files or configuration files, select the <b>Modules</b> tab. </li>
+<li>To modify the environment settings, select the <b>Global Settings</b> tab.</li>
+</ul>
+<p>See the sections below for instructions on editing the configuration file.</p></li>
+<li>When you are finished with the edits, close the <b>Configuration Editor</b> view. </li>
+<li>To save your changes, click <b>Yes</b>. </li>
+</ol>
+
+<h4><a name="module"></a>Adding and modifying modules</h4>
+<p>Before you can run your test case, you need to add your test module to the STF configuration file to make it accessible for STF. The modules tab of the STF Configuration Editor provides a graphical interface for these operations. On the <b>Modules</b> tab, you can do the following things: </p>
+<ul>
+<li>Add a new module by clicking <b>Add module</b>.</li>
+<li>Add a new test case (.cfg) file by clicking <b>Add test case files</b>.</li>
+<li>Add a new configuration (.ini) file, by clicking <b>Add ini file</b>.</li>
+<li>Edit module names or remove them.</li>
+</ul>
+
+<h4><a name="global"></a>Modifying the global settings</h4>
+<p>Editing the global settings by hand can be error-prone. The STF Configuration Editor provides a convenient interface for editing this file. The editor contains a parser that is capable of finding mistakes in global settings (in case of manual modification). Global settings specify options for STF Engine and STF Logger:</p>
+<ul>
+<li><b>STF Engine</b> loads test modules and executes the test cases.
+<p>With these options, you can specify things such as file paths and file names for test reports.</p></li>
+<li><b>STF Logger</b> provides logging services. <p>With these options, you can specify paths and log formats both for emulator and hardware, log modes and the generated timestamps.</p></li>
+</ul>
+<p>Fields that are greyed out have default values and are not present in the .ini file. However, you can still change the values of these fields.</p>
+<p><b>Tip:</b> For details on what the fields contain and what their values can be, click the <b>Source</b> tab and check the descriptions in the text file itself. You can also edit the values in this text file directly. To get code assistance, press CTRL + SPACEBAR as shown below:</p>
+<p><img src="screenshots\config_editor_assist.png" alt="Sample of Source page and code assistance"></p>
+
+<h4>Related tasks</h4>
+<ul>
+<li><a href="configuration_wizard.htm">Setting up the STF configuration file</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/configuration_wizard.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Setting up the STF configuration file</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Setting up the STF configuration file</h2>
+<p>STF has a configuration file that is used to set up the tool's functionality, for example, the default environment settings such as filepaths for test reports, and the test modules to be used.</p>
+<p>To set up the configuration file, do the following:</p>
+<ol>
+ <li>To start creating the configuration file, select <b>File > New > Other</b>.</li>
+ <li>Select <b>Carbide Extensions > STF Configuration file</b>, and click <b>Next</b>.</li>
+ <li>Click <b>Browse</b> to locate the file container of your choice, that is, the project being tested. </li>
+ <li>In the <b>File name</b> field, enter the name of the configuration file.</li>
+ <li>Click <b>Finish</b>.
+ <p>The configuration file (identified with a .ini file extension) is created to the selected container in Project Explorer. In addition, it is opened in the Carbide.c++ view as a text-only version.</p>
+ <p>For instructions on how to modify this file using the STF Configuration Editor, see <a href="configuration_editor.htm">Editing the configuration file</a>.</p></li>
+</ol>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/creating_scripts.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Creating scripts</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Creating scripts</h2>
+
+<h4>Before you start</h4>
+<p>In STF, you can create scripts that consist of a series of keywords and arguments, describing the operation of the test case. The Script Editor is an easy way to manipulate script files and offers syntax highlighting, code assistant, syntax checker and so on. </p>
+<p>Scripts enable you to create advanced combinations of test cases, which can be suited for your development needs. For more background information, see <a href="../concepts/scripts.htm">Test scripts</a>.</p><p>To create a script, do the following:</p>
+<ol>
+<li>In the Project Explorer, right-click the .cfg file you want to use and select <b>Open With > STF Script Editor</b>.</li>
+<li><p><img src="screenshots\script_editor_view.png" alt="Script editor"></p></li>
+<li>To start creating the script text, enter the keywords and arguments that describe the test case's operation. <p>For more information on the keywords, see the reference topics <a href="../references/script_keywords.htm">Script keywords</a>.</p>
+<p><b>Note:</b> The <code>title</code> keyword must be the first one. </p><p>For more tips on how to create and edit the script, see the section below. </p></li>
+</ol>
+
+<h4>Tips for working with the STF Script Editor</h4>
+<ul>
+<li>You can expand or collapse lines by clicking the plus or minus signs next to the given test case. </li>
+<li>To get code assistance on the keywords, press CTRL + SPACEBAR. The suggested words depend on the context. </li>
+<li>The editor provides validation for the syntax. If an error is found, any line containing it is marked and a comment is added to it in the <b>Problems</b> tab. <p>See the examples below: </p><p><img src="screenshots\script_editor_code_assist.png" alt="Example of code assist and error validation."></p></li>
+<li>In addition, the <b>Outline</b> tab lists the test cases that the current file contains. Click a test case on the outline to move to the corresponding location in the script. See the example:
+<p><img src="screenshots\script_editor_outline.png" alt="Outline view and the Script Editor"></p></li>
+</ul>
+
+<h4>Related references</h4><ul>
+<li><a href="../references/script_keywords.htm">Script keywords</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/creating_stf_project.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Creating STF project</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Creating STF project</h2>
+<p>To create an STF project, in Carbide do the following:</p>
+<ol>
+<li>Select <b>File > New > Other</b>.</li>
+<li>Select <b>Carbide Extensions > Test Frameworks > Symbian Test Framework</b> and click <b>Next</b>, as shown below:<p><img src="screenshots/creating_stf_project.png" alt="Sample of creating STF project"></p></li>
+<li>Set the project name, path and builder, and click <b>Next</b>, as shown below:<p><img src="screenshots/creating_stf_project1.png" alt="Set project name, path and builder"></p></li>
+<li>Select one or more Symbian SDKs to be used as the build configuration, as shown below:<p><img src="screenshots/creating_stf_project2.png" alt="Select SDK"></p></li>
+<li>Set the test class properties:<br><p><img src="screenshots/creating_stf_project3.png" alt="Set test class properties"></p><p>then click <b>Next</b>.</p></li>
+<li>Define the test classes and methods. You can <b>Add</b>, <b>Edit</b>, or <b>Delete</b> them, or <b>Bind</b> them with headers or libraries: <br><p><img src="screenshots/creating_stf_project4.png" alt="Define classes and methods"></p>
+<p>Add method: <br><p><img src="screenshots/creating_stf_project4-1.png" alt="Add methods"></p>
+<p>Edit method: <br><p><img src="screenshots/creating_stf_project4-2.png" alt="Edit methods"></p>
+<p>Delete method: <br><p><img src="screenshots/creating_stf_project4-3.png" alt="Delete methods"></p>
+<p>Bind: <br><p><img src="screenshots/creating_stf_project4-4.png" alt="Bind"></p></li>
+<li>Click <b>Finish</b>.<p>The test class is created and can be viewed in the Project Explorer. </p></li>
+</ol>
+
+<h3><a name="Creating test class"></a>Creating test class</h3>
+<p>To create an STF test class for an existing project, right-click the project, then select <b>Test Frameworks</b> > <b>Generate STF Class...</b>. Then follow steps 3 to 7 shown above to finish the creation.</p>
+<h5>Related concepts</h5>
+<ul>
+<li><a href="../concepts/test_class.htm">Test classes</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/creating_test_case.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Creating test case</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Creating STF cases</h2>
+<p>To create an STF case, do the following:</p>
+<ol>
+<li>Select a header file for which you want to create test cases.</li>
+<li>Right-click the selected header file then choose <b>Test Frameworks</b> > <b>Generate STF cases...</b></li>
+<li>Define the test classes and methods. Refer to step 6 of <a href="creating_stf_project.htm">"Creating STF projects"</a>.<br><p>For example:</p><p><img src="screenshots/creating_stf_case1.png" alt="Create STF cases"></p></li>
+<li>Click <b>Next</b>. The "Preview changes" page will pop up, as shown below:<br><p><img src="screenshots/creating_stf_case2.png" alt="Preview changes"></p></li>
+<li>Click <b>Finish</b> to apply the change.</li>
+</ol>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/import_of_project.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 1.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
+<title>Importing an STF project</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Importing an STF project</h2>
+<p>You can import an STF project you created earlier.</p>
+<p>To import existing project, do the following: </p>
+<ol>
+<li>Select <b>File > Import</b>.</li>
+<li>Select <b>Bld.inf</b> file and click <b>Next</b>.</li>
+<li>Click <b>Browse</b> to locate the <i>bld.inf</i> file of the project you want to import, and click <b>Next</b>.</li>
+<li>Select one or more Symbian SDKs to be used as the build configuration, and click <b>Next</b>.</li>
+<li>From the available options, select the MMP files you want to work with, and click <b>Next</b>.</li>
+<li>(Optional) If needed, modify the <b>Project name</b> and <b>Root directory</b> values.</li>
+<li>Click <b>Finish</b>. <p>The project is imported into the Carbide.c++ environment.</p></li>
+</ol>
+
+<h4>Related concepts</h4>
+<ul>
+<li><a href="../concepts/test_class.htm">Test classes</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/preferences.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,51 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Setting TestDrop preferences</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Setting TestDrop preferences</h2>
+<p>To configure TestDrop preferences:</p>
+<ol>
+<li>Choose <b>Windows > Preferences > Carbide Extensions > TestDrop Preferences</b>.</li>
+<li>(Optional) Select the <b>Enable test drop for hardware</b> check box and fill in the necessary ATS Server Connection settings.</li>
+<li>Click <b>Test Connection</b>. <p>If you receive the message <b>"Connection is ok!"</b>, you can continue.</p>
+<p>If there are problems with the connection, revise the settings. </p></li>
+<li>To specify options for the TestDrop dialog, select either of the following:
+<ul>
+<li><b>Show the dialog always:</b> Select this option to always show the <b>Send TestDrop</b> dialog. <p>Define the minutes from <b>Target Device List Cache</b> to set an interval for updating the list. With <b>None</b>, the update is not done. The timer is restarted after every <b>Send TestDrop</b> command. The list contains only devices that are valid for the project. </p></li>
+<li><b>Set one target device as default:</b> Select one device from the list to be the default. The test drop is sent directly to the ATS Server without the dialog. </li>
+<!--Set Image(s) button let user to select needed device images to be flashed to devices
+before test execution.-->
+</ul></li>
+<li>Specify if the test drop should be sent directly to the ATS Server or to a shared directory <b>shared</b> with the ATS Server.
+<ul>
+<li>To send the test drop directly to the ATS Server, select the <b>Use test drop import for sending test drop</b> check box. </li>
+<li>To send the test drop to a shared directory where the ATS Server will collect it, leave the check box empty. <p>Click <b>Browse</b> to locate the shared directory name (or type the directory into the field. Be sure to enter the path as a path to a network share, e.g.: <i>\\[computer_name]\[shared_dir_name]</i>.</p><p><b>Important:</b> Both the TestDrop application and ATS Server must have access to the specified directory. Check the <b>Properties > Sharing</b> or <b>Security</b> options of the directory to ensure it is configured properly. </p></li>
+</ul></li>
+<li>On the <b>TestDrop Result</b> list, specify which results are shown in the <b>TestDrop Result View</b>.
+<ul>
+<li><b>All:</b> All test results are displayed. </li>
+<li><b>Failed cases only:</b> Successful results are not displayed. </li>
+</ul></li>
+<li>In the <b>Test Results Path</b>, specify if the TestDrop results should be retrieved directly from the ATS Server or saved to a <b>shared</b> directory.
+<ul>
+<li>To get the results directly, leave the box empty. </li>
+<li>If you want to have the results saved to a <b>shared</b> directory, specify the path to it. Be sure to enter the path as a path to a network share.<p><b>Important:</b> Both the TestDrop application and ATS Server must have access to the specified directory. Check the <b>Properties > Sharing</b> or <b>Security</b> options of the directory to ensure it is configured properly.</p></li>
+</ul></li>
+<li>Click <b>Apply</b> and <b>Save</b> to save the modifications.</li>
+</ol>
+
+<h4>Related tasks</h4>
+<ul>
+<li><a href="senddialog.htm">Sending a STF test drop to ATS</a></li>
+<li><a href="view_testdrop_results.htm">Viewing TestDrop test results</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/run_test_case.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Running the test cases</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Running the test cases</h2>
+<ol>
+<li><p>To run STF tests, click <b>Run</b> > <b>Run Configurations...</b>, the "Launch configurations" window will pop up:
+<br><img src="screenshots/launch_config.png" alt="Launch configurations"></p>
+<p>Create a new configuration in "STF Emulator Test", then select test script from drop-down list "Test script".</p></li>
+<li>Run this configuration</li>
+<li>The result will be shown in result view:<br><img src="screenshots/stf_result_view.png" alt="Result view"></li>
+</ol>
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/TestDropTestResults.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/config_editor_assist.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/creating_stf_case1.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/creating_stf_case2.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/creating_stf_project.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/creating_stf_project1.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/creating_stf_project2.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/creating_stf_project3.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/creating_stf_project4-1.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/creating_stf_project4-2.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/creating_stf_project4-3.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/creating_stf_project4-4.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/creating_stf_project4.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/creating_test_module4.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/launch_config.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/script_editor.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/script_editor_code_assist.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/script_editor_folding.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/script_editor_outline.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/script_editor_syntax_checking_errors.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/script_editor_view.png has changed
Binary file testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/screenshots/stf_result_view.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/script_editor.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,79 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <title>STF Script Editor</title>
+ <link rel="stylesheet" href="../../book.css" type="text/css" />
+ </head>
+ <body>
+ <h2>STF Script Editor</h2>
+ <p>
+ STF plug-in offers a user-friendly editor for manipulating
+ script files. The editor provides users
+ with syntax highlighting, code assistant, syntax checking and other features
+ that make working with scripts easier and more efficient.
+ <br />
+ <br />
+ To use the STF Script Editor simply open the .cfg file in the Carbide.c++
+ environment (<b>File</b> -> <b>Open File...</b>).<br />
+ <br />
+ </p>
+ <p>
+ The STF Script Editor will start and display the file. See the figure below for an example.
+ <br />
+ <br />
+ <img src="screenshots/script_editor.png" alt="Script editor"/><br />
+ <i>Script Editor</i><br />
+ <br />
+ </p>
+ <p>
+ As shown in the figure above, the editor offers code highlighting for keywords. For the set of
+ keywords that will be highlighted, see <a href="../references/script_keywords.htm">Script Keywords</a>.
+ </p>
+ <br />
+ <p>
+ The editor lets you fold test cases. A test case can be
+ collapsed by clicking the minus "-" sign next to the given test case.<br />
+ The figure below presents a collapsed test case:
+ <br />
+ <br />
+ <img src="screenshots/script_editor_folding.png" alt="Scriptor editor: folding"/><br />
+ </p>
+ <p>
+ The test cases can be expanded to the previous form by clicking the plus "+"
+ sign next to the given test case.<br />
+ </p>
+ <br />
+ <br />
+ <p>
+ The Outline view presents a list of test cases that the current file contains.<br />
+ You can move the cursor to the selected test case by clicking its associated
+ label in the Outline view:<br />
+ <br />
+ <img src="screenshots/script_editor_outline.png" alt="Scriptor editor: outline"/><br />
+ </p>
+ <br />
+ <br />
+ <p>
+ The editor checks the syntax of the script. If an error is found then any line
+ containing it is marked and a comment is added to the Problems window. The
+ figure below shows how the editor points to the errors:<br />
+ <br />
+ <img src="screenshots/script_editor_syntax_checking_errors.png" alt="Scriptor editor: error checking"/><br />
+ </p>
+ <br />
+ <br />
+ <p>
+ The STF Script Editor provides users with code assistance. The suggestions of the
+ code assistant, depending on the current context, can be displayed by pressing the
+ CTRL + SPACEBAR combination on the keyboard.<br />
+ The figure below shows code assistant window with suggested words
+ for the current context:<br />
+ <br />
+ <img src="screenshots/script_editor_code_assist.png" alt="Scriptor editor: code assist"/><br />
+ </p>
+ <div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+ License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+ </body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/senddialog.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Sending a STF test drop to ATS</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Sending an STF test drop to ATS</h2>
+
+<h5>Before you start</h5>
+<ul>
+<li>Before sending a test drop to the Automatic Test System (ATS), create or import an STF project. For instructions, see <a href="creating_stf_project.htm">Creating STF project</a> or <a href="import_of_project.htm">Importing existing STF project</a>. The newly created test module contains exemplary test cases and is ready to be compiled. </li>
+<li>Check the settings for TestDrop (for example, connection to the ATS Server, view options for the TestDrop test results). For instructions, see <a href="../tasks/preferences.htm">Setting TestDrop Preferences</a>. </li>
+<li>Test Drop can be used to run test modules directly on your computer using an Symbian platform emulator. This feature is extremely handy when you expect immediate results. Using the emulator limits the duration of Test Drop to the minimum as it avoids any communication actions. Remember that not all SDK environments deliver the emulator. As a result, not all listed devices with "(emulator)" postfix may be valid. </li>
+</ul>
+<p>To send the TestDrop either to a hardware target or an emulator, follow these steps:</p>
+<ol>
+<li>Do the following:
+<ul>
+<li>Compile the test module. Depending on the chosen build configuration (debug or release), TestDrop will use the appropriate build version of the test module.</li>
+</ul></li>
+<li>do one of the following:
+<ul>
+<li>From the main menu select <b>Carbide > Send TestDrop</b> with a project or a .cfg file in the Project Explorer.</li>
+<li>Right-click your project or a .cfg file, and select <b>Send TestDrop</b>.</li>
+<li>Use a keyboard shortcut with a project or a .cfg file in the Project Explorer. The shortcut is set by default to Alt+D
+but you can easily change it by modifying the TestDrop key binding in <b>Window > Preferences > General > Keys > Binding</b>.</li>
+</ul>
+<p>The <b>Send TestDrop</b> dialog is displayed.</p>
+<p><b>Note:</b> This selection is shown only if you select the <b>Show the dialog option</b> in TestDrop's preferences. If you only have one target device you are using by default, it is enough to specify that one. </p></li>
+<li>Select the target device on the list: either a hardware or an emulator target.
+When a hardware device is used the user should also specify the files that will be needed to run the test drop. The listed files will be included into the test drop allowing a successful run of tests.<br/>
+<p><img src="../images/Components.png" alt="Components"></p></li>
+
+<li>Click <b>Send</b>. <p>Depending on your test setup, the test drop is either sent directly to the ATS Server or it is run through <i>atsinterface</i> on the emulator. </p></li>
+</ol>
+<p>You can view the results of the test from the <b>TestDrop Result view</b>. For more information, see <a href="view_testdrop_results.htm">Viewing TestDrop test results</a>. </p>
+
+<h5>Related tasks</h5>
+<ul>
+<li><a href="../tasks/preferences.htm">Setting TestDrop Preferences</a></li>
+<li><a href="view_testdrop_results.htm">Viewing TestDrop test results</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/tasks.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,28 @@
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <title>Guide</title>
+ <link rel="stylesheet" href="../../book.css" type="text/css"/>
+ </head>
+ <body>
+ <h2>Tasks</h2>
+ <p>This section tells you how to work with STF plug-in.</p>
+ <p>Topics in this section include:</p>
+ <ul>
+ <li><a href="creating_stf_project.htm">Creating STF projects</a></li>
+ <li><a href="creating_stf_project.htm#Creating test class">Creating test class</a></li>
+ <li><a href="creating_test_case.htm">Creating test cases from header files</a></li>
+ <li><a href="import_of_project.htm">Importing an STF project</a></li>
+ <li><a href="configuration_wizard.htm">Setting up the STF configuration file</a></li>
+ <li><a href="creating_scripts.htm">Creating scripts</a></li>
+ <li><a href="configuration_editor.htm">Editing the configuration file</a></li>
+ <li><a href="run_test_case.htm">Running the test cases</a></li>
+ <li><a href="preferences.htm">Setting TestDrop preferences</a></li>
+ <li><a href="senddialog.htm">Sending a STF TestDrop to ATS</a></li>
+ <li><a href="view_testdrop_results.htm">Viewing TestDrop test results</a></li>
+ </ul>
+ <div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+ License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+ </body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/tasks/view_testdrop_results.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Viewing TestDrop test results</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Viewing TestDrop test results</h2>
+<p>After sending the TestDrop tests to the ATS Server or running them on an emulator, the results of executed tests are returned to the <b>TestDrop Result View</b> in Carbide.c++.</p>
+<p><b>Tip:</b> In the TestDrop preferences, you can specify to view either all cases or only failed cases. See <a href="../tasks/preferences.htm">Setting TestDrop Preferences</a> for instructions.</p>
+<p>See the following figure for an example: </p><p><img src="screenshots/TestDropTestResults.png" alt=""></p>
+<p>The Test Drop View shows the basic information from the test results. The background coloring shows the basic information on the passed/failed ratio of the test drop. The size of the green area represents the relative number of passed test cases.</p>
+<p>To view more detailed information of a test, click the test result of your choice.</p>
+
+<h4>Related tasks</h4>
+<ul>
+<li><a href="../tasks/preferences.htm">Setting TestDrop Preferences</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/html/tool.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,51 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Table of Contents</title>
+<link href="../book.css" type="text/css" rel="stylesheet"></head>
+<body>
+
+<h1>ITE Online Help</h1>
+
+<p><a href="release_notes.htm">Release notes</a></p>
+
+<p><a href="gettingstarted/GS_index.htm">Getting started</a></p>
+<ul>
+ <li><a href="gettingstarted/overview.htm">Overview</a></li>
+ <li><a href="gettingstarted/walk_through.htm">Basic walk-through</a></li>
+</ul>
+
+<p><a href="concepts/concepts.htm">Concepts</a></p>
+<ul>
+ <li><a href="concepts/test_case.htm">Test cases</a></li>
+ <li><a href="concepts/test_class.htm">Test classes</a></li>
+ <li><a href="concepts/scripts.htm">Test scripts</a></li>
+ <li><a href="concepts/ats.htm">Automatic Test System (ATS)</a></li>
+</ul>
+
+<p><a href="tasks/tasks.htm">Tasks</a></p>
+<ul>
+ <li><a href="tasks/creating_stf_project.htm">Creating STF projects</a></li>
+ <li><a href="tasks/creating_stf_project.htm#Creating test class">Creating test class</a></li>
+ <li><a href="tasks/creating_test_case.htm">Creating test cases from header file</a></li>
+ <li><a href="tasks/import_of_project.htm">Importing STF projects</a></li>
+ <li><a href="tasks/configuration_wizard.htm">Setting up the STF configuration file</a></li>
+ <li><a href="tasks/configuration_editor.htm">Editing the configuration file</a></li>
+ <li><a href="tasks/creating_scripts.htm">Creating scripts</a></li>
+ <li><a href="tasks/run_test_case.htm">Running the test cases</a></li>
+ <li><a href="tasks/preferences.htm">Setting TestDrop preferences</a></li>
+ <li><a href="tasks/senddialog.htm">Sending a STF test drop to ATS</a></li>
+ <li><a href="tasks/view_testdrop_results.htm">Viewing TestDrop test results</a></li>
+</ul>
+
+<p><a href="references/references.htm">References</a></p>
+<ul>
+ <li><a href="references/script_keywords.htm">Script keywords</a></li>
+</ul>
+<p><a href="legal.htm">Legal</a></p>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/index.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.index"?>
+
+ <!-- INDEX INSTRUCTIONS
+
+ Use the index.xml file to define the index entries for the plugin's
+ help contents. In Eclipse 3.2 and beyond an Index tab appears in the Help
+ viewer making it possible for user to more easily locate subjects of
+ interest to them.
+
+ In brief, every file used in the help documentation should have at least one
+ associated index entry for it. Ideally, it's simple to make two entries per
+ page by simply re-wording the subject slightly. For example, a view could
+ be indexed twice like this, 1) Breakpoint view, and 2) Views/Breakpoint.
+
+ See ??? for details on creating indexes.
+
+ -->
+
+<index>
+ <entry keyword="Legal" >
+ <topic href="html/legal.htm" />
+ </entry>
+ <entry keyword="Overview" >
+ <topic href="html/Getting_Started/overview.htm" />
+ </entry>
+ <entry keyword="Release Notes" >
+ <topic href="html/release_notes.htm" />
+ </entry>
+ <entry keyword="Basic walk-through" >
+ <topic href="html/Getting_Started/walk_through.htm" />
+ </entry>
+
+</index>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/plugin.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.help.toc">
+
+ <toc
+ file="toc.xml"
+ primary="true" />
+
+ <toc
+ file="tocgettingstarted.xml"
+ primary="false" />
+
+ <toc
+ file="tocConcepts.xml"
+ primary="false" />
+
+ <toc
+ file="tocReference.xml"
+ primary="false" />
+
+ <toc
+ file="tocTasks.xml"
+ primary="false" />
+
+ </extension>
+
+ <extension point="org.eclipse.help.contexts">
+ </extension>
+</plugin>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/src/com/nokia/testfw/stf/help/HelpPlugin.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.help;
+
+import org.eclipse.ui.plugin.*;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class HelpPlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static HelpPlugin plugin;
+
+ /**
+ * The constructor.
+ */
+ public HelpPlugin() {
+ plugin = this;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static HelpPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path.
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin("com.nokia.testfw.stf.help", path);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/toc.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+
+<toc label="STF"
+ link_to="../com.nokia.carbide.help.common/carbideHelpTOC.xml#anchorCarbideFeature" >
+
+ <topic label="STF" href="html/tool.htm">
+
+
+
+ <topic label="Release notes" href="html/release_notes.htm" />
+
+ <topic label="Getting started" href="html/gettingstarted/GS_index.htm">
+ <anchor id="gettingstarted"/>
+ </topic>
+ <topic label="Concepts" href="html/concepts/concepts.htm" >
+ <anchor id="concepts"/>
+ </topic>
+
+
+ <topic label="Tasks" href="html/tasks/tasks.htm" >
+ <anchor id="tasks"/>
+ </topic>
+
+ <topic label="References" href="html/references/references.htm" >
+ <anchor id="references"/>
+ </topic>
+
+
+ <topic label="Legal" href="html/legal.htm" />
+
+ </topic>
+
+</toc>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/tocConcepts.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Concepts" link_to="toc.xml#concepts">
+
+ <!-- Enter topic entries here for Concepts section of help -->
+
+ <topic label="Test cases" href="html/concepts/test_case.htm" />
+ <topic label="Test classes" href="html/concepts/test_class.htm" />
+ <topic label="Test scripts" href="html/concepts/scripts.htm" />
+ <topic label="Automatic Test System (ATS) " href="html/concepts/ats.htm" />
+
+</toc>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/tocReference.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Reference" link_to="toc.xml#references">
+
+ <!-- Enter topic entries here for References section of help -->
+
+ <topic label="Script keywords" href="html/references/script_keywords.htm" />
+
+</toc>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/tocTasks.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Guide" link_to="toc.xml#tasks">
+
+ <topic label="Creating STF project" href="html/tasks/creating_stf_project.htm" />
+ <topic label="Importing STF project" href="html/tasks/import_of_project.htm" />
+ <topic href="html/tasks/configuration_wizard.htm" label="Setting up the STF configuration file">
+ </topic>
+ <topic href="html/tasks/configuration_editor.htm" label="Editing the configuration file">
+ </topic>
+<topic label="Editing Scripts" href="html/tasks/script_editor.htm" />
+<topic label="Running the test cases" href="html/tasks/run_test_case.htm" />
+ <topic href="html/tasks/preferences.htm" label="Setting TestDrop preferences">
+ </topic>
+ <topic href="html/tasks/senddialog.htm" label="Sending a STF TestDrop to ATS">
+ </topic>
+ <topic href="html/tasks/view_testdrop_results.htm" label="Viewing TestDrop test results">
+ </topic>
+</toc>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.help/tocgettingstarted.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Getting Started" link_to="toc.xml#gettingstarted">
+
+ <topic label="Overview" href="html/gettingstarted/overview.htm" />
+ <topic label="Walk-Through" href="html/gettingstarted/walk_through.htm" />
+
+</toc>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.stf.scripteditor</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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/META-INF/MANIFEST.MF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: STF Script Editor plug-in
+Bundle-SymbolicName: com.nokia.testfw.stf.scripteditor;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: com.nokia.testfw.stf.scripteditor.Activator
+Bundle-Vendor: Nokia
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.jface.text,
+ org.eclipse.core.resources,
+ org.eclipse.ui.editors,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.ui.views
+Eclipse-AutoStart: true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/STIFScriptsEditor.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+ContentAssistProposal.label=Content assist
+ContentAssistProposal.tooltip=Content assist
+ContentAssistProposal.description=Provides Content Assistance
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/build.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,10 @@
+javacSource=1.5
+javacTarget=1.5
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ combiner.xml,\
+ scripter.xml,\
+ META-INF/,\
+ .,\
+ icons/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/combiner.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,580 @@
+<?xml version="1.0"?>
+
+<sections>
+
+<section name="Test" endname="Endtest">
+
+<command id="title">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ titleValue
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="words" binding="none" nextvalue="none">
+ titleValue
+ </argument>
+ </optional>
+ <errornote>
+ Title commmand requires test title as an argument
+ </errornote>
+ <commandinfo>
+The title keyword is used to give a verbal description for a test case.
+ </commandinfo>
+</command>
+
+<command id="timeout">
+ <mandatory>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ timeoutValue
+ </argument >
+ </mandatory>
+ <errornote>
+ Timeout keyword should have a timeout value as an argument
+ </errornote>
+ <commandinfo>
+Timeout is used to give a timeout value for a test case.
+Timeout value is passed in milliseconds.
+ </commandinfo>
+</command>
+
+<command id="priority">
+ <mandatory>
+ <argument type="selective" value="none" binding="none" nextvalue="none">
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ normal
+ </argument>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ priorityValue
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ high
+ </argument>
+
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ low
+ </argument>
+ </argument>
+ </mandatory>
+ <errornote>
+ "priority" keyword should have a priority value as an argument
+ </errornote>
+ <commandinfo>
+Priority is used to give a priority for a test case.
+Priority value either as an integer or as the string high, normal or low.
+ </commandinfo>
+</command>
+
+<command id="print">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ TestObjectName
+ </argument >
+ </mandatory>
+ <optional>
+ <argument type="normal" value="words" binding="none" nextvalue="none">
+ yes
+ </argument>
+ </optional>
+ <errornote>
+ "print" keyword has invalid argument
+ </errornote>
+ <commandinfo>
+The print keyword can be used to print, for example, progress information to UI.
+ </commandinfo>
+</command>
+
+
+<command id="canceliferror">
+ <errornote>
+ "canceliferror" keyword takes no arguments
+ </errornote>
+ <commandinfo>
+The canceliferror keyword is used to cancel the execution of the remaining test cases if one of the executed test cases has failed.
+This keyword is normally used to stop the test case execution when some of the test cases are long running.
+ </commandinfo>
+</command>
+
+<command id="pausecombiner">
+ <mandatory>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ pausecombinerValue
+ </argument >
+ </mandatory>
+ <errornote>
+ "pausecombiner" keyword takes number of miliseconds as an argument"
+ </errornote>
+ <commandinfo>
+The pausecombiner keyword is used to pause test combiner for a specified time
+
+Arguments:
+Timeout: The timeout for the pause, specified in milliseconds.
+ </commandinfo>
+</command>
+
+
+<command id="run">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ testmodule
+ </argument>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ configfile
+ </argument>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ TestCaseNumber
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="name" binding="=" nextvalue="digit">
+ expect
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="literal">
+ testid
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="literal">
+ ini
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="literal">
+ category
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="digit">
+ timeout
+ </argument>
+ <argument type="normal" value="quoted" binding="none" nextvalue="none">
+ title
+ </argument>
+ </optional>
+ <errornote>
+ "run" keyword takes test module name, configuration file and test case number as argumets
+ </errornote>
+ <commandinfo>
+The run keyword is used to start a specified test case. It has several mandatory and optional arguments.
+
+Arguments:
+testmodule: The test module name.
+configfile: The test case configuration file.
+Test case number: The test case number to be executed from configfile.
+
+expect: The expected result (0 = KErrNone).
+testid: Test case identification, which is used by other keywords to identify the test case ().
+ini: The initialization file for test module ().
+category: The result category; either normal, leave, panic, exception or timeout.
+timeout: Test case timeout (not supported yet).
+title: Test case title.
+ </commandinfo>
+</command>
+
+
+<command id="cancel">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ testid
+ </argument >
+ </mandatory>
+ <errornote>
+ "cancel" keyword takes test an identification of a test case as an argument
+ </errornote>
+ <commandinfo>
+The cancel keyword is used to cancel a started test case.
+The test case is cancelled by immediately killing the thread that executes the test case.
+
+Arguments:
+testid: The test ID from the run command.
+ </commandinfo>
+</command>
+
+
+<command id="pause">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ testid
+ </argument >
+ </mandatory>
+ <optional>
+ <argument type="normal" value="name" binding="=" nextvalue="digit">
+ time
+ </argument>
+ </optional>
+ <errornote>
+ "cancel" keyword takes test an identification of a test case as an argument and optonal argument: number of miliseconds
+ </errornote>
+ <commandinfo>
+The pause keyword is used to pause a test case.
+The test case is paused by pausing the thread that executes the test case.
+
+Arguments:
+testid: The test ID from the run command.
+Time Pause time in milliseconds. After this time, resume is called automatically.
+ </commandinfo>
+</command>
+
+
+<command id="resume">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ testid
+ </argument >
+ </mandatory>
+ <errornote>
+ "resume" keyword takes an identification of a test case as an argument
+ </errornote>
+ <commandinfo>
+The resume keyword is used to resume a paused test case.
+
+Arguments:
+testid: The test ID from the run command.
+ </commandinfo>
+</command>
+
+<command id="complete">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ testid
+ </argument >
+ </mandatory>
+ <errornote>
+ "complete" keyword takes an identification of a test case as an argument
+ </errornote>
+ <commandinfo>
+The complete keyword is used to have a started test case wait to complete.
+It blocks until the test case has finished.
+
+Arguments:
+testid: The test ID from the run command.
+ </commandinfo>
+</command>
+
+<command id="measurement">
+ <mandatory>
+ <argument type="selective" value="none" binding="none" nextvalue="none">
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ start
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ stop
+ </argument>
+ </argument>
+ <argument type="selective" value="none" binding="none" nextvalue="none">
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ measurementplugin01
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ measurementplugin02
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ measurementplugin03
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ measurementplugin04
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ measurementplugin05
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ stifbappeaprofiler
+ </argument>
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ STIF Test measurement parameters
+ </argument>
+
+ </optional>
+ <errornote>
+ "testmeasurement" keyword must be follwed by a command, type and optionaly parameters
+ </errornote>
+ <commandinfo>
+The testmeasurement keyword is used for test measurement testing.
+
+Arguments:
+STIF Test measurement command: Command for STIF Test Measurement control.
+The supported values are: "start" for starting test measurement and "stop" for stopping test measurement. It also releases all allocated resources.
+STIF Test measurement type: Test measurement type.
+The supported values are: measurementplugin01, measurementplugin02, measurementplugin03, measurementplugin04, measurementplugin05, bappeaprofiler
+STIF Test measurement parameters: Optional. Test measurement module configuring etc. user and test measurement module specific. This is returned as a descriptor to the test measurement module in start operation.
+ </commandinfo>
+</command>
+
+
+<command id="loop">
+ <mandatory>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ loopTimes
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="selective" value="none" binding="none" nextvalue="none">
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ msec
+ </argument>
+ <argument type="normal" value="name" binding="space" nextvalue="digit">
+ passlimit
+ </argument>
+ </argument>
+ </optional>
+ <errornote>
+ "loop" keyword must be followed by the loop count, optionaly the "msec" word, optional "passlimit" word and passlimit value
+ </errornote>
+ <commandinfo>
+The loop keyword is used to repeat a section of the test case file for the specified number of iterations.
+The section to be repeated is enclosed with the loop and endloop keywords.
+Nested loops are not supported.
+
+Arguments:
+Loop times: The loop count, that is, the number of times that the loop is executed.
+
+msec: This keyword says that ‘Loop times’ argument stands for the time in milliseconds during which loop will be looped
+passlimit: This keyword turns on passlimit (endurance) feature
+Passlimit value: Says how many iteration must pass to let pass the whole loop
+ </commandinfo>
+</command>
+
+<command id="endloop">
+ <errornote>
+ "endloop" takes no arguments
+ </errornote>
+ <commandinfo>
+The endloop keyword is used to specify the end of a looped section.
+ </commandinfo>
+</command>
+
+<command id="request">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ Event
+ </argument>
+ </mandatory>
+ <errornote>
+ "request" keyword must be follwed by an event name
+ </errornote>
+ <commandinfo>
+The request keyword is used to request an event.
+If someone wants to use an event, it must first be requested and after that it can be waited.
+After the event is not used anymore, it must be released.
+
+Arguments:
+Event: The event name.
+ </commandinfo>
+</command>
+
+<command id="wait">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ Event
+ </argument>
+ </mandatory>
+ <errornote>
+ "wait" keyword must be follwed by an event name
+ </errornote>
+ <commandinfo>
+The wait keyword is used to wait an event.
+Request must be called before wait, and wait blocks until the requested event is set.
+Wait may proceed immediately if the requested event is a state event and already pending
+
+Arguments:
+Event: The event name.
+ </commandinfo>
+</command>
+
+<command id="release">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ Event
+ </argument>
+ </mandatory>
+ <errornote>
+ "release" keyword must be follwed by an event name
+ </errornote>
+ <commandinfo>
+The release keyword is used to release an event.
+Every requested event must be released explicitly after it is not used anymore
+
+Arguments:
+Event: The event name.
+ </commandinfo>
+
+</command>
+
+<command id="set">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ Event
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="literal" binding="=" nextvalue="digit">
+ state
+ </argument>
+ </optional>
+ <errornote>
+ "set" keyword must be follwed by an event name
+ </errornote>
+ <commandinfo>
+The set keyword is used to set an event. Every set state event must be explicitly unset.
+
+Arguments:
+Event: The event name.
+state If set to 1, indicates that this is a state event, i.e. it remains set until it is unset explicitly with the unset keyword.
+If set to 0, indicates that the event is an indication, so it is set only once to every requester and implicitly unset after that.
+ </commandinfo>
+</command>
+
+
+<command id="unset">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ Event
+ </argument>
+ </mandatory>
+ <errornote>
+ "unset" keyword must be follwed by an event name
+ </errornote>
+ <commandinfo>
+The unset keyword is used to unset a state event. Every set state event must be unset.
+Indication events cannot be unset.
+Unset blocks until everyone who has requested the specified event have released the event.
+
+Arguments:
+Event: The event name.
+ </commandinfo>
+</command>
+
+<command id="allocate">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ SlaveType
+ </argument>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ SlaveName
+ </argument>
+ </mandatory>
+ <errornote>
+ "allocate" keyword must be follwed by slave type ans slave name
+ </errornote>
+ <commandinfo>
+The allocate keyword is used to allocate a slave, for example for running a test case on a remote phone.
+It uses Remote Control Protocol (RPC).
+The slave must always be allocated first before it can be used.
+
+Arguments:
+Slave type: The type of the slave.
+STIF only supports slave phone. phone indicates that slave phone is also running STIF.
+Other types must be handled by the slave implementation, i.e. when implementing separate support for external network simulator.
+
+Slave name: A unique name for the slave.
+
+ </commandinfo>
+</command>
+
+
+<command id="free">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ SlaveName
+ </argument>
+ </mandatory>
+ <errornote>
+ "free" keyword must be follwed by slave name
+ </errornote>
+ <commandinfo>
+Every allocated slave must be freed with free when it becomes unused.
+
+Arguments:
+Slave type: The type of the slave.
+STIF only supports slave phone. phone indicates that slave phone is also running STIF.
+Other types must be handled by the slave implementation, i.e. when implementing separate support for external network simulator.
+
+ </commandinfo>
+</command>
+
+<command id="remote">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ objectName
+ </argument>
+ <argument type="selective" value="none" binding="none" nextvalue="none">
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ run
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ request
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ wait
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ set
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ unset
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ set
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ release
+ </argument>
+ </argument>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ module
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ testmodule
+ </argument>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ configfile
+ </argument>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ testCaseNumber
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="digit">
+ expect
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="literal">
+ testid
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="literal">
+ ini
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="literal">
+ category
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="digit">
+ timeout
+ </argument>
+ <argument type="normal" value="quoted" binding="none" nextvalue="none">
+ title
+ </argument>
+ </optional>
+ <errornote>
+ syntax error error
+ </errornote>
+ <commandinfo>
+The remote keyword is used to start the execution of a test case in a slave and also to request and release events from the slave.
+Other test case controlling for remote test cases is done with the same keywords as for the local test cases.
+
+Arguments:
+Slave name: The slave name, the same that was given for allocate.
+Command name: The remote command name
+supported commands:
+-run
+-request
+-wait
+-set
+-unset
+-release
+
+
+ </commandinfo>
+</command>
+
+</section>
+
+<section name="Define" endname="Enddefine">
+</section>
+
+</sections>
Binary file testdev/ite/src/com.nokia.testfw.stf.scripteditor/icons/full/obj16/scriptfile.gif has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/plugin.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.editors">
+
+ <editor
+ name="STF Script Editor"
+ extensions="cfg"
+ icon="icons/full/obj16/scriptfile.gif"
+ contributorClass="com.nokia.testfw.stf.scripteditor.editors.ScriptEditorContributor"
+ class="com.nokia.testfw.stf.scripteditor.editors.ScriptEditor"
+ id="com.nokia.testfw.stf.scripteditor.editors.ScriptEditor"
+ default="true">
+ </editor>
+ </extension>
+
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="com.nokia.testfw.stf.scripteditor.preference.PreferenceInitializer">
+ </initializer>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ name="TestFramework"
+ class="com.nokia.testfw.stf.scripteditor.preference.ItePreferencePage"
+ category="com.nokia.carbide.cpp.preferences.ExtensionsPreferencesPage"
+ id="com.nokia.testfw.preferences"/>
+ <page
+ name="STF Editor"
+ category="com.nokia.testfw.preferences"
+ class="com.nokia.testfw.stf.scripteditor.preference.ScriptEditorPreferencePage"
+ id="com.nokia.testfw.stf.preference.ScriptEditorPreferencePage"/>
+ </extension>
+
+</plugin>
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/scripter.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1312 @@
+<?xml version="1.0"?>
+
+<sections>
+
+<section name="Test" endname="Endtest" proposal="[Test]\ title testcasename\[Endtest]">
+
+<command id="title">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ string
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="words" binding="none" nextvalue="none">
+ value
+ </argument>
+ </optional>
+ <errornote>
+ Title commmand requires test title as an argument
+ </errornote>
+ <commandinfo>
+Specifies a verbal description for a test case.
+
+title testcasedescription
+
+Arguments:
+test case description: A verbal description for a test case.
+ </commandinfo>
+</command>
+
+<command id="timeout">
+ <mandatory>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ value
+ </argument>
+ </mandatory>
+ <errornote>
+ Timeout keyword should have a timeout value as an argument
+ </errornote>
+ <commandinfo>
+Specifies a timeout value for a test case.
+Timeout value is passed in milliseconds.
+
+timeout value
+
+Arguments:
+value:Timeout value,passed in milliseconds.
+ </commandinfo>
+
+</command>
+
+<command id="priority">
+ <mandatory>
+ <argument type="selective" value="none" binding="none" nextvalue="none">
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ normal
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ high
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ low
+ </argument>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ Priority value
+ </argument>
+ </argument>
+ </mandatory>
+ <errornote>
+ Priority keyword should have a priority value as an argument
+ </errornote>
+ <commandinfo>
+Specifies the priority value of the test case. The value can be either an integer
+or the string "high", "normal" or "low". Negative values are low and positive
+values are high.
+ </commandinfo>
+</command>
+
+<command id="setresultdescription">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ setresultdescriptionValue
+ </argument>
+ </mandatory>
+ <errornote>
+ Setresultdescription has invalid argument
+ </errornote>
+ <commandinfo>
+Sets the description of the current executed test case.
+In case of error situation, it will be shown to user in test report.
+
+setresultdescription setresultdescriptionValue
+ </commandinfo>
+</command>
+
+<command id="create">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ TestClassName
+ </argument>
+ <argument type="creative" value="literal" binding="none" nextvalue="none">
+ TestObjectName
+ </argument>
+ </mandatory>
+ <errornote>
+ Create has invalid argument
+ </errornote>
+ <commandinfo>
+Creates keyword is used to create a new instance of a test class.
+
+create TestClassName TestObjectName
+
+Arguments:
+Test class name: The test class name for the new object.
+Test object name: The name of the created new instance of the test class.
+ </commandinfo>
+</command>
+
+<command id="createkernel">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ KernelTestClassName
+ </argument>
+ <argument type="creative" value="literal" binding="none" nextvalue="none">
+ TestObjectName
+ </argument>
+ </mandatory>
+ <errornote>
+ Createkernel has invalid argument
+ </errornote>
+ <commandinfo>
+Creates a new instance of a kernel test class.
+
+createkernel KernelTestClassName TestObjectName
+
+Arguments:
+Test class name: The test class name for the new object. It's the first argument.
+Test object name: The name of the created new instance of the test class.
+ </commandinfo>
+</command>
+
+<command id="delete">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ TestObjectName
+ </argument>
+ </mandatory>
+ <errornote>
+ Delete has invalid argument
+ </errornote>
+ <commandinfo>
+Deletes an instance of a test class
+
+delete TestObjectName
+
+Arguments:
+Test object name: The name of the instance of the test class that is deleted.
+ </commandinfo>
+</command>
+
+<command id="allownextresult">
+ <mandatory>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ errorCode
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="words" binding="none" nextvalue="digit">
+ optionalErrorCode
+ </argument>
+ </optional>
+ <errornote>
+ "allownextresult" keyword must be followed by an error code
+ </errornote>
+ <commandinfo>
+Adds valid result values for a method and for asynchronous commands.
+The default value for the expected result is 0
+
+allownextresult errorCode
+
+Arguments:
+A Symbian OS error codes: A Symbian OS error codes, which is allowed from the next method or waittestclass completion.
+Optional Error Code: Optional.Multiple error codes, separated by space, can be passed.
+ </commandinfo>
+</command>
+
+<command id="allowerrorcodes">
+ <mandatory>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ errorCode
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="words" binding="none" nextvalue="digit">
+ optionalErrorCode
+ </argument>
+ </optional>
+ <errornote>
+ "allowerrorcodes" keyword must be followed by an error code
+ </errornote>
+ <commandinfo>
+Adds valid result values for a method and for asynchronous commands.
+The default value for the expected result is 0
+
+allowerrorcodes errorCode
+
+Arguments:
+A Symbian OS error codes: A Symbian OS error codes, which is allowed from the next method or waittestclass completion.
+Optional Error Code: Optional.Multiple error codes, separated by space, can be passed.
+ </commandinfo>
+</command>
+
+
+<command id="waittestclass">
+ <mandatory>
+ <argument type="normal" value="object" binding="none" nextvalue="none">
+ TestObjectName
+ </argument>
+ </mandatory>
+ <errornote>
+ Delete has invalid argument
+ </errornote>
+ <commandinfo>
+Pauses test case running until the specified test class object calls the
+Signal function to proceed with the test case execution again.
+
+waittestclass TestObjectName
+
+Arguments:
+Test object name: The name of the instance of the test class,
+which must call Signal() to proceed with the test case execution.
+ </commandinfo>
+</command>
+
+<command id="pause">
+ <mandatory>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ pauseValue
+ </argument>
+ </mandatory>
+ <errornote>
+ "pause" keyword takes number of miliseconds as an argument"
+ </errornote>
+ <commandinfo>
+Pauses test case running.
+
+pause pauseValue
+
+Arguments:
+pauseValue: The timeout for the pause, specified in milliseconds.
+ </commandinfo>
+</command>
+
+<command id="loop">
+ <mandatory>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ loopTimes
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ msec
+ </argument>
+ </optional>
+ <errornote>
+ "loop" keyword must be followed by the loop count
+ </errornote>
+ <commandinfo>
+Repeats a section of the test case file for the specified number of iterations.
+The section to be repeated is enclosed with the loop and endloop keywords.
+
+loop loopTimes msec
+
+Arguments:
+Loop times: The loop count, that is, the number of times that the loop is executed.
+Msec: Optional.This keyword says that ‘Loop times’ argument stands for the time in milliseconds during which loop will be looped
+ </commandinfo>
+</command>
+
+<command id="print">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ String
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="words" binding="none" nextvalue="none">
+ yes
+ </argument>
+ </optional>
+ <errornote>
+ incorrect "print" value
+ </errornote>
+ <commandinfo>
+Specifies a description to print, for example, to print progress information to the UI.
+
+print string
+
+Arguments:
+Print string: The string that want to be printed.
+ </commandinfo>
+</command>
+
+<command id="endloop">
+ <errornote>
+ "endloop" keyword takes no arguments
+ </errornote>
+ <commandinfo>
+The endloop keyword is used to specify the end of a looped section.
+
+endloop
+ </commandinfo>
+</command>
+
+
+<command id="oomignorefailure">
+ <mandatory>
+ <argument type="selective" value="none" binding="none" nextvalue="none">
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ on
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ off
+ </argument>
+ </argument>
+ </mandatory>
+ <errornote>
+ "oomignorefailure" keyword must be followed by an on/off value
+ </errornote>
+ <commandinfo>
+Used for OOM testing.
+Defines if a test class’s building block execution result is checked or ignored.
+
+Arguments:
+Indication for the result check: The possible values are on and off:
+on indicates that the building block execution result will be ignored.
+off (default) indicates that the building block execution result will be checked and errors will be handled.
+ </commandinfo>
+</command>
+
+<command id="oomheapfailnext">
+ <mandatory>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ CountValue
+ </argument>
+ </mandatory>
+ <errornote>
+ "oomheapfailnext" keyword must be followed by a failure rate
+ </errornote>
+ <commandinfo>
+Used for OOM testing.
+Defines that heap allocation failure occurs in the test thread.
+
+oomheapfailnext CountValue
+
+Arguments:
+Count value (rate): The failure rate. Heap allocation fails every time that is given as an argument.
+The given argument will be increased by one because the Test Scripter LOOP_COUNTER range starts from 0.
+The oomheapfailnext range starts from 1.
+ </commandinfo>
+</command>
+
+
+<command id="oomheapsetfail">
+ <mandatory>
+ <argument type="selective" value="none" binding="none" nextvalue="none">
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ random
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ truerandom
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ deterministic
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ none
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ failnext
+ </argument>
+ </argument>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ CountValue
+ </argument >
+ </mandatory>
+ <errornote>
+ "oomheapsetfail" keyword must be followed by the type of failure and a count value
+ </errornote>
+ <commandinfo>
+Used for OOM testing.
+Defines that heap allocation failure occurs in the test thread.
+The user can define the failure type and count (rate).
+
+Arguments:
+The type of failure to be simulated: The supported value are: random, truerandom, deterministic, none, failnext
+Count value (rate): The given argument will be increased by one because the Test Scripter LOOP_COUNTER range starts from 0.
+ The oomheapsetfail range starts from 1
+ </commandinfo>
+
+</command>
+
+<command id="oomheaptonormal">
+ <errornote>
+ "oomheaptonormal" takes no parameter
+ </errornote>
+ <commandinfo>
+Used for OOM testing.
+Ends OOM testing and normal testing continues.
+
+oomheaptonormal
+ </commandinfo>
+</command>
+
+<command id="testinterference">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ objectName
+ </argument>
+ <argument type="selective" value="none" binding="none" nextvalue="none">
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ start
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ stop
+ </argument>
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="selective" value="none" binding="none" nextvalue="none">
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ activeobject
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ thread
+ </argument>
+ </argument>
+ <argument type="selective" value="none" binding="none" nextvalue="none">
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ cpuload
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ filesystemreadc
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ filesystemreadd
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ filesystemreade
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ filesystemreadz
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ filesystemwritec
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ filesystemwrited
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ filesystemwritee
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ filesystemfillandemptyc
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ filesystemfillandemptyd
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ filesystemfillandemptye
+ </argument>
+ </argument>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ idleTime
+ </argument>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ activeTime
+ </argument>
+ </optional>
+ <errornote>
+ syntax error error
+ </errornote>
+ <commandinfo>
+Interferes the testing.
+
+Arguments:
+object name: Object name that is used for starting and stopping interference operations.
+command: Command for STIF Test Interference control.
+The supported values are:
+-start
+-stop.
+
+category: Interference category. The supported values are:
+-activeobject
+-thread.
+
+type: Interference type.
+The supported values are:
+-cpuload
+-filesystemreadc
+-filesystemreadd
+-filesystemreade
+-filesystemreadz
+-filesystemwritec
+-filesystemwrited
+-filesystemwritee
+-filesystemfillandemptyc
+-filesystemfillandemptyd
+-filesystemfillandemptye
+
+idle time: Idle time in milliseconds.
+active time: Active time in milliseconds.
+set priority: Optional. Set priority for thread or active object.
+ </commandinfo>
+</command>
+
+<command id="measurement">
+ <mandatory>
+ <argument type="selective" value="none" binding="none" nextvalue="none">
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ start
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ stop
+ </argument>
+ </argument>
+ <argument type="selective" value="none" binding="none" nextvalue="none">
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ measurementplugin01
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ measurementplugin02
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ measurementplugin03
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ measurementplugin04
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ measurementplugin05
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ stifbappeaprofiler
+ </argument>
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ STIFTestMeasurementParameters
+ </argument>
+
+ </optional>
+ <errornote>
+ "measurement" keyword must be follwed by a command, type and optionaly parameters
+ </errornote>
+ <commandinfo>
+easures the testing.
+
+Arguments:
+STIF Test measurement command: Commad for STIF Test Measurement control. The supported values are: start for starting test measurement, stop for stopping test measurement. It also releases all allocated resources.
+STIF Test measurement type: Test measurement type.
+The supported values are: measurementplugin01, measurementplugin02, measurementplugin03, measurementplugin04, measurementplugin05, bappeaprofiler
+STIF Test measurement parameters: Test measurement module configuring etc. user and test measurement module specific.
+ </commandinfo>
+</command>
+
+<command id="var">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ varName
+ </argument>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ varValue
+ </argument>
+ </mandatory>
+ <errornote>
+ "var" keyword requires variable name and value
+ </errornote>
+ <commandinfo>
+Assigns a text value to a specified variable. It can be then used in other part of the script.
+
+var varName varValue
+ </commandinfo>
+</command>
+
+
+<command id="callsub">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ callsubValue
+ </argument>
+ </mandatory>
+ <errornote>
+ "callsub" keyword requires subroutine name as the only agrument
+ </errornote>
+ <commandinfo>
+Makes TestScripter executing pointed section of script.
+
+Section which will be called must start with [Sub name] and end with [EndSub] tags, where name is the identifier of the sub.
+The execution of the sub will continue until its end is reached. There is possibility to call a sub from another sub.
+
+callsub callsubValue
+ </commandinfo>
+</command>
+
+<command id="request">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ requestValue
+ </argument>
+ </mandatory>
+ <errornote>
+ "request" keyword must be follwed by an event name
+ </errornote>
+ <commandinfo>
+Requests an event. If someone wants to use an event, it must first be requested, and after that it can be waited.
+After the event is not used anymore, it must be released.
+
+request requestValue
+
+Arguments:
+Event: The event name.
+ </commandinfo>
+</command>
+
+<command id="wait">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ waitValue
+ </argument>
+ </mandatory>
+ <errornote>
+ "wait" keyword must be follwed by an event name
+ </errornote>
+ <commandinfo>
+Waits for an event.
+A request must be called before wait, and wait blocks until the requested event is set.
+Wait may proceed immediately if the requested event is a state event and already pending (for example, a phone call is already active).
+
+wait waitValue
+
+Arguments:
+Event: The event name.
+ </commandinfo>
+
+</command>
+
+<command id="release">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ releaseValue
+ </argument>
+ </mandatory>
+ <errornote>
+ "release" keyword must be follwed by an event name
+ </errornote>
+ <commandinfo>
+Releases an event.
+Every requested event must be released explicitly when it is not used anymore.
+
+release releaseValue
+
+Arguments:
+Event: The event name.
+ </commandinfo>
+</command>
+
+
+<command id="set">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ setValue
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ state
+ </argument>
+ </optional>
+ <errornote>
+ "set" keyword must be follwed by an event name
+ </errornote>
+ <commandinfo>
+Sets an event. Every set state event must be explicitly unset.
+
+set setValue state
+
+Arguments:
+Event: The event name.
+State: Optional. If a state is given, sets the state event, otherwise sets an indication event.
+ </commandinfo>
+</command>
+
+<command id="unset">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ unsetValue
+ </argument>
+ </mandatory>
+ <errornote>
+ "unset" keyword must be follwed by an event name
+ </errornote>
+ <commandinfo>
+The unset keyword is used to unset a state event.
+Every set state event must be unset.
+Indication events cannot be unset. unset blocks until everyone who has requested the specified event has released the event.
+
+unset unsetValue
+
+Arguments:
+Event: The event name.
+ </commandinfo>
+</command>
+
+
+<command id="bringtoforeground">
+ <errornote>
+ "bringtoforeground" keyword takes no arguments
+ </errornote>
+ <commandinfo>
+Brings UI component container to foreground described in below.
+
+bringtoforeground
+ </commandinfo>
+</command>
+
+<command id="sendtobackground">
+ <errornote>
+ "sendtobackground" keyword takes no arguments
+ </errornote>
+ <commandinfo>
+Sends UI component container to background.
+
+sendtobackground
+ </commandinfo>
+</command>
+
+<command id="presskey">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ presskeyValue
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="words" binding="none" nextvalue="none">
+ presskeyValue
+ </argument>
+ </optional>
+ <errornote>
+ "presskey" keyword takes Key code as an argument.
+ </errornote>
+ <commandinfo>
+Sends key event to tested UI component.
+
+presskey presskeyValue
+
+Arguments:
+Key code Single character or constant defined in TKeyCode enumeration. Must be defined if keycode and keyscancode is not defined
+
+keycode: Numeric value or constant defined in TKeyCode enumeration. If it is defined, then mandatory argument may be omitted
+keyscancode: Numeric key value or constant defined in TStdScanCode enumeration. If it is defined, then mandatory argument or keycode argument may be omitted
+modifier: One of the constant values defined in TEventModifier enumeration
+repeats: Count of auto repeats generated. 0 means an event without repeats. 1 or more means "this many auto repeat events". In most cases this value is ignored and treated as a single event.
+local: Sends key event to focused UI control, constructed under CCoeEnv delivered by STIF.
+global: Sends key event to focused UI control ( constructed under any CCoeEnv, not necessarily CCoeEnv delivered by STIF ) e.g press left softkey of global message box
+
+ </commandinfo>
+</command>
+
+
+<command id="typetext">
+ <mandatory>
+ <argument type="normal" value="quoted" binding="none" nextvalue="none">
+ typetextValue
+ </argument>
+ </mandatory>
+ <errornote>
+ "typetext" keyword takes text as an argument.
+ </errornote>
+ <commandinfo>
+Sends text to tested UI component.
+
+typetext typetextValue
+
+Arguments:
+text: Text in quotation marks which should be send to UI component
+
+ </commandinfo>
+</command>
+
+
+<command id="sendpointerevent">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ sendpointereventValue
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="words" binding="none" nextvalue="none">
+ SendpointereventValue
+ </argument>
+ </optional>
+ <errornote>
+ "sendpointerevent" keyword takes Event type and positon as an arguments.
+ </errornote>
+ <commandinfo>
+Sends pointer event to tested UI component.
+
+sendpointerevent sendpointereventValue
+
+Arguments:
+Event type: Pointer event type.
+Fallowing pointer even types are sypported: EButton1, EButton2, EButton3, EPointerMove, EPointerSwitchOn, EButton1Down, EButton1Up, EButton2Down, EButton2Up, EButton3Down, EButton3Up
+x: Pointer x co-ordinate
+y: Pointer y co-ordinate
+
+ </commandinfo>
+</command>
+
+
+<command id="using">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ TestLibDLLName
+ </argument>
+ <argument type="creative" value="literal" binding="none" nextvalue="none">
+ DllObjectName
+ </argument>
+ </mandatory>
+ <errornote>
+ Create has invalid argument
+ </errornote>
+ <commandinfo>
+Loads STF specific test harness library.
+
+using TestLibDLLName DllObjectName
+
+Arguments:
+DLL name: The test harness library name.
+DLL object name: The alias of the created new instance of the test harness library.
+ </commandinfo>
+</command>
+
+<command id="expectedpanic">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ PanicNumber
+ </argument>
+ </mandatory>
+ <errornote>
+ "expectedpanic" keyword takes one panic number argument
+ </errornote>
+ <commandinfo>
+Declares valid panic result value for a test case. It indicates that the test case MUST panic with this specified panic code in execution, and only can be used once with a single parameter.
+NOTE: expectedpanic does not support UI Testing.
+
+expectedpanic PanicNumber
+
+Arguments:
+Panic Number, An single integer, which represents the expected panic number.
+
+ </commandinfo>
+</command>
+
+<!-- commands below are for test combiner -->
+
+<command id="canceliferror">
+ <errornote>
+ "canceliferror" keyword takes no arguments
+ </errornote>
+ <commandinfo>
+Cancels the execution of the remaining test cases if one of the executed test cases has failed.
+This keyword is normally used to stop the test case execution when some of the test cases are long running.
+
+canceliferror
+ </commandinfo>
+</command>
+
+<command id="run">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ testmodule
+ </argument>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ configfile
+ </argument>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ TestCaseNumber
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="name" binding="=" nextvalue="digit">
+ expect
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="literal">
+ testid
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="literal">
+ ini
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="literal">
+ category
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="digit">
+ timeout
+ </argument>
+ <argument type="normal" value="quoted" binding="none" nextvalue="none">
+ title
+ </argument>
+ </optional>
+ <errornote>
+ "run" keyword takes test module name, configuration file and test case number as argumets
+ </errornote>
+ <commandinfo>
+Starts a specified test case. It has several mandatory and optional arguments.
+
+run testmodule configfile TestCaseNumber expect testid ini category timeout title
+
+Arguments:
+testmodule: The test module name.
+configfile: The test case configuration file.
+Test case number: The test case number to be executed from configfile.
+
+Optional arguments:
+expect: The expected result (0 = KErrNone).
+testid: Test case identification, which is used by other keywords to identify the test case ().
+ini: The initialization file for test module ().
+category: The result category; either normal, leave, panic, exception or timeout.
+timeout: Test case timeout (not supported yet).
+title: Test case title.
+ </commandinfo>
+</command>
+
+
+<command id="cancel">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ testid
+ </argument >
+ </mandatory>
+ <errornote>
+ "cancel" keyword takes test an identification of a test case as an argument
+ </errornote>
+ <commandinfo>
+Cancels a started test case.
+The test case is cancelled by immediately killing the thread that executes the test case.
+
+cancel testid
+
+Arguments:
+testid: The test ID from the run command.
+ </commandinfo>
+</command>
+
+<command id="pausetest">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ testid
+ </argument >
+ </mandatory>
+ <optional>
+ <argument type="normal" value="name" binding="=" nextvalue="digit">
+ time
+ </argument>
+ </optional>
+ <errornote>
+ "pausetest" keyword takes testid as mandatory argument.
+ </errornote>
+ <commandinfo>
+Pauses a test case. The test case is paused by pausing the thread that executes
+the test case. The pausetest keyword has one mandatory argument
+
+pausetest testid time
+
+Arguments:
+testid: the test ID from the run command.
+time: (optional) Pause time in milliseconds. After this time, resume is called automatically (if not given, resume needs to be called explicitly).
+ </commandinfo>
+</command>
+
+<command id="resume">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ testid
+ </argument >
+ </mandatory>
+ <errornote>
+ "resume" keyword takes an identification of a test case as an argument
+ </errornote>
+ <commandinfo>
+Resumes a paused test case.
+
+resume testid
+
+Arguments:
+testid: The test ID from the run command.
+ </commandinfo>
+</command>
+
+<command id="complete">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ testid
+ </argument >
+ </mandatory>
+ <errornote>
+ "complete" keyword takes an identification of a test case as an argument
+ </errornote>
+ <commandinfo>
+Waits and blocks a running test case. This keyword is used to have a started test case wait to complete.
+It blocks until the test case has finished.
+
+complete testid
+
+Arguments:
+testid: The test ID from the run command.
+ </commandinfo>
+</command>
+
+<command id="allocate">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ SlaveType
+ </argument>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ SlaveName
+ </argument>
+ </mandatory>
+ <errornote>
+ "allocate" keyword must be follwed by slave type ans slave name
+ </errornote>
+ <commandinfo>
+Allocates a slave, for example for running a test case on a remote phone.
+It uses Remote Control Protocol (RPC).
+The slave must always be allocated first before it can be used.
+
+Arguments:
+Slave type: The type of the slave.
+STIF only supports slave phone. phone indicates that slave phone is also running STIF.
+Other types must be handled by the slave implementation, i.e. when implementing separate support for external network simulator.
+
+Slave name: A unique name for the slave.
+
+ </commandinfo>
+</command>
+
+
+<command id="free">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ SlaveName
+ </argument>
+ </mandatory>
+ <errornote>
+ "free" keyword must be follwed by slave name
+ </errornote>
+ <commandinfo>
+Frees a slave. Every allocated slave must be freed with free when it becomes unused.
+
+Arguments:
+Slave type: The type of the slave.
+STIF only supports slave phone. phone indicates that slave phone is also running STIF.
+Other types must be handled by the slave implementation, i.e. when implementing separate support for external network simulator.
+
+ </commandinfo>
+</command>
+
+<command id="remote">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ objectName
+ </argument>
+ <argument type="selective" value="none" binding="none" nextvalue="none">
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ run
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ request
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ wait
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ set
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ unset
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ set
+ </argument>
+ <argument type="normal" value="name" binding="none" nextvalue="none">
+ release
+ </argument>
+ </argument>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ module
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ testmodule
+ </argument>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ configfile
+ </argument>
+ <argument type="normal" value="digit" binding="none" nextvalue="none">
+ testCaseNumber
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="digit">
+ expect
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="literal">
+ testid
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="literal">
+ ini
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="literal">
+ category
+ </argument>
+ <argument type="normal" value="name" binding="=" nextvalue="digit">
+ timeout
+ </argument>
+ <argument type="normal" value="quoted" binding="none" nextvalue="none">
+ title
+ </argument>
+ </optional>
+ <errornote>
+ syntax error error
+ </errornote>
+ <commandinfo>
+Starts the execution of a test case in a slave and also to request and release events from the slave.
+Other test case controlling for remote test cases is done with the same keywords as for the local test cases.
+
+Arguments:
+Slave name: The slave name, the same that was given for allocate.
+Command name: The remote command name
+supported commands:
+-run
+-request
+-wait
+-set
+-unset
+-release
+
+
+ </commandinfo>
+</command>
+
+
+<command id="INCLUDE">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ filename
+ </argument>
+ </mandatory>
+ <errornote>
+ missing mandatory argument: filename.
+ </errornote>
+ <commandinfo>
+Includes a file.
+
+Must be written in capital letters and must start from the first column of the line.
+File name (with path and extension) must follow INCLUDE command. Rest of line would be ignored.
+All files included from Unicode file should also be in Unicode format (and vice versa).
+Loops in includes are not allowed (for example incorrect situation is when file A includes file B and file B includes file A). In that case, the second include will be ignored, but STF parser will continue working).
+ </commandinfo>
+</command>
+
+<!-- end test combiner commands -->
+
+<!-- commands for shareobject -->
+<command id="createshareobj">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ TestClassName
+ </argument>
+ <argument type="creative" value="literal" binding="none" nextvalue="none">
+ TestObjectName
+ </argument>
+ </mandatory>
+ <errornote>
+ syntax error
+ </errornote>
+ <commandinfo>
+Creates an object, wihch can be shared to other test cases in the same test script file.
+
+createshareobj TestClassName TestObjectName
+
+Arguments:
+Test Class Name: The test class name for the new object.
+Test Object Name: the name of the created new instance of the test class
+ </commandinfo>
+</command>
+
+<command id="restoreshareobj">
+ <mandatory>
+ <argument type="creative" value="literal" binding="none" nextvalue="none">
+ TestObjectName
+ </argument>
+ </mandatory>
+ <errornote>
+ syntax error
+ </errornote>
+ <commandinfo>
+Restores an object, which has been created by the createshareobj keyword.
+
+restoreshareobj TestObjectName
+
+Arguments:
+Test Object Name: the name of the instance of the test class
+ </commandinfo>
+</command>
+
+<command id="deleteshareobj">
+ <mandatory>
+ <argument type="creative" value="literal" binding="none" nextvalue="none">
+ TestObjectName
+ </argument>
+ </mandatory>
+ <errornote>
+ syntax error
+ </errornote>
+ <commandinfo>
+Deletes an instance of a test class created with createshareobj.
+
+deleteshareobj TestObjectName
+
+Arguments:
+Test Object Name: the name of the instance of the test class
+ </commandinfo>
+</command>
+
+<!-- end commands for shareobject -->
+
+</section>
+
+<section name="StifSettings" endname="EndStifSettings" proposal="[StifSettings]\[EndStifSettings]">
+
+</section>
+
+
+<section name="Define" endname="Enddefine" proposal="[Define]\[Enddefine]">
+</section>
+
+
+<section name="New_Include_Module" endname="End_Include_Module" proposal="[New_Include_Module]\[End_Include_Module]">
+</section>
+
+<section name="Data" endname="Enddata" proposal="[Data]\ file sectionfile.ini sectiondescriptor
+\ section SectionName SectionObjectName\[Enddata]">
+
+<command id="file">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ sectionfile.ini
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="creative" value="literal" binding="none" nextvalue="none">
+ da
+ </argument>
+ </optional>
+ <errornote>
+ Create has invalid argument
+ </errornote>
+ <commandinfo>
+Specifies data file name.
+
+file sectionfile.ini da
+
+Arguments:
+sectionfile.ini: the data file name
+da: Optional.A short name used in the script to reference the data file
+ </commandinfo>
+</command>
+
+
+<command id="section">
+ <mandatory>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ SectionName
+ </argument>
+ </mandatory>
+ <optional>
+ <argument type="normal" value="literal" binding="none" nextvalue="none">
+ SectionShortName
+ </argument>
+ </optional>
+ <errornote>
+ Create has invalid argument
+ </errornote>
+ <commandinfo>
+Specify which section in the data file will be referred
+
+section SectionName SectionShortName
+
+Arguments:
+SectionName: The section name defined in the data file.
+SectionShortName: Optional.The short name.
+ </commandinfo>
+</command>
+
+
+</section>
+
+<section name="Sub" endname="Endsub" proposal="[Sub subname]\[Endsub]">
+</section>
+
+</sections>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/STIFScriptsEditor.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+ContentAssistProposal.label=Content assist
+ContentAssistProposal.tooltip=Content assist
+ContentAssistProposal.description=Provides Content Assistance
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/Activator.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "com.nokia.testfw.stf.scripteditor";
+
+ private static final String EDITOR_ID = "com.nokia.testfw.stf.scripteditor.editors.ScriptEditor";
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ //set default editor
+ PlatformUI.getWorkbench().getEditorRegistry().setDefaultEditor("*.cfg", EDITOR_ID);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/editors/ScriptEditor.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,413 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.testfw.stf.scripteditor.editors;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.ResourceBundle;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.IAnnotationModelExtension;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.IVerticalRuler;
+import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
+import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
+import org.eclipse.jface.text.source.projection.ProjectionSupport;
+import org.eclipse.jface.text.source.projection.ProjectionViewer;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.editors.text.TextEditor;
+import org.eclipse.ui.texteditor.ContentAssistAction;
+import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+import com.nokia.testfw.stf.scripteditor.utils.ScriptParser;
+import com.nokia.testfw.stf.scripteditor.utils.Section;
+import com.nokia.testfw.stf.scripteditor.utils.SectionFinder;
+import com.nokia.testfw.stf.scripteditor.utils.TestCase;
+
+/**
+ * STIF script file editor.
+ *
+ */
+
+public class ScriptEditor extends TextEditor implements
+ ISelectionChangedListener, SelectionListener {
+
+ private ScriptEditorOutlinePage outlinePage;
+
+ private ProjectionAnnotationModel annotationModel;
+
+ private ArrayList<ProjectionAnnotation> currentAnnotations = new ArrayList<ProjectionAnnotation>();
+
+ private ScriptEditorConfiguration configuration;
+
+ private ScriptParser parser;
+
+ public ScriptEditor() {
+ configuration = new ScriptEditorConfiguration();
+ configuration.changeConfigurationMode(null);
+ setSourceViewerConfiguration(configuration);
+ parser = new ScriptParser();
+ }
+
+ /**
+ * Saves the editor document
+ */
+ public void doSave(IProgressMonitor monitor) {
+ refreshOutlineFoldingAndParse();
+ super.doSave(monitor);
+ }
+
+ /**
+ * Checks editor content syntax and updates folding.
+ */
+ public void refreshOutlineFoldingAndParse() {
+ if (outlinePage != null) {
+ TestCase[] testCases = (TestCase[]) (SectionFinder.getSections(this
+ .getDocumentProvider().getDocument(getEditorInput())));
+ outlinePage.updateViewWithTests(testCases);
+ updateFoldingStructure(testCases);
+ }
+ checkScript();
+ }
+
+ /**
+ * Checks editor content syntax.
+ */
+ private void checkScript() {
+ String scriptContent = getDocumentProvider().getDocument(
+ getEditorInput()).get();
+ parser.checkScripterScript(scriptContent, getEditorInput());
+ configuration.changeConfigurationMode(parser.subSectionContent);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * Method declared on SelectionListener
+ */
+ public void widgetSelected(SelectionEvent selectionEv) {
+ String scriptContent = getDocumentProvider().getDocument(
+ getEditorInput()).get();
+ try {
+
+ ScriptEditorConfiguration conf = (ScriptEditorConfiguration) getSourceViewerConfiguration();
+ conf.changeConfigurationMode(null);
+ parser.checkScripterScript(scriptContent, getEditorInput());
+
+ this.getSourceViewer().invalidateTextPresentation();
+
+ } catch(Exception ex) {
+ MessageBox message = new MessageBox(PlatformUI
+ .getWorkbench().getActiveWorkbenchWindow().getShell());
+ message.setText("Problems while saving editor mode");
+ message.setMessage(ex.getMessage());
+ }
+ }
+
+ /*
+ * (non-Javadoc) Method declared on SelectionListener
+ */
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see IStorage#getAdapter()
+ */
+ public Object getAdapter(Class required) {
+ if (IContentOutlinePage.class.equals(required)) {
+ if (outlinePage == null) {
+ outlinePage = new ScriptEditorOutlinePage(this);
+ }
+ return outlinePage;
+ }
+ return super.getAdapter(required);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action
+ * .IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(SelectionChangedEvent sce) {
+ ITreeSelection selection = (ITreeSelection) sce.getSelection();
+ if (selection.isEmpty())
+ return;
+
+ TreePath[] selections = selection.getPaths();
+ TestCase testCase = (TestCase) selections[0].getFirstSegment();
+
+ IDocument doc = getDocumentProvider().getDocument(getEditorInput());
+
+ String contentOfDoc = doc.get();
+ String name = testCase.getName();
+ name = name.replaceAll("\\(", "\\\\(").replaceAll("\\)", "\\\\)");
+ String patternString = "\\s+title\\s+(" + name + ")\\s*$";
+
+ Pattern pattern = Pattern.compile(patternString, Pattern.MULTILINE);
+ Matcher regExMatcher = pattern.matcher(contentOfDoc);
+ ArrayList<Integer> indexesList = new ArrayList<Integer>();
+ while (regExMatcher.find()) {
+ indexesList.add(regExMatcher.start(1));
+ indexesList.add(regExMatcher.end(1));
+ }
+
+ int oneFromCasesWithSameName = 0;
+ if (indexesList.size() > 2) {
+ TreeViewer tv = (TreeViewer) sce.getSource();
+ Tree tree = tv.getTree();
+ TreeItem[] treeItems = tree.getItems();
+
+ for (int i = 0; i < treeItems.length; i++) {
+ if (treeItems[i].getText().equals(
+ tree.getSelection()[0].getText())) {
+ if (treeItems[i] == tree.getSelection()[0]) {
+ break;
+ }
+ oneFromCasesWithSameName++;
+ }
+ }
+ }
+ if (indexesList.size() > 0) {
+ selectAndReveal(indexesList.get(oneFromCasesWithSameName * 2),
+ indexesList.get(oneFromCasesWithSameName * 2 + 1)
+ - indexesList.get(oneFromCasesWithSameName * 2));
+ }
+ }
+
+ /**
+ * Updates folding structure of the current file. Invalid annotations are
+ * removed and new ones are added
+ */
+ public void updateFoldingStructure(Section[] sections) {
+ HashMap<ProjectionAnnotation, Position> newAnnotations = new HashMap<ProjectionAnnotation, Position>();
+ ArrayList<ProjectionAnnotation> annotationsToRemove = new ArrayList<ProjectionAnnotation>();
+
+ for (int i = 0; i < currentAnnotations.size(); i++) {
+ boolean annotationExists = false;
+ for (int j = 0; j < sections.length; j++) {
+ if (currentAnnotations.get(i).getText().equals(
+ sections[j].getName())) {
+ annotationExists = true;
+ break;
+ }
+ }
+ if (!annotationExists) {
+ annotationsToRemove.add(currentAnnotations.get(i));
+ currentAnnotations.remove(i);
+ }
+ }
+
+ for (int i = 0; i < sections.length; i++) {
+ if (sections[i].getIsNew()) {
+ ProjectionAnnotation annotation = new ProjectionAnnotation();
+ annotation.setText(sections[i].getName());
+ int length = sections[i].getEndOffset()
+ - sections[i].getStartOffset();
+ newAnnotations.put(annotation, new Position(sections[i]
+ .getStartOffset(), length));
+ currentAnnotations.add(annotation);
+ }
+ }
+
+ IAnnotationModelExtension modelExtension = (IAnnotationModelExtension) annotationModel;
+ modelExtension.replaceAnnotations(annotationsToRemove
+ .toArray(new ProjectionAnnotation[0]), newAnnotations);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * Overriden
+ */
+ public void createPartControl(Composite arg0) {
+ super.createPartControl(arg0);
+
+ ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
+ ProjectionSupport support = new ProjectionSupport(viewer,
+ getAnnotationAccess(), getSharedColors());
+ support.install();
+
+ viewer.doOperation(ProjectionViewer.TOGGLE);
+
+ annotationModel = viewer.getProjectionAnnotationModel();
+
+ Control control = (Control) getAdapter(org.eclipse.swt.widgets.Control.class);
+
+ control.addKeyListener(new KeyListener() {
+ public void keyPressed(KeyEvent e) {
+ refreshOutlineFoldingAndParse(); // method responsible for
+ // refreshing and parsing
+ // tests invoked after any
+ // key event.
+ }
+
+ public void keyReleased(KeyEvent e) {
+ }
+ });
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * Overriden
+ */
+ protected ISourceViewer createSourceViewer(Composite parent,
+ IVerticalRuler ruler, int styles) {
+
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.marginTop = 0;
+ layout.marginBottom = 0;
+ layout.marginLeft = 0;
+ layout.marginRight = 0;
+ parent.setLayout(layout);
+
+ GridData scriptEditorGridData = new GridData(GridData.FILL_HORIZONTAL
+ | GridData.FILL_VERTICAL);
+
+ ProjectionViewer sourceViewer = new ProjectionViewer(parent, ruler,
+ getOverviewRuler(), isOverviewRulerVisible(), styles);
+ getSourceViewerDecorationSupport(sourceViewer);
+
+ sourceViewer.getTextWidget().getParent().setLayoutData(
+ scriptEditorGridData);
+
+ return sourceViewer;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.editors.text.TextEditor#createActions()
+ */
+ protected void createActions() {
+ super.createActions();
+ ResourceBundle resourceBundle = ResourceBundle
+ .getBundle("STIFScriptsEditor");
+ Action action = new ContentAssistAction(resourceBundle,
+ "ContentAssistProposal.", this);
+ String id = ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS;
+ action.setActionDefinitionId(id);
+ setAction("ContentAssistProposal", action);
+ markAsStateDependentAction("ContentAssistProposal", true);
+ checkScript();
+
+ // action = new TextOperationAction(resourceBundle, "Comment.", this,
+ // ITextOperationTarget.PREFIX);
+ //
+ // action.setActionDefinitionId("org.eclipse.cdt.ui.edit.text.c.add.block.comment");
+ //
+ // setAction("Comment", action);
+ //
+ // markAsStateDependentAction("Comment", true);
+ //
+ //
+ // action = new TextOperationAction(resourceBundle,
+ // "Uncomment.", this,
+ // ITextOperationTarget.STRIP_PREFIX);
+ //
+ // action.setActionDefinitionId("org.eclipse.cdt.ui.edit.text.c.add.block.uncomment");
+ // setAction("Uncomment", action);
+ // markAsStateDependentAction("Uncomment", true);
+ //
+ // action = new ToggleCommentAction(resourceBundle, "ToggleComment.",
+ // this);
+ // action.setActionDefinitionId("org.eclipse.cdt.ui.edit.text.c.toggle.comment");
+ // setAction("ToggleComment", action);
+ // markAsStateDependentAction("ToggleComment", true);
+ //
+ // ISourceViewer sourceViewer = getSourceViewer();
+ // SourceViewerConfiguration configuration =
+ // getSourceViewerConfiguration();
+ // ((ToggleCommentAction) action).configure(sourceViewer,
+ // configuration);
+
+ }
+
+ /**
+ * Gets resource associated with editor input
+ *
+ * @return resource
+ */
+ protected IResource getResource() {
+ IEditorInput input = getEditorInput();
+ if (input == null) {
+ return null;
+ }
+ IResource resource = (IResource) input.getAdapter(IFile.class);
+ if (resource == null) {
+ resource = (IResource) input.getAdapter(IResource.class);
+ if (resource == null) {
+ resource = ResourcesPlugin.getWorkspace().getRoot();
+
+ }
+ }
+ refreshOutlineFoldingAndParse();
+ return resource;
+ }
+
+ public ScriptEditorConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ public void setInitializationData(IConfigurationElement cfig,
+ String propertyName, Object data) {
+ super.setInitializationData(cfig, propertyName, data);
+ }
+
+ /**
+ * override the method to always display line number
+ */
+ protected boolean isLineNumberRulerVisible() {
+ return true;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/editors/ScriptEditorConfiguration.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,153 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor.editors;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.DefaultTextHover;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.presentation.IPresentationReconciler;
+import org.eclipse.jface.text.presentation.PresentationReconciler;
+import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
+import org.eclipse.jface.text.source.DefaultAnnotationHover;
+import org.eclipse.jface.text.source.IAnnotationHover;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+
+import com.nokia.testfw.stf.scripteditor.Activator;
+import com.nokia.testfw.stf.scripteditor.editors.scripter.ScripterAssistProcessor;
+import com.nokia.testfw.stf.scripteditor.preference.PreferenceConstants;
+import com.nokia.testfw.stf.scripteditor.utils.Command;
+
+/**
+ * Config source editor configuration
+ *
+ */
+
+public class ScriptEditorConfiguration extends SourceViewerConfiguration {
+
+ /**
+ * Creates Script Editor configuration
+ */
+ public ScriptEditorConfiguration() {
+ assistant = new ContentAssistant();
+ reconciler = new PresentationReconciler();
+ scriptScanner = new ScriptScanner();
+ repairer = new DefaultDamagerRepairer(scriptScanner);
+ scripterAssistProcessor = new ScripterAssistProcessor();
+
+ IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+
+ assistant.enableAutoActivation(store.getBoolean(PreferenceConstants.AUTO_ACTIVATION));
+ assistant.setAutoActivationDelay(store.getInt(PreferenceConstants.AUTO_ACTIVATION_DELAY));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.editors.text.TextSourceViewerConfiguration#getAnnotationHover
+ */
+ public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
+ return new DefaultAnnotationHover();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer)
+ */
+ public IPresentationReconciler getPresentationReconciler(ISourceViewer arg0) {
+ reconciler.setRepairer(repairer, IDocument.DEFAULT_CONTENT_TYPE);
+ reconciler.setDamager(repairer, IDocument.DEFAULT_CONTENT_TYPE);
+ return reconciler;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getContentAssistant(org.eclipse.jface.text.source.ISourceViewer)
+ */
+ public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
+ assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
+ return assistant;
+ }
+
+ public IContentAssistant getContentAssistant() {
+ return assistant;
+ }
+
+ /**
+ * Changes Script Editor mode
+ */
+ public void changeConfigurationMode(ArrayList<String> subSectionContent) {
+ assistant.setContentAssistProcessor(scripterAssistProcessor,
+ IDocument.DEFAULT_CONTENT_TYPE);
+ scriptScanner.changeSetOfKeywords(subSectionContent);
+ }
+
+ public ITextHover getTextHover(ISourceViewer sourceViewer,
+ String contentType)
+ {
+ return new DefaultTextHover(sourceViewer) {
+
+ public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion)
+ {
+ try {
+ String keyword = textViewer.getDocument().get(
+ hoverRegion.getOffset(), hoverRegion.getLength());
+ ArrayList<Command> cmds = scripterAssistProcessor.getCommand();
+
+ for (Command cmd : cmds) {
+ if (keyword.equals(cmd.getCommandName())) {
+ return cmd.getCommandInfo();
+ }
+ }
+ return null;
+ }
+ catch (Exception e) {
+ return null;
+ }
+
+ }
+
+
+
+ };
+ }
+
+ public String[] getDefaultPrefixes(ISourceViewer sourceViewer, String contentType) {
+ return super.getDefaultPrefixes(sourceViewer, contentType);
+ }
+
+ private ContentAssistant assistant;
+
+ private PresentationReconciler reconciler;
+
+ private DefaultDamagerRepairer repairer;
+
+ private ScriptScanner scriptScanner;
+
+ private ScripterAssistProcessor scripterAssistProcessor;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/editors/ScriptEditorContributor.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor.editors;
+
+import org.eclipse.jface.action.*;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.ide.IDEActionFactory;
+import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorActionConstants;
+
+/**
+ * Manages the installation/deinstallation of global actions for multi-page
+ * editors. Responsible for the redirection of global actions to the active
+ * editor. Multi-page contributor replaces the contributors for the individual
+ * editors in the multi-page editor.
+ */
+public class ScriptEditorContributor extends
+ MultiPageEditorActionBarContributor {
+
+ private IEditorPart activeEditorPart;
+
+ /**
+ * Creates a multi-page contributor.
+ */
+ public ScriptEditorContributor() {
+ super();
+ createActions();
+ }
+
+ /**
+ * Returns the action registed with the given text editor.
+ *
+ * @return IAction or null if editor is null.
+ */
+ protected IAction getAction(ITextEditor editor, String actionID) {
+ return (editor == null ? null : editor.getAction(actionID));
+ }
+
+ /*
+ * (non-JavaDoc) Method declared in
+ * AbstractMultiPageEditorActionBarContributor.
+ */
+
+ public void setActivePage(IEditorPart part) {
+ if (activeEditorPart == part)
+ return;
+
+ activeEditorPart = part;
+
+ IActionBars actionBars = getActionBars();
+ if (actionBars != null) {
+
+ ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part
+ : null;
+
+ actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),
+ getAction(editor, ITextEditorActionConstants.DELETE));
+ actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(),
+ getAction(editor, ITextEditorActionConstants.UNDO));
+ actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(),
+ getAction(editor, ITextEditorActionConstants.REDO));
+ actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(),
+ getAction(editor, ITextEditorActionConstants.CUT));
+ actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(),
+ getAction(editor, ITextEditorActionConstants.COPY));
+ actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(),
+ getAction(editor, ITextEditorActionConstants.PASTE));
+ actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(),
+ getAction(editor, ITextEditorActionConstants.SELECT_ALL));
+ actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(),
+ getAction(editor, ITextEditorActionConstants.FIND));
+ actionBars.setGlobalActionHandler(
+ IDEActionFactory.BOOKMARK.getId(), getAction(editor,
+ IDEActionFactory.BOOKMARK.getId()));
+ actionBars.updateActionBars();
+ }
+ }
+
+ /**
+ * Creates editor actions
+ */
+
+ private void createActions() {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToMenu(org.eclipse.jface.action.IMenuManager)
+ */
+ public void contributeToMenu(IMenuManager manager) {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(org.eclipse.jface.action.IToolBarManager)
+ */
+ public void contributeToToolBar(IToolBarManager manager) {
+
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/editors/ScriptEditorOutlinePage.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor.editors;
+
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.part.IPageSite;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.editors.text.TextEditor;
+
+import com.nokia.testfw.stf.scripteditor.utils.OutlinePageContentProvider;
+import com.nokia.testfw.stf.scripteditor.utils.OutlineViewLabelProvider;
+import com.nokia.testfw.stf.scripteditor.utils.TestCase;
+
+/**
+ * Creates Outline page for Script Editor.
+ * Outline page displays tests in tree view.
+ *
+ */
+public class ScriptEditorOutlinePage extends ContentOutlinePage {
+
+ /**
+ * Creates Script Editor Outline view
+ *
+ */
+ public ScriptEditorOutlinePage(TextEditor scriptEditor) {
+ editor = scriptEditor;
+
+ }
+
+ /*
+ * (non-JavaDoc) Method declared in
+ * @see org.eclipse.ui.views.contentoutline.ContentOutlinePage#init()
+ */
+ public void init(IPageSite arg0) {
+ super.init(arg0);
+ }
+
+ /*
+ * (non-JavaDoc) Method declared in
+ * @see org.eclipse.ui.views.contentoutline.ContentOutlinePage#createControl()
+ */
+ public void createControl(Composite arg0) {
+ super.createControl(arg0);
+ treeViewer = getTreeViewer();
+ treeViewer.setContentProvider(new OutlinePageContentProvider());
+ treeViewer.setLabelProvider(new OutlineViewLabelProvider());
+ treeViewer.addSelectionChangedListener((ISelectionChangedListener) editor);
+
+ //call the method in editor to initialize outline view with list of test case names
+ ((ScriptEditor)editor).refreshOutlineFoldingAndParse();
+
+ }
+
+ /**
+ * Creates Script Editor Outline view
+ *
+ */
+ public void updateViewWithTests(TestCase[] testCases) {
+ treeViewer.setInput(testCases);
+ }
+
+ private TreeViewer treeViewer;
+
+ private TextEditor editor;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/editors/ScriptScanner.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor.editors;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.MultiLineRule;
+import org.eclipse.jface.text.rules.IWhitespaceDetector;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WhitespaceRule;
+import org.eclipse.jface.text.rules.WordRule;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.jface.text.rules.IRule;
+
+
+import com.nokia.testfw.stf.scripteditor.editors.scripter.ScripterWordsProvider;
+import com.nokia.testfw.stf.scripteditor.utils.KeywordDetector;
+
+/**
+ * Config source scaner. Defines syntax highlighting rules.
+ *
+ */
+public class ScriptScanner extends RuleBasedScanner {
+
+ /**
+ * Creates config source scaner
+ */
+ public ScriptScanner(/*EditorMode mode*/){
+
+ sectionWordRule = new WordRule(new SectionDetector());
+ keywordRule = new WordRule(new KeywordDetector(), Token.WHITESPACE);
+
+ wsRule = new WhitespaceRule(new IWhitespaceDetector() {
+ public boolean isWhitespace(char c) {
+ return Character.isWhitespace(c);
+ }
+ });
+
+ Color COMMENT_COLOR = Display.getCurrent().getSystemColor( SWT.COLOR_DARK_GRAY );
+ Token comment = new Token(new TextAttribute( COMMENT_COLOR ));
+ hashCommentRule = new EndOfLineRule("#", comment);
+ slashCommentRule = new EndOfLineRule("//", comment);
+ blkCommentRule = new MultiLineRule("/*", "*/", comment);
+
+ String[] sectionWords = null;
+ String[] keywords = null;
+
+ sectionWords = ScripterWordsProvider.provideSectionWords();
+ keywords = ScripterWordsProvider.provideKeywords();
+ for (int i = 0; i < sectionWords.length; i++) {
+ sectionWordRule.addWord(sectionWords[i], sectionWordToken);
+ }
+ for(int i = 0; i < keywords.length; i++){
+ keywordRule.addWord(keywords[i], keywordToken);
+ }
+ setRules(new IRule[] {sectionWordRule, keywordRule, hashCommentRule, slashCommentRule, wsRule, blkCommentRule});
+ }
+
+ /**
+ * Changes set of keywords between TestScripter and TestCombiner
+ */
+
+ public void changeSetOfKeywords(ArrayList<String> subSectionContent/*EditorMode mode*/){
+ sectionWordRule = new WordRule(new SectionDetector());
+ keywordRule = new WordRule(new KeywordDetector(), Token.WHITESPACE);
+
+ String[] sectionWords = null;
+ String[] keywords = null;
+
+ sectionWords = ScripterWordsProvider.provideSectionWords();
+ keywords = ScripterWordsProvider.provideKeywords();
+
+ for(int i = 0; i < sectionWords.length; i++){
+ sectionWordRule.addWord(sectionWords[i], sectionWordToken);
+ }
+
+ if(subSectionContent!=null && subSectionContent.size()>0){
+ if(subSectionContent.get(0).equals("[Sub")){
+ sectionWordRule.addWord(subSectionContent.get(0), sectionWordToken);
+ }
+ if(subSectionContent.size()>1){
+ for(int i=1;i<subSectionContent.size();i++){
+ if(subSectionContent.get(i).matches("[a-z]+\\]")){
+ sectionWordRule.addWord(subSectionContent.get(i), sectionWordToken);
+ }
+ }
+ }
+ }
+
+ for(int i = 0; i < keywords.length; i++){
+ keywordRule.addWord(keywords[i], keywordToken);
+ }
+
+ setRules(new IRule[] {sectionWordRule, keywordRule, hashCommentRule, slashCommentRule, wsRule, blkCommentRule});
+ }
+
+ private Color KEYWORD_COLOR = Display.getCurrent().getSystemColor(SWT.COLOR_BLUE);
+ private Color SECTION_WORD_COLOR = Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN);
+
+ private WordRule sectionWordRule;
+ private WordRule keywordRule;
+ private WhitespaceRule wsRule;
+ private EndOfLineRule hashCommentRule;
+ private EndOfLineRule slashCommentRule;
+ private MultiLineRule blkCommentRule;
+
+ private Token sectionWordToken = new Token(new TextAttribute(SECTION_WORD_COLOR, null, SWT.BOLD));
+ private Token keywordToken = new Token(new TextAttribute(KEYWORD_COLOR, null, SWT.BOLD));
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/editors/SectionDetector.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor.editors;
+
+import org.eclipse.jface.text.rules.IWordDetector;
+
+/**
+ * Detect begining and end of a section in script.
+ *
+ */
+
+public class SectionDetector implements IWordDetector {
+ /**
+ * Checks [ char position
+ *
+ * @return boolean
+ */
+
+ public boolean isWordStart(char c) {
+ if (c == '[') {
+ return true;
+ }
+ return Character.isJavaIdentifierStart(c);
+ }
+
+ /**
+ * Checks ] char position
+ *
+ * @return boolean
+ */
+ public boolean isWordPart(char c) {
+ if (c == ']')
+ return true;
+ return Character.isJavaIdentifierPart(c);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/editors/scripter/ScripterAssistProcessor.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,333 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor.editors.scripter;
+
+import org.eclipse.jface.contentassist.IContentAssistSubjectControl;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.CompletionProposal;
+import org.eclipse.jface.text.contentassist.ContextInformation;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+
+import com.nokia.testfw.stf.scripteditor.utils.Arguments;
+import com.nokia.testfw.stf.scripteditor.utils.Command;
+import com.nokia.testfw.stf.scripteditor.utils.Parser;
+import com.nokia.testfw.stf.scripteditor.utils.ScriptParser;
+import com.nokia.testfw.stf.scripteditor.utils.SectionTag;
+import com.nokia.testfw.stf.scripteditor.utils.ScriptParser.ScripterSection;
+
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+
+
+public class ScripterAssistProcessor implements IContentAssistProcessor
+ {
+
+ public ScripterAssistProcessor() {
+ String[] keywordsArray = ScripterWordsProvider.provideKeywords();
+ String[] sectionWordsArray = ScripterWordsProvider
+ .provideSectionOpeningKeywords();
+ parser = new Parser("/scripter.xml");
+ SectionTag testSec = parser.getSectionByName("Test");
+ this.testCommand = testSec.getCommandList();
+ SectionTag dataSec = parser.getSectionByName("Data");
+ this.dataCommand = dataSec.getCommandList();
+
+ for (int i = 0; i < keywordsArray.length; i++) {
+ keywords.add(keywordsArray[i]);
+ }
+ for (int i = 0; i < sectionWordsArray.length; i++) {
+ sectionWords.add(sectionWordsArray[i]);
+ }
+ }
+
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
+
+ createdMacros = Parser.provideMacrosObjects();
+ createdObjects = Parser.provideObjectsList();
+
+ String document = viewer.getDocument().get();
+ ArrayList<ICompletionProposal> props = new ArrayList<ICompletionProposal>();
+ ScripterSection currentSection = ScriptParser.getCurrentScripterSection(document, offset);
+
+ int startOffset = offset;
+ for(int i = offset - 1; i >= 0; i--){
+ if(Character.isWhitespace(document.charAt(i))){
+ break;
+ }
+ startOffset = i;
+ }
+ String wordBeginning = document.substring( startOffset, offset );
+ if(currentSection != ScripterSection.NoSection){
+ if(currentSection == ScripterSection.StifSettingsSection){
+ if(ScripterWordsProvider.END_TEST_TAG.startsWith(wordBeginning)){
+ props.add(new CompletionProposal(ScripterWordsProvider.END_STIF_SETTINGS_TAG, startOffset, offset - startOffset, ScripterWordsProvider.END_TEST_TAG.length()));
+ }
+ }
+ else if(currentSection == ScripterSection.DefineSection){
+ if(ScripterWordsProvider.END_DEFINE_TAG.startsWith(wordBeginning)){
+ props.add(new CompletionProposal(ScripterWordsProvider.END_DEFINE_TAG, startOffset, offset - startOffset, ScripterWordsProvider.END_DEFINE_TAG.length()));
+ }
+ }
+ else if(currentSection == ScripterSection.NewIncludeModuleSection){
+ if(ScripterWordsProvider.END_INCLUDE_MODULE_TAG.startsWith(wordBeginning)){
+ props.add(new CompletionProposal(ScripterWordsProvider.END_INCLUDE_MODULE_TAG, startOffset, offset - startOffset, ScripterWordsProvider.END_INCLUDE_MODULE_TAG.length()));
+ }
+ }
+ else if(currentSection == ScripterSection.DataSection){
+ if(ScripterWordsProvider.END_DATA_TAG.startsWith(wordBeginning)){
+ props.add(new CompletionProposal(ScripterWordsProvider.END_DATA_TAG, startOffset, offset - startOffset, ScripterWordsProvider.END_DATA_TAG.length()));
+ }
+ createProposalForCmds(props, wordBeginning, startOffset, offset, dataCommand);
+ }
+ else if(currentSection == ScripterSection.TestSection){
+ getProposalsForTestSection(props, wordBeginning, startOffset, offset);
+ }
+
+ }
+ else {
+ for (String sectionWord : sectionWords) {
+ if (sectionWord.startsWith(wordBeginning)) {
+ if (sectionWord.startsWith("[")) {
+ sectionWord = sectionWord.substring(1);
+ sectionWord = sectionWord.substring(0, sectionWord.length()-1);
+ }
+
+ SectionTag secTag = parser.getSectionByName(sectionWord);
+ String propStr = secTag.getProposal();
+ propStr = propStr.replace('\\', '\n');
+ CompletionProposal proposal =
+ new CompletionProposal(propStr, startOffset, offset - startOffset, propStr.length());
+ props.add(proposal);
+ }
+ }
+
+ }
+ return props.toArray(new ICompletionProposal[0]);
+ }
+
+
+ private void getProposalsForTestSection(ArrayList<ICompletionProposal> props, String wordBeginning,
+ int startOffset, int offset) {
+
+ if (ScripterWordsProvider.END_STIF_SETTINGS_TAG
+ .startsWith(wordBeginning)) {
+ props.add(new CompletionProposal(
+ ScripterWordsProvider.END_TEST_TAG, startOffset, offset
+ - startOffset,
+ ScripterWordsProvider.END_STIF_SETTINGS_TAG.length()));
+ }
+
+ for (int i = 0; i < createdMacros.size(); i++) {
+ String keyword = createdMacros.get(i);
+ if (keyword.startsWith(wordBeginning)) {
+ CompletionProposal proposal = new CompletionProposal((keyword),
+ startOffset, offset - startOffset, keyword.length(),
+ null, null, null, " \n Macro defined in Define section");
+ props.add(proposal);
+ }
+ }
+
+ for (int i = 0; i < createdObjects.size(); i++) {
+ String keyword = createdObjects.get(i);
+ if (keyword.startsWith(wordBeginning)) {
+ CompletionProposal proposal = new CompletionProposal((keyword),
+ startOffset, offset - startOffset, keyword.length(),
+ null, null, null,
+ " \n Object created using \"create\" or \"cratekernel\" command.");
+ props.add(proposal);
+ }
+ }
+ createProposalForCmds(props, wordBeginning, startOffset, offset, testCommand);
+ }
+
+ private void createProposalForCmds(ArrayList<ICompletionProposal> props, String wordBeginning,
+ int startOffset, int offset, ArrayList<Command> command) {
+ for (int i = 0; i < command.size(); i++) {
+ String keyword = command.get(i).getCommandName();
+ ArrayList<Arguments> optional = command.get(i).getOptional();
+ ArrayList<Arguments> argument = command.get(i).getMandatory();
+ String tempKeyword = command.get(i).getCommandName();
+ if (keyword.startsWith(wordBeginning)) {
+ for (int j = 0; j < argument.size(); j++) {
+
+ if (argument.get(j).getArgumenType() != null) {
+ if (argument.get(j).getArgumenType().equals("literal")) {
+ keyword = (keyword + " " + argument.get(j)
+ .getArgumentName());
+ tempKeyword = tempKeyword.concat(" "
+ + argument.get(j).getArgumentName());
+ }
+ if (argument.get(j).getArgumenType().equals("digit")) {
+ keyword = (keyword + " 0");
+ tempKeyword = tempKeyword.concat(" "
+ + argument.get(j).getArgumentName());
+ }
+ if (argument.get(j).getArgumenType().equals("value")) {
+ keyword = (keyword + " " + argument.get(j)
+ .getArgumentName());
+ tempKeyword = tempKeyword.concat(" value");
+ }
+ if (argument.get(j).getArgumenType().equals("quoted")) {
+ keyword = (keyword + " \""
+ + argument.get(j).getArgumentName() + "\"");
+ tempKeyword = tempKeyword.concat(" "
+ + argument.get(j).getArgumentName());
+ }
+ }
+
+ }
+ CompletionProposal proposal = new CompletionProposal(keyword,
+ startOffset, offset - startOffset, keyword.length(),
+ null, tempKeyword, null, "\n"
+ + command.get(i).getCommandInfo());
+ props.add(proposal);
+ if (optional != null) {
+ for (int j = 0; j < optional.size(); j++) {
+
+ if (optional.get(j).getArgumenType() != null) {
+ if (optional.get(j).getArgumenType()
+ .equals("words")) {
+ continue;
+ }
+
+ if (optional.get(j).getArgumenType().equals(
+ "literal")
+ || optional.get(j).getArgumenType().equals(
+ "name")) {
+ if (optional.get(j).getArgumentBinding()
+ .equals("=")) {
+
+ tempKeyword = tempKeyword
+ .concat(" "
+ + optional.get(j)
+ .getArgumentName());
+ if (optional.get(j).getNextValue().equals(
+ "digit")) {
+
+ keyword = (keyword
+ + " "
+ + optional.get(j)
+ .getArgumentName() + " = 0");
+
+ } else {
+ keyword = (keyword
+ + " "
+ + optional.get(j)
+ .getArgumentName() + " = value");
+
+ }
+ } else {
+ keyword = (keyword + " " + optional.get(j)
+ .getArgumentName());
+ tempKeyword = tempKeyword
+ .concat(" "
+ + optional.get(j)
+ .getArgumentName());
+ }
+ }
+ if (optional.get(j).getArgumenType()
+ .equals("digit")) {
+ keyword = (keyword + " 0");
+ tempKeyword = tempKeyword.concat(" "
+ + optional.get(j).getArgumentName());
+ }
+ if (optional.get(j).getArgumenType()
+ .equals("value")) {
+ keyword = (keyword + " " + optional.get(j)
+ .getArgumentName());
+ tempKeyword = tempKeyword.concat(" value");
+ }
+ if (optional.get(j).getArgumenType().equals(
+ "quoted")) {
+ keyword = (keyword + " \""
+ + optional.get(j).getArgumentName() + " = value\"");
+ tempKeyword = tempKeyword.concat(" "
+ + optional.get(j).getArgumentName());
+ }
+ }
+ CompletionProposal prop = new CompletionProposal(
+ keyword, startOffset, offset - startOffset,
+ keyword.length(), null, tempKeyword, null,
+ command.get(i).getCommandInfo());
+ props.add(prop);
+ }
+ }
+ }
+ }
+
+ }
+
+
+ public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
+ IContextInformation[] result= new IContextInformation[5];
+ for (int i= 0; i < result.length; i++)
+ result[i]= new ContextInformation(
+ MessageFormat.format("CompletionProcessor.ContextInfo.display.pattern", new Object[] { new Integer(i), new Integer(documentOffset) }),
+ MessageFormat.format("CompletionProcessor.ContextInfo.value.pattern", new Object[] { new Integer(i), new Integer(documentOffset - 5), new Integer(documentOffset + 5)}));
+ return result;
+ }
+
+ public char[] getCompletionProposalAutoActivationCharacters() {
+
+ return new char[] { '.' , 't', 'p' , 'g', 'e'};
+
+ }
+
+ public char[] getContextInformationAutoActivationCharacters() {
+ // TODO Auto-generated method stub
+ return new char[] { 't' };
+ }
+
+ public String getErrorMessage() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IContextInformationValidator getContextInformationValidator() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ private ArrayList<String> createdMacros = new ArrayList<String>();
+ private ArrayList<String> createdObjects = new ArrayList<String>();
+ private ArrayList<String> sectionWords = new ArrayList<String>();
+ private ArrayList<String> keywords = new ArrayList<String>();
+ private ArrayList<Command> testCommand =new ArrayList<Command>();
+ private ArrayList<Command> dataCommand =new ArrayList<Command>();
+ private Parser parser;
+
+ public ICompletionProposal[] computeCompletionProposals(IContentAssistSubjectControl arg0, int arg1) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IContextInformation[] computeContextInformation(IContentAssistSubjectControl arg0, int arg1) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ArrayList<Command> getCommand() {
+ return testCommand;
+ }
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/editors/scripter/ScripterWordsProvider.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.stf.scripteditor.editors.scripter;
+
+import java.util.ArrayList;
+
+import com.nokia.testfw.stf.scripteditor.utils.Parser;
+import com.nokia.testfw.stf.scripteditor.utils.SectionTag;
+
+/**
+ * Provides set of keywords and session tags for code assistant and syntax
+ * checking
+ *
+ */
+public class ScripterWordsProvider {
+
+ /**
+ * Provides set of sesion tags
+ * @return list of keywords
+ */
+ public static String[] provideSectionWords(){
+ Parser parser = new Parser("/scripter.xml");
+ String[] sectionkeywrds = parser.provideSectionTags();
+ return sectionkeywrds;
+
+
+ }
+
+
+ /**
+ * Provides set of opening sesion tags
+ * @return list of sections tags
+ */
+ public static String[] provideSectionOpeningKeywords(){
+ Parser parser = new Parser("/scripter.xml");
+ ArrayList<SectionTag> arrayOfSections = parser.gerSection();
+ String[] sectionkeywrds = new String[arrayOfSections.size()];
+ for(int i = 0 ; i < sectionkeywrds.length ; i++ ){
+
+ sectionkeywrds[i] = ("[" +arrayOfSections.get(i).getName() +"]");
+
+ }
+ return sectionkeywrds;
+ }
+
+ /**
+ * Provides set of keywords
+ * @return list keywords
+ */
+ public static String[] provideKeywords(){
+
+
+ Parser parser = new Parser("/scripter.xml");
+ ArrayList<SectionTag> arrayOfSections = parser.gerSection();
+ String[] sectionkeywrds = new String[arrayOfSections.size()];
+ ArrayList<String> keywordsList = new ArrayList<String>();
+ for(int i = 0 ; i < sectionkeywrds.length ; i++ ){
+
+ SectionTag section =arrayOfSections.get(i);
+ for(int g = 0 ; g < section.getCommandList().size() ; g++){
+
+ String command = section.getCommandList().get(g).getCommandName();
+ keywordsList.add(command);
+
+ }
+
+ }
+ String[] keywordsArray = new String[keywordsList.size()];
+ for (int h = 0 ; h < keywordsList.size() ; h++){
+ keywordsArray[h] = keywordsList.get(h);
+ }
+
+
+ return keywordsArray;
+ }
+
+ public static final String TEST_TAG = "[Test]";
+ public static final String END_TEST_TAG = "[Endtest]";
+ public static final String DEFINE_TAG = "[Define]";
+ public static final String END_DEFINE_TAG = "[Enddefine]";
+ public static final String NEW_INCLUDE_MODULE_TAG = "[New_Include_Module]";
+ public static final String END_INCLUDE_MODULE_TAG = "[End_Include_Module]";
+ public static final String STIF_SETTINGS_TAG = "[StifSettings]";
+ public static final String END_STIF_SETTINGS_TAG = "[EndStifSettings]";
+ public static final String END_DATA_TAG = "[Enddata]";
+
+ public static final String TITLE_KEYWORD = "title";
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/preference/ItePreferencePage.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.stf.scripteditor.preference;
+
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class ItePreferencePage extends FieldEditorPreferencePage
+implements IWorkbenchPreferencePage {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+ */
+ @Override
+ protected void createFieldEditors() {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/preference/PreferenceConstants.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.stf.scripteditor.preference;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class PreferenceConstants {
+ public static final String AUTO_ACTIVATION = "enableact";
+ public static final String AUTO_ACTIVATION_DELAY = "delay";
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/preference/PreferenceInitializer.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.stf.scripteditor.preference;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+import com.nokia.testfw.stf.scripteditor.Activator;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ @Override
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = Activator.getDefault()
+ .getPreferenceStore();
+ store.setDefault(PreferenceConstants.AUTO_ACTIVATION, "true");
+ store.setDefault(PreferenceConstants.AUTO_ACTIVATION_DELAY, "200");
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/preference/ScriptEditorPreferencePage.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.stf.scripteditor.preference;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.PlatformUI;
+
+import com.nokia.testfw.stf.scripteditor.Activator;
+import com.nokia.testfw.stf.scripteditor.editors.ScriptEditor;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class ScriptEditorPreferencePage extends FieldEditorPreferencePage
+ implements IWorkbenchPreferencePage {
+
+ public BooleanFieldEditor enableAutoActivation;
+ public IntegerFieldEditor activationDelay;
+
+ public ScriptEditorPreferencePage() {
+ super(GRID);
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setDescription("STF script editor preference");
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+ */
+ @Override
+ protected void createFieldEditors() {
+
+ enableAutoActivation = new BooleanFieldEditor(
+ PreferenceConstants.AUTO_ACTIVATION,
+ "Enable auto activation", getFieldEditorParent());
+
+ activationDelay = new IntegerFieldEditor(
+ PreferenceConstants.AUTO_ACTIVATION_DELAY,
+ "Auto activation delay:", getFieldEditorParent());
+
+ addField(enableAutoActivation);
+ addField(activationDelay);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench arg0) {
+ }
+
+ public boolean performOk()
+ {
+
+ boolean ret = super.performOk();;
+ try {
+ // update the editor if needed
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ if (workbench != null) {
+ IWorkbenchPage page = workbench.getActiveWorkbenchWindow()
+ .getActivePage();
+ IEditorPart editor = page.getActiveEditor();
+ if (editor != null && editor instanceof ScriptEditor) {
+ ScriptEditor se = (ScriptEditor) editor;
+ ContentAssistant assistant = (ContentAssistant) se
+ .getConfiguration().getContentAssistant();
+ assistant.enableAutoActivation(enableAutoActivation
+ .getBooleanValue());
+ assistant.setAutoActivationDelay(activationDelay
+ .getIntValue());
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return ret;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/Argument.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,279 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+import java.util.ArrayList;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+class Argument implements Arguments {
+
+ public Argument(String value, String name, String binding, String nvalue) {
+ this.argumentType = value;
+ this.argumentName = name;
+ this.argumentBinding = binding;
+ this.argumentNextvalue = nvalue;
+
+ }
+
+ public String getNextValue() {
+ return argumentNextvalue;
+ }
+
+ /**
+ * @return argument type (ex. normal, selective)
+ */
+ public String getArgumenType() {
+ return argumentType;
+ }
+
+ /**
+ * @return expected argument value
+ */
+ public String getArgumentName() {
+ return argumentName;
+ }
+
+ /**
+ * @return expected binding value ("=" or space)
+ */
+ public String getArgumentBinding() {
+ return argumentBinding;
+ }
+
+ /**
+ * @return expected value of complex argument
+ */
+ public String getargumentNextvalue() {
+ return argumentNextvalue;
+ }
+
+ /**
+ *
+ */
+ public ArrayList<String> validate(ArrayList<String> tokenizedLine) {
+ boolean lineCorrect = false;
+ boolean firstArgument = false;
+ boolean secondArgument = false;
+ boolean thirdArgument = false;
+ if (tokenizedLine.size() > 0) {
+
+ if (this.argumentBinding.equals("none")) {
+
+ if (this.argumentType.equals("digit")) {
+
+ String patternString = "^[0-9+-]*$";
+
+ lineCorrect = validateArgment(patternString, tokenizedLine
+ .get(0));
+
+ } else if (this.argumentType.equals("literal")) {
+
+ String patternString = "^[0-9a-zA-Z\\\\/:=\\s._()-,]*$";
+
+ lineCorrect = validateArgment(patternString, tokenizedLine
+ .get(0));
+
+ } else if (this.argumentType.equals("name")) {
+
+ if (this.argumentName
+ .equalsIgnoreCase(tokenizedLine.get(0))) {
+ lineCorrect = true;
+ }
+
+
+ }else if (this.argumentType.equals("words")) {
+ tokenizedLine.clear();
+
+ }else if (this.argumentType.equals("object")) {
+ for (int i = 0 ; i < Parser.createdObjectsList.size() ; i++){
+ if(Parser.createdObjectsList.get(i).equalsIgnoreCase(tokenizedLine.get(0))){
+ lineCorrect = true;
+ }
+ }
+ }else if (this.argumentType.equals("objectdelete")) {
+ for (int i = 0 ; i < Parser.createdObjectsList.size() ; i++){
+ if(Parser.createdObjectsList.get(i).equalsIgnoreCase(tokenizedLine.get(0))){
+ lineCorrect = true;
+ Parser.createdObjectsList.remove(i);
+ }
+ }
+ }else if (this.argumentType.equals("quoted")) {
+ if(tokenizedLine.get(0).startsWith("\"") && tokenizedLine.get(0).endsWith("\"")){
+ lineCorrect = true;
+ }
+ }
+
+ if (lineCorrect && tokenizedLine.size()>0) {
+ tokenizedLine.remove(0);
+
+ }
+
+ } else if (this.argumentBinding.equals("=")) {
+ if (tokenizedLine.size() > 2) {
+
+ if (this.argumentType.equals("digit")) {
+
+ String patternString = "^[0-9+-]*$";
+
+ firstArgument = validateArgment(patternString,
+ tokenizedLine.get(0));
+
+ } else if (this.argumentType.equals("literal")) {
+
+ String patternString = "^[0-9a-zA-Z\\\\/:._]*$";
+
+ firstArgument = validateArgment(patternString,
+ tokenizedLine.get(0));
+
+ } else if (this.argumentType.equals("name")) {
+
+ if (this.argumentName.equalsIgnoreCase(tokenizedLine
+ .get(0))) {
+ firstArgument = true;
+ }
+ }
+ if (tokenizedLine.get(1).equals("=")) {
+ secondArgument = true;
+
+ }
+ if (this.argumentNextvalue.equals("digit")) {
+
+ String patternString = "^[0-9+-]*$";
+
+ thirdArgument = validateArgment(patternString,
+ tokenizedLine.get(2));
+
+ } else if (this.argumentNextvalue.equals("literal")) {
+
+ String patternString = "^[0-9a-zA-Z\\\\/:._]*$";
+
+ thirdArgument = validateArgment(patternString,
+ tokenizedLine.get(2));
+
+ } else if (this.argumentNextvalue.equals("name")) {
+
+ if (this.argumentName.equalsIgnoreCase(tokenizedLine
+ .get(2))) {
+ thirdArgument = true;
+ }
+ }
+ else if (this.argumentNextvalue.equals("words")) {
+ tokenizedLine.clear();
+
+ }
+ if (tokenizedLine.size()>0 && firstArgument && secondArgument && thirdArgument) {
+
+ tokenizedLine.remove(0);
+ tokenizedLine.remove(0);
+ tokenizedLine.remove(0);
+ }
+
+ }
+ }else if (this.argumentBinding.equals("space")) {
+ if (tokenizedLine.size() > 1) {
+ if (this.argumentType.equals("digit")) {
+
+ String patternString = "^[0-9+-]*$";
+
+ firstArgument = validateArgment(patternString,
+ tokenizedLine.get(0));
+
+ } else if (this.argumentType.equals("literal")) {
+
+ String patternString = "^[0-9a-zA-Z\\\\/:._]*$";
+
+ firstArgument = validateArgment(patternString,
+ tokenizedLine.get(0));
+
+ } else if (this.argumentType.equals("name")) {
+
+ if (this.argumentName.equalsIgnoreCase(tokenizedLine
+ .get(0))) {
+ firstArgument = true;
+ }
+ }
+
+ if (this.argumentNextvalue.equals("digit")) {
+
+ String patternString = "^[0-9+-]*$";
+
+ thirdArgument = validateArgment(patternString,
+ tokenizedLine.get(1));
+
+ } else if (this.argumentNextvalue.equals("literal")) {
+
+ String patternString = "^[0-9a-zA-Z\\\\/:._]*$";
+
+ thirdArgument = validateArgment(patternString,
+ tokenizedLine.get(1));
+
+ } else if (this.argumentNextvalue.equals("name")) {
+
+ if (this.argumentName.equalsIgnoreCase(tokenizedLine
+ .get(1))) {
+ thirdArgument = true;
+ }
+
+ }if (tokenizedLine.size()>0 && firstArgument && thirdArgument) {
+
+ tokenizedLine.remove(0);
+ tokenizedLine.remove(0);
+ }
+ }
+ }
+ }
+
+
+ return tokenizedLine;
+
+ }
+
+ /**
+ * Validate single argument
+ *
+ * @param patternString -
+ * regular expresion mathing expected argument.
+ * @param token -
+ * single token from tokenized line
+ * @return true if argument is valid
+ */
+ private boolean validateArgment(String patternString, String token) {
+ Pattern titlePattern = Pattern
+ .compile(patternString, Pattern.MULTILINE);
+ Matcher regExMatcher = titlePattern.matcher(token);
+ if (regExMatcher.find()) {
+ return true;
+
+ }
+ return false;
+ }
+
+ // define argument type (ex. digit, text or name)
+ private String argumentType;
+
+ // uniqe argument name, it is value of XML argument tag
+ private String argumentName;
+
+ // define argument binding type (ex. = or space)
+ private String argumentBinding;
+
+ // define type of value that argument can take (ex. digit or literal)
+ private String argumentNextvalue;
+
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/ArgumentFactory.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+import org.w3c.dom.Node;
+
+
+
+
+public class ArgumentFactory {
+
+ public static Arguments createArgument(Node arg,int type) {
+ switch (type){
+ case 1:
+ String value = arg.getAttributes().getNamedItem("value").getNodeValue();
+ String textForNode = arg.getTextContent();
+ String binding = arg.getAttributes()
+ .getNamedItem("binding").getNodeValue();
+ String nextvalue = arg.getAttributes()
+ .getNamedItem("nextvalue").getNodeValue();
+
+ Argument normal = new Argument(value,textForNode.trim(), binding,nextvalue);
+ return normal;
+
+ case 2:
+ SelectiveArgument selective = new SelectiveArgument(arg);
+ return selective;
+
+ case 3:
+ String cValue = arg.getAttributes().getNamedItem("value").getNodeValue();
+ String cTextForNode = arg.getTextContent();
+ String cBinding = arg.getAttributes()
+ .getNamedItem("binding").getNodeValue();
+ String cNextvalue = arg.getAttributes()
+ .getNamedItem("nextvalue").getNodeValue();
+ CreativeArgument crative = new CreativeArgument(cValue,cTextForNode.trim(), cBinding,cNextvalue);
+ return crative;
+
+ default:
+ Argument none = new Argument(null,null,null,null);
+ return none;
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/Arguments.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+import java.util.ArrayList;
+
+public interface Arguments {
+
+ public ArrayList<String> validate(ArrayList<String> mandList);
+ public String getArgumentBinding();
+ public String getArgumentName();
+ public String getArgumenType();
+ public String getNextValue();
+
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/Command.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,151 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+import static org.w3c.dom.Node.ELEMENT_NODE;
+
+import java.util.*;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+public class Command {
+
+ //conscructor of command class creates lists of mandatory and optional arguments
+ public Command(String name, Node argnode) {
+
+ this.commandName = name;
+ this.mandatory = new ArrayList<Arguments>();
+ this.optional = new ArrayList<Arguments>();
+
+ NodeList list = argnode.getChildNodes();
+
+ for (int i = 0; i < list.getLength(); i++) {
+ short typeC = list.item(i).getNodeType();
+ if (typeC == ELEMENT_NODE) {
+
+ if (list.item(i).getNodeName() == "mandatory") {
+
+ createArgumentsList(list.item(i), mandatory);
+ }
+ if (list.item(i).getNodeName() == "optional") {
+
+ createArgumentsList(list.item(i), optional);
+ }
+ if (list.item(i).getNodeName().equals("errornote")){
+
+ this.errorNote = list.item(i).getTextContent().trim();
+
+ }
+ if (list.item(i).getNodeName().equals("commandinfo")){
+
+ this.commandInfo = list.item(i).getTextContent().trim();
+
+ }
+
+ }
+
+ }
+ }
+
+ public String getCommandName(){
+ return commandName;
+ }
+
+ private void createArgumentsList(Node argNode, ArrayList<Arguments> arglist) {
+
+
+ NodeList argNodes = argNode.getChildNodes();
+
+ for (int i = 0; i < argNodes.getLength(); i++) {
+ short typeC = argNodes.item(i).getNodeType();
+ if (typeC == ELEMENT_NODE) {
+
+ String type = argNodes.item(i).getAttributes()
+ .getNamedItem("type").getNodeValue();
+
+ if (type.equals("normal")){
+ arglist.add(ArgumentFactory.createArgument(argNodes.item(i),1));
+ }
+ if (type.equals("selective")){
+ arglist.add(ArgumentFactory.createArgument(argNodes.item(i),2));
+
+ }
+ if (type.equals("creative")){
+ arglist.add(ArgumentFactory.createArgument(argNodes.item(i),3));
+
+ }
+
+
+ }
+
+ }
+
+ }
+
+ public String toString() {
+ String command = ("command name: " + commandName +errorNote
+ + "\nnumber of mandatory args: " + mandatory.size()
+ + "number of opcional args: " + optional.size());
+ return command;
+ }
+
+ public ArrayList<Arguments> getMandatory(){
+ return mandatory;
+ }
+
+ public ArrayList<Arguments> getOptional(){
+ return optional;
+ }
+
+ public int getMandatorySize(){
+ int size = 0;
+
+ for (int i = 0 ; i < this.mandatory.size() ; i++){
+ if(this.mandatory.get(i).getArgumentBinding().equals("none") ){
+ size++;
+ }
+ else if(this.mandatory.get(i).getArgumentBinding().equals("=") ){
+ size=size+3;
+ }
+ }
+
+ return size;
+ }
+
+ public String getErrorNote(){
+ return errorNote;
+ }
+ public String getCommandInfo(){
+ return commandInfo;
+ }
+ //
+ private String commandName;
+
+ private String errorNote;
+
+ private String commandInfo;
+
+ // list containing mandatory arguments
+ private ArrayList<Arguments> mandatory;
+
+ // list containing optional arguments
+ private ArrayList<Arguments> optional;
+
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/CreativeArgument.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+import java.util.ArrayList;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class CreativeArgument implements Arguments{
+
+ public String getArgumentBinding() {
+
+ return "none";
+ }
+
+ public CreativeArgument(String value, String name, String binding, String nvalue) {
+ this.argumentType = value;
+ this.argumentName = name;
+ this.argumentBinding = binding;
+ this.argumentNextvalue = nvalue;
+
+
+ }
+
+ public ArrayList<String> validate(ArrayList<String> tokenizedLine) {
+ boolean lineCorrect = false;
+ if (this.argumentBinding.equals("none")) {
+
+ if (this.argumentType.equals("literal")) {
+
+ String patternString = "^[0-9a-zA-Z\\\\/:=\\s]*$";
+
+ lineCorrect = validateArgment(patternString, tokenizedLine.get(0));
+
+ }
+ }
+ if (lineCorrect) {
+ createObject(tokenizedLine.get(0));
+ tokenizedLine.remove(0);
+
+ }
+ return tokenizedLine;
+ }
+
+ public String getArgumentName() {
+ return argumentName;
+ }
+
+ public String getNextValue() {
+ return argumentNextvalue;
+ }
+
+ private void createObject(String string) {
+ Parser.createdObjectsList.add(string);
+ }
+
+ private boolean validateArgment(String patternString,
+ String token) {
+ Pattern titlePattern = Pattern
+ .compile(patternString, Pattern.MULTILINE);
+ Matcher regExMatcher = titlePattern.matcher(token);
+ if (regExMatcher.find()) {
+ return true;
+
+ }
+ return false;
+ }
+ //define argument type (ex. digit, text or name)
+ private String argumentType;
+
+ //uniqe argument name, it is value of XML argument tag
+ private String argumentName;
+
+ //define argument binding type (ex. = or space)
+ private String argumentBinding;
+
+ //define type of value that argument can take (ex. digit or literal)
+ private String argumentNextvalue;
+
+ public String getArgumenType() {
+ // TODO Auto-generated method stub
+ return argumentType;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/KeywordDetector.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+import org.eclipse.jface.text.rules.IWordDetector;
+
+/**
+ * Class used by ScriptScanner to help to decide if word is a keyword
+ */
+public class KeywordDetector implements IWordDetector {
+
+ /**
+ * Implementation of IWordDetector.isWordStart
+ */
+ public boolean isWordStart(char c) {
+ return Character.isJavaIdentifierStart(c);
+ }
+
+ /**
+ * Implementation of IWordDetector.isWordPart
+ */
+ public boolean isWordPart(char c) {
+ return Character.isJavaIdentifierPart(c);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/OutlinePageContentProvider.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+
+/**
+ * Class needed for outline view to work. The items in outline view currerntly do
+ * not have parent/children nodes. That's why the autogenerated implementation is used
+ */
+public class OutlinePageContentProvider extends ArrayContentProvider
+ implements ITreeContentProvider {
+
+ public Object getParent(Object arg0) {
+ return null;
+ }
+
+ public Object[] getChildren(Object arg0) {
+ return null;
+ }
+
+ public boolean hasChildren(Object arg0) {
+ return false;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/OutlineViewLabelProvider.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+import org.eclipse.jface.viewers.LabelProvider;
+
+import com.nokia.testfw.stf.scripteditor.utils.TestCase;
+
+/**
+ * Needed to display nodes in outline view
+ */
+public class OutlineViewLabelProvider extends LabelProvider {
+
+ @Override
+ public String getText(Object testOb) {
+ TestCase test = (TestCase)testOb;
+ return test.getName();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/ParseProblem.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+
+/**
+ * Objects of this class are used to describe a found syntax problem
+ *
+ */
+public class ParseProblem {
+
+ public enum ProblemType {
+ ERROR,
+ WARNING };
+
+ /**
+ * Constructor
+ *
+ * @param type
+ * ERROR/WARNING
+ * @param lineNumber
+ * Number of line that this problem refers to
+ * @param description
+ * Description of problem/solving the problem
+ */
+ public ParseProblem(ProblemType type, int lineNumber, String description){
+ this.type = type;
+ this.lineNumber = lineNumber;
+ this.description = description;
+ }
+
+ /**
+ * Problem type
+ */
+ public ProblemType type;
+ /**
+ * Line number in which problem occurs
+ */
+ public int lineNumber;
+ /**
+ * Problem description
+ */
+ public String description;
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/Parser.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,279 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+import static org.w3c.dom.Node.ELEMENT_NODE;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+public class Parser{
+
+ /**
+ * Creates parser object based on location of xml file
+ * @param xmlLocation
+ */
+ public Parser(String xmlLocation) {
+
+ this.sectionList = new ArrayList<SectionTag>();
+
+ InputStream is = getClass().getResourceAsStream(xmlLocation);
+
+ DocumentBuilderFactory builderFactory = DocumentBuilderFactory
+ .newInstance();
+ builderFactory.setNamespaceAware(true);
+ builderFactory.setIgnoringElementContentWhitespace(true);
+
+ DocumentBuilder builder = null;
+ try {
+ builder = builderFactory.newDocumentBuilder();
+ } catch (ParserConfigurationException e) {
+ e.printStackTrace();
+ }
+ Document xmlDoc = null;
+
+ try {
+
+ xmlDoc = builder.parse(is);
+
+ } catch (SAXException e) {
+ e.printStackTrace();
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ Node rootNode = xmlDoc.getDocumentElement();
+
+ NodeList list = rootNode.getChildNodes();
+
+ for (int i = 0; i < list.getLength(); i++) {
+
+ short typeC = list.item(i).getNodeType();
+ if (typeC == ELEMENT_NODE) {
+
+ Node sectionNode = list.item(i);
+ SectionTag section = new SectionTag(list.item(i),
+ sectionNode.getAttributes().getNamedItem("name").getNodeValue(),
+ sectionNode.getAttributes().getNamedItem("endname").getNodeValue(),
+ sectionNode.getAttributes().getNamedItem("proposal").getNodeValue());
+ sectionList.add(section);
+ }
+ }
+ }
+
+ /**
+ * Returns list of parsed sections
+ */
+ public ArrayList<SectionTag> gerSection() {
+ return sectionList;
+ }
+
+ public SectionTag getSectionByName(String sectionName) {
+ for (SectionTag tag : sectionList) {
+ if (tag.getName().equals(sectionName)) {
+ return tag;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns list of commands from all section
+ *
+ * @param Parser object
+ * @return ArrayList of strings - List of commands
+ *
+ */
+ public ArrayList<String> provideCommands() {
+
+ ArrayList<SectionTag> arrayOfSections = this.gerSection();
+ String[] sectionkeywrds = new String[arrayOfSections.size()];
+ ArrayList<String> keywordsList = new ArrayList<String>();
+ for (int i = 0; i < sectionkeywrds.length; i++) {
+
+ SectionTag section = arrayOfSections.get(i);
+ for (int g = 0; g < section.getCommandList().size(); g++) {
+
+ String command = section.getCommandList().get(g)
+ .getCommandName();
+ keywordsList.add(command);
+ }
+ }
+ return keywordsList;
+ }
+
+ private ArrayList<SectionTag> sectionList;
+
+ /**
+ * first tier of tokenized line checking, gets proper command object type, and invokes mandatory argument checking
+ *
+ * @param tokenizedLine
+ * @param commandName
+ * @return
+ */
+
+ public String checkArguments(ArrayList<String> tokenizedLine,
+ String commandName) {
+
+ ArrayList<SectionTag> arrayOfSections = this.gerSection();
+ String[] sectionkeywrds = new String[arrayOfSections.size()];
+
+ for (int i = 0; i < sectionkeywrds.length; i++) {
+
+ SectionTag section = arrayOfSections.get(i);
+ for (int g = 0; g < section.getCommandList().size(); g++) {
+
+ String command = section.getCommandList().get(g)
+ .getCommandName();
+ if (command.equals(commandName)) {
+ boolean ret = checkMandatory(section.getCommandList()
+ .get(g), tokenizedLine);
+ if (!ret) {
+ return section.getCommandList().get(g).getErrorNote();
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Checks mandatory arguments and invokes checking of optional arguments if needed
+ *
+ * @param command - reference command parsed from XML file
+ * @param tokenizedLine - list containig arguments from editor (without command token)
+ * @return
+ */
+
+ private boolean checkMandatory(Command command, ArrayList<String> tokenizedLine) {
+ ArrayList<String> ret = null;
+ boolean optionalCheck;
+ ArrayList<String> tokenizedMandatory = new ArrayList<String>();
+ ArrayList<Arguments> argsList = command.getMandatory();
+ ArrayList<Arguments> opionalList = command.getOptional();
+ ArrayList<String> tokenizedOptional = new ArrayList<String>(
+ tokenizedLine);
+
+ int size = command.getMandatorySize();
+
+ // conditions checked if command can not have arguments (ex. endloop)
+ if(argsList.size()==0 && opionalList.size() == 0){
+ if(tokenizedLine.size() ==0){
+ return true;
+ } else return false;
+ }
+
+ if (size > tokenizedLine.size()) {
+ return false;
+ }
+ if (!tokenizedLine.isEmpty()) {
+ for (int g = 0; g < tokenizedLine.size() && g < size; g++) {
+ tokenizedMandatory.add(tokenizedLine.get(g));
+ tokenizedOptional.remove(tokenizedLine.get(g));
+ }
+ }
+
+ for (int i = 0; i < argsList.size(); i++) {
+
+ ret = command.getMandatory().get(i).validate(tokenizedMandatory);
+ }
+ if (ret.size() == 0) {
+ if (tokenizedOptional.size() == 0) {
+ return true;
+ }
+ optionalCheck = checkOptional(opionalList, tokenizedOptional);
+ if (optionalCheck) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Checks optional arguments
+ *
+ * @param opionalList - list of optional arguments parsed from XML
+ * @param optionalArgs - list of tokens remain after checking mandatory arguments
+ * @return true if command contains valid optional arguments
+ */
+ private boolean checkOptional(ArrayList<Arguments> optionalList,
+ ArrayList<String> optionalArgs) {
+
+ ArrayList<Arguments> tempOptionalList = new ArrayList<Arguments>(optionalList);
+
+ for (int i = 0; i < tempOptionalList.size();) {
+ int t = optionalArgs.size();
+ optionalArgs = tempOptionalList.get(i).validate(optionalArgs);
+ if (optionalArgs.size() != t) {
+ tempOptionalList.remove(i);
+ i = 0;
+ continue;
+ }
+ i++;
+ }
+ if (optionalArgs.size() == 0) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ *
+ * @return list of section tags
+ */
+ public String[] provideSectionTags() {
+ ArrayList<SectionTag> arrayOfSections = gerSection();
+ String[] sectionkeywrds = new String[(arrayOfSections.size()*2)];
+ int j = 0;
+ for(int i = 0 ; (i < sectionkeywrds.length-1 && j < sectionkeywrds.length-1) ; i++ ){
+
+ sectionkeywrds[j] = ("[" +arrayOfSections.get(i).getName() +"]");
+ sectionkeywrds[++j] = ("[" +arrayOfSections.get(i).getEndName() +"]");
+ j++;
+
+ }
+ return sectionkeywrds;
+ }
+ public static ArrayList<String> provideMacrosObjects() {
+ // TODO Auto-generated method stub
+ return createdMacrosList;
+ }
+
+ public static ArrayList<String> provideObjectsList() {
+ // TODO Auto-generated method stub
+ return createdObjectsList;
+ }
+
+ public static ArrayList<String> createdMacrosList = new ArrayList<String>();
+ public static ArrayList<String> createdObjectsList = new ArrayList<String>();
+
+
+
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/ScriptParser.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,887 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+import java.io.BufferedReader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Stack;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.ui.IEditorInput;
+
+import com.nokia.testfw.stf.scripteditor.utils.ParseProblem.ProblemType;
+
+
+import java.io.IOException;
+
+/**
+ * Parser of script. Used to check syntax and find code sections in cfg files
+ *
+ */
+public class ScriptParser {
+
+ /**
+ * Default constructor
+ *
+ */
+ public ScriptParser() {
+ problemsList = new ArrayList<ParseProblem>();
+ markersList = new ArrayList<IMarker>();
+ createdObjectsList = new ArrayList<String[]>();
+
+ }
+
+ /**
+ * Removes all problem markers
+ *
+ */
+ private void clearProblemMarkers() {
+ for (int a = 0; a < markersList.size(); a++) {
+ try {
+ markersList.get(a).delete();
+ markersList.remove(a);
+
+ } catch (CoreException ex) {
+ }
+ }
+ }
+ public void checkScripterScript(String scriptContent, IEditorInput input) {
+
+ Parser parser = new Parser("/scripter.xml");
+ checkScript(scriptContent, input, parser);
+ }
+// public void checkCombinerScript(String scriptContent, IEditorInput input) {
+//
+// Parser parser = new Parser("/combiner.xml");
+// checkScript(scriptContent, input, parser);
+//
+// }
+
+ /**
+ * Processes the scriptContent in search of syntax errors (testscripter).
+ * The found errors are stored to problemsList.
+ *
+ * @param scriptContent
+ * Content of script as a string
+ * @param input
+ * IEditorInput object needed to display found errors
+ */
+ public void checkScript(String scriptContent, IEditorInput input, Parser parser) {
+ Parser.createdMacrosList.clear();
+ Parser.createdObjectsList.clear();
+ BufferedReader scriptReader = new BufferedReader(new StringReader(
+ scriptContent));
+ String line = null;
+ lineNumber = -1;
+ createdObjectsList.clear();
+ ArrayList<String> commands = parser.provideCommands();
+ String[] sectionTags = parser.provideSectionTags();
+ problemsList = new ArrayList<ParseProblem>();
+ boolean defineSectionFound = false;
+ // Variables help to remove block comments.
+ boolean inBlkComment = false;
+ String token = null;
+ String token1 = null;
+ StringTokenizer t = null;
+ int blkCommentBeginLineNo = -1;
+ SectionContextStack sectionStack = new SectionContextStack();
+ SectionContext curSection = null;
+ subSectionContent = new ArrayList<String>();
+
+ try {
+ while (true) {
+ line = scriptReader.readLine();
+ lineNumber++;
+
+ if (line == null) {
+ break;
+ }
+ line = line.trim();
+
+ // Remove block comment enclosed in "/*" and "*/".
+ // "/*" must be at the begin of the line and "*/ must be at the
+ // end of the line.
+ inBlkComment = false;
+ t = new StringTokenizer(line);
+ while (t.hasMoreTokens())
+ {
+ token = t.nextToken();
+ if (token.indexOf("/*") >= 0){
+ if (blkCommentBeginLineNo == -1) {
+ blkCommentBeginLineNo = lineNumber;
+ } else {
+ problemsList.add(new ParseProblem(ProblemType.ERROR, lineNumber,
+ errorEmbeddedSlashStar));
+ }
+ }else if (token.indexOf("*/") >= 0) {
+ inBlkComment = true; // needed to skip the line containing "*/"
+ if (blkCommentBeginLineNo != -1) {
+ blkCommentBeginLineNo = -1;
+ } else {
+ problemsList.add(new ParseProblem(ProblemType.ERROR, lineNumber,
+ errorTailStarSlash));
+ }
+ }
+ }
+
+ if (line.indexOf("/*") > 0) {
+ problemsList.add(new ParseProblem(ProblemType.ERROR, lineNumber,
+ errorSlashStarMustBeFirstWord));
+ }
+
+ if (line.indexOf("*/") > 0 && !line.substring(line.length() - 2).equals("*/")) {
+ problemsList.add(new ParseProblem(ProblemType.ERROR, lineNumber,
+ errorStarSlashMustBeLastWord));
+ }
+
+ if (blkCommentBeginLineNo != -1 || inBlkComment || line.equals("") || line.startsWith("//") || line.startsWith("#")){
+ if (sectionStack.lastSectionContext() != null) {
+ sectionStack.lastSectionContext().incTitleAtLine();
+ }
+ continue;
+ }
+
+ // removes line comments
+ String[] commentsRem = line.split("//");
+ if(commentsRem.length > 0){
+ line = commentsRem[0].trim();
+ }
+
+ if (line.startsWith("[")) {
+ // Section tag found
+ t = new StringTokenizer(line);
+ while (t.hasMoreTokens()) // Tags can be located at one line.
+ {
+ if(t.countTokens()>1){
+ token = t.nextToken();
+ token1 = t.nextToken();
+ if(token1!=null){
+ if(token.equals("[Sub") && !subSectionContent.contains("[Sub")){
+ subSectionContent.add(token);
+ }
+ if(token1.matches("([a-z]+)\\]")){
+ subSectionContent.add(token1);
+ }
+ }
+ }
+ else
+ token = t.nextToken();
+
+ if(token.equals("[Sub]")){
+ // Non-existing tag
+ problemsList.add(new ParseProblem(ProblemType.ERROR, lineNumber,
+ errorSubTagMissingTitle + token + "\""));
+ }
+
+ if(token.equals("[Sub")){
+ token = "[Sub]";
+ }
+
+ int i = findSectionTagIndex(sectionTags, token);
+ if (i < sectionTags.length) {
+ if (i % 2 == 0) { // Section opened.
+ if (sectionStack.size() > 0) {
+ problemsList.add(new ParseProblem(ProblemType.ERROR, lineNumber,
+ errorEmbeddedSection));
+ curSection = sectionStack.lastSectionContext();
+ }
+ sectionStack.addContext(new SectionContext(i, lineNumber, sectionTags[i].equals("[Test]")));
+
+ // Mandatory "title" keyword right after [Test]
+ // tag.
+ if (sectionStack.lastSectionContext().isTestSection) {
+ sectionStack.lastSectionContext().setTitleAtLine(lineNumber + 1);
+ sectionStack.lastSectionContext().setTitleExpected(true);
+ }
+ } else { // Section closed
+ curSection = sectionStack.lastSectionContext();
+ if (sectionTags[i].equals("[Endtest]") && curSection != null
+ && curSection.isTestSection && curSection.isTitleExpected()) {
+ problemsList.add(new ParseProblem(ProblemType.ERROR, curSection.getTitleAtLine(),
+ errorTitleMustBeTheFirstWord));
+ }
+ if (!sectionStack.removeContext(i)) {
+ // Cannot find nearest paired open section tag.
+ problemsList.add(new ParseProblem(ProblemType.ERROR, lineNumber,
+ errorMissingTag + sectionTags[i - 1] + doubleQuotation));
+ }
+ }
+ } else {
+ // Non-existing tag
+ problemsList.add(new ParseProblem(ProblemType.ERROR, lineNumber,
+ errorNonExistingTag + token + doubleQuotation));
+ }
+ }
+ } else { // Commands.
+ ArrayList<String> tokenizedLine = lineTokenize(line);
+ // "title" must be the first word.
+ ArrayList<String> tLine = lineTokenize(line);
+ curSection = sectionStack.lastSectionContext();
+ if (tLine.size() > 0 && tLine.get(0).equals("title")) {
+ if (curSection != null){
+ if (!curSection.isTitleExpected()) { // Multiple title lines detected.
+ problemsList.add(new ParseProblem(ProblemType.ERROR, lineNumber,
+ errorUnexpectedTitle));
+ } else if (curSection.getTitleAtLine()!= lineNumber) { // title line at wrong line.
+ problemsList.add(new ParseProblem(ProblemType.ERROR, lineNumber,
+ errorTitleMustBeTheFirstWord));
+ } else {
+ curSection.setTitleExpected(false);
+ continue;
+ }
+ }
+ }
+
+ checkCreatedObjects(tokenizedLine);
+
+ String command = null;
+ if (tokenizedLine.size() > 0) {
+ command = tokenizedLine.get(0);
+ }
+ tokenizedLine = resolveDefine(tokenizedLine);
+ String lineCheck = checkCommand(commands, tokenizedLine, parser);
+ int defIndex = findSectionTagIndex(sectionTags, "[Define]");
+ int inclIndex = findSectionTagIndex(sectionTags, "[New_Include_Module]");
+ defineSectionFound = sectionStack .isCurrentSection(defIndex)
+ || sectionStack.isCurrentSection(inclIndex);
+
+ if (defineSectionFound) {
+ // Inside a define section
+ if (tokenizedLine.size() == 0) {
+ continue;
+ }
+
+ // check if statement in define section have 2
+ // elements (e.g. "EVENT TestScripterEvent")
+ if (tokenizedLine.size() != 2) {
+ problemsList.add(new ParseProblem(ProblemType.ERROR, lineNumber,
+ errorSyntaxError));
+ } else {
+ // if statement contains keyword it can't be
+ // used in define section.
+ for (int i = 0; i < commands.size(); i++) {
+ if (command.equals(commands.get(i))) {
+ problemsList.add(new ParseProblem(ProblemType.ERROR, lineNumber,
+ errorSyntaxError));
+ }
+ }
+ makeDefineObjects(tokenizedLine);
+ }
+ }
+ // if line do not contains valid command with valid
+ // parameters error note is displayed
+ if (sectionStack.size() > 0) {
+ // Command inside section
+ if (command != null && command.equals("INCLUDE")) {
+ // INCLUDE not expected.
+ problemsList.add(new ParseProblem(ProblemType.ERROR, lineNumber, errorNonSectionCmd + command + doubleQuotation));
+ }
+ } else {
+ // Command outside section
+ if (command != null && !command.equals("INCLUDE")) {
+ // free text detected.
+ problemsList.add(new ParseProblem(ProblemType.ERROR, lineNumber, errorFreeText));
+ } else if (lineCheck != null) {
+ // INCLUDE syntax error
+ problemsList.add(new ParseProblem(ProblemType.ERROR, lineNumber, lineCheck));
+ }
+ }
+ }
+ }
+
+ if (blkCommentBeginLineNo != -1){
+ problemsList.add(new ParseProblem(ProblemType.ERROR, blkCommentBeginLineNo,
+ errorMissingStarSlash));
+ }
+ // check if all sections are closed.
+ SectionContext[] arr = new SectionContext[sectionStack.size()];
+ sectionStack.toArray(arr);
+ for (SectionContext tmp : arr) {
+ problemsList.add(new ParseProblem(ProblemType.ERROR, tmp.lineNumber, errorMissingTag + sectionTags[tmp.sectionIndex + 1] + "\""));
+ if (tmp.isTestSection && tmp.isTitleExpected()) {
+ problemsList.add(new ParseProblem(ProblemType.ERROR, tmp.getTitleAtLine(),
+ errorTitleMustBeTheFirstWord));
+ }
+ }
+ } catch (IOException ex) {
+
+ }
+ addErrorMarkers(input);
+ }
+
+ /**
+ * checks if line starts with created object, if so no error would be displayed
+ *
+ * @param tokenizedLine
+ * @return
+ */
+ private ArrayList<String> checkCreatedObjects(ArrayList<String> tokenizedLine) {
+
+ for(int i = 0 ; i < Parser.createdObjectsList.size() ; i++ ){
+ if(tokenizedLine.size()>1 && tokenizedLine.get(0).equals(Parser.createdObjectsList.get(i))){
+ if(tokenizedLine.size()>1){
+ tokenizedLine.clear();
+ break;
+ }
+ }
+ }
+ return tokenizedLine;
+ }
+
+ /**
+ * replace defined statments with their value.
+ *
+ * @param tokenizedLine
+ * @param parser
+ * @return tokenizedLine
+ */
+ private ArrayList<String> resolveDefine(ArrayList<String> tokenizedLine) {
+ if (createdObjectsList.size()>0 && tokenizedLine != null){
+ for (int i = 0; i < tokenizedLine.size(); i++) {
+ for (int j = 0; j < createdObjectsList.size(); j++) {
+
+
+ if(tokenizedLine.get(i).equals(createdObjectsList.get(j)[0])){
+ tokenizedLine.remove(i);
+ tokenizedLine.add(i, createdObjectsList.get(j)[1]);
+
+
+
+ }
+ }
+
+ }
+ }
+
+ return tokenizedLine;
+ }
+
+ /**
+ * Add statment from define section to createdObjectsList,
+ * list is used to replace defined words with correct aliases
+ *
+ * @param tokenizedLine
+ */
+ private void makeDefineObjects(ArrayList<String> tokenizedLine) {
+
+ defineAlias = tokenizedLine.get(0);
+ defineValue = tokenizedLine.get(1);
+ String[] st = new String[2];
+ st[0]=defineAlias;
+ st[1]=defineValue;
+ createdObjectsList.add(st);
+ Parser.createdMacrosList.add(defineAlias);
+
+ }
+
+ /**
+ * Check if first token form tokenizedLine is a valid command and invokes
+ * methods checking parameters
+ *
+ * @param commands -
+ * list of commands
+ * @param tokenizedLine -
+ * line form editor input
+ * @param parser -
+ * parser object
+ * @return error note or null
+ */
+ private String checkCommand(ArrayList<String> commands,
+ ArrayList<String> tokenizedLine, Parser parser) {
+ for (int i = 0; i < commands.size(); i++) {
+
+ if (tokenizedLine.size() == 0) {
+ return null;
+ }
+ if (tokenizedLine.size() > 0
+ && tokenizedLine.get(0).equals(commands.get(i))) {
+ tokenizedLine.remove(0);
+
+ String ret = parser.checkArguments(tokenizedLine, commands
+ .get(i));
+ if (ret != null) {
+ return ret;
+
+ } else {
+ return null;
+ }
+ }
+ }
+ return errorSyntaxError;
+ }
+
+ /**
+ * Separate passed string in to tokens
+ *
+ * @param string
+ * @return ArrayList list of tokens
+ */
+
+ static ArrayList<String> lineTokenize(String string) {
+
+ char[] pars = string.toCharArray();
+ ArrayList<String> ret = new ArrayList<String>();
+ String set;
+ int beginpos = 0;
+ int endpos = 1;
+ boolean qclosed;
+
+ for (int i = 0; i < pars.length; i++) {
+
+ if (pars[i] == '"') {
+ // set flag checking if guot is closed
+ qclosed = false;
+ int a = i;
+
+ if (i > 0 && pars[i - 1] == '\\') {
+ pars[i - 1] = ' ';
+
+ // begin position = i;
+ continue;
+ }
+
+ // when char before '"' is different than space.
+ if (i > 0 && !Character.isWhitespace(pars[i - 1])
+ && (pars[i - 1] != '=')) {
+ set = new String(pars, beginpos, endpos - beginpos);
+ ret.add(set);
+
+ }
+ beginpos = i; //+ 1;
+
+ // searching for next '"' char
+ for (int j = i + 1; j < pars.length; j++) {
+
+ if (pars[j] == '"') {
+ qclosed = true;
+ if (j > 0 && pars[j - 1] == '\\') {
+
+ pars[j - 1] = ' ';
+ continue;
+ }
+ // set end position to last element
+ endpos = j+1; //j;
+
+ set = new String(pars, beginpos, endpos - beginpos);
+ ret.add(set);
+ beginpos = (j + 1);
+ i = j;
+ break;
+ }
+ }
+ if (!qclosed && pars[a] == '\"') {
+
+ set = new String(pars, a, 1);
+ beginpos = a++;
+
+ ret.add(set);
+
+ }
+ }
+ endpos = i;
+ // checking for space
+ if (Character.isWhitespace(pars[i])) {
+
+ // check if previous char is a space,
+ // if yes skip it
+ if (i > 0 && Character.isWhitespace(pars[i - 1])
+ && i < pars.length - 1) {
+ beginpos++;
+
+ }
+ // create new token from begin position to current position
+ if (i > 0 && !Character.isWhitespace(pars[i - 1])
+ && (pars[i - 1] != '"')) {
+ set = new String(pars, beginpos, endpos - beginpos);
+ // begin position is a next char after current position
+ beginpos = (i + 1);
+
+ ret.add(set.trim());
+ }
+ }
+ // checking for '='
+ if (pars[i] == '=') {
+
+ // when char before "=" is different than space.
+ if (i > 0 && !Character.isWhitespace(pars[i - 1])
+ && (pars[i - 1] != '"')) {
+ set = new String(pars, beginpos, endpos - beginpos);
+
+ ret.add(set);
+ // begin position is set on = char
+
+ }// when char after "=" is different than space.
+ beginpos = i;
+ if (i < pars.length - 1 && !Character.isWhitespace(pars[i + 1])) {
+ set = new String(pars, endpos, 1);
+ ret.add(set);
+ beginpos = (i + 1);
+
+ }
+ }
+
+
+ }
+ // last tag have to be tokenized sepretly becouse last har may not be
+ // space.
+ if (endpos == pars.length - 1 && pars[(pars.length - 1)] != '\"') {
+
+ set = new String(pars, beginpos, pars.length - beginpos);
+ if (set.length() != 0 && set.toCharArray()[0] != ' ') {
+ ret.add(set);
+ }
+ }
+
+ return ret;
+
+ }
+
+ /**
+ * Makes IEditorInput display the found errors
+ *
+ * @param input
+ * IEditorInput object that IMarker (error markers)
+ * of found errors will be added to
+ */
+ private void addErrorMarkers(IEditorInput input) {
+ try {
+
+ clearProblemMarkers();
+ if (resource == null) {
+ resource = (IResource) input.getAdapter(IResource.class);
+ if (resource == null) {
+ resource = ResourcesPlugin.getWorkspace().getRoot();
+ }
+ }
+ resource.deleteMarkers(null, true, 0);
+
+ for (int i = 0; i < problemsList.size(); i++) {
+ IMarker marker = resource.createMarker(IMarker.PROBLEM);
+ marker.setAttribute(IMarker.LINE_NUMBER,
+ problemsList.get(i).lineNumber + 1);
+ marker.setAttribute(IMarker.MESSAGE,
+ problemsList.get(i).description);
+
+ if (problemsList.get(i).type == ParseProblem.ProblemType.ERROR) {
+ marker
+ .setAttribute(IMarker.PRIORITY,
+ IMarker.PRIORITY_HIGH);
+ marker.setAttribute(IMarker.SEVERITY,
+ IMarker.SEVERITY_ERROR);
+ } else if (problemsList.get(i).type == ParseProblem.ProblemType.WARNING) {
+ marker
+ .setAttribute(IMarker.PRIORITY,
+ IMarker.PRIORITY_HIGH);
+ marker.setAttribute(IMarker.SEVERITY,
+ IMarker.SEVERITY_WARNING);
+ }
+ markersList.add(marker);
+ }
+ } catch (CoreException ex) {
+
+ }
+ }
+
+ public static ScripterSection getCurrentScripterSection(String document,
+ int offset) {
+ boolean currentSectionFound = false;
+ currentSearchOffset = 0;
+ ScripterSection currentSection = ScripterSection.NoSection;
+ ScripterSection previousSection = ScripterSection.NoSection;
+
+ while (!currentSectionFound) {
+ currentSection = findNextScripterSection(document);
+ if (currentSearchOffset > offset || currentSection == null)
+ currentSectionFound = true;
+ else {
+ previousSection = currentSection;
+ }
+ }
+ return previousSection;
+ }
+
+ /**
+ * This method is used by testcombiner content assistant to provide
+ * info about keywords valid in current context
+ *
+ * @param document
+ * Script content
+ * @param offset
+ * Current offset of cursor in file
+ * @return
+ * Object describing if cursor is currently in a section ([Define], [Test], etc.)
+ */
+
+// public static CombinerSection getCurrentCombinerSection(String document,
+// int offset) {
+// boolean currentSectionFound = false;
+// currentSearchOffset = 0;
+// CombinerSection currentSection = CombinerSection.NoSection;
+// CombinerSection previousSection = CombinerSection.NoSection;
+//
+// while (!currentSectionFound) {
+// currentSection = findNextCombinerSection(document);
+// if (currentSearchOffset > offset || currentSection == null)
+// currentSectionFound = true;
+// else {
+// previousSection = currentSection;
+// }
+// }
+// return previousSection;
+// }
+
+ /**
+ * Utility method used by getCurrentScripterSection method
+ *
+ * @param document
+ * Script content
+ * @return
+ * Object describing the section that follows current section (the next
+ * section after the one in which cursor currently remains).
+ */
+ private static ScripterSection findNextScripterSection(String document) {
+ int currentSearchOffsetAtStart = currentSearchOffset;
+ ScripterSection section = ScripterSection.NoSection;
+ int indexOfOpeningBracket = document.indexOf("[", currentSearchOffset);
+ int indexOfClosingBracket = -1;
+ if (indexOfOpeningBracket > -1) {
+ indexOfClosingBracket = document
+ .indexOf("]", indexOfOpeningBracket);
+ if (indexOfClosingBracket > -1) {
+ String sectionWord = document.substring(
+ indexOfOpeningBracket + 1, indexOfClosingBracket);
+ if (sectionWord.equals("Test")) {
+ section = ScripterSection.TestSection;
+ } else if (sectionWord.equals("Define")) {
+ section = ScripterSection.DefineSection;
+ } else if (sectionWord.equals("New_Include_Module")) {
+ section = ScripterSection.NewIncludeModuleSection;
+ } else if (sectionWord.equals("StifSettings")) {
+ section = ScripterSection.StifSettingsSection;
+ } else if (sectionWord.equals("Data")) {
+ section = ScripterSection.DataSection;
+ }
+ currentSearchOffset = indexOfClosingBracket + 1;
+ }
+ }
+ if (currentSearchOffset != currentSearchOffsetAtStart)
+ return section;
+ else
+ return null;
+ }
+
+
+ /**
+ * Utility method used by getCurrentCombinerSection method
+ *
+ * @param document
+ * Script content
+ * @return
+ * Object describing the section that follows current section (the next
+ * section after the one in which cursor currently remains).
+ */
+// private static CombinerSection findNextCombinerSection(String document) {
+// int currentSearchOffsetAtStart = currentSearchOffset;
+// CombinerSection section = CombinerSection.NoSection;
+// int indexOfOpeningBracket = document.indexOf("[", currentSearchOffset);
+// int indexOfClosingBracket = -1;
+// if (indexOfOpeningBracket > -1) {
+// indexOfClosingBracket = document
+// .indexOf("]", indexOfOpeningBracket);
+// if (indexOfClosingBracket > -1) {
+// String sectionWord = document.substring(
+// indexOfOpeningBracket + 1, indexOfClosingBracket);
+// if (sectionWord.equals("Test")) {
+// section = CombinerSection.TestSection;
+// } else if (sectionWord.equals("Define")) {
+// section = CombinerSection.DefineSection;
+// } else if (sectionWord.equals("New_Include_Module")) {
+// section = CombinerSection.NewIncludeModuleSection;
+// }
+// currentSearchOffset = indexOfClosingBracket + 1;
+// }
+// }
+// if (currentSearchOffset != currentSearchOffsetAtStart)
+// return section;
+// else
+// return null;
+// }
+
+ /**
+ * Enum That describes section of testcombiner script
+ */
+ public enum ScripterSection {
+ NoSection, TestSection, DefineSection, NewIncludeModuleSection, StifSettingsSection, DataSection
+ }
+
+ /**
+ * Helper to check script and locate errors
+ */
+ private int findSectionTagIndex(String[] tags, String tag) {
+ int index = 0;
+ while (index < tags.length && !tags[index].equals(tag))++index;
+ return index;
+ }
+
+ private class SectionContext{
+ public SectionContext(int index, int lineNo, boolean testSection) {
+ sectionIndex = index;
+ lineNumber = lineNo;
+ isTestSection = testSection;
+ }
+ public void incTitleAtLine() {
+ if (isTestSection) {
+ ++titleAtLine;
+ }
+ }
+ public void setTitleAtLine(int lineNo) {
+ if (isTestSection) {
+ titleAtLine = lineNo;
+ titleExpected = true;
+ }
+ }
+
+ public int getTitleAtLine() {
+ return titleAtLine;
+ }
+
+ public void setTitleExpected(boolean title) {
+ if (isTestSection) {
+ titleExpected = title;
+ }
+ }
+
+ public boolean isTitleExpected() {
+ return titleExpected;
+ }
+ public int sectionIndex;
+ public int lineNumber;
+ public boolean isTestSection;
+
+ // Members for [Test] section only.
+ private int titleAtLine;
+ private boolean titleExpected;
+ }
+
+ private class SectionContextStack{
+ public SectionContextStack() {
+ contextStack = new Stack<SectionContext>();
+ }
+
+ public void addContext(SectionContext context) {
+ contextStack.push(context);
+ }
+
+ public boolean removeContext(int sectionIndex) {
+ if (!contextStack.empty() && contextStack.lastElement().sectionIndex == --sectionIndex) {
+ contextStack.pop();
+ return true;
+ }
+ return false;
+ }
+
+ public boolean isCurrentSection(int i) {
+ return !contextStack.empty() && contextStack.lastElement().sectionIndex == i;
+ }
+
+ public SectionContext[] toArray(SectionContext[] arr) {
+ return contextStack.toArray(arr);
+ }
+
+ public SectionContext lastSectionContext() {
+ if (!contextStack.empty()) {
+ return contextStack.lastElement();
+ }
+ else {
+ return null;
+ }
+ }
+
+ public int size() {
+ return contextStack.size();
+ }
+
+ private Stack<SectionContext> contextStack;
+ }
+
+// public enum CombinerSection {
+// NoSection, TestSection, DefineSection, NewIncludeModuleSection,
+// }
+
+
+ private List<IMarker> markersList;
+
+ private List<ParseProblem> problemsList;
+
+ private int lineNumber = -1;
+
+ ArrayList<String> objectNames = null;
+
+ ArrayList<String> definedNames = null;
+
+ ArrayList<String> testIds = null;
+
+ private static int currentSearchOffset = 0;
+
+ private String errorTitleMustBeTheFirstWord = "test case content must start with the \"title\" keyword and title following";
+
+ private String errorSyntaxError = "syntax error";
+
+ private String errorEmbeddedSlashStar = "Embedded \"/*\" not allowed";
+
+ private String errorTailStarSlash = "Tail \"*/\"";
+
+ private String errorMissingStarSlash = "Missing \"*/\"";
+
+ private String errorMissingTag = "Missing tag: \"";
+
+ private String errorNonExistingTag = "Non existing tag: \"";
+
+ private String errorSubTagMissingTitle = "Sub Tag missing ttitle: \"";
+
+ private String errorUnexpectedTitle = "Unexpected \"title\" keyword";
+
+ private String errorFreeText = "Free text not allowed";
+
+ private String errorEmbeddedSection = "Embedded section not allowed";
+
+ private String errorSlashStarMustBeFirstWord = "/* must be at the begin of the line";
+
+ private String errorStarSlashMustBeLastWord = "*/ must be at the end of the line";
+
+ private String errorNonSectionCmd = "Non-section command: \"";
+
+ private String doubleQuotation = "\"";
+
+ private IResource resource;
+
+ private String defineAlias;
+
+ private String defineValue;
+
+ private ArrayList<String[]> createdObjectsList;
+
+ public ArrayList<String> subSectionContent;
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/Section.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,172 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+/**
+ * Objects of this class describe sections in script file. Section is for example:
+ * [Test]
+ * ....
+ * [Endtest]
+ *
+ * Such section is defined by properties like name, offset in file, etc.
+ *
+ */
+public class Section {
+
+ /**
+ * Constructor
+ *
+ * @param name
+ * Name of section
+ */
+ public Section(String name){
+ this.name = name;
+ this.isNew = true;
+ this.isDeleted = false;
+ }
+
+ /**
+ * Name getter
+ *
+ * @return
+ * name of section
+ */
+ public String getName(){
+ return name;
+ }
+
+ /**
+ * Name setter
+ *
+ * @param name
+ * name of section
+ */
+ public void setName(String name){
+ this.name = name;
+ }
+
+ /**
+ * Start offset setter
+ *
+ * @param offset
+ * Start offset
+ */
+ public void setStartOffset(int offset){
+ startOffset = offset;
+ }
+
+ /**
+ * Start offset getter
+ *
+ * @return
+ * Start offset
+ */
+ public int getStartOffset(){
+ return startOffset;
+ }
+
+ /**
+ * End offset setter
+ *
+ * @param offset
+ * End offset
+ */
+ public void setEndOffset(int offset){
+ endOffset = offset;
+ }
+
+ /**
+ * End offset getter
+ *
+ * @return
+ * End offset
+ */
+ public int getEndOffset(){
+ return endOffset;
+ }
+
+ /**
+ * Sets if this is a new section. This is needed to update folding
+ * structure.
+ *
+ * @param isNew
+ * If the section is new
+ */
+ public void setIsNew(boolean isNew){
+ this.isNew = isNew;
+ }
+
+ /**
+ * Gets if this is a new section. This is needed to update folding
+ * structure.
+ *
+ * @return
+ * If the section is new
+ */
+ public boolean getIsNew(){
+ return isNew;
+ }
+
+ /**
+ * Sets content of section
+ *
+ * @param content
+ * Content of section
+ */
+ public void setContent(String content){
+ this.content = content;
+ }
+
+ /**
+ * Gets content of section
+ *
+ * @return
+ * Content of section
+ */
+ public String getContent(){
+ return content;
+ }
+
+ /**
+ * Sets if the section was deleted by used from the last updating of folding structure
+ *
+ * @param isDeleted
+ * If the section was deleted
+ */
+ public void setIsDeleted(boolean isDeleted){
+ this.isDeleted = isDeleted;
+ }
+
+ /**
+ * Gets if the section was deleted by used from the last updating of folding structure
+ *
+ * @return
+ * If the section was deleted
+ */
+ public boolean getIsDeleted(){
+ return isDeleted;
+ }
+
+ private String name;
+ private int startOffset;
+ private int endOffset;
+ private boolean isNew;
+ private boolean isDeleted;
+ private String content;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/SectionFinder.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,228 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import org.eclipse.jface.text.IDocument;
+
+import com.nokia.testfw.stf.scripteditor.editors.scripter.ScripterWordsProvider;
+
+/**
+ * Class used to parse content of script in search of sections (test cases).
+ * Used to update outline view and folding structure.
+ *
+ */
+public class SectionFinder {
+
+ /**
+ * Search for sections in document
+ *
+ * @param scripterDoc
+ * Document to be parsed in search of test cases
+ * @return
+ * Array containing found test cases
+ */
+ public static Section[] getSections(IDocument scripterDoc){
+ String content = scripterDoc.get();
+ ArrayList<TestCase> testCases = new ArrayList<TestCase>();
+
+ if(currentSections == null){
+ currentSections = new ArrayList<Section>();
+ }
+
+ for(int i = 0; i < currentSections.size(); i++){
+ currentSections.get(i).setIsDeleted(true);
+ }
+
+ int currentPos = 0;
+ while(currentPos < content.length()){
+ int startIndex = content.indexOf(ScripterWordsProvider.TEST_TAG, currentPos);
+ int endIndex = content.indexOf(ScripterWordsProvider.END_TEST_TAG, currentPos);
+ if(endIndex > 0){
+ endIndex += ScripterWordsProvider.END_TEST_TAG.length();
+ int positionOfNewLine = content.indexOf("\n", endIndex);
+ if(positionOfNewLine > -1){
+ endIndex = positionOfNewLine + 1;
+ }
+ }
+ if(startIndex > -1 && endIndex > -1){
+ if(startIndex < endIndex) {
+ String titleValue = getTitle(content, startIndex, endIndex);
+ if(titleValue != null && titleValue.length() > 0){
+ int titleIndex = content.indexOf(titleValue, startIndex);
+ TestCase testCase = new TestCase(titleValue);
+ testCase.setStartOffset(titleIndex + titleValue.length());
+ testCase.setEndOffset(endIndex);
+
+ String testContent = content.substring(startIndex, endIndex);
+ for(int i = 0; i < currentSections.size(); i++){
+ if(currentSections.get(i).getContent().equals(testContent)){
+ testCase.setIsNew(false);
+ currentSections.get(i).setIsDeleted(false);
+ }
+ }
+ if(testCase.getIsNew()){
+ testCase.setContent(testContent);
+ currentSections.add(testCase);
+ }
+ testCases.add(testCase);
+ }
+ }
+ }
+ else {
+ break;
+ }
+ currentPos = endIndex;
+ }
+
+ int i = 0;
+ while(i < currentSections.size()){
+ if(currentSections.get(i).getIsDeleted()){
+ currentSections.remove(i);
+ }
+ else{
+ i++;
+ }
+ }
+
+ return testCases.toArray(new TestCase[0]);
+ }
+
+ /**
+ * Returns title of test starting at 'start' and 'ending' at end offset
+ *
+ * @param content
+ * Content of script
+ * @param start
+ * Start offset of test case
+ * @param end
+ * End offset
+ * @return
+ * Name of test case
+ */
+ private static String getTitle(String content, int start, int end){
+ String retVal = null;
+ String sb = removeComments(content.substring(start, end));
+
+ boolean titleFound = false;
+ StringTokenizer t = new StringTokenizer(sb.toString());
+ while (t.hasMoreTokens()) {
+ String token = t.nextToken();
+ if (token.equals(ScripterWordsProvider.TITLE_KEYWORD)) {
+ titleFound = true;
+ break;
+ }
+ }
+
+ // Now return the case name after "title".
+ if (titleFound) {
+ int titleTagIndex = sb.indexOf(ScripterWordsProvider.TITLE_KEYWORD);
+ if(titleTagIndex > -1){
+ int titleIndex = titleTagIndex + ScripterWordsProvider.TITLE_KEYWORD.length();
+ int indexOfNewLine = sb.indexOf("\n", titleTagIndex);
+ retVal = sb.substring(titleIndex, indexOfNewLine).trim();
+ }
+ }
+ return retVal;
+ }
+
+ /**
+ * Line comments started with "//" and "#" and c style block comments are removed.
+ * Set to public so that it can be reused.
+ * @param content
+ * @return comments stripped string.
+ */
+ public static String removeComments(String content) {
+ BufferedReader reader = new BufferedReader(new StringReader(content));
+ StringBuffer sb = new StringBuffer(); // buffer contains no comments.
+ boolean isLineComment = false;
+ boolean inComment = false;
+ char ch;
+
+ /**
+ * Remove all comments in case of "title" inside comment.
+ * This won't check any errors.
+ */
+ try {
+ while ((ch = (char)reader.read()) != (char)-1) {
+ char next;
+ switch (ch) {
+ case '/':
+ if (!inComment){
+ reader.mark(1);
+ next = (char)reader.read();
+ if (next == '/' || next == '*') {
+ inComment = true;
+ if (next == '/') {
+ isLineComment = true;
+ }
+ } else {
+ sb.append(ch);
+ reader.reset();
+ }
+ }
+ break;
+ case '#':
+ if (!inComment) {
+ inComment = true;
+ isLineComment = true;
+ }
+ break;
+ case '\n':
+ if (inComment) {
+ if (isLineComment) {
+ inComment = false;
+ isLineComment = false;
+ }
+ } else {
+ sb.append(ch);
+ }
+ break;
+ case '*':
+ if (inComment) {
+ reader.mark(1);
+ next = (char) reader.read();
+ if (next != '/') {
+ reader.reset();
+ } else {
+ inComment = false;
+ }
+ } else {
+ sb.append(ch);
+ }
+ break;
+ default:
+ if (!inComment) {
+ sb.append(ch);
+ }
+ break;
+ }
+ }
+ }catch (IOException e) {
+
+ }
+ return sb.toString();
+ }
+ private static ArrayList<Section> currentSections;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/SectionTag.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+import static org.w3c.dom.Node.ELEMENT_NODE;
+
+import java.util.ArrayList;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class SectionTag {
+
+ //passing "section" node, create section object
+ //containig list of commands pressent in that section
+ public SectionTag(Node list, String sectionName, String sectionEndName, String proposal) {
+
+ NodeList sectionNode = list.getChildNodes();
+ this.name = sectionName;
+ this.endName = sectionEndName;
+ this.commandList = new ArrayList<Command>();
+ this.proposal = proposal;
+
+ for (int i = 0; i < sectionNode.getLength(); i++) {
+
+ short typeC = sectionNode.item(i).getNodeType();
+ if (typeC == ELEMENT_NODE) {
+
+ Command text = new Command(sectionNode.item(i).getAttributes()
+ .getNamedItem("id").getNodeValue(), sectionNode.item(i));
+ commandList.add(text);
+
+
+ }
+ }
+
+ }
+
+ public String getName() {
+ return name;
+
+ }
+ public String getEndName() {
+ return endName;
+
+ }
+
+ public ArrayList<Command> getCommandList() {
+ return commandList;
+
+ }
+
+ public String getProposal() {
+ return proposal;
+ }
+
+
+ //begining of section (ex. [Test])
+ private String name;
+
+ //end of section (ex. [EndTest])
+ private String endName;
+
+ //list of all commands in section
+ private ArrayList<Command> commandList;
+
+ private String proposal;
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/SelectiveArgument.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+import static org.w3c.dom.Node.ELEMENT_NODE;
+
+import java.util.ArrayList;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class SelectiveArgument implements Arguments {
+
+
+
+ public SelectiveArgument(Node selectionNode) {
+
+ this.arglist = new ArrayList<Arguments>();
+
+ NodeList selectionList = selectionNode.getChildNodes();
+
+ for (int i = 0; i < selectionList.getLength(); i++) {
+ short typeC = selectionList.item(i).getNodeType();
+ if (typeC == ELEMENT_NODE) {
+ String value = selectionList.item(i).getAttributes()
+ .getNamedItem("value").getNodeValue();
+ String textForNode = selectionList.item(i).getTextContent();
+ String binding = selectionList.item(i).getAttributes()
+ .getNamedItem("binding").getNodeValue();
+ String nextvalue = selectionList.item(i).getAttributes()
+ .getNamedItem("nextvalue").getNodeValue();
+
+ Argument normal = new Argument(value,textForNode.trim(), binding,nextvalue);
+ arglist.add(normal);
+
+ }
+ }
+ }
+
+ public String getNextValue() {
+ return null;
+ }
+
+ public String getArgumentBinding(){
+ return "none";
+ }
+ public String getArgumentName() {
+ return this.arglist.get(0).getArgumentName();
+ }
+
+
+
+
+
+ private ArrayList<Arguments> arglist;
+
+
+ public ArrayList<String> validate(ArrayList<String> tokenizedLine) {
+ int size = tokenizedLine.size();
+ for(int i = 0 ; i < arglist.size() ; i++){
+
+ tokenizedLine = this.arglist.get(i).validate(tokenizedLine);
+ if(tokenizedLine.size() < size){
+ return tokenizedLine;
+ }
+ }
+
+ return tokenizedLine;
+ }
+
+ public String getArgumenType() {
+ // TODO Auto-generated method stub
+ return "value";
+
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.stf.scripteditor/src/com/nokia/testfw/stf/scripteditor/utils/TestCase.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.stf.scripteditor.utils;
+
+/**
+ * Currently ScriptEditor supports only test case sections. But there are also
+ * [Define] sections and other. So if in future we decide that we want also those
+ * sections to be listed in outline view then Section class will be super class
+ * for them. This class currently does not extend Section class functionality.
+ * But probably it will in future.
+ *
+ */
+public class TestCase extends Section {
+
+ /**
+ * Constructor
+ *
+ * @param title
+ * Title of test case
+ */
+ public TestCase(String title){
+ super(title);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.sut.help</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/META-INF/MANIFEST.MF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SUT Help plug-in
+Bundle-SymbolicName: com.nokia.testfw.sut.help;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: com.nokia.testfw.sut.help.HelpPlugin
+Bundle-Vendor: Nokia
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Eclipse-LazyStart: true
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/about.html Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body>
+
+<h2>About This Content</h2>
+
+<p>February 4, 2009</p>
+
+<h3>Copyright</h3>
+<p>Copyright © 2007-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.<br>
+This component and the accompanying materials are made available under the <br/>
+terms of the License "Symbian Foundation License v1.0" which accompanies this <br/>
+distribution, and is available at the URL: <a href="http://www.symbianfoundation.org/legal/epl-v10.html">http://www.symbianfoundation.org/legal/epl-v10.html</a>.<p>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/book.css Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,186 @@
+/*
+ Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+ License: http://www.symbianfoundation.org/legal/epl-v10.html.
+
+*/
+
+/* Add whitespace around entire display to avoid crowding edges of view */
+/* 20070523-Removed top margin size to close gap between location breadcrumbs and page title */
+html {
+ margin: 0px 10px 10px 10px;
+ }
+
+/* Set default font to serif style, 12-pt and plain */
+body, p, table {
+ font-family: Georgia, "Times New Roman", Times, serif;
+ font-size: 12px;
+ font-weight: normal;
+}
+
+/* Use sans-serif fonts for all title styles */
+h1, h2, h3, h4, h5, h6, strong, em {
+ font-family: Helvetica, sans-serif;
+ color: #000000;
+ }
+
+h1 { font-size:20px }
+h2 { font-size:18px }
+h3 { font-size:16px }
+h4 { font-size:14px }
+h5 { font-size:12px }
+h6 { font-size:10px }
+
+/* For headlines at the top of a view, add space */
+/* 20070522-added gradiant to background to update visual style of docs */
+h1, h2, h3 {
+ background-image: url(html/images/green_fade_left_68_165_28.png);
+ background-repeat: no-repeat;
+ padding:10px 0px 10px 12px;
+ }
+
+li {
+ margin-bottom:8px;
+ margin-top:8px;
+ }
+
+/* Footer includes space and a gray line above the company logo */
+#footer {
+ padding-top:10px;
+ margin-top:20px;
+ border-top:1px solid #999;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ color: #03C;
+ }
+
+.listing {
+ font-family: "Courier New", Courier, mono;
+ color: #009;
+ background-color: #EEE;
+ padding: 10px 0px;
+ margin: 10px 0px;
+ }
+
+.code, pre {
+ font-family: "Courier New", Courier, mono;
+ font-size: 11px;
+ color: #333;
+ }
+
+.step {
+ /* background-color: #EEE; */
+ /* margin: 10px 0px; */
+ color: #333;
+ border-bottom:2px solid #EEE;
+ }
+
+.substep {
+ background-color: #EEE;
+ }
+
+
+/* Figure/Listing/Table titles are centered and gray */
+p.table {
+ color: #999;
+ font-weight: bold;
+ padding-top: 5px;
+ }
+
+table {
+ border: solid #999 1px;
+ table-layout: auto;
+ font-size: 12px;
+ }
+
+td, th {
+ border: solid #999 1px;
+ padding: 5px;
+ vertical-align:top;
+ }
+
+/* 20070522-replaced gray with green background to match gradiant color for title */
+th {
+ background-color:#ACD79B;
+ /* background-color:#999;
+ color:#FFF; */
+ }
+
+div.ol.p {
+ margin-left: 3em;
+ }
+
+/* Make all ordered/unordered list items appear in bold gray */
+div ol > li, div ul > li {
+ font-weight:bold;
+ color: #333;
+ }
+
+div ol > p, div ul > p, div li > p {
+ font-weight:normal;
+ }
+
+/* Make all H4 and H5 items appear in bold gray against a light green background */
+div h5, div h4 {
+ padding:5px 0px 5px 12px;
+ background-color:#ECFBEA;
+ /* background-color: #EEE; */
+ font-weight:bold;
+ color: #333;
+ }
+
+
+/* Notes stand out using a light top & bottom borders with dark gray text */
+p.note {
+ /* color: #03C; */
+ /* background-color: #FFFF99; */
+ color: #333;
+ padding: 5px;
+ margin-left: 1em;
+ margin-right: 1em;
+ border-top: solid #BBB thin;
+ border-bottom: solid #BBB thin;
+ }
+
+
+/* Figure/Listing/Table titles are centered and gray */
+p.figure {
+ color: #333;
+ text-align: center;
+ font-weight: bold;
+ }
+
+/* highly visible red background and white text for things that need fixing before release */
+/* SHOULD NOT BE PRESENT IN RELEASED PRODUCTS */
+.fix {
+ background-color: red;
+ font-weight: bold;
+ color: white;
+ }
+
+.question {
+ font-style:italic;
+ font-weight:bold;
+ color: #555;
+ }
+
+.titleSmall {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ }
+
+
+.plain {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+ font-style: normal;
+ line-height: normal;
+ font-weight: normal;
+ font-variant: normal;
+ color: #000000;
+ text-decoration: none;
+ }
+
+a:link { color: #0033CC }
+a:visited { color: #555555 }
+a:hover { color: #0033CC }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/build.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,8 @@
+bin.includes = about.html,\
+ book.css,\
+ html/,\
+ META-INF/,\
+ plugin.xml,\
+ toc.xml,\
+ tocReference.xml,\
+ tocTasks.xml
Binary file testdev/ite/src/com.nokia.testfw.sut.help/html/images/consoleuidiagram.png has changed
Binary file testdev/ite/src/com.nokia.testfw.sut.help/html/images/sutfull.png has changed
Binary file testdev/ite/src/com.nokia.testfw.sut.help/html/images/symbinunittestcomponents.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/html/legal.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Legal</title>
+<link href="../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>License Information</h2>
+
+<h5>COPYRIGHTS</h5>
+
+<p>Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. This component and the accompanying materials are made available under the terms of the License "Symbian Foundation License v1.0" which accompanies this distribution, and is available at the URL <a href="http://www.eclipse.org/legal/epl-v10.html">"http://www.eclipse.org/legal/epl-v10.html"</a>.</p>
+<p>Initial Contributors:<br>
+Nokia Corporation - initial contribution</p>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/html/references/.sut_advance.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Further Study in Symbian Unit Test</title>
+<link href="../book.css" type="text/css" rel="stylesheet"></head>
+<body>
+
+<p>Further Study in Symbian Unit Test.</p>
+<p>1. SUT for negative test. <br />
+There are also some methods provided by CSymbianUnitTest for running negative test cases.</p>
+<p>SUT_ASSERT<br />
+Asserts a condition in a unit test case. Leaves with a Symbian unit test framework specific error code if the condition evaluates to EFalse.<br />
+In case of a failed assertion, the framework records the failure reason, line number and file name to the test results.</p>
+<p>SUT_ASSERT_EQUALS<br />
+Asserts that two values are equal. Leaves with a Symbian unit test framework specific error code if the values are not equal. <br />
+In case of a failed assertion, the framework records the failure reason, line number and file name to the test results.</p>
+<p>SUT_ASSERT_LEAVE_WITH<br />
+Asserts that a statement leaves an expected value. Leaves with a Symbian unit test framework specific error code if the leave code is not the expected one.<br />
+In case of a failed assertion, the framework records the failure reason, line number and file name to the test results. <br />
+Note: SUT_ASSERT_LEAVE_WITH should be used instead whenever possible, because the implementation of SYMBIAN_UT_ASSERT_LEAVE TRAPs also KErrNoMemory. This means that all the memory allocations are not looped through during the memory allocation failure simulation.</p>
+<p>SUT_ASSERT_LEAVE<br />
+Asserts that a statement leaves. The macro itself leaves with a Symbian unit test framework specific error code if the statement leaves. <br />
+In case of a failed assertion, the framework records the failure reason, the line number and file name to the test results.</p>
+<p>2. Interact with ATS. <br />
+SUT can also interact with ATS, please refer to ATS User Guide for more information.</p>
+<p>3. Convert EUNIT test case to SUT. <br />
+<p>There is a useful tool named eunit_to_symbianunit.pl, we can use it to convert the existing EUNIT test cases to SUT. Run it under the eunit test cases folder then the test cases are converted to SUT test cases.</p>
+
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/html/references/classes_and_macros.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Classes and macros</title>
+<link href="../book.css" type="text/css" rel="stylesheet"></head>
+<body>
+
+<h2>Classes and macros</h2>
+
+<p>1. There are several macros used in Symbian Unit Test Framework, we should define the macro SYMBIAN_UNIT_TEST in our test project’s mmp file to enable them.</p>
+<p>BASE_CONSTRUCT:<br />
+ Calls the base class constructor that sets the name of unit test, usually used in ConstructL in wrapper class.</p>
+<p>ADD_SUT( aTestPtr ):<br />
+ Adds a new unit test case to this unit test. The default setup and teardown functions will be used.</p>
+<p>ADD_SUT_WITH_SETUP_AND_TEARDOWN( aSetupPtr, aTestPtr, aTeardownPtr ):<br />
+ Adds a new unit test case to this unit test. The user can specify the customized setup and teardown functions. <br />
+ <br />
+SUT_ASSERT( aCondition ):<br />
+ Asserts a condition in a unit test case. Leaves with a Symbian unit test framework specific error code if the condition evaluates to EFalse.</p>
+<p>SUT_ASSERT_EQUALS( aExpected, aActual ):<br />
+ Asserts that two values are equal. Leaves with a Symbian unit test framework specific error code if the values are not equal.</p>
+<p>SUT_ASSERT_LEAVE_WITH( aStatement, aError ):<br />
+ Asserts that a statement leaves an expected value. Leaves with a Symbian unit test framework specific error code if the leave code is not the expected one.</p>
+<p>SUT_ASSERT_LEAVE( aStatement ):<br />
+ Asserts that a statement leaves. The macro itself leaves with a Symbian unit test framework specific error code if the statement leaves.</p>
+<p>The detailed explaination can be found in symbianunittestmacros.h.</p>
+<p>2. Classes in Symbian Unit Test Framework.</p>
+<p>In this section, we will review some key classes in SymbianUnitTest Framework. While writing a test project, below classes should be aware of from the client’s perspective:</p>
+<p>CSymbianUnitTest<br />
+CSymbianUnitTest is a basic test unit; it corresponds to the class which we will test. Client programmer should derive from it and implement test code in CSymbianUnitTest’s derived class. <br />
+Client user needs to override two methods SetupL and Teardown if extra initialization needed to run test case.</p>
+<p>CSymbianUnitTestSuite<br />
+CSymbianUnitTestSuite is the collection/container of CSymbianUnitTest. On the other words, it simply collects a number of CSymbianUnitTest's derived classes and run them during a particular test run.</p>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/html/references/consoleui.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Console UI</title>
+<link href="../book.css" type="text/css" rel="stylesheet"></head>
+<body>
+
+<h2>Console UI</h2>
+<p>There is a console based application provided by Symbian Unit Test Framework which is used to execute test cases.</p>
+<p>filename: <br />
+ symbianunittest.exe</p>
+<p>allowed arguments:<br />
+ -tests|t=<dllfilename1,dllfilename2,...><br />
+ -cases|c=<case1,case2,...><br />
+ -alloc|a<br />
+ -help|h<br />
+ -output|o=<html|xml|txt><br />
+ -timeout|to<br />
+ -noprompt</p>
+<p>each option has a short term form such as -h is the short term form of -help.</p>
+<p>-help/-h : print help message (the same effect as run symbianunittest.exe without any parameter)<br />
+ Example : symbianunittest -help<br />
+ <br />
+-tests/-t : specify the test dll files which include the symbian unit test cases, seperated by ‘,’. <br />
+ Example : symbianunittest -tests=testdllfilename1,testdllfilename2,testdllfilename3<br />
+ <br />
+-cases/-c : specify which test cases should be ran during the test procedure. the names of the test cases are seperated by ‘,’. (optional)<br />
+ Example : symbianunittest -tests=testdll -cases=testcasename1,testcasename2,testcasename3<br />
+ <br />
+-timeout/-to : set the time out value for test execution, 30 secondes by default, 0 for never timeout. (optional)<br />
+ Example : symbianunittest -tests=testdll1,testdll2,testdll3 -to=3<br />
+ Set time out to 3 seconds. <br />
+ <br />
+-output/-o : set the output format, default is html. Test result file is stored in c:\sut. <br />
+ Example : symbianunittest -tests=testdll1,testdll2,testdll3 -to=3 -o=xml</p>
+<p>-alloc/-a : Memory allocation failure simulation. (optional)<br />
+ Example : symbianunittest -tests=testdll1,testdll2,testdll3 -to=3 -o=xml -alloc<br />
+ <br />
+-noprompt : perform a quiet test for unit test execution. (optional)<br />
+ Example : symbianunittest -tests=testdll1,testdll2,testdll3 -to=3 -o=xml -alloc –noprompt</p>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/html/references/overview.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<meta http-equiv="Content-Style-Type" content="text/css" />
+<title>Overview</title>
+<link rel="StyleSheet" href="../../book.css" type="text/css"/>
+</head>
+<body>
+
+<h2>Overview</h2>
+
+<p>SymbianUnitTest is a unit test framework, which is a port of xUnit to Symbian C++. Its basic architecture and usage are closely linked with xUnit model.</p>
+<p>SymbianUnitTest makes full use of Symbian C++ language features. It provides helper macros for users to easily define test cases.</p>
+<p>Unit test frameworks are key elements of TDD(Test Driven Development). For this reason, SymbianUnitTest is not only considered as test framework to validate the software, but also the enabler for TDD and continuous integration to improve software quality and speed time to market.</p>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/html/references/references.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<meta http-equiv="Content-Style-Type" content="text/css" />
+<title>References</title>
+<link rel="StyleSheet" href="../../book.css" type="text/css"/>
+</head>
+<body>
+
+<h2>References</h2>
+<p>The following references are available for this tool:</p>
+<ul>
+ <li><a href="toc.htm">SymbianUnitTest user guide</a></li>
+</ul>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/html/references/sut_advance.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Further Study in Symbian Unit Test</title>
+<link href="../book.css" type="text/css" rel="stylesheet"></head>
+<body>
+
+<h2>Further Study in SymbianUnitTest</h2>
+<p>1. SymbianUnitTest Framework can also detect memory leaks. It will leave with a specified leave code if memory leak occurs.</p>
+<p>2. Interact with ATS. <br />
+Test cases created for SymbianUnitTest can run with ATS, please refer to ATS User Guide for more information.</p>
+<p>3. Convert EUNIT test case to SymbianUnitTest. <br />
+There is a Perl script called eunit_to_symbianunit.pl, which is used to convert the existing EUNIT test cases to SymbianUnitTest. Run it under the eunit test cases folder then the test cases are converted to SymbianUnitTest test cases.</p>
+
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/html/references/sut_introduction.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<meta http-equiv="Content-Style-Type" content="text/css" />
+<title>SUT Introduction</title>
+<link rel="StyleSheet" href="../../book.css" type="text/css"/>
+</head>
+<body>
+
+<h2>Introduction</h2>
+<p>SymbianUnitTest Framework consists of several components:<br />
+ <img src="../images/symbinunittestcomponents.png" alt="Components"></p>
+<p>Test Framework:</p>
+<div>Implemented as symbianunittestunitfw.dll, it is the core part of SymianUnitTest to handle all unit testing activities.</div>
+<div> </div>
+<div>Unit Test Runner:</div>
+<div>The test runner component is used for driving the test framework. It provides a unified interface to console and graphic UIs.</div>
+<div> </div>
+<div>Test Code:</div>
+<div>It is the user’s test cases which are implemented as a DLL file.</div>
+<div> </div>
+<div>Result & Logs:</div>
+<div>The test report will be generated at c:\sut\SymbianUnitTestResults.html</div>
+<div>If the logging is enabled while building and the c:\logs\sut directory exists, SymbianUnitTest will write debug information during test case execution.</div>
+<div> </div>
+<div>ConsoleUI:</div>
+<div>Implemented as symbianunittest.exe, it provides a console interface to users to run test cases via command line.</div>
+<div> </div>
+<div>Usage (will explained in the later section):</div>
+<p>Symbianunittest.exe –tests [-cases] [-alloc] [-help] [-output] [-timeout] [-noprompt]</p>
+ <img src="../images/sutfull.png"></div>
+<p>ConsoleUI accepts user input from keyboard, CSymbianUnitTestCommandParser deals with command line options. Then CSymbianUnitTestRunner starts to handle the test cases by communicating with Symbian Unit Test Framework via MSymbianUnitTestObserver interface. Each test case is executed in a separate thread. At the end of the test case execution, Test Framework generates test result in user specified format.</p>
+
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/html/references/toc.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Table of Contents</title>
+<link href="../book.css" type="text/css" rel="stylesheet"></head>
+<body>
+
+<h2>Symbian Unit Test Framework</h2>
+<div>Contents</div>
+<ul>
+ <li><a href="overview.htm">Overview</a></li>
+ <li><a href="sut_introduction.htm">SymbianUnitTest introduction</a></li>
+ <li><a href="write_a_unit_test_using_sut.htm">Write a unit test using SymbianUnitTest</a></li>
+ <li><a href="classes_and_macros.htm">Classes and Macros</a></li>
+ <li><a href="consoleui.htm">ConsoleUI usages</a></li>
+ <li><a href="sut_advance.htm">SymbianUnitTest advanced features</a></li>
+</ul>
+
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/html/references/write_a_unit_test_using_sut.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,165 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<meta http-equiv="Content-Style-Type" content="text/css" />
+<title>Write a unit test using SUT</title>
+<link rel="StyleSheet" href="../../book.css" type="text/css"/>
+</head>
+<body>
+
+<h2>Write a unit test using SUT</h2>
+
+<p>The following code snippet is from the example Racecar, we can download it from<br />
+<a href="https://developer.symbian.org/sfl/MCL/sftools/ana/testfw/testexecfw/symbianunittestfw/sutfw/sutfwexamples">https://developer.symbian.org/sfl/MCL/sftools/ana/testfw/testexecfw/symbianunittestfw/sutfw/sutfwexamples</a>.</p>
+<div><span>1.<span> </span></span>Select Class and methods to be tested</div>
+<div>For instance, we want to test the class CRaceCar in the example. Two of the functions we want to test are AddFuel() and SpeedL().</div>
+<div> </div>
+
+<div><code>#ifndef CRACECAR_H<br />
+#define CRACECAR_H<br />
+<br />
+class CRaceCar : public CBase <br />
+ {<br />
+<span> // some constructors and destructor…<br />
+<br />
+ public: // New functions<br />
+ TUint AddFuel( TUint aFuel );<br />
+ TUint SpeedL();<br />
+<br />
+ // some other methods and attributes…<br />
+ };<br />
+<br />
+#endif // CRACECAR_H</span></code></div>
+<br />
+<div>In order to get enough privillage to access private members in CRaceCar when creating unit test case, we need to define the test class UT_CRaceCar as friend class</div>
+<div><code>class CRaceCar : public CBase</code></div>
+<div> <code>{</code></div>
+<div> <code>// ...</code></div>
+<div> </div>
+<div> <code>private: // Test class</code></div>
+<div> <code>#ifdef SYMBIAN_UNIT_TEST</code></div>
+<div> <code>friend UT_CRaceCar;</code></div>
+<div> <code>#endif // SYMBIAN_UNIT_TEST</code></div>
+<div> <code>};</code></div>
+<div> </div>
+<div>UT_CRaceCar will be introduced to CRaceCar as friend class if the macro SYMBIAN_UNIT_TEST has been defined in test project.</div>
+<div> </div>
+<div><span>2.<span> </span></span>Define Test Class</div>
+<div>Define a test class UT_CRaceCar, it will derive from CSymbianUnitTest,</div>
+<div> </div>
+<div><code>#ifndef UT_RACECAR_H</code></div>
+<div><code>#define UT_RACECAR_H</code></div>
+<div><code> </code></div>
+<div><code>// INCLUDES</code></div>
+<div><code>#include <symbianunittest.h></code></div>
+<div><code> </code></div>
+<div><code>// FORWARD DECLARATIONS</code></div>
+<div><code>class CRaceCar;</code></div>
+<div><code> </code></div>
+<div><code>// CLASS DECLARATION</code></div>
+<div><code>class UT_CRaceCar : public CSymbianUnitTest</code></div>
+<div><code> {</code></div>
+<div><code> // Constructors and destructor…</code></div>
+<div><code> </code></div>
+<div><code> protected: // From CSymbianUnitTest</code></div>
+<div><code> void SetupL(); <br />
+ void Teardown(); </code></div>
+<div><code> </code></div>
+<div><code> protected: // Test functions, others are the same as this one.</code></div>
+<div><code> void UT_AddFuel(); </code><br />
+<span><code> void UT_SpeedL();</code> </span></div>
+<div><code> </code></div>
+<div><code> private: // Data</code></div>
+<div><code> // The object to be tested as a member variable:</code></div>
+<div><code> CRaceCar *iRaceCar; </code></div>
+<div><code> };</code></div>
+<div><code> </code></div>
+<div><code>#endif // UT_RACECAR_H</code></div>
+
+<div> </div>
+<div>Please notice some Symbian C++ essential functions such as NewL() and ConstructL() are ignored in this document.</div>
+<div>Users can provide optional SetupL() and Teardown() functions. They will be called before and after test case execution. SetupL() usually initializes some of the resources, allocates memory, Teardown() usually in charge of some resource destruction so that the test object can reset its state for the next test case execution.</div>
+<div>UT_AddFuel() and UT_SpeedL() are the unit test code to test the corresponding functions defined in the class CRaceCar.</div>
+<div>The iRaceCar is the instance of class under test.</div>
+<div> </div>
+<div><span>3.<span> </span></span>Create Test DLL entry.</div>
+<div>The next file that we should take into consideration is dllentry.cpp which you can find in the example test project dllentry.cpp.</div>
+<div>It only has one global function with the signature EXPORT_C MSymbianUnitTestInterface* CreateTestL(); in this function, it creates and return the test suites, so the SymbianUnitTest framework can load and run test cases. </div>
+<div> </div>
+<div>The example code snippet is shown below:</div>
+<div><code>EXPORT_C MSymbianUnitTestInterface* CreateTestL()</code></div>
+<div><code> {</code></div>
+<div><code> CSymbianUnitTestSuite* testSuite =</code></div>
+<div><code> CSymbianUnitTestSuite::NewLC( _L("ut_racecar") );</code></div>
+<div><code> </code></div>
+<div><code> testSuite->AddL( UT_CRaceCar::NewLC() );</code></div>
+<div><code> CleanupStack::Pop();</code></div>
+<div><code> </code></div>
+<div><code> // Add more tests to the test suite here when testing multiple classes</code></div>
+<div><code> CleanupStack::Pop( testSuite );</code></div>
+<div><code> return testSuite;</code></div>
+<div><code> }</code></div>
+<div><code> </code></div>
+<div><span>4.<span> </span></span>Implement test cases.</div>
+<div>One of the important functions should taken into account is the second phase constructor of the test suite. In this function, we must call the macro BASE_CONSTRUCT at the first line. Then the unit test methods can be added by using the macro ADD_SUT. Please note that SetupL() will be invoked before each test case runs and the Teardown() will be invoked after the test case execution.</div>
+<div>We can specify the SetupL() and Teardown() functions for certain test case simply by using the macro ADD_SUTWITH_SETUP_AND_TEARDOWN.</div>
+<div> </div>
+<div>The example code snippet is shown below:</div>
+<div><code>void UT_CRaceCar::ConstructL()</code></div>
+<div><code> {</code></div>
+<div><code> BASE_CONSTRUCT</code></div>
+<div><code> ADD_SUT( UT_AddFuel )</code></div>
+<div><code> ADD_SUT_WITH_SETUP_AND_TEARDOWN( SetupL, UT_ SpeedL, Teardown )</code></div>
+<div><code> }</code></div>
+<div><code> </code></div>
+<div>Here is an example a a unit test function.</div>
+<div> </div>
+<div><code>void UT_CRaceCar::UT_FuelL()</code></div>
+<div><code> {</code></div>
+<div><code> SUT_ASSERT_EQUALS( 0, iRaceCar->FuelLeft() )</code></div>
+<div><code> SUT_ASSERT_EQUALS( 0, iRaceCar->AddFuel( KInitialFuel ) )</code></div>
+<div><code> SUT_ASSERT_EQUALS( KInitialFuel, iRaceCar->FuelLeft() )</code></div>
+<div><code> SUT_ASSERT_EQUALS( 2, iRaceCar->AddFuel( 1 ) ) </code></div>
+<div><code> SUT_ASSERT_EQUALS( KInitialFuel, iRaceCar->FuelLeft() )</code></div>
+<div><code> }</code></div>
+<div><code> </code></div>
+<div>In this function, we use the macro SUT_ASSERT_EQUALS to assert if the test function's return value is what we expect, more macros will be introduced in later section. It will be marked as failed if the actual return value doesn't match the expected value when using the macro SUT_ASSERT_EQUALS. The rest of the functions should be tested follow the same way as we mentioned in this section.</div>
+<div> </div>
+<div><span>5.<span> </span></span>Create project mmp file.</div>
+<div>In the next step, we will create a project file. Showing below is a snippet of the mmp file:</div>
+<div>1) TARGET ut_racecar.dll</div>
+<div>2) TARGETTYPE dll</div>
+<div>3) UID<span> 0x20022E76 0x0E6A3C34</span></div>
+<div>4) MACRO SYMBIAN_UNIT_TEST</div>
+<div>5) SOURCE racecar.cpp</div>
+<div>6) SOURCE dllEntry.cpp</div>
+<div>7) SOURCE ut_racecar.cpp</div>
+<div>8) SYSTEMINCLUDE /epoc32/include/symbianunittest</div>
+<div>9) LIBRARY symbianunittestfw.lib</div>
+<div> </div>
+<div>The type of the test project is a dll project, so we should indicate the target type of the project, like line 2, we specify dll as the TARGETTYPE.</div>
+<div>At line 1, we set a target file name for the file.</div>
+<div>At line 3, we must specify the UID2 as it is identified for the SymbianUnitTest’s DLL.</div>
+<div>At line 4, we must add the SYMBIAN_UNIT_TEST macro to enable the macros the test framework provided.</div>
+<div>We also need to list the source code under test (in this case, the source file of the testing class is racecar.cpp), so we add it at line 5.</div>
+<div>We added dllEntry.cpp to the mmp file as stated in section "3 -- Write dll entry" at line 6.</div>
+<div>ut_racecar.cpp is test case implementation, we add it at line 7.</div>
+<div>Line 8 and line 9 contain the directory of the header files and the library file of the SymbianUnitTest we need in our test.</div>
+<div> </div>
+<div><span>6.<span> </span></span>Create bld.inf for the test project.</div>
+<div>We also need to add the newly created project mmp file to bld.inf, just like the following shown below:</div>
+<div>PRJ_TESTMMPFILES</div>
+<div>ut_racecar.mmp</div>
+<div> </div>
+<div><span>7.<span> </span></span>Build project and run it.</div>
+<div>In the test project group directory, execute the following command to build it:</div>
+<div>bldmake bldfiles</div>
+<div>abld test clean winscw</div>
+<div>abld test reallyclean winscw</div>
+<div>abld test build winscw udeb</div>
+<div> </div>
+<div>Run "symbianunittest.exe -t=ut_racecar.dll" to execute the test, we should get the test result at "c:\sut".</div>
+
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/add_case.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Adding test cases</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Adding test cases</h2>
+
+<p>New test cases can be added when new functions are added to a class.</p>
+<p>For example, when a new function is added to a class, do the following to add corresponding test case:</p>
+
+<ol>
+<li>Open the header file of the class.</li>
+<li>In outline view, right click the newly added function and select <b>Test Frameworks</b> > <b>Generate SymbianUnitTest Cases...</b>. Multiple functions can be selected by holding "CTRL" key when left clicking. A window like below will pop-up:<br/><img src="screenshots/add_sut_case.png" alt="Generate SUT cases" /></li>
+<li>(Optional) Click <b>Next</b> to set the properties of added test cases.<br><img src="screenshots/add_sut_case_properties.png" alt="Case properties" /></li>
+<li>(Optional) Check the "Preview changes" checkbox, the click <b>Next</b>. The SUT of ITE plugin will generate dummy test cases for you to modify.<br><img src="screenshots/preview_changes.png" alt="Preview changes" /><br/><br/><img src="screenshots/preview_changes1.png" alt="Preview changes: dummy functions" /></li>
+<li>Click <b>Finish</b> to apply changes.</li>
+</ol>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/creating_sut.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Creating test modules</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Creating SymbianUnitTest suite</h2>
+<p>To create SymbianUnitTest suite, you must have a Symbian C++ project, which is the actual development work, before you build a test project. Once the main development project has been created you can create a Symbian Unit Test suite, the suite files are saved separately in a specified folder, for example the test folder. The steps below show how to create SymbianUnitTest suite:</p>
+<ol>
+<li>Select <b>File > New > Other</b>.</li>
+<li>Select <b>Carbide Extensions > Test Frameworks > Symbian Unit Test</b>, and click <b>Next</b>.<br /><p><img src="screenshots/create_sut1.png" alt = "Create SUT wizard"/></p></li>
+<li>Select the project where the Symbian Unit Test suite will be created and click <b>Next</b>.<br /><p><img src="screenshots/create_sut2.png" alt = "Create SUT wizard: project selection"/></p></li>
+<li>Select the classes or functions to test. Click <b>Next</b>.<br /><p><img src="screenshots/create_sut3.png" alt = "Create SUT wizard: classes and functions selection"/></p></li>
+<li>If necessary, change the directory for the files generated by the wizard and click <b>Next</b>. By default, the generated files are saved under the test folder. The UID3 is generated randomly.<br /><p><img src="screenshots/create_sut4.png" alt = "Create SUT wizard: Location and properties"/></p></li>
+<li>A set of files for Symbian Unit Test suite are generated as following:<br /><p><img src="screenshots/create_sut5.png" alt = "Create SUT wizard: demo"/></p></li>
+</ol>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/run_sut.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Running the test cases</title>
+<link href="../../book.css" type="text/css" rel="stylesheet">
+</head>
+<body>
+
+<h2>Running Symbian unit test</h2>
+<p>Symbian unit test are executed in emulator by defining a launch configuration. This configuration is saved, so it is an operation that needs to be done only once.</p>
+<p>Launch configuration is created by selecting a menu item: <b>Run | Run Configurations...</b>, and then select Symbian Unit Test Emulation as your launch configuration type, then pressing the <b>New</b> button to create a new launch configuration.</p>
+<p>This launch configuration has three tabs. The first one is specific to this launch configuration and the remaining two are common tabs for all launch configuration. It contains settings like where to save the launch configuration, and where to direct its (possible) output. More information about Environment and Common tab can be found from Carbide documentation.</p>
+<p>If the project under Symbian Unit Test is selected in your workspace when the launch configuration is created, the wizard will fill all the fields automatically. Information can be then reviewed and launch can be preceded.</p>
+<p>The picture below is an example:</p>
+<p><img src="./screenshots/launch_config.png" alt="Launch configuration" /></p>
+<p>Some fields of launch configuration should be noted:</p>
+<ul>
+<li><b>Project</b> field defines the project in which the test code is. This is used to get information about active build parameters in the project.</li>
+<li><b>Test dll</b> defines the test dll which is to be executed in the emulator. Tab tries to resolve this automatically based on active build configuration in the project. For example on S60 platform, on "emulator debug" configuration, compiled dll files go to <code>%EPOCROOT%/Epoc32/release/winscw/udeb</code> folder.</li>
+<li><b>Test case</b> defines the test cases which are to be executed in the emulator. To run part of test cases, use <code>UTClassName::TestCaseName</code> to specify individual case, use comma "," to seperate them and no whitespace allowed.</li>
+</ul>
+
+<h2>Viewing Test Execution Results</h2>
+<p>When Symbian Unit Test launch configuration is launched, it will automatically show you the EUnit Results View. This view is by default located at the bottom central area of the IDE, as following:</p>
+<p><img src="./screenshots/blank_result_view.png" alt="Blank result view" /></p>
+<p>As execution is ongoing the results will be updated on the view. After the execution the view looks like as following:</p>
+<p><img src="./screenshots/result_view.png" alt="Result view" /></p>
+<p>Buttons (right side of the upper tab) from left to right indicate:</p>
+<ul>
+<li>Rerun test: Executes again the tests which results are currently displayed.</li>
+<li>Rerun test-failed: Executes again the failed tests which results are currently displayed.</li>
+<li>Test Run History: All the history test result, select the drop down list to show the history result.</li>
+</ul>
+<p>In the result view, double-click the link of failed case will open the source code and locate cursor at the the failed line.</p>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
Binary file testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/screenshots/add_sut_case.png has changed
Binary file testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/screenshots/add_sut_case_properties.png has changed
Binary file testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/screenshots/blank_result_view.png has changed
Binary file testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/screenshots/create_sut1.png has changed
Binary file testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/screenshots/create_sut2.png has changed
Binary file testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/screenshots/create_sut3.png has changed
Binary file testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/screenshots/create_sut4.png has changed
Binary file testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/screenshots/create_sut5.png has changed
Binary file testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/screenshots/launch_config.png has changed
Binary file testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/screenshots/preview_changes.png has changed
Binary file testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/screenshots/preview_changes1.png has changed
Binary file testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/screenshots/result_view.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/html/tasks/tasks.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,20 @@
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <title>Guide</title>
+ <link rel="stylesheet" href="../../book.css" type="text/css"/>
+ </head>
+ <body>
+ <h2>Tasks</h2>
+ <p>This section will tell you how to work with SUT plug-in.</p>
+ <p>Topics in this section include:</p>
+ <ul>
+ <li><a href="creating_sut.htm">Creating SymbianUnitTest suite</a></li>
+ <li><a href="add_case.htm">Adding test cases</a></li>
+ <li><a href="run_sut.htm">Running SymbianUnitTest in emulator</a></li>
+ </ul>
+ <div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+ License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+ </body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/html/tool.htm Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<title>Table of Contents</title>
+<link href="../book.css" type="text/css" rel="stylesheet"></head>
+<body>
+
+<h1>SymbianUnitTest Online Help</h1>
+
+<p><a href="tasks/tasks.htm">Tasks</a></p>
+<ul>
+ <li><a href="tasks/creating_sut.htm">Creating SymbianUnitTest suite</a></li>
+ <li><a href="tasks/add_case.htm">Adding test cases</a></li>
+ <li><a href="tasks/run_sut.htm">Running SymbianUnitTest in emulator</a></li>
+</ul>
+
+<p><a href="references/references.htm">References</a></p>
+<ul>
+ <li><a href="references/toc.htm">SymbianUnitTest user guide</a><br>
+ <ul>
+ <li><a href="references/overview.htm">Overview</a></li>
+ <li><a href="references/sut_introduction.htm">SymbianUnitTest introduction</a></li>
+ <li><a href="references/write_a_unit_test_using_sut.htm">Write a unit test using SymbianUnitTest</a></li>
+ <li><a href="references/classes_and_macros.htm">Classes and Macros</a></li>
+ <li><a href="references/consoleui.htm">ConsoleUI usages</a></li>
+ <li><a href="references/sut_advance.htm">SymbianUnitTest advanced features</a></li>
+ </ul>
+ <br></li>
+</ul>
+<p><a href="legal.htm">Legal</a></p>
+
+<div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/index.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.index"?>
+
+ <!-- INDEX INSTRUCTIONS
+
+ Use the index.xml file to define the index entries for the plugin's
+ help contents. In Eclipse 3.2 and beyond an Index tab appears in the Help
+ viewer making it possible for user to more easily locate subjects of
+ interest to them.
+
+ In brief, every file used in the help documentation should have at least one
+ associated index entry for it. Ideally, it's simple to make two entries per
+ page by simply re-wording the subject slightly. For example, a view could
+ be indexed twice like this, 1) Breakpoint view, and 2) Views/Breakpoint.
+
+ See ??? for details on creating indexes.
+
+ -->
+
+<index>
+ <entry keyword="Legal" >
+ <topic href="html/legal.htm" />
+ </entry>
+ <entry keyword="Overview" >
+ <topic href="html/Getting_Started/overview.htm" />
+ </entry>
+ <entry keyword="Basic walk-through" >
+ <topic href="html/Getting_Started/walk_through.htm" />
+ </entry>
+
+</index>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/plugin.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.help.toc">
+
+ <toc
+ file="toc.xml"
+ primary="true" />
+
+ <toc
+ file="tocgettingstarted.xml"
+ primary="false" />
+
+ <toc
+ file="tocConcepts.xml"
+ primary="false" />
+
+ <toc
+ file="tocReference.xml"
+ primary="false" />
+
+ <toc
+ file="tocTasks.xml"
+ primary="false" />
+
+ </extension>
+
+ <extension point="org.eclipse.help.contexts">
+ </extension>
+</plugin>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/src/com/nokia/testfw/sut/help/HelpPlugin.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.testfw.sut.help;
+
+import org.eclipse.ui.plugin.*;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class HelpPlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static HelpPlugin plugin;
+
+ /**
+ * The constructor.
+ */
+ public HelpPlugin() {
+ plugin = this;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static HelpPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path.
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin("com.nokia.testfw.sut.help", path);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/toc.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+
+<toc label="SUT"
+ link_to="../com.nokia.carbide.help.common/carbideHelpTOC.xml#anchorCarbideFeature" >
+
+ <topic label="SUT" href="html/tool.htm">
+
+
+
+
+
+
+ <topic label="Tasks" href="html/tasks/tasks.htm" >
+ <anchor id="tasks"/>
+ </topic>
+
+ <topic label="References" href="html/references/toc.htm" >
+ <anchor id="references"/>
+ </topic>
+
+
+ <topic label="Legal" href="html/legal.htm" />
+
+ </topic>
+
+</toc>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/tocReference.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Reference" link_to="toc.xml#references">
+
+ <!-- Enter topic entries here for References section of help -->
+
+ <topic href="html/references/overview.htm" label="Overview">
+ </topic>
+ <topic href="html/references/sut_introduction.htm" label="SUT introduction">
+ </topic>
+ <topic href="html/references/write_a_unit_test_using_sut.htm" label="Write a unit test using SUT">
+ </topic>
+ <topic href="html/references/classes_and_macros.htm" label="Classes and Macros">
+ </topic>
+ <topic href="html/references/consoleui.htm" label="ConsoleUI introduction">
+ </topic>
+ <topic href="html/references/sut_advance.htm" label="SUT advanced features">
+ </topic>
+
+</toc>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.sut.help/tocTasks.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Guide" link_to="toc.xml#tasks">
+
+ <topic href="html/tasks/creating_sut.htm" label="Creating SymbianUnitTest suite">
+ </topic>
+ <topic href="html/tasks/add_case.htm" label="Adding test cases">
+ </topic>
+ <topic href="html/tasks/run_sut.htm" label="Running SymbianUnitTest in emulator">
+ </topic>
+</toc>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/.externalToolBuilders/org.eclipse.pde.ManifestBuilder.launch Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.eclipse.pde.ManifestBuilder"/>
+<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+</launchConfiguration>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/.externalToolBuilders/org.eclipse.pde.SchemaBuilder.launch Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.eclipse.pde.SchemaBuilder"/>
+<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+</launchConfiguration>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.testrunner</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/.settings/org.eclipse.jdt.ui.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+#Mon Dec 07 11:28:04 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/.settings/org.eclipse.ltk.core.refactoring.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+#Mon Dec 07 11:28:04 CST 2009
+eclipse.preferences.version=1
+org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/.settings/org.eclipse.pde.core.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,4 @@
+#Mon Dec 07 11:28:04 CST 2009
+eclipse.preferences.version=1
+pluginProject.equinox=false
+pluginProject.extensions=false
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/src/com/nokia/hti/common/CommonMethods.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,495 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Helper class containing common non-HTI-specific helper
+* functions that can be used in other java classes.
+*
+*/
+
+
+package com.nokia.hti.common;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.security.MessageDigest;
+import java.util.Arrays;
+import java.util.Random;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.zip.InflaterInputStream;
+
+/**
+ * Helper class containing static non-hti-specific helper functions that can
+ * be used in other java classes.
+ *
+ */
+public class CommonMethods
+{
+//==============================================================================
+//Public constants
+
+ public static final int[] CRCLookUp =
+ {
+ 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
+ 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
+ 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,
+ 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE,
+ 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485,
+ 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D,
+ 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4,
+ 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC,
+ 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823,
+ 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B,
+ 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12,
+ 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A,
+ 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41,
+ 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49,
+ 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70,
+ 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78,
+ 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F,
+ 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067,
+ 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E,
+ 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256,
+ 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D,
+ 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
+ 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C,
+ 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634,
+ 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB,
+ 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3,
+ 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A,
+ 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92,
+ 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9,
+ 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1,
+ 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8,
+ 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0
+ };
+
+//==============================================================================
+//Public methods
+
+ /**
+ * Creates a logger with given level for the give class.
+ *
+ * @param className the name of the class for which
+ * the logger is created.
+ * @param level logging level for the logger.
+ * @return the created logger.
+ */
+ public static Logger getSimpleLogger( String className, Level level )
+ {
+ Logger logger = Logger.getLogger( className );
+ logger.setLevel( level );
+ logger.setUseParentHandlers( false );
+
+ ConsoleHandler h = new ConsoleHandler();
+ h.setFormatter( new SimpleLogFormatter() );
+ logger.addHandler( h );
+
+ return logger;
+ }
+
+ /**
+ * Calculates the CRC value for the given data with given length.
+ *
+ * @param data Data from which the CRC is calculated.
+ * @param length The amount of data to be included in CRC calculation.
+ * @return The calculated CRC.
+ */
+ public static int CRC16CCITT( byte[] data, int length )
+ {
+ int crc16= 0xFFFF;
+
+ for( int i = 0; i < length; i++ )
+ {
+ int t = ( crc16 >> 8 ) ^ ( data[i] & 0xFF );
+ crc16 = ( ( crc16 << 8 ) & 0xffff ) ^ CRCLookUp[t];
+ }
+
+ return crc16;
+ }
+
+ /**
+ * Converts an array of bytes to integer value. The bytes in the array are
+ * expected to be in the little endian format.
+ *
+ * @param data The byte array in little endian format.
+ * @param offset The offset in the source array from where the
+ * bytes are read onwards.
+ * @param length The number of bytes to read from the source array.
+ * @return The resulting int value.
+ */
+ public static int littleEndianBytesToInt( byte[] data,
+ int offset,
+ int length )
+ {
+ int result = 0;
+ int shiftBits = 0;
+
+ for( int i = 0; i < length; i++ )
+ {
+ result += ( data[offset + i] & 0xFF ) << shiftBits;
+ shiftBits += 8;
+ }
+
+ return result;
+ }
+
+ /**
+ * Converts an array of bytes to long value. The bytes in the array are
+ * expected to be in the little endian format.
+ *
+ * @param data The byte array in little endian format.
+ * @param offset The offset in the source array from where the
+ * bytes are read onwards.
+ * @param length The number of bytes to read from the source array.
+ * @return The resulting long value.
+ */
+ public static long littleEndianBytesToLong( byte[] data,
+ int offset,
+ int length )
+ {
+ long result = 0;
+ int shiftBits = 0;
+
+ for( int i = 0; i < length; i++ )
+ {
+ result += ( data[offset + i] & 0xFF ) << shiftBits;
+ shiftBits += 8;
+ }
+
+ return result;
+ }
+
+ /**
+ * Converts an array of bytes to integer value. The bytes in the array are
+ * expected to be in the big endian format.
+ *
+ * @param data The byte array in big endian format.
+ * @param offset The offset in the source array from where the
+ * bytes are read onwards.
+ * @param length The number of bytes to read from the source array.
+ * @return The resulting int value.
+ */
+ public static int bigEndianBytesToInt( byte[] data,
+ int offset,
+ int length )
+ {
+ int result = 0;
+ int shiftBits = 8 * ( length - 1 );
+
+ for( int i = 0; i < length; i++ )
+ {
+ result += ( data[offset + i] & 0xFF ) << shiftBits;
+ shiftBits -= 8;
+ }
+
+ return result;
+ }
+
+ /**
+ * Converts an int to the array of bytes in the little endian format.
+ *
+ * @param value The int value to be converted to the array of bytes.
+ * @param destination The byte array to where the result is stored.
+ * @param offset The offset in the result array from where the
+ * result bytes are stored onwards.
+ * @param length The number of bytes to store the result.
+ */
+ public static void intToLittleEndianBytes( int value,
+ byte[] destination,
+ int offset,
+ int length )
+ {
+ int shiftBits = 0;
+
+ for( int i = 0; i < length; i++ )
+ {
+ destination[offset + i] = (byte)( ( value >> shiftBits ) & 0xFF );
+ shiftBits += 8;
+ }
+ }
+
+ /**
+ * Returns an int as the array of bytes.
+ *
+ * @param value The int value to be converted to the array of bytes.
+ * @param length The length of byte array which the int is converted to.
+ */
+ public static byte[] intToLittleEndianBytes( int value, int length )
+ {
+ int shiftBits = 0;
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ for( int i = 0; i < length; i++ )
+ {
+ baos.write( (byte)( ( value >> shiftBits ) & 0xFF ) );
+ shiftBits += 8;
+ }
+
+ return baos.toByteArray();
+ }
+
+ /**
+ * Converts a long to the array of bytes in the little endian format.
+ *
+ * @param value The long value to be converted to the
+ * array of bytes.
+ * @param destination The byte array to where the result is stored.
+ * @param offset The offset in the result array from where the
+ * result bytes are stored onwards.
+ * @param length The number of bytes to store the result.
+ */
+ public static void longToLittleEndianBytes( long value,
+ byte[] destination,
+ int offset,
+ int length )
+ {
+ int shiftBits = 0;
+
+ for( int i = 0; i < length; i++ )
+ {
+ destination[offset + i] = (byte)( ( value >> shiftBits ) & 0xFF );
+ shiftBits += 8;
+ }
+ }
+
+ /**
+ * Returns a part from byte array as a string.
+ *
+ * @param source Source byte array.
+ * @param offset Starting point in the source array.
+ * @param length The number of bytes to read from the source array.
+ * @return The result string.
+ */
+ public static String extractString( byte[] source, int offset, int length )
+ {
+ byte[] part = new byte[length];
+ System.arraycopy( source, offset, part, 0, length );
+ return new String( part );
+ }
+
+ /**
+ * Returns a part of given byte array in nice human readable form.
+ *
+ * @param topic Topic for returned log record.
+ * @param data Byte array containing the logging data.
+ * @param start Starting index in byte array from which the bytes are
+ * included.
+ * @param length The number of bytes in the array to be included.
+ * @return The part of the byte array as a String.
+ */
+ public static String formatByteArray( String topic,
+ byte[] data,
+ int start,
+ int length )
+ {
+ StringBuffer sb = new StringBuffer();
+ sb.append( topic + ": " );
+
+ for( int i = start; i < start + length; i++ )
+ {
+ if( i > start ) sb.append( " " );
+ sb.append( toHex( data[i] ) );
+ }
+
+ return sb.toString();
+ }
+
+ /**
+ * Renders a given by to nice human readable hex format.
+ *
+ * @param b The byte to be converted to a string.
+ * @return The result as a string, in the format 0x00.
+ */
+ public static String toHex( byte b )
+ {
+ StringBuffer sb = new StringBuffer( 4 );
+ sb.append( "0x" );
+ int val = b & 0xff;
+ if( val < 0x10 ) sb.append( "0" );
+ sb.append( Integer.toString( val, 16 ) );
+ return sb.toString();
+ }
+
+ /**
+ * Decompresses the given byte array of compressed data.
+ * Returns the decompressed data as a byte array.
+ *
+ * @param source byte array containing the compressed data
+ * @return decompressed data as a byte array
+ * @throws IOException if I/O error occurs
+ */
+ public static byte[] decompress( byte[] source ) throws IOException
+ {
+ // decompress the response through InflaterInputStream
+ InflaterInputStream iis =
+ new InflaterInputStream( new ByteArrayInputStream( source ) );
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ byte[] buffer = new byte[1024];
+ int readBytes;
+
+ while( ( readBytes = iis.read( buffer ) ) != -1 )
+ {
+ baos.write( buffer, 0, readBytes );
+ }
+ iis.close();
+
+ return baos.toByteArray();
+ }
+
+ /**
+ * Gets the stack trace from the given throwable object as a string.
+ *
+ * @param t The throwable object whose stack trace is returned
+ * @return The stack trace as a string.
+ */
+ public static String getStackTrace( Throwable t )
+ {
+ StringWriter stringWriter = new StringWriter();
+ t.printStackTrace( new PrintWriter( stringWriter ) );
+ return stringWriter.toString();
+ }
+
+ /**
+ * Calculates an MD5 checksum for the given file.
+ *
+ * @param f The file that the checksum is calculated for
+ * @return The checksum as a byte array
+ * @throws Exception if I/O error occurs
+ */
+ public static byte[] calculateMd5( File f ) throws Exception
+ {
+ MessageDigest md = MessageDigest.getInstance( "MD5" );
+
+ long fileRemaining = f.length();
+ FileInputStream fis = new FileInputStream( f );
+ while( fileRemaining > 0 )
+ {
+ byte[] buf = new byte[1024];
+ int bytesRead = fis.read( buf );
+ md.update( buf, 0, bytesRead );
+ fileRemaining -= bytesRead;
+ }
+
+ return md.digest();
+ }
+
+ /**
+ * Generated a dummy test file, filled with zeroes.
+ * Used in FTP service tests.
+ *
+ * @param fileName The name of the test file to be generated.
+ * @param size The size of the test file to be generated.
+ * @throws IOException if I/O exception occurs.
+ */
+ public static void generateTestFile( String fileName, int size )
+ throws IOException
+ {
+ File f = new File( fileName );
+
+ deleteTestFile( f );
+
+ FileOutputStream fos = new FileOutputStream( f );
+ byte[] buffer = new byte[size];
+ Arrays.fill( buffer, (byte)0x06 );
+ fos.write( buffer );
+ fos.flush();
+ fos.close();
+ }
+
+ /**
+ * Generates a text file with given text and/or random characters.
+ * If given text string is null the file will be filled with random
+ * characters. Also if given text is shorter than the desired file size
+ * the text will be inserted first and then file is filled to desired
+ * size with random characters.
+ *
+ * @param fileName The name of the text file to be generated.
+ * @param text The text to be written to the file.
+ * @param size Size of the file to create (in bytes).
+ * @throws IOException if I/O exception occurs.
+ */
+ public static void generateTextFile( String fileName, String text, int size )
+ throws IOException
+ {
+ ByteArrayOutputStream characters = new ByteArrayOutputStream( size );
+ if ( text != null )
+ {
+ characters.write( text.getBytes(), 0, text.getBytes().length );
+ characters.write( (byte)32 );
+ }
+ if ( characters.size() < size )
+ {
+ Random rand = new Random( System.currentTimeMillis() );
+ for ( int i = 0; i < size; i++ )
+ {
+ if ( i > 0 && i % 5 == 0 )
+ {
+ // insert space character
+ characters.write( (byte)32 );
+ }
+ else
+ {
+ // draw a random lowercase character
+ characters.write( (byte)( rand.nextInt( 25 ) + 97 ) );
+ }
+ }
+ }
+ File f = new File( fileName );
+ deleteTestFile( f );
+ FileOutputStream fos = new FileOutputStream( f );
+ fos.write( characters.toByteArray(), 0, size );
+ fos.flush();
+ fos.close();
+ }
+
+ /**
+ * Checks if given file exists and is a file and if so, deletes it.
+ *
+ * @param f The file to be deleted.
+ */
+ public static void deleteTestFile( File f )
+ {
+ if ( f.exists() && f.isFile() )
+ {
+ System.gc();
+ f.delete();
+ }
+ }
+
+//==============================================================================
+//Protected methods
+
+//==============================================================================
+//Private methods
+
+//==============================================================================
+//Protected attributes
+
+//==============================================================================
+//Private attributes
+
+//==============================================================================
+//Static initialization block
+
+//==============================================================================
+//Inner classes
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/src/com/nokia/hti/common/HtiConnection.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,191 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: A singleton class providing HTI connection used in
+* system tests and tools.
+* The properties are defined in HTI.properties file.
+*
+*/
+
+
+package com.nokia.hti.common;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.Socket;
+import java.util.Vector;
+
+// From comm.jar
+//import javax.comm.CommPortIdentifier;
+//import javax.comm.SerialPort;
+
+/**
+ * A singleton class providing HTI connection used in system tests and tools.
+ * The properties are defined in HTI.properties file.
+ */
+public class HtiConnection
+{
+//==============================================================================
+//Public constants
+
+//==============================================================================
+//Public methods
+
+ public static HtiConnection getInstance() throws Exception
+ {
+ if( container.size() == 0 )
+ {
+ container.add( new HtiConnection() );
+ }
+
+ return (HtiConnection) container.get( 0 );
+ }
+
+ public InputStream getInputStream() { return in; }
+ public OutputStream getOutputStream() { return out; }
+
+ public void setSocketTimeout( int timeout )
+ {
+ try
+ {
+ if ( s != null )
+ {
+ s.setSoTimeout( timeout );
+ }
+ }
+ catch ( Exception e )
+ {
+ }
+ }
+
+ public void resetSocketTimeout()
+ {
+ setSocketTimeout( defaultSocketTimeout );
+ }
+
+//==============================================================================
+//Protected methods
+
+//==============================================================================
+//Private methods
+
+ private HtiConnection() throws Exception
+ {
+ HtiProperties htiProps = HtiProperties.getInstance();
+
+ // String selectedMedia = properties.getProperty( "selectedMedia" );
+ String selectedMedia = htiProps.getString( "selectedMedia" );
+ if( selectedMedia == null ||
+ selectedMedia.equalsIgnoreCase( "socket" ) )
+ {
+ // use the socket connection
+
+ // get the host name for socket connection
+ // String socketHost = properties.getProperty( "socketHost" );
+ String socketHost = htiProps.getString( "socketHost" );
+ if( socketHost == null ) socketHost = "localhost";
+
+ // get the socket port
+ int socketPort = 2000; // default value
+ try
+ {
+ socketPort = htiProps.getInt( "socketPort" );
+ }
+ catch( Exception e )
+ {
+ // ignore, port value is left to default value.
+ }
+
+ // get the default socket timeout value
+ defaultSocketTimeout = 10000;
+ try
+ {
+ defaultSocketTimeout = htiProps.getInt( "socketTimeout" );
+ }
+ catch( Exception e )
+ {
+ // ignore, timeout value is left to default value.
+ }
+ setSocketTimeout( defaultSocketTimeout );
+
+ // open the socket
+ s = new Socket( socketHost, socketPort );
+
+ // open the streams
+ in = s.getInputStream();
+ out = s.getOutputStream();
+ }
+ else
+ {
+ // use the serial connection
+
+ throw new Exception( "Serial connection not supported" );
+/*
+ // get the port to use
+ // String portName = properties.getProperty( "portName" );
+ String portName = htiProps.getString( "portName" );
+ if( portName == null ) portName = "COM1";
+
+ // get the speed of the COM port
+ int portSpeed = 115200; // default value
+ try
+ {
+ portSpeed = htiProps.getInt( "portSpeed" );
+ }
+ catch( Exception e )
+ {
+ // ignore, port value is left to default value.
+ }
+
+ // open the serial port
+ CommPortIdentifier portId =
+ CommPortIdentifier.getPortIdentifier( portName );
+ SerialPort serialPort =
+ (SerialPort) portId.open( "HtiSystemTest", 10000 );
+
+ // set serial port settings
+ int flow = SerialPort.FLOWCONTROL_RTSCTS_IN |
+ SerialPort.FLOWCONTROL_RTSCTS_OUT;
+ serialPort.setFlowControlMode( flow );
+ serialPort.setSerialPortParams( portSpeed,
+ SerialPort.DATABITS_8,
+ SerialPort.STOPBITS_1,
+ SerialPort.PARITY_NONE );
+
+ // open streams
+ in = serialPort.getInputStream();
+ out = serialPort.getOutputStream();
+*/
+ }
+ }
+
+
+//==============================================================================
+//Protected attributes
+
+//==============================================================================
+//Private attributes
+
+ private Socket s;
+ private InputStream in;
+ private OutputStream out;
+ private static Vector container = new Vector( 1, 1 );
+ private int defaultSocketTimeout;
+
+//==============================================================================
+//Static initialization block
+
+//==============================================================================
+//Inner classes
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/src/com/nokia/hti/common/HtiConstants.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1548 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Helper class containing HTI related constant used in
+* other classes.
+*
+*/
+
+package com.nokia.hti.common;
+
+public class HtiConstants
+{
+//==============================================================================
+//Public constants
+
+ // Application UID's
+ public static final int APP_UID_HTIADMIN = 0x1020DEB5;
+ public static final int APP_UID_PHONEBOOK = 0x101F4CCE;
+ public static final int APP_UID_DUMMY = 0x1030DEB6;
+ public static final int APP_UID_GALLERY = 0x101f8599;
+
+ // service UID's
+ public static final int SERVICE_UID_HTI = 0x1020DEB6;
+ public static final int SERVICE_UID_ECHO = 0x1020DEBF;
+ public static final int SERVICE_UID_SCREEN = 0x1020DEC3;
+ public static final int SERVICE_UID_KEYEVENT = 0x1020DEC1;
+ public static final int SERVICE_UID_FTP = 0x1020DEC5;
+ public static final int SERVICE_UID_APP = 0x1020DEC7;
+ public static final int SERVICE_UID_STIF = 0x10210CC3;
+ public static final int SERVICE_UID_SYSINFO = 0x10210CC7;
+ public static final int SERVICE_UID_AUDIO = 0x10210CCB;
+ public static final int SERVICE_UID_PIM = 0x10210CCD;
+ public static final int SERVICE_UID_MESSAGES = 0x10210CCF;
+ public static final int SERVICE_UID_ISIMSG = 0x10210CD1;
+ public static final int SERVICE_UID_IPPROXY = 0x10210CD3;
+ public static final int SERVICE_UID_SUT = 0x10210CD7;
+
+ // platform versions
+ public static final double PLATFORM_VERSION_S60_2_6 = 2.6;
+ public static final double PLATFORM_VERSION_S60_2_8 = 2.8;
+ public static final double PLATFORM_VERSION_S60_3_0 = 2.9;
+ public static final double PLATFORM_VERSION_S60_3_1 = 3.1;
+ public static final double PLATFORM_VERSION_S60_3_2 = 3.2;
+ public static final double PLATFORM_VERSION_S60_5_0 = 5.0;
+ public static final double PLATFORM_VERSION_S60_5_1 = 5.1;
+ public static final double PLATFORM_VERSION_S60_5_2 = 5.2;
+
+ // service names
+ public static final String SERVICE_NAME_HTI = "HTI system service";
+ public static final String SERVICE_NAME_ECHO = "Echo(ping) service";
+ public static final String SERVICE_NAME_SCREEN = "Screenshot service";
+ public static final String SERVICE_NAME_KEYEVENT = "Key event service";
+ public static final String SERVICE_NAME_FTP = "FTP service";
+ public static final String SERVICE_NAME_APP = "Application control service";
+ public static final String SERVICE_NAME_STIF = "STIF TF Control Service";
+ public static final String SERVICE_NAME_SYSINFO = "SysInfo service";
+ public static final String SERVICE_NAME_AUDIO = "Audio Control Service";
+ public static final String SERVICE_NAME_PIM = "Personal information " +
+ "manager service";
+ public static final String SERVICE_NAME_MESSAGES = "Message management " +
+ "service (inbox etc.)";
+ public static final String SERVICE_NAME_ISIMSG = "ISI message service";
+ public static final String SERVICE_NAME_IPPROXY = "IP-Proxy service";
+
+ // HTI error codes
+ public static final int ERROR_HTI_MSG_TOO_BIG = 0x01;
+ public static final int ERROR_HTI_OUT_OF_MEMORY = 0x02;
+ public static final int ERROR_HTI_SERVICE_NOT_FOUND = 0x03;
+ public static final int ERROR_HTI_SERVICE_ERROR = 0x04;
+ public static final int ERROR_HTI_NOT_AUTHORIZED = 0x05;
+ public static final int ERROR_HTI_FAILED_UNWRAP = 0x06;
+
+ // HTI system service commands
+ public static final int CMD_HTI_AUTH = 0x01;
+ public static final int CMD_HTI_VERSION = 0x02;
+ public static final int CMD_HTI_SERVICE_LIST = 0x03;
+ public static final int CMD_HTI_STOP = 0x04;
+ public static final int CMD_HTI_REBOOT = 0x05;
+ public static final int CMD_HTI_FORMAT = 0x06;
+ public static final int CMD_HTI_RESET = 0x07;
+ public static final int CMD_HTI_SHOW_CONSOLE = 0x08;
+ public static final int CMD_HTI_HIDE_CONSOLE = 0x09;
+ public static final int CMD_HTI_INSTANCE_ID = 0x0A;
+ public static final int CMD_HTI_DEBUG_PRINT = 0x0B;
+ public static final int CMD_HTI_ERROR = 0xFF;
+
+ // SCREEN service commands
+ public static final int CMD_SCREEN_SCREEN = 0x01;
+ public static final int CMD_SCREEN_REGION = 0x02;
+ public static final int CMD_SCREEN_SCREEN_ZIP = 0x03;
+ public static final int CMD_SCREEN_REGION_ZIP = 0x04;
+ public static final int CMD_SCREEN_TEXT_RECOG = 0x10;
+ public static final int CMD_SCREEN_TEXT_RECOG_U = 0x11;
+ public static final int CMD_SCREEN_TEXT_BITMAP = 0x12;
+ public static final int CMD_SCREEN_TEXT_BITMAP_U = 0x13;
+ public static final int CMD_SCREEN_SCREEN_SERIES = 0x21;
+ public static final int CMD_SCREEN_REGION_SERIES = 0x22;
+ public static final int CMD_SCREEN_SCREEN_ZIP_SERIES = 0x23;
+ public static final int CMD_SCREEN_REGION_ZIP_SERIES = 0x24;
+ public static final int CMD_SCREEN_SELECT = 0x30;
+ public static final int CMD_SCREEN_MODE = 0x3A;
+ public static final int CMD_SCREEN_DELTA = 0x81;
+ public static final int CMD_SCREEN_REGION_DELTA = 0x82;
+ public static final int CMD_SCREEN_DELTA_ZIP = 0x83;
+ public static final int CMD_SCREEN_REGION_DELTA_ZIP = 0x84;
+ public static final int CMD_SCREEN_DELTA_RESET = 0x85;
+
+ // Font attributes
+ public static final int FONT_BOLD = 0x01;
+ public static final int FONT_ITALIC = 0x02;
+ public static final int FONT_BITMAP_GLYPH = 0x04;
+ public static final int FONT_SUPERSCRIPT = 0x08;
+ public static final int FONT_SUBSCRIPT = 0x18;
+
+ // Text recognition responses
+ public static final int TEXT_RECOG_OK = 0xF0;
+ public static final int TEXT_RECOG_NOT_FOUND = 0xF1;
+
+ // Color depth used in screen capture commands
+ public static final int COLOR_DEPTH_NONE = 0x00;
+ public static final int COLOR_DEPTH_GRAY_2 = 0x01;
+ public static final int COLOR_DEPTH_GRAY_4 = 0x02;
+ public static final int COLOR_DEPTH_GRAY_16 = 0x03;
+ public static final int COLOR_DEPTH_GRAY_256 = 0x04;
+ public static final int COLOR_DEPTH_COLOR_16 = 0x05;
+ public static final int COLOR_DEPTH_COLOR_256 = 0x06;
+ public static final int COLOR_DEPTH_COLOR_64K = 0x07;
+ public static final int COLOR_DEPTH_COLOR_16M = 0x08;
+ public static final int COLOR_DEPTH_RGB = 0x09;
+ public static final int COLOR_DEPTH_COLOR_4K = 0x0A;
+ public static final int COLOR_DEPTH_COLOR_16MU = 0x0B;
+ public static final int COLOR_DEPTH_COLOR_16MA = 0x0C;
+
+ // KEYEVENT service commands
+ public static final int CMD_KEYEVENT_PRESSKEY = 0x01;
+ public static final int CMD_KEYEVENT_KEYDOWN = 0x02;
+ public static final int CMD_KEYEVENT_KEYUP = 0x03;
+ public static final int CMD_KEYEVENT_TYPETEXT = 0x04;
+ public static final int CMD_KEYEVENT_LONGKEYPRESS = 0x05;
+ public static final int CMD_KEYEVENT_TYPETEXTPW = 0x06;
+ public static final int CMD_KEYEVENT_KEY_SEQUENCE = 0x07;
+ public static final int CMD_POINTEREVENT_TAP = 0x10;
+ public static final int CMD_POINTEREVENT_TAP_DRAG = 0x11;
+ public static final int CMD_POINTEREVENT_MULTIPOINT = 0x12;
+ public static final int CMD_POINTEREVENT_DOWN = 0x13;
+ public static final int CMD_POINTEREVENT_UP = 0x14;
+ public static final int CMD_KEYEVENT_OK = 0xFF;
+
+ // KEYEVENT error codes
+ public static final int ERROR_KEYEVENT_NO_COMMAND = 0x01;
+ public static final int ERROR_KEYEVENT_INVALID_COMMAND = 0x02;
+ public static final int ERROR_KEYEVENT_NOT_READY = 0x03;
+ public static final int ERROR_KEYEVENT_INVALID_SCANCODE = 0x80;
+ public static final int ERROR_KEYEVENT_NO_TEXT = 0x90;
+ public static final int ERROR_KEYEVENT_INVALID_TEXT = 0x91;
+
+ // FTP service commands
+ public static final int CMD_FTP_STOR = 0x02;
+ public static final int CMD_FTP_STOR_U = 0x03;
+ public static final int CMD_FTP_RETR = 0x04;
+ public static final int CMD_FTP_RETR_U = 0x05;
+ public static final int CMD_FTP_LIST = 0x06;
+ public static final int CMD_FTP_LIST_U = 0x07;
+ public static final int CMD_FTP_MKD = 0x08;
+ public static final int CMD_FTP_MKD_U = 0x09;
+ public static final int CMD_FTP_RMD = 0x0A;
+ public static final int CMD_FTP_RMD_U = 0x0B;
+ public static final int CMD_FTP_DELE = 0x0C;
+ public static final int CMD_FTP_DELE_U = 0x0D;
+ public static final int CMD_FTP_CANCEL = 0x0E;
+ public static final int CMD_FTP_FILESIZE = 0x0F;
+ public static final int CMD_FTP_LISTDIR = 0x10;
+ public static final int CMD_FTP_LISTDIR_U = 0x11;
+ public static final int CMD_FTP_LISTSIZES = 0x12;
+ public static final int CMD_FTP_LISTSIZES_U = 0x13;
+ public static final int CMD_FTP_LISTDRIVES = 0x14;
+ public static final int CMD_FTP_LISTDRIVES_U = 0x15;
+ public static final int CMD_FTP_RENAME = 0x16;
+ public static final int CMD_FTP_RENAME_U = 0x17;
+ public static final int CMD_FTP_COPY = 0x18;
+ public static final int CMD_FTP_COPY_U = 0x19;
+ public static final int CMD_FTP_MOVE = 0x1A;
+ public static final int CMD_FTP_MOVE_U = 0x1B;
+ public static final int CMD_FTP_SETFORCE = 0x20;
+ public static final int CMD_FTP_CHECKSUM = 0x30;
+ public static final int CMD_FTP_CHECKSUM_U = 0x31;
+ public static final int CMD_FTP_FORMAT = 0x40;
+ public static final int CMD_FTP_OK = 0xF0;
+
+ // FTP checksum algorithms
+ public static final int CHECKSUM_ALGORITHM_MD5 = 0x01;
+
+ // APP service commands
+ public static final int CMD_APP_START_PROCESS = 0x02;
+ public static final int CMD_APP_START_PROCESS_U = 0x03;
+ public static final int CMD_APP_STATUS_PROCESS = 0x04;
+ public static final int CMD_APP_STATUS_PROCESS_U = 0x05;
+ public static final int CMD_APP_STATUS_PROCESS_ID = 0x06;
+ public static final int CMD_APP_STOP_PROCESS = 0x08;
+ public static final int CMD_APP_STOP_PROCESS_U = 0x09;
+ public static final int CMD_APP_STOP_PROCESS_ID = 0x0A;
+ public static final int CMD_APP_LIST_PROCESSES = 0x0C;
+ public static final int CMD_APP_LIST_PROCESSES_U = 0x0D;
+
+ public static final int CMD_APP_START_PROCESS_STORE_HANDLE = 0x0E;
+ public static final int CMD_APP_START_PROCESS_STORE_HANDLE_U = 0x07;
+ public static final int CMD_APP_GET_PROCESS_EXIT_CODE = 0x0B;
+
+ public static final int CMD_APP_START_APP = 0x10;
+ public static final int CMD_APP_START_APP_U = 0x11;
+ public static final int CMD_APP_START_APP_UID = 0x12;
+ public static final int CMD_APP_START_APP_UID_U = 0x13;
+ public static final int CMD_APP_START_DOC = 0x14;
+ public static final int CMD_APP_START_DOC_U = 0x15;
+ public static final int CMD_APP_STATUS_APP = 0x16;
+ public static final int CMD_APP_STATUS_APP_U = 0x17;
+ public static final int CMD_APP_STATUS_DOC = 0x18;
+ public static final int CMD_APP_STATUS_DOC_U = 0x19;
+ public static final int CMD_APP_STATUS_APP_UID = 0x1A;
+ public static final int CMD_APP_STOP_APP = 0x1C;
+ public static final int CMD_APP_STOP_APP_U = 0x1D;
+ public static final int CMD_APP_STOP_DOC = 0x1E;
+ public static final int CMD_APP_STOP_DOC_U = 0x1F;
+ public static final int CMD_APP_STOP_APP_UID = 0x20;
+ public static final int CMD_APP_LIST_APPS = 0x24;
+ public static final int CMD_APP_LIST_APPS_U = 0x25;
+ public static final int CMD_APP_LIST_INSTALLED = 0x26;
+ public static final int CMD_APP_LIST_INSTALLED_U = 0x27;
+ public static final int CMD_APP_INSTALL = 0x30;
+ public static final int CMD_APP_INSTALL_U = 0x31;
+ public static final int CMD_APP_UNINSTALL = 0x32;
+ public static final int CMD_APP_UNINSTALL_NAME_U = 0x33;
+ public static final int CMD_APP_UNINSTALL_NAME = 0x34;
+
+ // APP service responses
+ public static final int RESP_APP_OK = 0xF0;
+ public static final int RESP_APP_NOT_FOUND = 0xF1;
+ public static final int RESP_APP_ALREADY_RUNNING = 0xF2;
+ public static final int RESP_APP_RUNNING = 0xF4;
+
+ // STIF service commands
+ public static final int CMD_STIF_OPEN = 0x01;
+ public static final int CMD_STIF_CLOSE = 0x02;
+ public static final int CMD_STIF_LOAD_MODULE = 0x03;
+ public static final int CMD_STIF_UNLOAD_MODULE = 0x04;
+ public static final int CMD_STIF_LIST_CASES = 0x05;
+ public static final int CMD_STIF_START_CASE = 0x06;
+ public static final int CMD_STIF_CANCEL_CASE = 0x07;
+ public static final int CMD_STIF_PAUSE_CASE = 0x08;
+ public static final int CMD_STIF_RESUME_CASE = 0x09;
+ public static final int CMD_STIF_ADD_CASE_FILE = 0x0A;
+ public static final int CMD_STIF_REMOVE_CASE_FILE = 0x0B;
+ public static final int CMD_STIF_CASE_MESSAGE = 0x0C;
+ public static final int CMD_STIF_SET_DEVICEID = 0x0D;
+ public static final int CMD_STIF_TEST_COMPLETED = 0x0E;
+ public static final int CMD_STIF_ATS_MESSAGE = 0x0F;
+
+ // SUT service commands
+ public static final int CMD_SUT_OPEN = 0x01;
+ public static final int CMD_SUT_CLOSE = 0x02;
+ public static final int CMD_SUT_LIST_CASES = 0x03;
+ public static final int CMD_SUT_START_CASE = 0x04;
+ public static final int CMD_SUT_START_ALL_CASES = 0x05;
+ public static final int CMD_SUT_TEST_COMPLETE = 0x06;
+
+ // SYSINFO service commands
+ public static final int CMD_SYSINFO_HAL = 0x01;
+ public static final int CMD_SYSINFO_IMEI = 0x02;
+ public static final int CMD_SYSINFO_SWVERSION = 0x03;
+ public static final int CMD_SYSINFO_LANGVERSION = 0x04;
+ public static final int CMD_SYSINFO_SWLANGVERSION = 0x05;
+ public static final int CMD_SYSINFO_UASTRING = 0x06;
+ public static final int CMD_SYSINFO_FREE_RAM = 0x07;
+ public static final int CMD_SYSINFO_USED_RAM = 0x08;
+ public static final int CMD_SYSINFO_TOTAL_RAM = 0x09;
+ public static final int CMD_SYSINFO_EAT_RAM = 0x0A;
+ public static final int CMD_SYSINFO_RELEASE_RAM = 0x0B;
+ public static final int CMD_SYSINFO_FREE_DISK_SPACE = 0x0C;
+ public static final int CMD_SYSINFO_USED_DISK_SPACE = 0x0D;
+ public static final int CMD_SYSINFO_TOTAL_DISK_SPACE = 0x0E;
+ public static final int CMD_SYSINFO_EAT_DISK_SPACE = 0x0F;
+ public static final int CMD_SYSINFO_RELEASE_DISK_SPACE = 0x10;
+ public static final int CMD_SYSINFO_SET_HOMETIME = 0x20;
+ public static final int CMD_SYSINFO_GET_HOMETIME = 0x21;
+ public static final int CMD_SYSINFO_SET_DATE_TIME_FORMAT = 0x22;
+ public static final int CMD_SYSINFO_LIGHT_STATUS = 0x30;
+ public static final int CMD_SYSINFO_LIGHT_ON = 0x31;
+ public static final int CMD_SYSINFO_LIGHT_OFF = 0x32;
+ public static final int CMD_SYSINFO_LIGHT_BLINK = 0x33;
+ public static final int CMD_SYSINFO_LIGHT_RELEASE = 0x3A;
+ public static final int CMD_SYSINFO_SCREENSAVER_DISABLE = 0x40;
+ public static final int CMD_SYSINFO_SCREENSAVER_ENABLE = 0x41;
+ public static final int CMD_SYSINFO_SCREENSAVER_TIMEOUT = 0x42;
+ public static final int CMD_SYSINFO_GET_NETWORKMODE = 0x50;
+ public static final int CMD_SYSINFO_SET_NETWORKMODE = 0x51;
+ public static final int CMD_SYSINFO_SET_NETWORKMODE_NO_REBOOT = 0x52;
+ public static final int CMD_SYSINFO_HSDPA_ENABLE_DISABLE = 0x53;
+ public static final int CMD_SYSINFO_IR_ACTIVATE = 0x5A;
+ public static final int CMD_SYSINFO_BT_POWER = 0x5B;
+ public static final int CMD_SYSINFO_BT_SETTINGS = 0x5C;
+ public static final int CMD_SYSINFO_KEYLOCK_TOGGLE = 0x60;
+ public static final int CMD_SYSINFO_AUTO_KEYLOCK_TIME = 0x61;
+ public static final int CMD_SYSINFO_EMPTY_DRM_RIGHTS_DB = 0x65;
+ public static final int CMD_SYSINFO_BATTERY_STATUS = 0x70;
+ public static final int CMD_SYSINFO_SIGNAL_STRENGTH = 0x71;
+ public static final int CMD_SYSINFO_UPDATE_MEDIA_GALLERY = 0x7A;
+ public static final int CMD_SYSINFO_ACTIVATE_SKIN = 0x80;
+
+ public static final int LIGHT_TARGET_PRIMARY_DISPLAY = 0x01;
+ public static final int LIGHT_TARGET_PRIMARY_KEYBOARD = 0x02;
+ public static final int LIGHT_TARGET_SECONDARY_DISPLAY = 0x04;
+ public static final int LIGHT_TARGET_SECONDARY_KEYBOARD = 0x08;
+
+ public static final int LIGHT_STATUS_UNKNOWN = 0x00;
+ public static final int LIGHT_STATUS_ON = 0x01;
+ public static final int LIGHT_STATUS_OFF = 0x02;
+ public static final int LIGHT_STATUS_BLINK = 0x03;
+
+ // AUDIO service commands
+ public static final int CMD_AUDIO_LIST = 0x01;
+ public static final int CMD_AUDIO_PLAY_FILE = 0x02;
+ public static final int CMD_AUDIO_PLAY_TONE = 0x03;
+ public static final int CMD_AUDIO_PLAY_DTMF = 0x04;
+ public static final int CMD_AUDIO_STOP = 0x05;
+ public static final int CMD_AUDIO_GET_DURATION = 0x06;
+ public static final int CMD_AUDIO_GET_MAX_VOL = 0x07;
+ public static final int CMD_AUDIO_SET_VOL = 0x08;
+
+ // PIM service commands
+ public static final int CMD_PIM_IMPORT_VCARD = 0x01;
+ public static final int CMD_PIM_IMPORT_VCALENDAR = 0x02;
+ public static final int CMD_PIM_DEL_CONTACT_ENTRIES = 0x03;
+ public static final int CMD_PIM_DEL_CALENDAR_ENTRIES = 0x04;
+ public static final int CMD_PIM_ADD_NOTEPAD_MEMO = 0x05;
+ public static final int CMD_PIM_ADD_NOTEPAD_MEMO_FROM_FILE = 0x06;
+ public static final int CMD_PIM_DEL_ALL_NOTEPAD_MEMOS = 0x07;
+ public static final int CMD_PIM_SIM_CARD_INFO = 0x10;
+ public static final int CMD_PIM_IMPORT_SIM_CONTACT = 0x11;
+ public static final int CMD_PIM_DELETE_SIM_CONTACT = 0x12;
+ public static final int CMD_PIM_CREATE_BOOKMARK = 0x1A;
+ public static final int CMD_PIM_DELETE_BOOKMARK = 0x1B;
+ public static final int CMD_PIM_OK = 0xFF;
+
+ public static final int SIM_FIELD_TYPE_NAME = 0x01;
+ public static final int SIM_FIELD_TYPE_2ND_NAME = 0x02;
+ public static final int SIM_FIELD_TYPE_PHONE_NUMBER = 0x03;
+ public static final int SIM_FIELD_TYPE_EMAIL = 0x04;
+ public static final int SIM_FIELD_TYPE_ADDITIONAL_NUMBER = 0x05;
+
+ // MESSAGES service commands
+ public static final int CMD_MSGS_ADD_SMS = 0x01;
+ public static final int CMD_MSGS_ADD_MMS = 0x02;
+ public static final int CMD_MSGS_ADD_EMAIL = 0x03;
+ public static final int CMD_MSGS_ADD_IRDA_MSG = 0x04;
+ public static final int CMD_MSGS_ADD_BT_MSG = 0x05;
+ public static final int CMD_MSGS_ADD_SMART_MSG = 0x06;
+ public static final int CMD_MSGS_ADD_AUDIO_MSG = 0x07;
+ public static final int CMD_MSGS_DELETE_MESSAGE = 0x10;
+ public static final int CMD_MSGS_DELETE_FOLDER_CONTENT = 0x11;
+ public static final int CMD_MSGS_CREATE_MAILBOX = 0x20;
+ public static final int CMD_MSGS_DELETE_MAILBOX = 0x21;
+ public static final int CMD_MSGS_CREATE_ACCESSPOINT = 0x30;
+ public static final int CMD_MSGS_DELETE_ACCESSPOINT = 0x31;
+ public static final int CMD_MSGS_CREATE_DESTINATION = 0x32;
+ public static final int CMD_MSGS_DELETE_DESTINATION = 0x33;
+ public static final int CMD_MSGS_ADD_TO_DESTINATION = 0x34;
+ public static final int CMD_MSGS_REMOVE_FROM_DESTINATION = 0x35;
+ public static final int CMD_MSGS_SET_DEFAULT_CONNECTION = 0x36;
+ public static final int CMD_MSGS_SET_DEFAULT_SMS_CENTER = 0x40;
+ public static final int CMD_MSGS_DELETE_SMS_CENTER = 0x41;
+ public static final int CMD_MSGS_SET_SMS_SETTINGS = 0x42;
+ public static final int CMD_MSGS_SET_MMS_SETTINGS = 0x45;
+ public static final int CMD_MSGS_OK = 0xFF;
+
+ // MESSAGES folders
+ public static final int MESSAGES_FOLDER_ALL = 0x00;
+ public static final int MESSAGES_FOLDER_INBOX = 0x01;
+ public static final int MESSAGES_FOLDER_DRAFTS = 0x02;
+ public static final int MESSAGES_FOLDER_SENT = 0x03;
+ public static final int MESSAGES_FOLDER_OUTBOX = 0x04;
+
+ // MESSAGES message types
+ public static final int MESSAGES_MSG_TYPE_ALL = 0x00;
+ public static final int MESSAGES_MSG_TYPE_SMS = 0x01;
+ public static final int MESSAGES_MSG_TYPE_MMS = 0x02;
+ public static final int MESSAGES_MSG_TYPE_SMART_MESSAGE = 0x03;
+ public static final int MESSAGES_MSG_TYPE_EMAIL = 0x04;
+ public static final int MESSAGES_MSG_TYPE_IR_MESSAGE = 0x05;
+ public static final int MESSAGES_MSG_TYPE_BT_MESSAGE = 0x06;
+ public static final int MESSAGES_MSG_TYPE_AUDIO_MESSAGE = 0x07;
+
+ // MESSAGES service error codes
+ public static final int ERROR_MSGS_MISSING_COMMANDS = 0x01;
+ public static final int ERROR_MSGS_UNRECOGNIZED_COMMAND = 0x02;
+ public static final int ERROR_MSGS_INVALID_PARAMETERS = 0x03;
+ public static final int ERROR_MSGS_INVALID_ID = 0x04;
+ public static final int ERROR_MSGS_INVALID_FOLDER = 0x05;
+ public static final int ERROR_MSGS_SMS_BODY_TOO_LONG = 0x06;
+
+ // SMS settings related enumerations
+ public static final int SMS_CHAR_SUPPORT_REDUCED = 0x00;
+ public static final int SMS_CHAR_SUPPORT_FULL = 0x01;
+
+ public static final int SMS_VALIDITY_PERIOD_MAX = 0x00;
+ public static final int SMS_VALIDITY_PERIOD_1H = 0x01;
+ public static final int SMS_VALIDITY_PERIOD_6H = 0x02;
+ public static final int SMS_VALIDITY_PERIOD_24H = 0x03;
+ public static final int SMS_VALIDITY_PERIOD_3D = 0x04;
+ public static final int SMS_VALIDITY_PERIOD_1W = 0x05;
+
+ public static final int SMS_CONVERSION_NONE = 0x00;
+ public static final int SMS_CONVERSION_FAX = 0x01;
+ public static final int SMS_CONVERSION_PAGING = 0x02;
+ public static final int SMS_CONVERSION_EMAIL = 0x03;
+
+ public static final int SMS_PREFERRED_CONNECTION_GSM = 0x00;
+ public static final int SMS_PREFERRED_CONNECTION_PACKET = 0x01;
+
+ // MMS settings related enumerations
+ public static final int MMS_CREATION_MODE_RESTRICTED = 0x00;
+ public static final int MMS_CREATION_MODE_GUIDED = 0x01;
+ public static final int MMS_CREATION_MODE_FREE = 0x02;
+
+ public static final int MMS_IMAGE_SIZE_SMALL = 0x00;
+ public static final int MMS_IMAGE_SIZE_LARGE = 0x01;
+ public static final int MMS_IMAGE_SIZE_ORIGINAL = 0x02;
+
+ public static final int MMS_RECEPTION_AUTOMATIC_ALWAYS = 0x00;
+ public static final int MMS_RECEPTION_AUTOMATIC_IN_HOME_NETWORK = 0x01;
+ public static final int MMS_RECEPTION_MANUAL_ALWAYS = 0x02;
+ public static final int MMS_RECEPTION_DISABLED = 0x03;
+
+ public static final int MMS_VALIDITY_PERIOD_MAX = 0x00;
+ public static final int MMS_VALIDITY_PERIOD_1H = 0x01;
+ public static final int MMS_VALIDITY_PERIOD_6H = 0x02;
+ public static final int MMS_VALIDITY_PERIOD_24H = 0x03;
+ public static final int MMS_VALIDITY_PERIOD_3D = 0x04;
+ public static final int MMS_VALIDITY_PERIOD_1W = 0x05;
+
+
+ // MAILBOX related stuff
+ public static final int MAILBOX_TYPE_POP3 = 0;
+ public static final int MAILBOX_TYPE_IMAP = 1;
+
+ public static final int MAILBOX_IN_SECURITY_OFF = 0;
+ public static final int MAILBOX_IN_SECURITY_START_TLS = 1;
+ public static final int MAILBOX_IN_SECURITY_SSL_TLS = 2;
+
+ public static final int MAILBOX_OUT_SECURITY_OFF = 0;
+ public static final int MAILBOX_OUT_SECURITY_START_TLS = 1;
+ public static final int MAILBOX_OUT_SECURITY_SSL_TLS = 2;
+
+ public static final int MAILBOX_SEND_MSG_IMMEDIATELY = 0;
+ public static final int MAILBOX_SEND_MSG_ON_NEXT_CONN = 1;
+ public static final int MAILBOX_SEND_MSG_ON_REQUEST = 2;
+
+ public static final int MAILBOX_COPY_TO_OWN_NONE = 0;
+ public static final int MAILBOX_COPY_TO_OWN_TO = 1;
+ public static final int MAILBOX_COPY_TO_OWN_CC = 2;
+ public static final int MAILBOX_COPY_TO_OWN_BCC = 3;
+
+ public static final int MAILBOX_RETRIEVE_ONLY_HEADER = 0;
+ public static final int MAILBOX_RETRIEVE_SIZE_LIMIT = 1;
+ public static final int MAILBOX_RETRIEVE_BODY_AND_ATTACHMENT = 2;
+
+ public static final int MAILBOX_AUTO_UPDATE_ALWAYS_ON = 0;
+ public static final int MAILBOX_AUTO_UPDATE_IN_HOME_NETWORK = 1;
+ public static final int MAILBOX_AUTO_UPDATE_NOT_ENABLED = 2;
+
+ // Test SIM numbers
+ public static final String HTI_TEST_SIM_1 = "+3584544108884";
+ public static final String HTI_TEST_SIM_2 = "+3584544108885";
+ public static final String HTI_TEST_SIM_3 = "+3584544108886";
+
+ public static final String TOOLS_TEST_SIM_1 ="+3584544267199";
+ public static final String TOOLS_TEST_SIM_2 ="+3584544267200";
+ public static final String TOOLS_TEST_SIM_3 ="+3584544267201";
+ public static final String TOOLS_TEST_SIM_4 ="+3584544267202";
+
+ // Capabilities of our NTN SIM cards
+ public static final int SIMCARD_MAXNUMOFSECONDNAMES = 1;
+ public static final int SIMCARD_MAXNUMOFADDITIONALNUMS = 1;
+ public static final int SIMCARD_MAXNUMOFEMAILS = 1;
+ public static final int SIMCARD_MAXLENGTHOFNAME = 24;
+ public static final int SIMCARD_MAXLENGTHOFNUMBER = 50;
+ public static final int SIMCARD_MAXLENGTHOFSECONDNAME = 24;
+ public static final int SIMCARD_MAXLENGTHOFADDITIONALNUM = 50;
+ public static final int SIMCARD_MAXLENGHTOFEMAIL = 40;
+ public static final int SIMCARD_TOTALSLOTS = 50;
+
+ // SIS install related constants
+ public static final String DUMMY_SIS_UPLOAD_PATH = "C:\\Dummy.sisx";
+ public static final int INSTALLER_MIME_TYPE_SISX = 0;
+ public static final int INSTALLER_MIME_TYPE_SIS = 1;
+ public static final int INSTALLER_MIME_TYPE_PIP = 2;
+ public static final int INSTALLER_MIME_TYPE_JAD = 3;
+ public static final int INSTALLER_MIME_TYPE_JAR = 4;
+ public static final int INSTALLER_MIME_TYPE_JAVA = 5;
+ public static final int INSTALLER_MIME_TYPE_JARX = 6;
+
+ // Screen sizes
+ public static final int SCREEN_WIDTH_LEGACY = 176;
+ public static final int SCREEN_HEIGHT_LEGACY = 208;
+ public static final int SCREEN_WIDTH_QVGA = 240;
+ public static final int SCREEN_HEIGHT_QVGA = 320;
+ public static final int SCREEN_WIDTH_DOUBLE = 352;
+ public static final int SCREEN_HEIGHT_DOUBLE = 416;
+ public static final int SCREEN_WIDTH_VGA = 480;
+ public static final int SCREEN_HEIGHT_VGA = 640;
+ public static final int SCREEN_WIDTH_WVGA = 360;
+ public static final int SCREEN_HEIGHT_WVGA = 640;
+
+ // Memory card format options
+ public static final int FTP_FORMAT_OPTION_FULL = 0;
+ public static final int FTP_FORMAT_OPTION_QUICK = 1;
+
+ // Machine UID numbers for detecting hardware
+ public static final int MACHINE_UID_CHARLIE = 0x101fbb55;
+ public static final int MACHINE_UID_MARS = 0x10274cd3;
+ public static final int MACHINE_UID_MARS_S5_3 = 0x20001856;
+ public static final int MACHINE_UID_ZEUS_S4_1 = 0x20001857;
+ public static final int MACHINE_UID_ZEUS = 0x10274cd5;
+ public static final int MACHINE_UID_THUNDER = 0x200005f8;
+ public static final int MACHINE_UID_SCARFE = 0x10208558;
+ public static final int MACHINE_UID_ROSETTA = 0x20000606;
+ public static final int MACHINE_UID_AALTO_B2_B3 = 0x2000060B;
+ public static final int MACHINE_UID_SCHNAPPI_B2 = 0x2000060A;
+ public static final int MACHINE_UID_DEVLON = 0x101FB3E8;
+ public static final int MACHINE_UID_VEGA = 0x20002d7b;
+ public static final int MACHINE_UID_ARIANE_B4 = 0x019CC530;
+ public static final int MACHINE_UID_MERLIN = 0x20002D81;
+ public static final int MACHINE_UID_LUMIERE = 0x20002D82;
+ public static final int MACHINE_UID_GADGET = 0x20002D86;
+ public static final int MACHINE_UID_TUBE = 0x2000Da56;
+ public static final int MACHINE_UID_IVALO = 0x20014DDD;
+ public static final int MACHINE_UID_COROLLA = 0x20014DDF;
+ public static final int MACHINE_UID_VASCO = 0x101FB3E8; // == Devlon, not final?
+ public static final int MACHINE_UID_WINS = 0x10005f62;
+
+
+ /*
+ * Common constants for test cases
+ * These can be overridden in platform and/or hardware specific constants
+ */
+ public static final String FTP_UPLOAD_DESTINATION = "C:\\testfile.hti";
+ public static final String MESSAGE_ATTACHMENT_PATH = "C:\\hti.jpg";
+ public static final String AUDIO_ATTACHMENT_PATH = "C:\\hti.amr";
+ public static final String GALLERY_IMAGE_PATH = "C:\\Data\\Images\\";
+ public static final int UPLOAD_FILE_SIZE_BYTES = 20 * 1024;
+ public static final int PRESS_MANY_KEYS_CYCLES = 50;
+
+ /*
+ * Platform specific constants for test cases
+ * These can be overridden in hardware specific constants
+ */
+
+ // S60 2.6
+ public static final String S60_2_6_EXE_PATH = "C:\\System\\Programs\\dummy.exe";
+ public static final String S60_2_6_APP_PATH = "C:\\System\\Apps\\HtiAdmin\\HtiAdmin.app";
+ public static final String S60_2_6_APP_NO_PATH = "htiadmin.app";
+ public static final String S60_2_6_APP_NAME = "HtiAdmin";
+ public static final String S60_2_6_DOC_PATH = "Z:\\Nokia\\Sounds\\Digital\\Nokia tune.mid";
+ public static final String S60_2_6_MIDI_FILE_PATH = "Z:\\Nokia\\Sounds\\Digital\\Message.mid";
+ public static final String S60_2_6_RNG_FILE_PATH = "Z:\\Nokia\\Sounds\\Simple\\Desk phone.rng";
+ public static final String S60_2_6_AUDIO_FILE_LIST_PATH = "Z:\\Nokia\\Sounds\\Digital\\";
+ public static final String S60_2_6_CONTACT_DB_PATH = "C:\\System\\Data\\Contacts.cdb";
+ public static final String S60_2_6_APP_CAPTION_FONT_TYPEFACE = "LatinBold19";
+ public static final int S60_2_6_APP_CAPTION_FONT_HEIGHT = 0;
+ public static final int S60_2_6_APP_CAPTION_FONT_STYLE = 0;
+ public static final String S60_2_6_SMS_TEXT_FONT_TYPEFACE = "LatinBold12";
+ public static final int S60_2_6_SMS_TEXT_FONT_HEIGHT = 0;
+ public static final int S60_2_6_SMS_TEXT_FONT_STYLE = 0;
+
+ // S60 3.0
+ public static final String S60_3_0_EXE_PATH = "C:\\sys\\bin\\dummy.exe";
+ public static final String S60_3_0_APP_PATH = "C:\\sys\\bin\\htiadmin.exe";
+ public static final String S60_3_0_APP_NO_PATH = "htiadmin.exe";
+ public static final String S60_3_0_APP_NAME = "HtiAdmin";
+ public static final String S60_3_0_DOC_PATH = "Z:\\Nokia\\Images\\Pictures\\1.ota";
+ public static final String S60_3_0_MIDI_FILE_PATH = "Z:\\data\\Sounds\\Digital\\Message.mid";
+ public static final String S60_3_0_RNG_FILE_PATH = "Z:\\data\\Sounds\\Simple\\Intro.rng";
+ public static final String S60_3_0_AUDIO_FILE_LIST_PATH = "Z:\\data\\Sounds\\Digital\\";
+ public static final String S60_3_0_CONTACT_DB_PATH = "C:\\private\\100012a5\\DBS_100065FF_Contacts.cdb";
+ public static final String S60_3_0_APP_CAPTION_FONT_TYPEFACE = "Series 60 Sans TitleSmBd";
+ public static final int S60_3_0_APP_CAPTION_FONT_HEIGHT = 970;
+ public static final int S60_3_0_APP_CAPTION_FONT_STYLE = 0;
+ public static final String S60_3_0_SMS_TEXT_FONT_TYPEFACE = "Series 60 Sans";
+ public static final int S60_3_0_SMS_TEXT_FONT_HEIGHT = 136;
+ public static final int S60_3_0_SMS_TEXT_FONT_STYLE = FONT_BOLD;
+
+ // S60 3.1
+ public static final String S60_3_1_EXE_PATH = "C:\\sys\\bin\\dummy.exe";
+ public static final String S60_3_1_APP_PATH = "C:\\sys\\bin\\htiadmin.exe";
+ public static final String S60_3_1_APP_NO_PATH = "htiadmin.exe";
+ public static final String S60_3_1_APP_NAME = "HtiAdmin";
+ public static final String S60_3_1_DOC_PATH = "Z:\\resource\\apps\\About.mbm";
+ public static final String S60_3_1_MIDI_FILE_PATH = "Z:\\data\\sounds\\digital\\Clock alert 2.mid";
+ public static final String S60_3_1_RNG_FILE_PATH = "Z:\\data\\Sounds\\Simple\\Beep.rng";
+ public static final String S60_3_1_AUDIO_FILE_LIST_PATH = "Z:\\data\\Sounds\\Digital\\";
+ public static final String S60_3_1_CONTACT_DB_PATH = "C:\\private\\100012a5\\DBS_100065FF_Contacts.cdb";
+ public static final String S60_3_1_APP_CAPTION_FONT_TYPEFACE = "Series 60 Hindi TitleSmB";
+ public static final int S60_3_1_APP_CAPTION_FONT_HEIGHT = 21;
+ public static final int S60_3_1_APP_CAPTION_FONT_STYLE = 0;
+ public static final String S60_3_1_SMS_TEXT_FONT_TYPEFACE = "Series 60 Hindi";
+ public static final int S60_3_1_SMS_TEXT_FONT_HEIGHT = 16;
+ public static final int S60_3_1_SMS_TEXT_FONT_STYLE = FONT_BOLD;
+
+ // S60 3.2
+ public static final String S60_3_2_EXE_PATH = "C:\\sys\\bin\\dummy.exe";
+ public static final String S60_3_2_APP_PATH = "Z:\\sys\\bin\\about.exe";
+ public static final String S60_3_2_APP_NO_PATH = "htiadmin.exe";
+ public static final String S60_3_2_APP_NAME = "HtiAdmin";
+ public static final String S60_3_2_DOC_PATH = "Z:\\resource\\apps\\About.mbm";
+ public static final String S60_3_2_MIDI_FILE_PATH = "Z:\\data\\sounds\\digital\\Nokia tune.aac";
+ public static final String S60_3_2_RNG_FILE_PATH = "Z:\\data\\Sounds\\Simple\\Beep.rng";
+ public static final String S60_3_2_AUDIO_FILE_LIST_PATH = "Z:\\data\\Sounds\\Digital\\";
+ public static final String S60_3_2_CONTACT_DB_PATH = "C:\\private\\10003a73\\contacts.cdb";
+ public static final String S60_3_2_APP_CAPTION_FONT_TYPEFACE = "Series 60 Sans TitleSmBd";
+ public static final int S60_3_2_APP_CAPTION_FONT_HEIGHT = 21;
+ public static final int S60_3_2_APP_CAPTION_FONT_STYLE = 0;
+ public static final String S60_3_2_SMS_TEXT_FONT_TYPEFACE = "Series 60 Sans";
+ public static final int S60_3_2_SMS_TEXT_FONT_HEIGHT = 16;
+ public static final int S60_3_2_SMS_TEXT_FONT_STYLE = FONT_BOLD;
+
+ // S60 5.0
+ public static final String S60_5_0_EXE_PATH = "C:\\sys\\bin\\dummy.exe";
+ public static final String S60_5_0_APP_PATH = "z:\\sys\\bin\\about.exe";
+ public static final String S60_5_0_APP_NO_PATH = "htiadmin.exe";
+ public static final String S60_5_0_APP_NAME = "HtiAdmin";
+ public static final String S60_5_0_DOC_PATH = "Z:\\resource\\apps\\About.mbm";
+ public static final String S60_5_0_MIDI_FILE_PATH = "Z:\\data\\sounds\\digital\\Message 1.aac";
+ public static final String S60_5_0_RNG_FILE_PATH = "Z:\\data\\Sounds\\Digital\\Beep.rng";
+ public static final String S60_5_0_AUDIO_FILE_LIST_PATH = "Z:\\data\\Sounds\\Digital\\";
+ public static final String S60_5_0_CONTACT_DB_PATH = "C:\\private\\10003a73\\contacts.cdb";
+ public static final String S60_5_0_APP_CAPTION_FONT_TYPEFACE = "Series 60 Sans TitleSmBd";
+ public static final int S60_5_0_APP_CAPTION_FONT_HEIGHT = 27;
+ public static final int S60_5_0_APP_CAPTION_FONT_STYLE = 0;
+ public static final String S60_5_0_SMS_TEXT_FONT_TYPEFACE = "Series 60 Sans";
+ public static final int S60_5_0_SMS_TEXT_FONT_HEIGHT = 21;
+ public static final int S60_5_0_SMS_TEXT_FONT_STYLE = FONT_BOLD;
+
+ // S60 5.1
+ public static final String S60_5_1_EXE_PATH = "C:\\sys\\bin\\dummy.exe";
+ public static final String S60_5_1_APP_PATH = "z:\\sys\\bin\\about.exe";
+ public static final String S60_5_1_APP_NO_PATH = "htiadmin.exe";
+ public static final String S60_5_1_APP_NAME = "HtiAdmin";
+ public static final String S60_5_1_DOC_PATH = "Z:\\resource\\apps\\About.mbm";
+ public static final String S60_5_1_MIDI_FILE_PATH = "Z:\\data\\sounds\\digital\\Message 1.aac";
+ public static final String S60_5_1_RNG_FILE_PATH = "Z:\\data\\sounds\\simple\\Beep.rng";
+ public static final String S60_5_1_AUDIO_FILE_LIST_PATH = "Z:\\data\\Sounds\\Digital\\";
+ public static final String S60_5_1_CONTACT_DB_PATH = "C:\\private\\10003a73\\contacts.cdb";
+ public static final String S60_5_1_APP_CAPTION_FONT_TYPEFACE = "Series 60 Sans TitleSmBd";
+ public static final int S60_5_1_APP_CAPTION_FONT_HEIGHT = 38;
+ public static final int S60_5_1_APP_CAPTION_FONT_STYLE = 0;
+ public static final String S60_5_1_SMS_TEXT_FONT_TYPEFACE = "Series 60 Sans";
+ public static final int S60_5_1_SMS_TEXT_FONT_HEIGHT = 29;
+ public static final int S60_5_1_SMS_TEXT_FONT_STYLE = FONT_BOLD;
+
+ // S60 5.2
+ public static final String S60_5_2_EXE_PATH = "C:\\sys\\bin\\dummy.exe";
+ public static final String S60_5_2_APP_PATH = "z:\\sys\\bin\\about.exe";
+ public static final String S60_5_2_APP_NO_PATH = "htiadmin.exe";
+ public static final String S60_5_2_APP_NAME = "HtiAdmin";
+ public static final String S60_5_2_DOC_PATH = "Z:\\resource\\apps\\About.mbm";
+ public static final String S60_5_2_MIDI_FILE_PATH = "Z:\\data\\sounds\\digital\\Message 1.aac";
+ public static final String S60_5_2_RNG_FILE_PATH = "Z:\\data\\sounds\\simple\\Beep.rng";
+ public static final String S60_5_2_AUDIO_FILE_LIST_PATH = "Z:\\data\\Sounds\\Digital\\";
+ public static final String S60_5_2_CONTACT_DB_PATH = "C:\\private\\10003a73\\SQLite__contacts.cdb";
+ public static final String S60_5_2_APP_CAPTION_FONT_TYPEFACE = "Series 60 Sans TitleSmBd";
+ public static final int S60_5_2_APP_CAPTION_FONT_HEIGHT = 27;
+ public static final int S60_5_2_APP_CAPTION_FONT_STYLE = 0;
+ public static final String S60_5_2_SMS_TEXT_FONT_TYPEFACE = "Series 60 Sans";
+ public static final int S60_5_2_SMS_TEXT_FONT_HEIGHT = 21;
+ public static final int S60_5_2_SMS_TEXT_FONT_STYLE = FONT_BOLD;
+
+ /*
+ * Hardware specific constants for test cases
+ * These can override the common and/or platform specific constants
+ */
+
+ // CHARLIE specific constants
+ public static final int CHARLIE_REBOOT_DELAY_MS = 45 * 1000;
+ public static final int CHARLIE_SCREEN_WIDTH = SCREEN_WIDTH_LEGACY;
+ public static final int CHARLIE_SCREEN_HEIGHT = SCREEN_HEIGHT_LEGACY;
+
+ // MARS specific constants
+ public static final int MARS_REBOOT_DELAY_MS = 50 * 1000;
+ public static final int MARS_SCREEN_WIDTH = SCREEN_WIDTH_DOUBLE;
+ public static final int MARS_SCREEN_HEIGHT = SCREEN_HEIGHT_DOUBLE;
+
+ // ZEUS specific constants
+ public static final int ZEUS_REBOOT_DELAY_MS = 50 * 1000;
+ public static final int ZEUS_SCREEN_WIDTH = SCREEN_WIDTH_DOUBLE;
+ public static final int ZEUS_SCREEN_HEIGHT = SCREEN_HEIGHT_DOUBLE;
+
+ // THUNDER specific constants
+ public static final int THUNDER_REBOOT_DELAY_MS = 45 * 1000;
+ public static final int THUNDER_SCREEN_WIDTH = SCREEN_WIDTH_LEGACY;
+ public static final int THUNDER_SCREEN_HEIGHT = SCREEN_HEIGHT_LEGACY;
+
+ // SCARFE specific constants
+ public static final int SCARFE_REBOOT_DELAY_MS = 60 * 1000;
+ public static final int SCARFE_SCREEN_WIDTH = SCREEN_WIDTH_QVGA ;
+ public static final int SCARFE_SCREEN_HEIGHT = SCREEN_HEIGHT_QVGA;
+
+ // ROSETTA specific constants
+ public static final int ROSETTA_REBOOT_DELAY_MS = 50 * 1000;
+ public static final int ROSETTA_SCREEN_WIDTH = SCREEN_WIDTH_QVGA;
+ public static final int ROSETTA_SCREEN_HEIGHT = SCREEN_HEIGHT_QVGA;
+
+ // VEGA specific constants
+ public static final int VEGA_REBOOT_DELAY_MS = 50 * 1000;
+ public static final int VEGA_SCREEN_WIDTH = SCREEN_WIDTH_QVGA;
+ public static final int VEGA_SCREEN_HEIGHT = SCREEN_HEIGHT_QVGA;
+
+ // AALTO specific constants
+ public static final int AALTO_REBOOT_DELAY_MS = 60 * 1000;
+ public static final int AALTO_SCREEN_WIDTH = SCREEN_WIDTH_QVGA;
+ public static final int AALTO_SCREEN_HEIGHT = SCREEN_HEIGHT_QVGA;
+
+ // DEVLON specific constants
+ public static final int DEVLON_REBOOT_DELAY_MS = 50 * 1000;
+ public static final int DEVLON_SCREEN_WIDTH = 360;
+ public static final int DEVLON_SCREEN_HEIGHT = 640;
+
+ // ARIANE specific constants
+ public static final int ARIANE_REBOOT_DELAY_MS = 50 * 1000;
+ public static final int ARIANE_SCREEN_WIDTH = SCREEN_WIDTH_QVGA;
+ public static final int ARIANE_SCREEN_HEIGHT = SCREEN_HEIGHT_QVGA;
+
+ // MERLIN specific constants
+ public static final int MERLIN_REBOOT_DELAY_MS = 50 * 1000;
+ public static final int MERLIN_SCREEN_WIDTH = SCREEN_WIDTH_QVGA;
+ public static final int MERLIN_SCREEN_HEIGHT = SCREEN_HEIGHT_QVGA;
+
+ // LUMIERE specific constants
+ public static final int LUMIERE_REBOOT_DELAY_MS = 50 * 1000;
+ public static final int LUMIERE_SCREEN_WIDTH = SCREEN_WIDTH_QVGA;
+ public static final int LUMIERE_SCREEN_HEIGHT = SCREEN_HEIGHT_QVGA;
+
+ // GADGET specific constants
+ public static final int GADGET_REBOOT_DELAY_MS = 50 * 1000;
+ public static final int GADGET_SCREEN_WIDTH = SCREEN_WIDTH_QVGA;
+ public static final int GADGET_SCREEN_HEIGHT = SCREEN_HEIGHT_QVGA;
+
+ // TUBE specific constants
+ public static final int TUBE_REBOOT_DELAY_MS = 50 * 1000;
+ public static final int TUBE_SCREEN_WIDTH = SCREEN_WIDTH_WVGA;
+ public static final int TUBE_SCREEN_HEIGHT = SCREEN_HEIGHT_WVGA;
+
+ // IVALO specific constants
+ public static final int IVALO_REBOOT_DELAY_MS = 50 * 1000;
+ public static final int IVALO_SCREEN_WIDTH = SCREEN_WIDTH_WVGA;
+ public static final int IVALO_SCREEN_HEIGHT = SCREEN_HEIGHT_WVGA;
+
+ // COROLLA specific constants
+ public static final int COROLLA_REBOOT_DELAY_MS = 50 * 1000;
+ public static final int COROLLA_SCREEN_WIDTH = SCREEN_WIDTH_VGA;
+ public static final int COROLLA_SCREEN_HEIGHT = SCREEN_HEIGHT_VGA;
+
+ // VASCO specific constants
+ public static final int VASCO_REBOOT_DELAY_MS = 50 * 1000;
+ public static final int VASCO_SCREEN_WIDTH = SCREEN_WIDTH_WVGA;
+ public static final int VASCO_SCREEN_HEIGHT = SCREEN_HEIGHT_WVGA;
+
+ // WINS specific constants
+ public static final int WINS_SCREEN_WIDTH = SCREEN_WIDTH_QVGA;
+ public static final int WINS_SCREEN_HEIGHT = SCREEN_HEIGHT_QVGA;
+
+ /*
+ * Data for files used in test cases
+ */
+
+ // Data of the jpg image file used as an attachment in message plugin tests
+ public static final byte[] HTI_JPG_DATA = new byte[] { (byte) 0xff,
+ (byte) 0xd8, (byte) 0xff, (byte) 0xe0, (byte) 0x00, (byte) 0x10,
+ (byte) 0x4a, (byte) 0x46, (byte) 0x49, (byte) 0x46, (byte) 0x00,
+ (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x00, (byte) 0x60,
+ (byte) 0x00, (byte) 0x60, (byte) 0x00, (byte) 0x00, (byte) 0xff,
+ (byte) 0xdb, (byte) 0x00, (byte) 0x43, (byte) 0x00, (byte) 0x08,
+ (byte) 0x06, (byte) 0x06, (byte) 0x07, (byte) 0x06, (byte) 0x05,
+ (byte) 0x08, (byte) 0x07, (byte) 0x07, (byte) 0x07, (byte) 0x09,
+ (byte) 0x09, (byte) 0x08, (byte) 0x0a, (byte) 0x0c, (byte) 0x14,
+ (byte) 0x0d, (byte) 0x0c, (byte) 0x0b, (byte) 0x0b, (byte) 0x0c,
+ (byte) 0x19, (byte) 0x12, (byte) 0x13, (byte) 0x0f, (byte) 0x14,
+ (byte) 0x1d, (byte) 0x1a, (byte) 0x1f, (byte) 0x1e, (byte) 0x1d,
+ (byte) 0x1a, (byte) 0x1c, (byte) 0x1c, (byte) 0x20, (byte) 0x24,
+ (byte) 0x2e, (byte) 0x27, (byte) 0x20, (byte) 0x22, (byte) 0x2c,
+ (byte) 0x23, (byte) 0x1c, (byte) 0x1c, (byte) 0x28, (byte) 0x37,
+ (byte) 0x29, (byte) 0x2c, (byte) 0x30, (byte) 0x31, (byte) 0x34,
+ (byte) 0x34, (byte) 0x34, (byte) 0x1f, (byte) 0x27, (byte) 0x39,
+ (byte) 0x3d, (byte) 0x38, (byte) 0x32, (byte) 0x3c, (byte) 0x2e,
+ (byte) 0x33, (byte) 0x34, (byte) 0x32, (byte) 0xff, (byte) 0xdb,
+ (byte) 0x00, (byte) 0x43, (byte) 0x01, (byte) 0x09, (byte) 0x09,
+ (byte) 0x09, (byte) 0x0c, (byte) 0x0b, (byte) 0x0c, (byte) 0x18,
+ (byte) 0x0d, (byte) 0x0d, (byte) 0x18, (byte) 0x32, (byte) 0x21,
+ (byte) 0x1c, (byte) 0x21, (byte) 0x32, (byte) 0x32, (byte) 0x32,
+ (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32,
+ (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32,
+ (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32,
+ (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32,
+ (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32,
+ (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32,
+ (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32,
+ (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32,
+ (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32, (byte) 0x32,
+ (byte) 0x32, (byte) 0x32, (byte) 0xff, (byte) 0xc0, (byte) 0x00,
+ (byte) 0x11, (byte) 0x08, (byte) 0x00, (byte) 0x16, (byte) 0x00,
+ (byte) 0x20, (byte) 0x03, (byte) 0x01, (byte) 0x22, (byte) 0x00,
+ (byte) 0x02, (byte) 0x11, (byte) 0x01, (byte) 0x03, (byte) 0x11,
+ (byte) 0x01, (byte) 0xff, (byte) 0xc4, (byte) 0x00, (byte) 0x1f,
+ (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x05, (byte) 0x01,
+ (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x02,
+ (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07,
+ (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b, (byte) 0xff,
+ (byte) 0xc4, (byte) 0x00, (byte) 0xb5, (byte) 0x10, (byte) 0x00,
+ (byte) 0x02, (byte) 0x01, (byte) 0x03, (byte) 0x03, (byte) 0x02,
+ (byte) 0x04, (byte) 0x03, (byte) 0x05, (byte) 0x05, (byte) 0x04,
+ (byte) 0x04, (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x7d,
+ (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x00, (byte) 0x04,
+ (byte) 0x11, (byte) 0x05, (byte) 0x12, (byte) 0x21, (byte) 0x31,
+ (byte) 0x41, (byte) 0x06, (byte) 0x13, (byte) 0x51, (byte) 0x61,
+ (byte) 0x07, (byte) 0x22, (byte) 0x71, (byte) 0x14, (byte) 0x32,
+ (byte) 0x81, (byte) 0x91, (byte) 0xa1, (byte) 0x08, (byte) 0x23,
+ (byte) 0x42, (byte) 0xb1, (byte) 0xc1, (byte) 0x15, (byte) 0x52,
+ (byte) 0xd1, (byte) 0xf0, (byte) 0x24, (byte) 0x33, (byte) 0x62,
+ (byte) 0x72, (byte) 0x82, (byte) 0x09, (byte) 0x0a, (byte) 0x16,
+ (byte) 0x17, (byte) 0x18, (byte) 0x19, (byte) 0x1a, (byte) 0x25,
+ (byte) 0x26, (byte) 0x27, (byte) 0x28, (byte) 0x29, (byte) 0x2a,
+ (byte) 0x34, (byte) 0x35, (byte) 0x36, (byte) 0x37, (byte) 0x38,
+ (byte) 0x39, (byte) 0x3a, (byte) 0x43, (byte) 0x44, (byte) 0x45,
+ (byte) 0x46, (byte) 0x47, (byte) 0x48, (byte) 0x49, (byte) 0x4a,
+ (byte) 0x53, (byte) 0x54, (byte) 0x55, (byte) 0x56, (byte) 0x57,
+ (byte) 0x58, (byte) 0x59, (byte) 0x5a, (byte) 0x63, (byte) 0x64,
+ (byte) 0x65, (byte) 0x66, (byte) 0x67, (byte) 0x68, (byte) 0x69,
+ (byte) 0x6a, (byte) 0x73, (byte) 0x74, (byte) 0x75, (byte) 0x76,
+ (byte) 0x77, (byte) 0x78, (byte) 0x79, (byte) 0x7a, (byte) 0x83,
+ (byte) 0x84, (byte) 0x85, (byte) 0x86, (byte) 0x87, (byte) 0x88,
+ (byte) 0x89, (byte) 0x8a, (byte) 0x92, (byte) 0x93, (byte) 0x94,
+ (byte) 0x95, (byte) 0x96, (byte) 0x97, (byte) 0x98, (byte) 0x99,
+ (byte) 0x9a, (byte) 0xa2, (byte) 0xa3, (byte) 0xa4, (byte) 0xa5,
+ (byte) 0xa6, (byte) 0xa7, (byte) 0xa8, (byte) 0xa9, (byte) 0xaa,
+ (byte) 0xb2, (byte) 0xb3, (byte) 0xb4, (byte) 0xb5, (byte) 0xb6,
+ (byte) 0xb7, (byte) 0xb8, (byte) 0xb9, (byte) 0xba, (byte) 0xc2,
+ (byte) 0xc3, (byte) 0xc4, (byte) 0xc5, (byte) 0xc6, (byte) 0xc7,
+ (byte) 0xc8, (byte) 0xc9, (byte) 0xca, (byte) 0xd2, (byte) 0xd3,
+ (byte) 0xd4, (byte) 0xd5, (byte) 0xd6, (byte) 0xd7, (byte) 0xd8,
+ (byte) 0xd9, (byte) 0xda, (byte) 0xe1, (byte) 0xe2, (byte) 0xe3,
+ (byte) 0xe4, (byte) 0xe5, (byte) 0xe6, (byte) 0xe7, (byte) 0xe8,
+ (byte) 0xe9, (byte) 0xea, (byte) 0xf1, (byte) 0xf2, (byte) 0xf3,
+ (byte) 0xf4, (byte) 0xf5, (byte) 0xf6, (byte) 0xf7, (byte) 0xf8,
+ (byte) 0xf9, (byte) 0xfa, (byte) 0xff, (byte) 0xc4, (byte) 0x00,
+ (byte) 0x1f, (byte) 0x01, (byte) 0x00, (byte) 0x03, (byte) 0x01,
+ (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01,
+ (byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01,
+ (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06,
+ (byte) 0x07, (byte) 0x08, (byte) 0x09, (byte) 0x0a, (byte) 0x0b,
+ (byte) 0xff, (byte) 0xc4, (byte) 0x00, (byte) 0xb5, (byte) 0x11,
+ (byte) 0x00, (byte) 0x02, (byte) 0x01, (byte) 0x02, (byte) 0x04,
+ (byte) 0x04, (byte) 0x03, (byte) 0x04, (byte) 0x07, (byte) 0x05,
+ (byte) 0x04, (byte) 0x04, (byte) 0x00, (byte) 0x01, (byte) 0x02,
+ (byte) 0x77, (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03,
+ (byte) 0x11, (byte) 0x04, (byte) 0x05, (byte) 0x21, (byte) 0x31,
+ (byte) 0x06, (byte) 0x12, (byte) 0x41, (byte) 0x51, (byte) 0x07,
+ (byte) 0x61, (byte) 0x71, (byte) 0x13, (byte) 0x22, (byte) 0x32,
+ (byte) 0x81, (byte) 0x08, (byte) 0x14, (byte) 0x42, (byte) 0x91,
+ (byte) 0xa1, (byte) 0xb1, (byte) 0xc1, (byte) 0x09, (byte) 0x23,
+ (byte) 0x33, (byte) 0x52, (byte) 0xf0, (byte) 0x15, (byte) 0x62,
+ (byte) 0x72, (byte) 0xd1, (byte) 0x0a, (byte) 0x16, (byte) 0x24,
+ (byte) 0x34, (byte) 0xe1, (byte) 0x25, (byte) 0xf1, (byte) 0x17,
+ (byte) 0x18, (byte) 0x19, (byte) 0x1a, (byte) 0x26, (byte) 0x27,
+ (byte) 0x28, (byte) 0x29, (byte) 0x2a, (byte) 0x35, (byte) 0x36,
+ (byte) 0x37, (byte) 0x38, (byte) 0x39, (byte) 0x3a, (byte) 0x43,
+ (byte) 0x44, (byte) 0x45, (byte) 0x46, (byte) 0x47, (byte) 0x48,
+ (byte) 0x49, (byte) 0x4a, (byte) 0x53, (byte) 0x54, (byte) 0x55,
+ (byte) 0x56, (byte) 0x57, (byte) 0x58, (byte) 0x59, (byte) 0x5a,
+ (byte) 0x63, (byte) 0x64, (byte) 0x65, (byte) 0x66, (byte) 0x67,
+ (byte) 0x68, (byte) 0x69, (byte) 0x6a, (byte) 0x73, (byte) 0x74,
+ (byte) 0x75, (byte) 0x76, (byte) 0x77, (byte) 0x78, (byte) 0x79,
+ (byte) 0x7a, (byte) 0x82, (byte) 0x83, (byte) 0x84, (byte) 0x85,
+ (byte) 0x86, (byte) 0x87, (byte) 0x88, (byte) 0x89, (byte) 0x8a,
+ (byte) 0x92, (byte) 0x93, (byte) 0x94, (byte) 0x95, (byte) 0x96,
+ (byte) 0x97, (byte) 0x98, (byte) 0x99, (byte) 0x9a, (byte) 0xa2,
+ (byte) 0xa3, (byte) 0xa4, (byte) 0xa5, (byte) 0xa6, (byte) 0xa7,
+ (byte) 0xa8, (byte) 0xa9, (byte) 0xaa, (byte) 0xb2, (byte) 0xb3,
+ (byte) 0xb4, (byte) 0xb5, (byte) 0xb6, (byte) 0xb7, (byte) 0xb8,
+ (byte) 0xb9, (byte) 0xba, (byte) 0xc2, (byte) 0xc3, (byte) 0xc4,
+ (byte) 0xc5, (byte) 0xc6, (byte) 0xc7, (byte) 0xc8, (byte) 0xc9,
+ (byte) 0xca, (byte) 0xd2, (byte) 0xd3, (byte) 0xd4, (byte) 0xd5,
+ (byte) 0xd6, (byte) 0xd7, (byte) 0xd8, (byte) 0xd9, (byte) 0xda,
+ (byte) 0xe2, (byte) 0xe3, (byte) 0xe4, (byte) 0xe5, (byte) 0xe6,
+ (byte) 0xe7, (byte) 0xe8, (byte) 0xe9, (byte) 0xea, (byte) 0xf2,
+ (byte) 0xf3, (byte) 0xf4, (byte) 0xf5, (byte) 0xf6, (byte) 0xf7,
+ (byte) 0xf8, (byte) 0xf9, (byte) 0xfa, (byte) 0xff, (byte) 0xda,
+ (byte) 0x00, (byte) 0x0c, (byte) 0x03, (byte) 0x01, (byte) 0x00,
+ (byte) 0x02, (byte) 0x11, (byte) 0x03, (byte) 0x11, (byte) 0x00,
+ (byte) 0x3f, (byte) 0x00, (byte) 0xf7, (byte) 0xfa, (byte) 0xcb,
+ (byte) 0x1e, (byte) 0x25, (byte) 0xd0, (byte) 0x4d, (byte) 0xbd,
+ (byte) 0xbd, (byte) 0xc0, (byte) 0xd6, (byte) 0xf4, (byte) 0xdf,
+ (byte) 0x22, (byte) 0xe1, (byte) 0x25, (byte) 0x78, (byte) 0x24,
+ (byte) 0xfb, (byte) 0x52, (byte) 0x6d, (byte) 0x95, (byte) 0x63,
+ (byte) 0x04, (byte) 0xc8, (byte) 0x54, (byte) 0xe7, (byte) 0x04,
+ (byte) 0x28, (byte) 0x04, (byte) 0xb1, (byte) 0x1d, (byte) 0x31,
+ (byte) 0xce, (byte) 0x2b, (byte) 0x52, (byte) 0xbc, (byte) 0x1f,
+ (byte) 0xc0, (byte) 0x5e, (byte) 0x19, (byte) 0xd7, (byte) 0x74,
+ (byte) 0xfb, (byte) 0xcf, (byte) 0x86, (byte) 0x53, (byte) 0xde,
+ (byte) 0x5b, (byte) 0x6a, (byte) 0xa2, (byte) 0x3b, (byte) 0x7f,
+ (byte) 0xed, (byte) 0x5f, (byte) 0xb4, (byte) 0x41, (byte) 0x3d,
+ (byte) 0xa8, (byte) 0x44, (byte) 0xb1, (byte) 0xdc, (byte) 0x18,
+ (byte) 0x2e, (byte) 0x48, (byte) 0x40, (byte) 0xcb, (byte) 0xbf,
+ (byte) 0x20, (byte) 0xfc, (byte) 0xe4, (byte) 0xe7, (byte) 0xf8,
+ (byte) 0x70, (byte) 0x38, (byte) 0xa0, (byte) 0x0f, (byte) 0x5c,
+ (byte) 0x8f, (byte) 0xc6, (byte) 0x9e, (byte) 0x15, (byte) 0x99,
+ (byte) 0x26, (byte) 0x78, (byte) 0xbc, (byte) 0x4b, (byte) 0xa3,
+ (byte) 0x3a, (byte) 0x42, (byte) 0x9b, (byte) 0xe5, (byte) 0x65,
+ (byte) 0xbf, (byte) 0x88, (byte) 0x84, (byte) 0x5d, (byte) 0xc1,
+ (byte) 0x72, (byte) 0xdf, (byte) 0x37, (byte) 0x03, (byte) 0x73,
+ (byte) 0x28, (byte) 0xc9, (byte) 0xee, (byte) 0x40, (byte) 0xef,
+ (byte) 0x5b, (byte) 0x95, (byte) 0xe1, (byte) 0xfa, (byte) 0xb6,
+ (byte) 0x85, (byte) 0xac, (byte) 0x49, (byte) 0xf0, (byte) 0xb7,
+ (byte) 0xe2, (byte) 0x3d, (byte) 0x9c, (byte) 0x7a, (byte) 0x55,
+ (byte) 0xf3, (byte) 0xdd, (byte) 0x5d, (byte) 0xf8, (byte) 0x96,
+ (byte) 0x69, (byte) 0xed, (byte) 0xa1, (byte) 0x5b, (byte) 0x77,
+ (byte) 0x2f, (byte) 0x34, (byte) 0x66, (byte) 0x78, (byte) 0x48,
+ (byte) 0x74, (byte) 0x5c, (byte) 0x65, (byte) 0x97, (byte) 0x00,
+ (byte) 0x9c, (byte) 0x8e, (byte) 0x38, (byte) 0x35, (byte) 0xee,
+ (byte) 0x14, (byte) 0x00, (byte) 0x51, (byte) 0x45, (byte) 0x14,
+ (byte) 0x00, (byte) 0x51, (byte) 0x45, (byte) 0x14, (byte) 0x01,
+ (byte) 0xff, (byte) 0xd9 };
+
+ // Data for the SISX file containing Dummy.exe
+ public static final byte[] DUMMY_SISX_DATA = {
+ (byte) 0x7a, (byte) 0x1a, (byte) 0x20, (byte) 0x10, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xb6, (byte) 0xde,
+ (byte) 0x30, (byte) 0x10, (byte) 0xd2, (byte) 0x49, (byte) 0xc5,
+ (byte) 0xbc, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x44, (byte) 0x0a, (byte) 0x00, (byte) 0x00, (byte) 0x22,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x02, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0xee, (byte) 0xde, (byte) 0x00,
+ (byte) 0x00, (byte) 0x23, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x28,
+ (byte) 0xf3, (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x04, (byte) 0x00,
+ (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x3c, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x78, (byte) 0x9c,
+ (byte) 0xe3, (byte) 0x65, (byte) 0x60, (byte) 0x60, (byte) 0x30,
+ (byte) 0x61, (byte) 0x63, (byte) 0x60, (byte) 0xe0, (byte) 0x03,
+ (byte) 0xd2, (byte) 0x7d, (byte) 0x40, (byte) 0xcc, (byte) 0x09,
+ (byte) 0xc4, (byte) 0x2c, (byte) 0x40, (byte) 0xbc, (byte) 0xed,
+ (byte) 0x9e, (byte) 0x81, (byte) 0x00, (byte) 0x23, (byte) 0x90,
+ (byte) 0xe6, (byte) 0x02, (byte) 0x62, (byte) 0x3f, (byte) 0x86,
+ (byte) 0x7c, (byte) 0x86, (byte) 0x6c, (byte) 0x86, (byte) 0x4c,
+ (byte) 0x86, (byte) 0x44, (byte) 0x20, (byte) 0x9b, (byte) 0x09,
+ (byte) 0x88, (byte) 0x45, (byte) 0x80, (byte) 0x18, (byte) 0x26,
+ (byte) 0xe7, (byte) 0xc2, (byte) 0x50, (byte) 0xca, (byte) 0x90,
+ (byte) 0x0b, (byte) 0x84, (byte) 0x95, (byte) 0x58, (byte) 0xe4,
+ (byte) 0x90, (byte) 0xf5, (byte) 0x81, (byte) 0xcc, (byte) 0xe4,
+ (byte) 0x81, (byte) 0xca, (byte) 0xc1, (byte) 0x00, (byte) 0x07,
+ (byte) 0x10, (byte) 0x4b, (byte) 0x00, (byte) 0x31, (byte) 0x1b,
+ (byte) 0x54, (byte) 0xfe, (byte) 0x06, (byte) 0x3b, (byte) 0xa7,
+ (byte) 0x28, (byte) 0x3b, (byte) 0x90, (byte) 0x66, (byte) 0x06,
+ (byte) 0xa9, (byte) 0x15, (byte) 0x62, (byte) 0x03, (byte) 0xab,
+ (byte) 0x11, (byte) 0x80, (byte) 0xea, (byte) 0x63, (byte) 0x82,
+ (byte) 0xaa, (byte) 0x51, (byte) 0x04, (byte) 0x62, (byte) 0x7e,
+ (byte) 0xa8, (byte) 0x3d, (byte) 0x4c, (byte) 0x50, (byte) 0x39,
+ (byte) 0x6e, (byte) 0xa8, (byte) 0x1c, (byte) 0xc8, (byte) 0x6c,
+ (byte) 0x41, (byte) 0x20, (byte) 0xae, (byte) 0x80, (byte) 0xca,
+ (byte) 0xa5, (byte) 0x00, (byte) 0xb1, (byte) 0x10, (byte) 0x10,
+ (byte) 0xc7, (byte) 0x20, (byte) 0xf9, (byte) 0x2b, (byte) 0xb1,
+ (byte) 0x52, (byte) 0x5e, (byte) 0x80, (byte) 0x15, (byte) 0xaa,
+ (byte) 0x1f, (byte) 0xe6, (byte) 0x26, (byte) 0x64, (byte) 0x00,
+ (byte) 0xd2, (byte) 0xa7, (byte) 0x03, (byte) 0x35, (byte) 0x4b,
+ (byte) 0x09, (byte) 0x88, (byte) 0x83, (byte) 0x19, (byte) 0x52,
+ (byte) 0x19, (byte) 0x8a, (byte) 0x80, (byte) 0x7e, (byte) 0x48,
+ (byte) 0x65, (byte) 0x28, (byte) 0x66, (byte) 0x30, (byte) 0x63,
+ (byte) 0x30, (byte) 0x60, (byte) 0x08, (byte) 0x00, (byte) 0xf2,
+ (byte) 0xf2, (byte) 0x81, (byte) 0x26, (byte) 0x97, (byte) 0x32,
+ (byte) 0x24, (byte) 0x33, (byte) 0x94, (byte) 0x30, (byte) 0x78,
+ (byte) 0x02, (byte) 0xfd, (byte) 0x8f, (byte) 0x70, (byte) 0x1b,
+ (byte) 0xc8, (byte) 0x2e, (byte) 0x61, (byte) 0x34, (byte) 0xf7,
+ (byte) 0x82, (byte) 0xec, (byte) 0x91, (byte) 0x01, (byte) 0xe2,
+ (byte) 0x0d, (byte) 0x50, (byte) 0xb1, (byte) 0x09, (byte) 0x50,
+ (byte) 0x3f, (byte) 0x77, (byte) 0x40, (byte) 0xed, (byte) 0xd0,
+ (byte) 0x00, (byte) 0xfb, (byte) 0xc9, (byte) 0x0a, (byte) 0xe8,
+ (byte) 0xc6, (byte) 0x60, (byte) 0x60, (byte) 0x18, (byte) 0x16,
+ (byte) 0x03, (byte) 0x69, (byte) 0x27, (byte) 0xa0, (byte) 0x6d,
+ (byte) 0x79, (byte) 0x40, (byte) 0x1a, (byte) 0x11, (byte) 0xb2,
+ (byte) 0x7a, (byte) 0x40, (byte) 0xdb, (byte) 0x2b, (byte) 0x80,
+ (byte) 0x18, (byte) 0x16, (byte) 0x76, (byte) 0x9a, (byte) 0x50,
+ (byte) 0xb3, (byte) 0xff, (byte) 0xfd, (byte) 0xe7, (byte) 0x67,
+ (byte) 0x90, (byte) 0x04, (byte) 0xd2, (byte) 0x0a, (byte) 0x50,
+ (byte) 0xb3, (byte) 0x54, (byte) 0xa1, (byte) 0xf6, (byte) 0xe5,
+ (byte) 0xe8, (byte) 0xef, (byte) 0x4b, (byte) 0x69, (byte) 0x16,
+ (byte) 0x73, (byte) 0x3a, (byte) 0xb9, (byte) 0xfe, (byte) 0xf6,
+ (byte) 0xea, (byte) 0xf5, (byte) 0xad, (byte) 0xcf, (byte) 0xd3,
+ (byte) 0x9e, (byte) 0x7c, (byte) 0x95, (byte) 0x52, (byte) 0x28,
+ (byte) 0x86, (byte) 0xe9, (byte) 0x7d, (byte) 0xce, (byte) 0x8a,
+ (byte) 0x4a, (byte) 0xc3, (byte) 0xfc, (byte) 0x0c, (byte) 0x32,
+ (byte) 0x8f, (byte) 0x17, (byte) 0x89, (byte) 0x2d, (byte) 0x05,
+ (byte) 0xc4, (byte) 0xea, (byte) 0x20, (byte) 0xbf, (byte) 0xb0,
+ (byte) 0x40, (byte) 0xc4, (byte) 0x4e, (byte) 0x00, (byte) 0xb1,
+ (byte) 0x0a, (byte) 0x10, (byte) 0x1f, (byte) 0x00, (byte) 0x62,
+ (byte) 0x35, (byte) 0x20, (byte) 0x36, (byte) 0x40, (byte) 0x72,
+ (byte) 0xbf, (byte) 0x21, (byte) 0xd0, (byte) 0x85, (byte) 0x46,
+ (byte) 0x40, (byte) 0x6c, (byte) 0xc1, (byte) 0x60, (byte) 0x02,
+ (byte) 0x14, (byte) 0xd7, (byte) 0x03, (byte) 0xf2, (byte) 0x0d,
+ (byte) 0x19, (byte) 0x8c, (byte) 0x19, (byte) 0x4c, (byte) 0x81,
+ (byte) 0x3c, (byte) 0x4b, (byte) 0x30, (byte) 0x0f, (byte) 0x82,
+ (byte) 0x4d, (byte) 0xc1, (byte) 0xee, (byte) 0x6b, (byte) 0x00,
+ (byte) 0x85, (byte) 0x07, (byte) 0x53, (byte) 0x42, (byte) 0xa2,
+ (byte) 0x70, (byte) 0xf0, (byte) 0x5d, (byte) 0xb7, (byte) 0xd4,
+ (byte) 0xaa, (byte) 0xf4, (byte) 0x47, (byte) 0x0c, (byte) 0x25,
+ (byte) 0x73, (byte) 0xb5, (byte) 0x32, (byte) 0x6d, (byte) 0x1d,
+ (byte) 0xed, (byte) 0x6f, (byte) 0x31, (byte) 0xec, (byte) 0x5a,
+ (byte) 0x79, (byte) 0xe1, (byte) 0x8a, (byte) 0xb2, (byte) 0x96,
+ (byte) 0x98, (byte) 0xdf, (byte) 0x22, (byte) 0x55, (byte) 0x21,
+ (byte) 0x0e, (byte) 0x4d, (byte) 0x9f, (byte) 0xc4, (byte) 0x6f,
+ (byte) 0x52, (byte) 0xf5, (byte) 0x87, (byte) 0x0e, (byte) 0x6c,
+ (byte) 0xf8, (byte) 0x63, (byte) 0x9b, (byte) 0xb0, (byte) 0xe9,
+ (byte) 0xbe, (byte) 0x53, (byte) 0xf1, (byte) 0x79, (byte) 0xb1,
+ (byte) 0xc3, (byte) 0x66, (byte) 0x0a, (byte) 0x1f, (byte) 0x0f,
+ (byte) 0xf5, (byte) 0xef, (byte) 0x12, (byte) 0x9e, (byte) 0x2d,
+ (byte) 0x70, (byte) 0x66, (byte) 0xf5, (byte) 0x3a, (byte) 0x0d,
+ (byte) 0xb7, (byte) 0x7a, (byte) 0x05, (byte) 0xe7, (byte) 0x55,
+ (byte) 0xbb, (byte) 0x56, (byte) 0x9a, (byte) 0x37, (byte) 0x6a,
+ (byte) 0x6f, (byte) 0x3f, (byte) 0xb2, (byte) 0xce, (byte) 0x47,
+ (byte) 0x25, (byte) 0x20, (byte) 0xec, (byte) 0x7c, (byte) 0x90,
+ (byte) 0x5f, (byte) 0x45, (byte) 0x9f, (byte) 0xe7, (byte) 0xb9,
+ (byte) 0x0b, (byte) 0x65, (byte) 0x2a, (byte) 0x32, (byte) 0xa2,
+ (byte) 0xba, (byte) 0x13, (byte) 0x5f, (byte) 0x07, (byte) 0xef,
+ (byte) 0x9c, (byte) 0xeb, (byte) 0xa7, (byte) 0xfa, (byte) 0x97,
+ (byte) 0xeb, (byte) 0xe8, (byte) 0xdd, (byte) 0xea, (byte) 0x15,
+ (byte) 0x29, (byte) 0xed, (byte) 0x9b, (byte) 0xf5, (byte) 0x9f,
+ (byte) 0x89, (byte) 0x70, (byte) 0xf6, (byte) 0x5b, (byte) 0xc8,
+ (byte) 0x6b, (byte) 0x2e, (byte) 0xf6, (byte) 0x7f, (byte) 0x70,
+ (byte) 0x77, (byte) 0xf3, (byte) 0xe1, (byte) 0xdd, (byte) 0xc6,
+ (byte) 0x62, (byte) 0x40, (byte) 0x37, (byte) 0x98, (byte) 0x30,
+ (byte) 0x43, (byte) 0xc2, (byte) 0x4b, (byte) 0x07, (byte) 0x48,
+ (byte) 0x1b, (byte) 0x34, (byte) 0x31, (byte) 0x6b, (byte) 0x18,
+ (byte) 0x34, (byte) 0x31, (byte) 0x4d, (byte) 0x5c, (byte) 0xc0,
+ (byte) 0xcc, (byte) 0xc4, (byte) 0xc8, (byte) 0xc4, (byte) 0xc4,
+ (byte) 0xc8, (byte) 0x60, (byte) 0xc0, (byte) 0xcb, (byte) 0xc6,
+ (byte) 0xa9, (byte) 0xd5, (byte) 0xe6, (byte) 0xd1, (byte) 0xf6,
+ (byte) 0x9d, (byte) 0x97, (byte) 0x91, (byte) 0x91, (byte) 0x95,
+ (byte) 0x95, (byte) 0xc1, (byte) 0x20, (byte) 0xd7, (byte) 0x90,
+ (byte) 0xdb, (byte) 0x80, (byte) 0x93, (byte) 0x8d, (byte) 0x39,
+ (byte) 0x94, (byte) 0x85, (byte) 0x4d, (byte) 0x98, (byte) 0xc9,
+ (byte) 0xcd, (byte) 0xd3, (byte) 0x50, (byte) 0xc0, (byte) 0x80,
+ (byte) 0x0f, (byte) 0xc4, (byte) 0xe1, (byte) 0x10, (byte) 0x66,
+ (byte) 0x77, (byte) 0xcb, (byte) 0xcc, (byte) 0xcb, (byte) 0x49,
+ (byte) 0xcc, (byte) 0x4b, (byte) 0x81, (byte) 0x89, (byte) 0xb0,
+ (byte) 0x0b, (byte) 0xb3, (byte) 0x87, (byte) 0x24, (byte) 0xe6,
+ (byte) 0x16, (byte) 0xa4, (byte) 0x16, (byte) 0xa5, (byte) 0x1a,
+ (byte) 0xf2, (byte) 0x19, (byte) 0xf0, (byte) 0x80, (byte) 0x44,
+ (byte) 0xb8, (byte) 0x84, (byte) 0x59, (byte) 0xfd, (byte) 0xf2,
+ (byte) 0xb3, (byte) 0x33, (byte) 0x13, (byte) 0x0d, (byte) 0x85,
+ (byte) 0x0c, (byte) 0x04, (byte) 0x40, (byte) 0x7c, (byte) 0x6e,
+ (byte) 0x61, (byte) 0xce, (byte) 0xe0, (byte) 0xd4, (byte) 0xa2,
+ (byte) 0xcc, (byte) 0xd4, (byte) 0x62, (byte) 0x05, (byte) 0x33,
+ (byte) 0x03, (byte) 0x43, (byte) 0x31, (byte) 0x03, (byte) 0x11,
+ (byte) 0x90, (byte) 0x18, (byte) 0xb3, (byte) 0x08, (byte) 0x2f,
+ (byte) 0x5c, (byte) 0x4c, (byte) 0x21, (byte) 0x48, (byte) 0xcd,
+ (byte) 0xc5, (byte) 0x40, (byte) 0x4e, (byte) 0x9c, (byte) 0xd7,
+ (byte) 0xc0, (byte) 0xd4, (byte) 0xc0, (byte) 0xc4, (byte) 0x10,
+ (byte) 0x08, (byte) 0x8c, (byte) 0x4c, (byte) 0x0d, (byte) 0x0c,
+ (byte) 0xa2, (byte) 0xc4, (byte) 0x79, (byte) 0x8d, (byte) 0x8d,
+ (byte) 0x0c, (byte) 0x2c, (byte) 0x8c, (byte) 0xcc, (byte) 0xa1,
+ (byte) 0x5c, (byte) 0x7a, (byte) 0x3b, (byte) 0xa7, (byte) 0x71,
+ (byte) 0x3e, (byte) 0x72, (byte) 0x78, (byte) 0x30, (byte) 0xb2,
+ (byte) 0x32, (byte) 0x30, (byte) 0x37, (byte) 0xf6, (byte) 0x32,
+ (byte) 0x18, (byte) 0x34, (byte) 0x76, (byte) 0x32, (byte) 0x35,
+ (byte) 0x36, (byte) 0x32, (byte) 0xec, (byte) 0xf7, (byte) 0x31,
+ (byte) 0xfe, (byte) 0xad, (byte) 0xb1, (byte) 0x48, (byte) 0xaa,
+ (byte) 0x7e, (byte) 0xfe, (byte) 0xba, (byte) 0xe8, (byte) 0xe6,
+ (byte) 0xe6, (byte) 0x5b, (byte) 0xaa, (byte) 0x91, (byte) 0x3b,
+ (byte) 0x9d, (byte) 0x99, (byte) 0x6e, (byte) 0xae, (byte) 0x9f,
+ (byte) 0x54, (byte) 0xc9, (byte) 0xf2, (byte) 0xb8, (byte) 0x7e,
+ (byte) 0xb5, (byte) 0xf6, (byte) 0x94, (byte) 0xe5, (byte) 0x7c,
+ (byte) 0xb3, (byte) 0x1f, (byte) 0xac, (byte) 0xb4, (byte) 0xb9,
+ (byte) 0xfa, (byte) 0x7c, (byte) 0xc7, (byte) 0xe6, (byte) 0xb4,
+ (byte) 0xff, (byte) 0xc7, (byte) 0xef, (byte) 0x0a, (byte) 0xd5,
+ (byte) 0xf4, (byte) 0x29, (byte) 0x3d, (byte) 0x09, (byte) 0xb7,
+ (byte) 0x15, (byte) 0x5a, (byte) 0xb6, (byte) 0x4a, (byte) 0xda,
+ (byte) 0x74, (byte) 0xbe, (byte) 0x53, (byte) 0xca, (byte) 0x11,
+ (byte) 0xc7, (byte) 0xf6, (byte) 0x53, (byte) 0x85, (byte) 0xdc,
+ (byte) 0x11, (byte) 0x47, (byte) 0xde, (byte) 0x69, (byte) 0x96,
+ (byte) 0x5d, (byte) 0x38, (byte) 0x7e, (byte) 0x65, (byte) 0x22,
+ (byte) 0x43, (byte) 0xaa, (byte) 0xf8, (byte) 0x79, (byte) 0xcd,
+ (byte) 0x7b, (byte) 0x52, (byte) 0xf5, (byte) 0x1d, (byte) 0x2a,
+ (byte) 0x37, (byte) 0xcf, (byte) 0xed, (byte) 0x79, (byte) 0xd4,
+ (byte) 0x1e, (byte) 0xc5, (byte) 0xd4, (byte) 0xb4, (byte) 0xe8,
+ (byte) 0xe9, (byte) 0xb7, (byte) 0xd6, (byte) 0x4f, (byte) 0x36,
+ (byte) 0xeb, (byte) 0x6e, (byte) 0xca, (byte) 0xae, (byte) 0x98,
+ (byte) 0x95, (byte) 0x35, (byte) 0xe3, (byte) 0x9d, (byte) 0xd5,
+ (byte) 0x25, (byte) 0xc6, (byte) 0x35, (byte) 0x46, (byte) 0x3c,
+ (byte) 0x76, (byte) 0xd3, (byte) 0x8e, (byte) 0xdd, (byte) 0x3b,
+ (byte) 0x99, (byte) 0x33, (byte) 0xed, (byte) 0x5b, (byte) 0xe4,
+ (byte) 0x7d, (byte) 0x7d, (byte) 0xa9, (byte) 0x7d, (byte) 0x29,
+ (byte) 0x7a, (byte) 0x6f, (byte) 0x56, (byte) 0x32, (byte) 0x31,
+ (byte) 0x33, (byte) 0x32, (byte) 0x30, (byte) 0x2e, (byte) 0x6e,
+ (byte) 0xbc, (byte) 0x6e, (byte) 0xd0, (byte) 0x78, (byte) 0xc5,
+ (byte) 0x40, (byte) 0x16, (byte) 0xe8, (byte) 0x7a, (byte) 0x59,
+ (byte) 0x3e, (byte) 0x16, (byte) 0x31, (byte) 0x16, (byte) 0x91,
+ (byte) 0x92, (byte) 0xdc, (byte) 0x79, (byte) 0x8d, (byte) 0x17,
+ (byte) 0xbf, (byte) 0x31, (byte) 0x35, (byte) 0x9b, (byte) 0x7e,
+ (byte) 0x9f, (byte) 0x91, (byte) 0xa0, (byte) 0xb2, (byte) 0xdd,
+ (byte) 0xea, (byte) 0xcf, (byte) 0x5b, (byte) 0x27, (byte) 0x8b,
+ (byte) 0x5a, (byte) 0x83, (byte) 0xc6, (byte) 0xe9, (byte) 0x20,
+ (byte) 0x79, (byte) 0x65, (byte) 0x96, (byte) 0xc6, (byte) 0x7e,
+ (byte) 0x83, (byte) 0xc6, (byte) 0x9e, (byte) 0x06, (byte) 0xac,
+ (byte) 0x6a, (byte) 0x16, (byte) 0x16, (byte) 0x2e, (byte) 0xc9,
+ (byte) 0xa7, (byte) 0x73, (byte) 0xe8, (byte) 0x36, (byte) 0x01,
+ (byte) 0x53, (byte) 0x1b, (byte) 0x48, (byte) 0xb3, (byte) 0xac,
+ (byte) 0x30, (byte) 0x0b, (byte) 0xab, (byte) 0x01, (byte) 0x33,
+ (byte) 0x23, (byte) 0xe3, (byte) 0x7f, (byte) 0x03, (byte) 0x6e,
+ (byte) 0x10, (byte) 0x8f, (byte) 0x9f, (byte) 0x85, (byte) 0x85,
+ (byte) 0x99, (byte) 0x89, (byte) 0xa9, (byte) 0x05, (byte) 0x2d,
+ (byte) 0x21, (byte) 0x32, (byte) 0x03, (byte) 0x43, (byte) 0x9c,
+ (byte) 0x7f, (byte) 0x71, (byte) 0x67, (byte) 0xc5, (byte) 0x42,
+ (byte) 0xc1, (byte) 0x7c, (byte) 0xe9, (byte) 0xa9, (byte) 0x4b,
+ (byte) 0x77, (byte) 0xa6, (byte) 0x7d, (byte) 0x7d, (byte) 0xfb,
+ (byte) 0xed, (byte) 0xaf, (byte) 0x68, (byte) 0x19, (byte) 0xc7,
+ (byte) 0xe4, (byte) 0x1f, (byte) 0x39, (byte) 0x1e, (byte) 0xd6,
+ (byte) 0x96, (byte) 0xe1, (byte) 0xca, (byte) 0x0f, (byte) 0x73,
+ (byte) 0xec, (byte) 0x85, (byte) 0x76, (byte) 0x66, (byte) 0xd5,
+ (byte) 0xee, (byte) 0x4a, (byte) 0xba, (byte) 0x27, (byte) 0x37,
+ (byte) 0xd5, (byte) 0xf1, (byte) 0x8f, (byte) 0xf8, (byte) 0x93,
+ (byte) 0xff, (byte) 0xf9, (byte) 0xd3, (byte) 0x6c, (byte) 0x4d,
+ (byte) 0x59, (byte) 0xd5, (byte) 0x72, (byte) 0x0e, (byte) 0x3f,
+ (byte) 0x98, (byte) 0x78, (byte) 0x90, (byte) 0xf1, (byte) 0x44,
+ (byte) 0xc9, (byte) 0x8e, (byte) 0x83, (byte) 0x12, (byte) 0xdb,
+ (byte) 0x0a, (byte) 0x4e, (byte) 0xaf, (byte) 0x56, (byte) 0xbc,
+ (byte) 0xa2, (byte) 0xcc, (byte) 0xf2, (byte) 0xcd, (byte) 0xf9,
+ (byte) 0xc5, (byte) 0x03, (byte) 0xb7, (byte) 0xeb, (byte) 0x4f,
+ (byte) 0xbd, (byte) 0x5e, (byte) 0x1e, (byte) 0xdc, (byte) 0x74,
+ (byte) 0xcc, (byte) 0x95, (byte) 0xfd, (byte) 0x84, (byte) 0xb0,
+ (byte) 0xa8, (byte) 0x7e, (byte) 0xe8, (byte) 0xb1, (byte) 0x62,
+ (byte) 0x75, (byte) 0x11, (byte) 0x5d, (byte) 0xf9, (byte) 0x63,
+ (byte) 0x1b, (byte) 0x7b, (byte) 0x5e, (byte) 0x76, (byte) 0x67,
+ (byte) 0x4b, (byte) 0xe4, (byte) 0xc9, (byte) 0xad, (byte) 0x16,
+ (byte) 0xb1, (byte) 0x73, (byte) 0x9c, (byte) 0x15, (byte) 0x1d,
+ (byte) 0x37, (byte) 0x95, (byte) 0x77, (byte) 0x52, (byte) 0xc3,
+ (byte) 0x82, (byte) 0x8b, (byte) 0x9f, (byte) 0x97, (byte) 0xa6,
+ (byte) 0x4e, (byte) 0x4b, (byte) 0x16, (byte) 0xa9, (byte) 0x3b,
+ (byte) 0x76, (byte) 0xe1, (byte) 0x8f, (byte) 0x81, (byte) 0xa7,
+ (byte) 0x06, (byte) 0xb4, (byte) 0x7c, (byte) 0x00, (byte) 0x01,
+ (byte) 0x00, (byte) 0xb1, (byte) 0x7d, (byte) 0x6a, (byte) 0xec,
+ (byte) 0x1e, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x1c,
+ (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x02, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x14, (byte) 0x06, (byte) 0x00,
+ (byte) 0x00, (byte) 0x1f, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x0c, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x02,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x04, (byte) 0x06,
+ (byte) 0x00, (byte) 0x00, (byte) 0x20, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0xfc, (byte) 0x05, (byte) 0x00, (byte) 0x00,
+ (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xf3,
+ (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0xe7, (byte) 0x05, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x7a, (byte) 0x00, (byte) 0x00, (byte) 0x10, (byte) 0x8d,
+ (byte) 0x00, (byte) 0x00, (byte) 0x10, (byte) 0xb6, (byte) 0xde,
+ (byte) 0x30, (byte) 0x10, (byte) 0xd8, (byte) 0xa5, (byte) 0x20,
+ (byte) 0x63, (byte) 0x45, (byte) 0x50, (byte) 0x4f, (byte) 0x43,
+ (byte) 0xb0, (byte) 0xbd, (byte) 0x94, (byte) 0xaf, (byte) 0x00,
+ (byte) 0x00, (byte) 0x0a, (byte) 0x00, (byte) 0xfc, (byte) 0x7a,
+ (byte) 0x1f, (byte) 0x10, (byte) 0x02, (byte) 0x01, (byte) 0x40,
+ (byte) 0x02, (byte) 0x80, (byte) 0x53, (byte) 0x6b, (byte) 0x4f,
+ (byte) 0x76, (byte) 0x37, (byte) 0xe1, (byte) 0x00, (byte) 0x2a,
+ (byte) 0x00, (byte) 0x00, (byte) 0x12, (byte) 0x40, (byte) 0x07,
+ (byte) 0x00, (byte) 0x00, (byte) 0x18, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x10, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x10, (byte) 0x00, (byte) 0x00,
+ (byte) 0x20, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x80, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x40, (byte) 0x00, (byte) 0x02,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x40, (byte) 0x07, (byte) 0x00, (byte) 0x00,
+ (byte) 0x9c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xdc,
+ (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0xf4, (byte) 0x07,
+ (byte) 0x00, (byte) 0x00, (byte) 0xec, (byte) 0x08, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x5e, (byte) 0x01, (byte) 0x00, (byte) 0x20, (byte) 0x74,
+ (byte) 0x08, (byte) 0x00, (byte) 0x00, (byte) 0xb6, (byte) 0xde,
+ (byte) 0x30, (byte) 0x10, (byte) 0x57, (byte) 0xb6, (byte) 0x1f,
+ (byte) 0x10, (byte) 0xfe, (byte) 0xff, (byte) 0x0f, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x5d,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0xde, (byte) 0xbb, (byte) 0x19, (byte) 0xe5,
+ (byte) 0x1f, (byte) 0x69, (byte) 0xec, (byte) 0xdf, (byte) 0x94,
+ (byte) 0xc4, (byte) 0xee, (byte) 0xd6, (byte) 0xb6, (byte) 0x75,
+ (byte) 0x68, (byte) 0x8e, (byte) 0x63, (byte) 0x75, (byte) 0x0c,
+ (byte) 0xdd, (byte) 0xe8, (byte) 0xd2, (byte) 0xe5, (byte) 0xc0,
+ (byte) 0xc7, (byte) 0x73, (byte) 0x4c, (byte) 0x2d, (byte) 0x33,
+ (byte) 0x03, (byte) 0x37, (byte) 0x5c, (byte) 0x32, (byte) 0x2d,
+ (byte) 0xb4, (byte) 0x66, (byte) 0x14, (byte) 0x77, (byte) 0x32,
+ (byte) 0xe6, (byte) 0xe5, (byte) 0x4d, (byte) 0xdd, (byte) 0xdd,
+ (byte) 0x5b, (byte) 0xb5, (byte) 0x1b, (byte) 0x5c, (byte) 0xd6,
+ (byte) 0xe5, (byte) 0x4d, (byte) 0xab, (byte) 0x68, (byte) 0x94,
+ (byte) 0x45, (byte) 0xad, (byte) 0xa5, (byte) 0x2d, (byte) 0x76,
+ (byte) 0xe3, (byte) 0xa5, (byte) 0x34, (byte) 0xc2, (byte) 0xe2,
+ (byte) 0x6d, (byte) 0xc5, (byte) 0xdb, (byte) 0xb9, (byte) 0x6a,
+ (byte) 0xe5, (byte) 0xcb, (byte) 0x98, (byte) 0xe5, (byte) 0x8d,
+ (byte) 0x8a, (byte) 0x5e, (byte) 0xb3, (byte) 0x31, (byte) 0x56,
+ (byte) 0xaa, (byte) 0xb5, (byte) 0xde, (byte) 0x2e, (byte) 0xad,
+ (byte) 0xbc, (byte) 0x79, (byte) 0xbc, (byte) 0xb7, (byte) 0x69,
+ (byte) 0x99, (byte) 0x4e, (byte) 0x02, (byte) 0x5b, (byte) 0xbe,
+ (byte) 0xfe, (byte) 0x15, (byte) 0xdd, (byte) 0x4e, (byte) 0x74,
+ (byte) 0x23, (byte) 0x20, (byte) 0xef, (byte) 0x79, (byte) 0xdb,
+ (byte) 0xe9, (byte) 0xbd, (byte) 0xf3, (byte) 0xc8, (byte) 0x8b,
+ (byte) 0xcb, (byte) 0xd3, (byte) 0x93, (byte) 0x33, (byte) 0x17,
+ (byte) 0xa1, (byte) 0xd5, (byte) 0xe3, (byte) 0xbb, (byte) 0xa8,
+ (byte) 0x11, (byte) 0x67, (byte) 0x64, (byte) 0x24, (byte) 0x5a,
+ (byte) 0xc9, (byte) 0x04, (byte) 0x45, (byte) 0x2c, (byte) 0x83,
+ (byte) 0x93, (byte) 0x28, (byte) 0xb6, (byte) 0xf3, (byte) 0x6b,
+ (byte) 0x45, (byte) 0xb7, (byte) 0xca, (byte) 0x24, (byte) 0x5c,
+ (byte) 0x24, (byte) 0xc4, (byte) 0x3a, (byte) 0x12, (byte) 0x29,
+ (byte) 0xe9, (byte) 0xb2, (byte) 0x8b, (byte) 0x1d, (byte) 0x67,
+ (byte) 0xf7, (byte) 0x52, (byte) 0x5e, (byte) 0x14, (byte) 0xe4,
+ (byte) 0x8a, (byte) 0x95, (byte) 0xae, (byte) 0xb3, (byte) 0x09,
+ (byte) 0x2d, (byte) 0x65, (byte) 0x97, (byte) 0xa9, (byte) 0x5b,
+ (byte) 0x7f, (byte) 0x98, (byte) 0x9b, (byte) 0x8d, (byte) 0x16,
+ (byte) 0x3a, (byte) 0x6b, (byte) 0xfd, (byte) 0xb2, (byte) 0x33,
+ (byte) 0xa4, (byte) 0x58, (byte) 0xeb, (byte) 0x2f, (byte) 0xeb,
+ (byte) 0x61, (byte) 0x26, (byte) 0xfe, (byte) 0xeb, (byte) 0xa6,
+ (byte) 0xf1, (byte) 0xff, (byte) 0x32, (byte) 0x42, (byte) 0x6c,
+ (byte) 0xe9, (byte) 0x63, (byte) 0xb4, (byte) 0xd5, (byte) 0xd4,
+ (byte) 0xa6, (byte) 0x7d, (byte) 0x52, (byte) 0x27, (byte) 0xfb,
+ (byte) 0xc2, (byte) 0x24, (byte) 0xa2, (byte) 0x36, (byte) 0x4c,
+ (byte) 0xee, (byte) 0xe8, (byte) 0xae, (byte) 0xe4, (byte) 0xd2,
+ (byte) 0x3f, (byte) 0xd1, (byte) 0xb0, (byte) 0x45, (byte) 0x52,
+ (byte) 0x6a, (byte) 0x9c, (byte) 0xc9, (byte) 0x09, (byte) 0xdd,
+ (byte) 0x0b, (byte) 0xfb, (byte) 0xb9, (byte) 0x34, (byte) 0x35,
+ (byte) 0x37, (byte) 0x72, (byte) 0x54, (byte) 0x2d, (byte) 0x64,
+ (byte) 0x7a, (byte) 0x48, (byte) 0x97, (byte) 0xee, (byte) 0x88,
+ (byte) 0xae, (byte) 0x24, (byte) 0xbe, (byte) 0x6b, (byte) 0x4b,
+ (byte) 0x1d, (byte) 0x37, (byte) 0xf6, (byte) 0x78, (byte) 0x46,
+ (byte) 0xd3, (byte) 0xc7, (byte) 0x69, (byte) 0xa9, (byte) 0xe1,
+ (byte) 0x0e, (byte) 0x51, (byte) 0xbd, (byte) 0xfe, (byte) 0xa8,
+ (byte) 0x99, (byte) 0x9a, (byte) 0x6e, (byte) 0x96, (byte) 0x07,
+ (byte) 0xb1, (byte) 0x85, (byte) 0x3e, (byte) 0x24, (byte) 0xd6,
+ (byte) 0xbe, (byte) 0x26, (byte) 0x6d, (byte) 0xa5, (byte) 0xad,
+ (byte) 0x7e, (byte) 0x63, (byte) 0x60, (byte) 0x0c, (byte) 0x3b,
+ (byte) 0xe2, (byte) 0xa1, (byte) 0xb6, (byte) 0x8c, (byte) 0x4c,
+ (byte) 0xd7, (byte) 0xcb, (byte) 0x26, (byte) 0x5e, (byte) 0xcb,
+ (byte) 0x54, (byte) 0x92, (byte) 0xa2, (byte) 0x48, (byte) 0xa6,
+ (byte) 0xef, (byte) 0x09, (byte) 0x9c, (byte) 0xe4, (byte) 0xb3,
+ (byte) 0x27, (byte) 0x96, (byte) 0x74, (byte) 0x89, (byte) 0x2c,
+ (byte) 0xa8, (byte) 0x26, (byte) 0xad, (byte) 0xe8, (byte) 0xc9,
+ (byte) 0xd8, (byte) 0x7e, (byte) 0x66, (byte) 0x59, (byte) 0x93,
+ (byte) 0xd1, (byte) 0x96, (byte) 0xee, (byte) 0xe6, (byte) 0x6b,
+ (byte) 0x83, (byte) 0xc7, (byte) 0xd5, (byte) 0xbf, (byte) 0x9e,
+ (byte) 0x7e, (byte) 0xb2, (byte) 0x4f, (byte) 0x5c, (byte) 0x74,
+ (byte) 0x5f, (byte) 0x13, (byte) 0xae, (byte) 0x07, (byte) 0x77,
+ (byte) 0x82, (byte) 0xee, (byte) 0xf6, (byte) 0x60, (byte) 0x47,
+ (byte) 0x9d, (byte) 0x0b, (byte) 0x4c, (byte) 0x67, (byte) 0xe5,
+ (byte) 0x95, (byte) 0xa1, (byte) 0xb7, (byte) 0x1e, (byte) 0x2c,
+ (byte) 0x07, (byte) 0x70, (byte) 0xad, (byte) 0x29, (byte) 0x75,
+ (byte) 0x3c, (byte) 0xf2, (byte) 0xa0, (byte) 0xfa, (byte) 0xa9,
+ (byte) 0xb8, (byte) 0x95, (byte) 0x13, (byte) 0x21, (byte) 0x9d,
+ (byte) 0xd5, (byte) 0x61, (byte) 0x30, (byte) 0x8f, (byte) 0x25,
+ (byte) 0xb8, (byte) 0xa2, (byte) 0xe1, (byte) 0xf1, (byte) 0x14,
+ (byte) 0x0a, (byte) 0x7a, (byte) 0xec, (byte) 0x24, (byte) 0x4f,
+ (byte) 0x06, (byte) 0x89, (byte) 0x1e, (byte) 0x77, (byte) 0xba,
+ (byte) 0xc7, (byte) 0x32, (byte) 0x58, (byte) 0xe3, (byte) 0x93,
+ (byte) 0xdc, (byte) 0xd2, (byte) 0xfc, (byte) 0x3e, (byte) 0x22,
+ (byte) 0x41, (byte) 0xfe, (byte) 0x9a, (byte) 0x35, (byte) 0xd9,
+ (byte) 0x63, (byte) 0x8a, (byte) 0x7c, (byte) 0xfd, (byte) 0x24,
+ (byte) 0x67, (byte) 0x94, (byte) 0xc1, (byte) 0x70, (byte) 0x1f,
+ (byte) 0x11, (byte) 0xaa, (byte) 0x2f, (byte) 0x4f, (byte) 0x35,
+ (byte) 0x27, (byte) 0x8b, (byte) 0x46, (byte) 0x87, (byte) 0x7e,
+ (byte) 0x6f, (byte) 0x77, (byte) 0x43, (byte) 0x2d, (byte) 0xdd,
+ (byte) 0xeb, (byte) 0x90, (byte) 0x7e, (byte) 0xf6, (byte) 0x0a,
+ (byte) 0x80, (byte) 0xc7, (byte) 0xf1, (byte) 0x60, (byte) 0xcc,
+ (byte) 0xb9, (byte) 0xd9, (byte) 0x71, (byte) 0x20, (byte) 0x29,
+ (byte) 0xa0, (byte) 0x77, (byte) 0x9b, (byte) 0x77, (byte) 0x0b,
+ (byte) 0xf8, (byte) 0xa6, (byte) 0xb4, (byte) 0xa5, (byte) 0xd3,
+ (byte) 0x73, (byte) 0xcc, (byte) 0xa7, (byte) 0x53, (byte) 0x8e,
+ (byte) 0xe6, (byte) 0xf4, (byte) 0xc6, (byte) 0x98, (byte) 0x53,
+ (byte) 0xdc, (byte) 0x2e, (byte) 0x6d, (byte) 0xf7, (byte) 0xae,
+ (byte) 0xc1, (byte) 0x68, (byte) 0x9d, (byte) 0x2f, (byte) 0x6c,
+ (byte) 0x7a, (byte) 0x4f, (byte) 0xc0, (byte) 0x29, (byte) 0x2e,
+ (byte) 0x78, (byte) 0x46, (byte) 0xa5, (byte) 0xf2, (byte) 0x18,
+ (byte) 0xf6, (byte) 0xfc, (byte) 0x37, (byte) 0x37, (byte) 0x3a,
+ (byte) 0xfa, (byte) 0x65, (byte) 0x6d, (byte) 0x89, (byte) 0x9c,
+ (byte) 0x16, (byte) 0x0d, (byte) 0xb1, (byte) 0xc5, (byte) 0x3a,
+ (byte) 0x7f, (byte) 0xf1, (byte) 0xb7, (byte) 0xe5, (byte) 0x9f,
+ (byte) 0x79, (byte) 0x9f, (byte) 0x3f, (byte) 0xcb, (byte) 0xfe,
+ (byte) 0x8c, (byte) 0x3b, (byte) 0xbd, (byte) 0x4c, (byte) 0x1e,
+ (byte) 0x00, (byte) 0xac, (byte) 0x98, (byte) 0xf0, (byte) 0x8f,
+ (byte) 0x59, (byte) 0xe8, (byte) 0xb1, (byte) 0x57, (byte) 0x01,
+ (byte) 0xd5, (byte) 0x19, (byte) 0xb9, (byte) 0x1d, (byte) 0x63,
+ (byte) 0xab, (byte) 0x57, (byte) 0x1d, (byte) 0x53, (byte) 0xd5,
+ (byte) 0x5d, (byte) 0x64, (byte) 0xd5, (byte) 0x7e, (byte) 0x66,
+ (byte) 0x0d, (byte) 0xc0, (byte) 0xed, (byte) 0x58, (byte) 0x56,
+ (byte) 0xe7, (byte) 0xde, (byte) 0xc3, (byte) 0xd7, (byte) 0x40,
+ (byte) 0xdd, (byte) 0xf8, (byte) 0x93, (byte) 0x47, (byte) 0x5b,
+ (byte) 0xff, (byte) 0x8e, (byte) 0xb7, (byte) 0xad, (byte) 0x8c,
+ (byte) 0xa1, (byte) 0xd6, (byte) 0xfe, (byte) 0xb8, (byte) 0xdd,
+ (byte) 0x95, (byte) 0xbe, (byte) 0xfb, (byte) 0x0a, (byte) 0x70,
+ (byte) 0x55, (byte) 0xbc, (byte) 0x56, (byte) 0xe0, (byte) 0x99,
+ (byte) 0xf2, (byte) 0x58, (byte) 0x89, (byte) 0x87, (byte) 0xe1,
+ (byte) 0x40, (byte) 0x5b, (byte) 0xb6, (byte) 0x5b, (byte) 0xd0,
+ (byte) 0x42, (byte) 0xde, (byte) 0x8e, (byte) 0x4a, (byte) 0xdd,
+ (byte) 0xf6, (byte) 0x4a, (byte) 0xdd, (byte) 0x53, (byte) 0x15,
+ (byte) 0xb8, (byte) 0x7d, (byte) 0xfc, (byte) 0x09, (byte) 0xc3,
+ (byte) 0xad, (byte) 0xd0, (byte) 0x1d, (byte) 0x6f, (byte) 0xd1,
+ (byte) 0x8c, (byte) 0xdb, (byte) 0x27, (byte) 0xe9, (byte) 0xc9,
+ (byte) 0x5b, (byte) 0x60, (byte) 0x7e, (byte) 0x2f, (byte) 0x6a,
+ (byte) 0x74, (byte) 0xe4, (byte) 0x63, (byte) 0x19, (byte) 0x2c,
+ (byte) 0xd8, (byte) 0x37, (byte) 0x56, (byte) 0xf6, (byte) 0xba,
+ (byte) 0xac, (byte) 0x99, (byte) 0xd9, (byte) 0x23, (byte) 0xe9,
+ (byte) 0x73, (byte) 0xcc, (byte) 0x2b, (byte) 0xc1, (byte) 0x4c,
+ (byte) 0xd6, (byte) 0x4e, (byte) 0xc7, (byte) 0x7d, (byte) 0x86,
+ (byte) 0x68, (byte) 0x7a, (byte) 0xe6, (byte) 0x35, (byte) 0x18,
+ (byte) 0x6c, (byte) 0xdf, (byte) 0x59, (byte) 0x46, (byte) 0x34,
+ (byte) 0x59, (byte) 0x82, (byte) 0x9d, (byte) 0x78, (byte) 0x6d,
+ (byte) 0x12, (byte) 0x66, (byte) 0x90, (byte) 0xfd, (byte) 0x5e,
+ (byte) 0xf9, (byte) 0x8a, (byte) 0x0a, (byte) 0x82, (byte) 0x67,
+ (byte) 0x1e, (byte) 0x51, (byte) 0x68, (byte) 0x0a, (byte) 0x88,
+ (byte) 0x99, (byte) 0x9e, (byte) 0x60, (byte) 0xad, (byte) 0x9a,
+ (byte) 0xc4, (byte) 0xc0, (byte) 0xc8, (byte) 0x54, (byte) 0x8a,
+ (byte) 0xe4, (byte) 0x99, (byte) 0xcc, (byte) 0xb1, (byte) 0xdc,
+ (byte) 0x60, (byte) 0x93, (byte) 0x35, (byte) 0x4c, (byte) 0x1a,
+ (byte) 0x1a, (byte) 0x84, (byte) 0xe7, (byte) 0x04, (byte) 0xdc,
+ (byte) 0x5c, (byte) 0x99, (byte) 0xef, (byte) 0x58, (byte) 0x39,
+ (byte) 0xd1, (byte) 0x39, (byte) 0x5d, (byte) 0xe4, (byte) 0x2d,
+ (byte) 0x4c, (byte) 0x27, (byte) 0x85, (byte) 0x69, (byte) 0x4e,
+ (byte) 0x5a, (byte) 0x57, (byte) 0x2b, (byte) 0xd2, (byte) 0x07,
+ (byte) 0xe9, (byte) 0x0c, (byte) 0xfe, (byte) 0x8d, (byte) 0x25,
+ (byte) 0xde, (byte) 0x96, (byte) 0x2d, (byte) 0xfb, (byte) 0xe0,
+ (byte) 0x26, (byte) 0x60, (byte) 0x6c, (byte) 0xde, (byte) 0x3a,
+ (byte) 0xaa, (byte) 0xf3, (byte) 0xde, (byte) 0x3b, (byte) 0xcd,
+ (byte) 0xba, (byte) 0xaa, (byte) 0x82, (byte) 0x74, (byte) 0xda,
+ (byte) 0x9d, (byte) 0x2c, (byte) 0x0e, (byte) 0x90, (byte) 0xdb,
+ (byte) 0x4a, (byte) 0x72, (byte) 0xde, (byte) 0x7b, (byte) 0x4e,
+ (byte) 0x45, (byte) 0xec, (byte) 0x97, (byte) 0x38, (byte) 0x5c,
+ (byte) 0x7f, (byte) 0x80, (byte) 0x5b, (byte) 0x92, (byte) 0xdb,
+ (byte) 0x0f, (byte) 0x5e, (byte) 0x80, (byte) 0xb4, (byte) 0x9d,
+ (byte) 0x99, (byte) 0x79, (byte) 0xc5, (byte) 0xb7, (byte) 0x2d,
+ (byte) 0xc0, (byte) 0x4a, (byte) 0xe2, (byte) 0x82, (byte) 0x6b,
+ (byte) 0xe2, (byte) 0x0e, (byte) 0xd5, (byte) 0x8c, (byte) 0xa6,
+ (byte) 0x8b, (byte) 0xb6, (byte) 0x2a, (byte) 0xc0, (byte) 0x6b,
+ (byte) 0x8a, (byte) 0xb4, (byte) 0x48, (byte) 0xc1, (byte) 0x1f,
+ (byte) 0xda, (byte) 0xb2, (byte) 0xaf, (byte) 0x2d, (byte) 0xa0,
+ (byte) 0x56, (byte) 0x69, (byte) 0x5f, (byte) 0x20, (byte) 0x65,
+ (byte) 0xad, (byte) 0x2b, (byte) 0x03, (byte) 0xc7, (byte) 0xda,
+ (byte) 0x08, (byte) 0xfa, (byte) 0x72, (byte) 0x7c, (byte) 0x22,
+ (byte) 0xe9, (byte) 0x0f, (byte) 0xeb, (byte) 0xfc, (byte) 0x75,
+ (byte) 0xe8, (byte) 0x8f, (byte) 0xbd, (byte) 0xf6, (byte) 0xf2,
+ (byte) 0x21, (byte) 0x9b, (byte) 0x4b, (byte) 0x95, (byte) 0x22,
+ (byte) 0x88, (byte) 0xd3, (byte) 0x5d, (byte) 0x9f, (byte) 0xf3,
+ (byte) 0xf0, (byte) 0xef, (byte) 0x94, (byte) 0x29, (byte) 0xa1,
+ (byte) 0xcd, (byte) 0xbd, (byte) 0x49, (byte) 0x44, (byte) 0xf5,
+ (byte) 0x3e, (byte) 0x7c, (byte) 0x58, (byte) 0x51, (byte) 0xe1,
+ (byte) 0x68, (byte) 0x46, (byte) 0x54, (byte) 0xe5, (byte) 0x0b,
+ (byte) 0x75, (byte) 0x95, (byte) 0x0e, (byte) 0xfc, (byte) 0x8b,
+ (byte) 0x10, (byte) 0x60, (byte) 0x2e, (byte) 0xf1, (byte) 0x7f,
+ (byte) 0x17, (byte) 0x09, (byte) 0xc5, (byte) 0x4c, (byte) 0x58,
+ (byte) 0xe5, (byte) 0x55, (byte) 0x16, (byte) 0x39, (byte) 0xb0,
+ (byte) 0xd6, (byte) 0x94, (byte) 0x38, (byte) 0xb1, (byte) 0xf6,
+ (byte) 0xa4, (byte) 0x5f, (byte) 0x99, (byte) 0x16, (byte) 0xb6,
+ (byte) 0x43, (byte) 0x81, (byte) 0x87, (byte) 0xff, (byte) 0x34,
+ (byte) 0x3f, (byte) 0x96, (byte) 0x03, (byte) 0xad, (byte) 0x90,
+ (byte) 0xd1, (byte) 0xf4, (byte) 0xc9, (byte) 0xfc, (byte) 0x53,
+ (byte) 0x43, (byte) 0x99, (byte) 0x98, (byte) 0x0a, (byte) 0xf4,
+ (byte) 0xe2, (byte) 0x86, (byte) 0x6c, (byte) 0x5d, (byte) 0xdc,
+ (byte) 0x34, (byte) 0xd7, (byte) 0xf2, (byte) 0x21, (byte) 0xc7,
+ (byte) 0x4c, (byte) 0x3f, (byte) 0x52, (byte) 0x15, (byte) 0xce,
+ (byte) 0x0c, (byte) 0x33, (byte) 0xfc, (byte) 0x8b, (byte) 0x45,
+ (byte) 0x91, (byte) 0xde, (byte) 0x07, (byte) 0xf5, (byte) 0x60,
+ (byte) 0x26, (byte) 0x15, (byte) 0xf2, (byte) 0x57, (byte) 0xdf,
+ (byte) 0xe1, (byte) 0x32, (byte) 0x30, (byte) 0x8f, (byte) 0xd2,
+ (byte) 0x1c, (byte) 0xdf, (byte) 0x9c, (byte) 0x36, (byte) 0xdd,
+ (byte) 0x9f, (byte) 0x64, (byte) 0x31, (byte) 0xee, (byte) 0x25,
+ (byte) 0x6a, (byte) 0x86, (byte) 0xbd, (byte) 0x39, (byte) 0xa4,
+ (byte) 0xd9, (byte) 0xce, (byte) 0xc9, (byte) 0xfd, (byte) 0x9c,
+ (byte) 0x8f, (byte) 0xc0, (byte) 0x60, (byte) 0xe2, (byte) 0xa0,
+ (byte) 0xec, (byte) 0x13, (byte) 0x6c, (byte) 0xec, (byte) 0x50,
+ (byte) 0x7c, (byte) 0xc4, (byte) 0x1b, (byte) 0x44, (byte) 0x1b,
+ (byte) 0x74, (byte) 0x17, (byte) 0xaa, (byte) 0x36, (byte) 0x68,
+ (byte) 0xd0, (byte) 0x7e, (byte) 0xb5, (byte) 0x5b, (byte) 0x3c,
+ (byte) 0x92, (byte) 0x6c, (byte) 0xe5, (byte) 0x26, (byte) 0x1b,
+ (byte) 0x3c, (byte) 0xc2, (byte) 0x46, (byte) 0xba, (byte) 0x0c,
+ (byte) 0xd3, (byte) 0xa6, (byte) 0xcc, (byte) 0xda, (byte) 0x0a,
+ (byte) 0xe8, (byte) 0x87, (byte) 0x9e, (byte) 0x46, (byte) 0x7f,
+ (byte) 0x89, (byte) 0x26, (byte) 0xcf, (byte) 0xc6, (byte) 0x83,
+ (byte) 0x4e, (byte) 0xe1, (byte) 0xb3, (byte) 0x05, (byte) 0x07,
+ (byte) 0x6e, (byte) 0x83, (byte) 0xea, (byte) 0x20, (byte) 0xef,
+ (byte) 0x50, (byte) 0x6d, (byte) 0x50, (byte) 0x7d, (byte) 0x74,
+ (byte) 0x1b, (byte) 0xa4, (byte) 0x18, (byte) 0xa8, (byte) 0x3c,
+ (byte) 0xb4, (byte) 0x71, (byte) 0xf9, (byte) 0x28, (byte) 0x3d,
+ (byte) 0x44, (byte) 0x1e, (byte) 0x1a, (byte) 0x2b, (byte) 0xf7,
+ (byte) 0x65, (byte) 0xfd, (byte) 0xfe, (byte) 0x7f, (byte) 0xe5,
+ (byte) 0x41, (byte) 0xe5, (byte) 0x20, (byte) 0xd4, (byte) 0xa3,
+ (byte) 0xe9, (byte) 0xec, (byte) 0x91, (byte) 0xbf, (byte) 0xc0,
+ (byte) 0x41, (byte) 0xe7, (byte) 0x10, (byte) 0xfd, (byte) 0x36,
+ (byte) 0x4b, (byte) 0x5f, (byte) 0x4d, (byte) 0x51, (byte) 0xb5,
+ (byte) 0x89, (byte) 0xf8, (byte) 0x75, (byte) 0x8d, (byte) 0xfa,
+ (byte) 0x5d, (byte) 0xac, (byte) 0x4d, (byte) 0x60, (byte) 0x29,
+ (byte) 0x14, (byte) 0xcc, (byte) 0x2d, (byte) 0xec, (byte) 0x24,
+ (byte) 0x9e, (byte) 0x5a, (byte) 0xd2, (byte) 0x92, (byte) 0xe4,
+ (byte) 0xf2, (byte) 0x1d, (byte) 0x3b, (byte) 0xaf, (byte) 0x75,
+ (byte) 0xc5, (byte) 0x91, (byte) 0x59, (byte) 0xa5, (byte) 0xf0,
+ (byte) 0xc6, (byte) 0x8d, (byte) 0x18, (byte) 0xf6, (byte) 0x6f,
+ (byte) 0x1b, (byte) 0x8e, (byte) 0x51, (byte) 0x33, (byte) 0x44,
+ (byte) 0xf4, (byte) 0xbe, (byte) 0xcf, (byte) 0xe9, (byte) 0xa6,
+ (byte) 0xbe, (byte) 0xe1, (byte) 0x9d, (byte) 0x0f, (byte) 0xd8,
+ (byte) 0xb4, (byte) 0x1c, (byte) 0xb0, (byte) 0xef, (byte) 0x1e,
+ (byte) 0xb7, (byte) 0x21, (byte) 0xab, (byte) 0x16, (byte) 0xe5,
+ (byte) 0xf4, (byte) 0x51, (byte) 0x28, (byte) 0x07, (byte) 0x7b,
+ (byte) 0x67, (byte) 0xf2, (byte) 0x1b, (byte) 0x97, (byte) 0x4c,
+ (byte) 0x76, (byte) 0x0d, (byte) 0xfa, (byte) 0x23, (byte) 0xa8,
+ (byte) 0x5d, (byte) 0xbd, (byte) 0xc3, (byte) 0x9a, (byte) 0x38,
+ (byte) 0xb2, (byte) 0xd2, (byte) 0xf1, (byte) 0xcb, (byte) 0xc1,
+ (byte) 0x2f, (byte) 0x18, (byte) 0xf4, (byte) 0x3f, (byte) 0x73,
+ (byte) 0xd3, (byte) 0x22, (byte) 0x5b, (byte) 0x19, (byte) 0xab,
+ (byte) 0x1b, (byte) 0x36, (byte) 0x9a, (byte) 0xb1, (byte) 0xdd,
+ (byte) 0x02, (byte) 0x90, (byte) 0xd3, (byte) 0xc0, (byte) 0x06,
+ (byte) 0x34, (byte) 0x6b, (byte) 0xc8, (byte) 0x9c, (byte) 0xd3,
+ (byte) 0x1e, (byte) 0x36, (byte) 0x56, (byte) 0x26, (byte) 0x58,
+ (byte) 0x54, (byte) 0xec, (byte) 0x06, (byte) 0xbd, (byte) 0x47,
+ (byte) 0x60, (byte) 0xd0, (byte) 0xf8, (byte) 0xd1, (byte) 0x2a,
+ (byte) 0x81, (byte) 0xdf, (byte) 0x0c, (byte) 0xeb, (byte) 0xf6,
+ (byte) 0x1b, (byte) 0x5f, (byte) 0x42, (byte) 0xd3, (byte) 0x6b,
+ (byte) 0xdf, (byte) 0x34, (byte) 0xde, (byte) 0x7f, (byte) 0xf5,
+ (byte) 0x77, (byte) 0xee, (byte) 0x69, (byte) 0xd8, (byte) 0x19,
+ (byte) 0xf2, (byte) 0x15, (byte) 0x30, (byte) 0xd8, (byte) 0x9d,
+ (byte) 0x01, (byte) 0xe0, (byte) 0x06, (byte) 0xb2, (byte) 0x77,
+ (byte) 0xc0, (byte) 0x52, (byte) 0x28, (byte) 0x2e, (byte) 0xac,
+ (byte) 0x0a, (byte) 0x85, (byte) 0x07, (byte) 0x81, (byte) 0x20,
+ (byte) 0x6b, (byte) 0xc0, (byte) 0xaa, (byte) 0x02, (byte) 0x10,
+ (byte) 0x10, (byte) 0xc0, (byte) 0xdd, (byte) 0x28, (byte) 0x2f,
+ (byte) 0x18, (byte) 0x0b, (byte) 0x40, (byte) 0x2d, (byte) 0x94,
+ (byte) 0x18, (byte) 0x54, (byte) 0x50, (byte) 0x78, (byte) 0x52,
+ (byte) 0x05, (byte) 0xe2, (byte) 0x83, (byte) 0x90, (byte) 0xc0,
+ (byte) 0xe5, (byte) 0x28, (byte) 0x27, (byte) 0xe0, (byte) 0x73,
+ (byte) 0x40, (byte) 0x5c, (byte) 0x0e, (byte) 0x80, (byte) 0x18,
+ (byte) 0x20, (byte) 0x4a, (byte) 0x50, (byte) 0x5e, (byte) 0xf0,
+ (byte) 0x18, (byte) 0xa6, (byte) 0xe4, (byte) 0xc1, (byte) 0xd8,
+ (byte) 0x37, (byte) 0x4a, (byte) 0x8a, (byte) 0x5a, (byte) 0xa2,
+ (byte) 0x96, (byte) 0xa8, (byte) 0xa5, (byte) 0x81, (byte) 0xf9,
+ (byte) 0x10, (byte) 0xd3, (byte) 0x33, (byte) 0x4d, (byte) 0x50,
+ (byte) 0xd3, (byte) 0x54, (byte) 0x34, (byte) 0xd5, (byte) 0x0d,
+ (byte) 0x35, (byte) 0x43, (byte) 0x4d, (byte) 0x50, (byte) 0xc7,
+ (byte) 0x54, (byte) 0x78, (byte) 0xf2, (byte) 0x07, (byte) 0xce,
+ (byte) 0x04, (byte) 0x1d, (byte) 0xce, (byte) 0xe2, (byte) 0x0d,
+ (byte) 0x7e, (byte) 0xed, (byte) 0xf3, (byte) 0xe7, (byte) 0xd5,
+ (byte) 0x6f, (byte) 0x83, (byte) 0xbd, (byte) 0x2d, (byte) 0x85,
+ (byte) 0x18, (byte) 0x4e, (byte) 0xe7, (byte) 0x51, (byte) 0x07,
+ (byte) 0x4d, (byte) 0xe5, (byte) 0x69, (byte) 0x2b, (byte) 0x2b,
+ (byte) 0xab, (byte) 0x8a, (byte) 0xb2, (byte) 0xbe, (byte) 0xc2,
+ (byte) 0xae, (byte) 0x0d, (byte) 0x5e, (byte) 0xca, (byte) 0xb7,
+ (byte) 0xb5, (byte) 0x20, (byte) 0x78, (byte) 0x41, (byte) 0xd3,
+ (byte) 0xed, (byte) 0xf9, (byte) 0xa8, (byte) 0x5d, (byte) 0x97,
+ (byte) 0xf6, (byte) 0x2b, (byte) 0x55, (byte) 0x2d, (byte) 0x58,
+ (byte) 0xb4, (byte) 0x25, (byte) 0xa3, (byte) 0x2d, (byte) 0xc9,
+ (byte) 0x5b, (byte) 0x03, (byte) 0x3f, (byte) 0xcc, (byte) 0xcb,
+ (byte) 0xf5, (byte) 0xe7, (byte) 0x3a, (byte) 0xb9, (byte) 0x9f,
+ (byte) 0xfb, (byte) 0x00 };
+
+ // Data for AMR audio file used in audio message case
+ // AMR format specification: http://www.ietf.org/rfc/rfc3267.txt
+ public static final byte[] HTI_AMR_DATA = new byte[] {
+ (byte) 0x23, (byte) 0x21, (byte) 0x41, (byte) 0x4d, (byte) 0x52,
+ (byte) 0x0a, (byte) 0x0c, (byte) 0x1f, (byte) 0xb9, (byte) 0x67,
+ (byte) 0xf7, (byte) 0xf1, (byte) 0xfd, (byte) 0xf5, (byte) 0x47,
+ (byte) 0xbf, (byte) 0x2e, (byte) 0x61, (byte) 0xc0, (byte) 0x60,
+ (byte) 0x0c, (byte) 0x1f, (byte) 0xb9, (byte) 0x67, (byte) 0xf7,
+ (byte) 0xf1, (byte) 0xfd, (byte) 0xf5, (byte) 0x47, (byte) 0xbf,
+ (byte) 0x2e, (byte) 0x61, (byte) 0xc0, (byte) 0x60, (byte) 0x0c,
+ (byte) 0x85, (byte) 0x8e, (byte) 0xc7, (byte) 0xff, (byte) 0xf0,
+ (byte) 0xf7, (byte) 0xb1, (byte) 0xff, (byte) 0xff, (byte) 0x3e,
+ (byte) 0x20, (byte) 0xc4, (byte) 0x66, (byte) 0x0c, (byte) 0x40,
+ (byte) 0x42, (byte) 0xcf, (byte) 0xc2, (byte) 0x6b, (byte) 0xdd,
+ (byte) 0x35, (byte) 0x7d, (byte) 0xa7, (byte) 0x06, (byte) 0xa6,
+ (byte) 0xda, (byte) 0x8c, (byte) 0x0c, (byte) 0x06, (byte) 0x08,
+ (byte) 0x1d, (byte) 0x6f, (byte) 0x7e, (byte) 0x22, (byte) 0x0f,
+ (byte) 0x4e, (byte) 0xa1, (byte) 0x7e, (byte) 0x64, (byte) 0x11,
+ (byte) 0x18, (byte) 0x0c, (byte) 0x1f, (byte) 0xae, (byte) 0xbb,
+ (byte) 0x04, (byte) 0x71, (byte) 0x29, (byte) 0x7a, (byte) 0xba,
+ (byte) 0x15, (byte) 0x39, (byte) 0x15, (byte) 0x79, (byte) 0x30,
+ (byte) 0x0c, (byte) 0xcb, (byte) 0x39, (byte) 0x99, (byte) 0xdb,
+ (byte) 0x75, (byte) 0x83, (byte) 0xde, (byte) 0xe5, (byte) 0xa1,
+ (byte) 0x27, (byte) 0x00, (byte) 0x41, (byte) 0x40, (byte) 0x0c,
+ (byte) 0x1f, (byte) 0x8c, (byte) 0x3f, (byte) 0xfd, (byte) 0xef,
+ (byte) 0xf8, (byte) 0xd4, (byte) 0x67, (byte) 0xbf, (byte) 0x15,
+ (byte) 0x9d, (byte) 0x07, (byte) 0x56, (byte) 0x0c, (byte) 0x08,
+ (byte) 0xe8, (byte) 0xb6, (byte) 0xaf, (byte) 0x77, (byte) 0x66,
+ (byte) 0xbe, (byte) 0x42, (byte) 0x8b, (byte) 0xa6, (byte) 0x87,
+ (byte) 0x69, (byte) 0x96, (byte) 0x0c, (byte) 0xc4, (byte) 0x18,
+ (byte) 0xc2, (byte) 0xf3, (byte) 0xf2, (byte) 0x30, (byte) 0x99,
+ (byte) 0xf8, (byte) 0x4a, (byte) 0xcf, (byte) 0x0a, (byte) 0x8d,
+ (byte) 0xc2, (byte) 0x0c, (byte) 0x00, (byte) 0x8a, (byte) 0xda,
+ (byte) 0x72, (byte) 0x4f, (byte) 0x14, (byte) 0xbf, (byte) 0xe5,
+ (byte) 0xa5, (byte) 0xa7, (byte) 0x34, (byte) 0x0b, (byte) 0x0e,
+ (byte) 0x0c, (byte) 0x07, (byte) 0x7f, (byte) 0x6c, (byte) 0xdf,
+ (byte) 0x7f, (byte) 0xc0, (byte) 0x5f, (byte) 0x64, (byte) 0x94,
+ (byte) 0x94, (byte) 0x32, (byte) 0x02, (byte) 0x16, (byte) 0x0c,
+ (byte) 0xb4, (byte) 0x16, (byte) 0x75, (byte) 0xbf, (byte) 0xe7,
+ (byte) 0x50, (byte) 0x58, (byte) 0xf9, (byte) 0x7f, (byte) 0x0f,
+ (byte) 0x4e, (byte) 0x81, (byte) 0x42, (byte) 0x0c, (byte) 0x44,
+ (byte) 0x36, (byte) 0xb2, (byte) 0xbb, (byte) 0x77, (byte) 0x58,
+ (byte) 0x34, (byte) 0x69, (byte) 0x8b, (byte) 0x0e, (byte) 0xff,
+ (byte) 0xeb, (byte) 0x76, (byte) 0x0c, (byte) 0xdc, (byte) 0x36,
+ (byte) 0x73, (byte) 0xfb, (byte) 0x5f, (byte) 0x50, (byte) 0xbf,
+ (byte) 0xc1, (byte) 0x86, (byte) 0x0a, (byte) 0x0b, (byte) 0x68,
+ (byte) 0x80, (byte) 0x0c, (byte) 0x08, (byte) 0x8a, (byte) 0x06,
+ (byte) 0x7f, (byte) 0x7f, (byte) 0x4d, (byte) 0xea, (byte) 0xf8,
+ (byte) 0x14, (byte) 0x3e, (byte) 0x57, (byte) 0x0f, (byte) 0x78 };
+
+// ==============================================================================
+// Public methods
+
+// ==============================================================================
+// Protected methods
+
+// ==============================================================================
+// Private methods
+
+// ==============================================================================
+// Protected attributes
+
+// ==============================================================================
+// Private attributes
+
+// ==============================================================================
+// Static initialization block
+
+//==============================================================================
+//Inner classes
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/src/com/nokia/hti/common/HtiException.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: HTI specific exception.
+*
+*/
+
+
+package com.nokia.hti.common;
+
+/**
+ * HTI specific exception.
+ */
+public class HtiException extends Exception
+{
+//==============================================================================
+//Public constants
+
+//==============================================================================
+//Public methods
+
+ public HtiException( String message )
+ {
+ super( message );
+ }
+
+//==============================================================================
+//Protected methods
+
+//==============================================================================
+//Private methods
+
+//==============================================================================
+//Protected attributes
+
+//==============================================================================
+//Private attributes
+
+//==============================================================================
+//Static initialization block
+
+//==============================================================================
+//Inner classes
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/src/com/nokia/hti/common/HtiHelper.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,850 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Helper class to create, send and receive HTI messages.
+*
+*/
+
+
+package com.nokia.hti.common;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Arrays;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Helper class to create, send and receive HTI messages.
+ *
+ */
+public class HtiHelper
+{
+//==============================================================================
+//Public constants
+
+ /**
+ * Validates that the given service uid is among the existing UID's.
+ *
+ * @param serviceUid The UID to be validated.
+ * @return true if given service UID is valid, otherwise false.
+ */
+ public static boolean validateServiceUid( int serviceUid )
+ {
+ return serviceUid == HtiConstants.SERVICE_UID_APP ||
+ serviceUid == HtiConstants.SERVICE_UID_ECHO ||
+ serviceUid == HtiConstants.SERVICE_UID_FTP ||
+ serviceUid == HtiConstants.SERVICE_UID_HTI ||
+ serviceUid == HtiConstants.SERVICE_UID_KEYEVENT ||
+ serviceUid == HtiConstants.SERVICE_UID_SCREEN ||
+ serviceUid == HtiConstants.SERVICE_UID_STIF ||
+ serviceUid == HtiConstants.SERVICE_UID_SYSINFO ||
+ serviceUid == HtiConstants.SERVICE_UID_AUDIO ||
+ serviceUid == HtiConstants.SERVICE_UID_PIM ||
+ serviceUid == HtiConstants.SERVICE_UID_MESSAGES ;
+ }
+
+ /**
+ * Creates a HTI message from given service UID and input file containing
+ * the message body.
+ *
+ * @param serviceUid The UID of the destination service.
+ * @param inputFile The file containing the message body.
+ * @return The created HTI message as a byte array.
+ * @throws Exception if error occurs in file handling.
+ */
+ public static byte[] createHtiMessage( int serviceUid, File inputFile )
+ throws Exception
+ {
+ byte[] message = new byte[14 + (int)inputFile.length()];
+
+ Arrays.fill( message, (byte)0 );
+
+ // add service UID, 4 bytes
+ CommonMethods.intToLittleEndianBytes( serviceUid, message, 0, 4 );
+
+ // add body size, 4 bytes
+ int bodySize = (int)inputFile.length();
+ CommonMethods.intToLittleEndianBytes( bodySize, message, 4, 4 );
+
+ // hti message version
+ message[8] = (byte)1;
+
+ // hti message priority
+ message[9] = serviceUid == HtiConstants.SERVICE_UID_FTP ? (byte) 2 : (byte) 0;
+
+ // leave flags and ext size to zero
+
+ // add the crc
+ int crc = CommonMethods.CRC16CCITT( message, 12 );
+ CommonMethods.intToLittleEndianBytes( crc, message, 12, 2 );
+
+ // read message body from file
+ FileInputStream fis = new FileInputStream( inputFile );
+ byte[] buf = new byte[1024];
+ int readBytes;
+ int offset = 14;
+ while( ( readBytes = fis.read( buf ) ) != -1 )
+ {
+ System.arraycopy( buf, 0, message, offset, readBytes );
+ offset += readBytes;
+ }
+
+ return message;
+ }
+
+ /**
+ * Wrapper to the private helper method.
+ * Creates a HTI message from given service UID, command and parameters.
+ * Sets HTI message priority to the default value (=0).
+ *
+ * @param serviceUid The UID of the destination service.
+ * @param command The command for the destination service.
+ * @param params Optional parameters for the command.
+ * @return The created HTI message as a byte array.
+ */
+ public static byte[] createHtiMessage( int serviceUid,
+ int command,
+ byte[] params )
+ {
+ return createHtiMessage( serviceUid, command, params, 0, true );
+ }
+
+ /**
+ * Wrapper to the private helper method.
+ * Creates a HTI message from given service UID and parameters, with no
+ * command specified for the destination service.
+ * Sets HTI message priority to the default value (=0).
+ * This method can be used in testing the ECHO service and error situations
+ * when the command is missing.
+ *
+ * @param serviceUid The UID of the destination service.
+ * @param params Optional parameters for the command.
+ * @return The created HTI message as a byte array.
+ */
+ public static byte[] createHtiMessage( int serviceUid, byte[] params )
+ {
+ return createHtiMessage( serviceUid, -1, params, 0, false );
+ }
+
+ /**
+ * Wrapper to the private helper method.
+ * Creates a command message for the FTP service with given command and
+ * parameters.
+ * Sets HTI message priority to the FTP command priority (=2).
+ *
+ * @param command The command for the FTP service.
+ * @param params The parameters for the command.
+ * @return The created HTI message as a byte array.
+ */
+ public static byte[] createFTPCommandMessage( int command,
+ byte[] params )
+ {
+ return createHtiMessage( HtiConstants.SERVICE_UID_FTP, command, params, 2, true );
+ }
+
+ /**
+ * Wrapper to the private helper method.
+ * Creates a command message for the FTP service with given parameters and
+ * with no command specified.
+ * Sets HTI message priority to the FTP command priority (=2).
+ * This method can be used in testing the error situations when the command
+ * is missing.
+ *
+ * @param params The parameters for the command.
+ * @return The created HTI message as a byte array.
+ */
+ public static byte[] createFTPCommandMessage( byte[] params )
+ {
+ return createHtiMessage( HtiConstants.SERVICE_UID_FTP, -1, params, 2, false );
+ }
+
+ /**
+ * Writes the HTI message to the given output stream.
+ *
+ * @param message HTI message as a byte array.
+ * @param out Output stream to which the HTI message is written.
+ * @throws IOException if I/O error occurs when writing to the stream.
+ */
+ public static void sendHtiMessage( byte[] message, OutputStream out )
+ throws IOException
+ {
+ out.write( message );
+ out.flush();
+ }
+
+ /**
+ * Encapsulates the content of the given file to the HTI messages and sends
+ * them to the given output stream. Used with FTP STOR command.
+ *
+ * @param file The file which is sent.
+ * @param out Output stream to which the HTI messages are written.
+ * @throws Exception if an error occurs when reading the file or
+ * writing to the stream.
+ */
+ public static void sendFileToFtpService( File file, OutputStream out )
+ throws Exception
+ {
+ if( file.length() == 0 )
+ {
+ sendEmptyFileToFtpService( out );
+ return;
+ }
+
+ final int BODY_MAX_SIZE = 10*1024 - 14;
+ //final int BODY_MAX_SIZE = 2*1024 - 14;
+
+ byte[] headerBytes = new byte[14];
+ long fileRemaining = file.length();
+ FileInputStream fis = new FileInputStream( file );
+
+ logger.info( "File size: " + fileRemaining );
+
+ while( fileRemaining > 0 )
+ {
+ Arrays.fill( headerBytes, (byte)0 );
+
+ // add ftp service uid to header
+ CommonMethods.intToLittleEndianBytes( HtiConstants.SERVICE_UID_FTP,
+ headerBytes,
+ 0,
+ 4);
+
+ int bodySize = fileRemaining <= BODY_MAX_SIZE
+ ? (int)fileRemaining
+ : BODY_MAX_SIZE;
+ fileRemaining -= bodySize;
+
+ logger.info( "Body size: " + bodySize );
+ logger.info( "File remaining: " + fileRemaining );
+
+ CommonMethods.intToLittleEndianBytes( bodySize, headerBytes, 4, 4 );
+
+ // hti message version
+ headerBytes[8] = (byte)1;
+
+ // add the crc
+ int crc = CommonMethods.CRC16CCITT( headerBytes, 12 );
+ CommonMethods.intToLittleEndianBytes( crc, headerBytes, 12, 2 );
+
+ // send header to the output stream
+ out.write( headerBytes );
+
+ // read message body from file, and send it to the output stream
+ byte[] buf = new byte[BODY_MAX_SIZE];
+ int readBytes;
+ int sentBytes = 0;
+ do
+ {
+ readBytes = fis.read( buf );
+ out.write( buf, 0, readBytes );
+ sentBytes += readBytes;
+
+ } while( sentBytes < bodySize );
+
+ out.flush();
+// Thread.sleep( 1000 );
+ }
+
+ out.flush();
+ fis.close();
+ }
+
+ /**
+ * Encapsulates the content of the given byte array to the HTI messages
+ * and sends them to the given output stream. Used with FTP STOR command.
+ *
+ * @param data The byte array containing data which is sent.
+ * @param out Output stream to which the HTI messages are written.
+ * @throws Exception if an error occurs when reading the file or
+ * writing to the stream.
+ */
+ public static void sendByteArrayToFtpService( byte[] data,
+ OutputStream out )
+ throws Exception
+ {
+ final int BODY_MAX_SIZE = 10*1024 - 14;
+
+ byte[] headerBytes = new byte[14];
+ int dataRemaining = data.length;
+ int offset = 0;
+
+ logger.info( "Data length: " + dataRemaining );
+
+ while( dataRemaining > 0 )
+ {
+ Arrays.fill( headerBytes, (byte)0 );
+
+ // add ftp service uid to header
+ CommonMethods.intToLittleEndianBytes( HtiConstants.SERVICE_UID_FTP,
+ headerBytes,
+ 0,
+ 4);
+
+ int bodySize = dataRemaining <= BODY_MAX_SIZE
+ ? (int)dataRemaining
+ : BODY_MAX_SIZE;
+ dataRemaining -= bodySize;
+
+ logger.info( "Body size: " + bodySize );
+ logger.info( "Data remaining: " + dataRemaining );
+
+ CommonMethods.intToLittleEndianBytes( bodySize, headerBytes, 4, 4 );
+
+ // hti message version
+ headerBytes[8] = (byte)1;
+
+ // add the crc
+ int crc = CommonMethods.CRC16CCITT( headerBytes, 12 );
+ CommonMethods.intToLittleEndianBytes( crc, headerBytes, 12, 2 );
+
+ // send header to the output stream
+ out.write( headerBytes );
+
+ // get message body from data array, and send it to the
+ // output stream
+ byte[] buf = new byte[BODY_MAX_SIZE];
+ System.arraycopy( data, offset, buf, 0, bodySize );
+ out.write( buf, 0, bodySize );
+ out.flush();
+
+ dataRemaining -= bodySize;
+ offset += bodySize;
+ }
+
+ out.flush();
+ }
+
+ /**
+ * Sends an empty FTP data message. Used with FTP STOR command when
+ * uploading zero sized files.
+ *
+ * @param out Output stream to which the HTI messages are written.
+ * @throws Exception if an error occurs when reading the file or
+ * writing to the stream.
+ */
+ public static void sendEmptyFileToFtpService( OutputStream out )
+ throws Exception
+ {
+ // create a FTP data message, which contains no data (only HTI header)
+ byte[] headerBytes = new byte[14];
+ Arrays.fill( headerBytes, (byte)0 );
+
+ // add ftp service uid to header
+ CommonMethods.intToLittleEndianBytes( HtiConstants.SERVICE_UID_FTP,
+ headerBytes,
+ 0,
+ 4);
+
+ // bytes defining the message body size are left to zero
+
+ // hti message version
+ headerBytes[8] = (byte)1;
+
+ // hti message priority is left to zero
+
+ // flags and ext size are left to zero
+
+ // add the crc
+ int crc = CommonMethods.CRC16CCITT( headerBytes, 12 );
+ CommonMethods.intToLittleEndianBytes( crc, headerBytes, 12, 2 );
+
+ // send header to the output stream
+ out.write( headerBytes );
+ }
+
+ /**
+ * Reads file content encapsulated in HTI messages from an input stream
+ * and writes the data to the file with given file name.
+ * Used with FTP RETR command.
+ *
+ * @param filename Local file name to which the received data is
+ * written.
+ * @param fileSize The size of the file received.
+ * @param in Input stream from which the HTI messages are read.
+ * @throws Exception if an error occurs when reading from stream or
+ * writing the file.
+ */
+ public static void receiveFileFromFtpService( String filename,
+ long fileSize,
+ InputStream in )
+ throws Exception
+ {
+ byte[] header = new byte[14];
+ long readBytes = 0;
+ FileOutputStream fos = new FileOutputStream( filename );
+
+ // For zero sized file we will get one empty data message
+ // so must always read at least one message.
+ do
+ {
+ //read the header
+ int readHeader = 0;
+ do
+ {
+ readHeader += in.read( header,
+ readHeader,
+ header.length - readHeader );
+ }
+ while( readHeader < header.length );
+
+ // first check the crc
+ if ( CommonMethods.CRC16CCITT( header, 12 ) !=
+ CommonMethods.littleEndianBytesToInt( header, 12, 2 ) )
+ {
+ logger.info( CommonMethods.formatByteArray( "Invalid header",
+ header,
+ 0,
+ header.length ) );
+ logger.info( "Header as string: " +
+ CommonMethods.extractString( header,
+ 0,
+ header.length ) );
+ throw new HtiException( "Invalid header. CRC's do not match." );
+ }
+
+ // read the extension, if there is any
+ int extSize = header[11];
+ byte[] extension = new byte[extSize];
+ if( extSize > 0 )
+ {
+ int readExt = 0;
+ do
+ {
+ readExt += in.read( extension, readExt, extSize - readExt );
+ }
+ while( readExt < extSize );
+ }
+
+ // get the body size from the header
+ int bodySize = CommonMethods.littleEndianBytesToInt( header, 4, 4 );
+
+ // read the body
+ byte[] buf = new byte[1024];
+ int received = 0;
+ int readBodyBytes;
+ int maxBytesToRead;
+ do
+ {
+ // make sure not to read beyond the current HTI message
+ maxBytesToRead = bodySize - received < buf.length
+ ? bodySize - received
+ : buf.length;
+ readBodyBytes = in.read( buf, 0, maxBytesToRead );
+ received += readBodyBytes;
+ fos.write( buf, 0, readBodyBytes );
+ }
+ while( received < bodySize );
+
+ readBytes += received;
+
+ logger.info( "Read HTI message, body size: " + bodySize );
+ logger.info( "Total bytes read: " + readBytes );
+
+ fos.flush();
+ }
+ while( readBytes < fileSize );
+
+ fos.close();
+ }
+
+ /**
+ * Reads file content encapsulated in HTI messages from an input stream
+ * and returns the file content as byte array.
+ *
+ * @param fileSize The size of the file received.
+ * @param in Input stream from which the HTI messages are read.
+ * @throws Exception if an error occurs when reading from stream or
+ * writing the file.
+ */
+ public static byte[] receiveFileFromFtpServiceAsByteArray( long fileSize,
+ InputStream in )
+ throws Exception
+ {
+ byte[] result = new byte[(int)fileSize];
+
+ byte[] header = new byte[14];
+ long readBytes = 0;
+
+ // For zero sized file we will get one empty data message
+ // so must always read at least one message.
+ do
+ {
+ //read the header
+ int readHeader = 0;
+ do
+ {
+ readHeader += in.read( header,
+ readHeader,
+ header.length - readHeader );
+ }
+ while( readHeader < header.length );
+
+ // first check the crc
+ if ( CommonMethods.CRC16CCITT( header, 12 ) !=
+ CommonMethods.littleEndianBytesToInt( header, 12, 2 ) )
+ {
+ logger.info( CommonMethods.formatByteArray( "Invalid header",
+ header,
+ 0,
+ header.length ) );
+ logger.info( "Header as string: " +
+ CommonMethods.extractString( header,
+ 0,
+ header.length ) );
+ throw new HtiException( "Invalid header. CRC's do not match." );
+ }
+
+ // read the extension, if there is any
+ int extSize = header[11];
+ byte[] extension = new byte[extSize];
+ if( extSize > 0 )
+ {
+ int readExt = 0;
+ do
+ {
+ readExt += in.read( extension, readExt, extSize - readExt );
+ }
+ while( readExt < extSize );
+ }
+
+ // get the body size from the header
+ int bodySize = CommonMethods.littleEndianBytesToInt( header, 4, 4 );
+
+ // read the body
+ byte[] buf = new byte[1024];
+ int received = 0;
+ int readBodyBytes;
+ int maxBytesToRead;
+ do
+ {
+ // make sure not to read beyond the current HTI message
+ maxBytesToRead = bodySize - received < buf.length
+ ? bodySize - received
+ : buf.length;
+ readBodyBytes = in.read( buf, 0, maxBytesToRead );
+ System.arraycopy( buf,
+ 0,
+ result,
+ (int)readBytes + received,
+ readBodyBytes );
+ received += readBodyBytes;
+ }
+ while( received < bodySize );
+
+ readBytes += received;
+ }
+ while( readBytes < fileSize );
+
+ return result;
+ }
+
+ /**
+ * Reads a HTI message from an input stream and returns the message body
+ * as a byte array.
+ *
+ * @param in Input stream from which the HTI message is read.
+ * @return The body of the HTI message that was read.
+ * @throws IOException if there is an error reading from the stream.
+ * @throws HtiException if the HTI message header is not valid.
+ */
+ public static byte[] receiveResponse( InputStream in )
+ throws IOException, HtiException
+ {
+ byte[] header = new byte[14];
+ int readBytes = 0;
+
+ //read the header
+ do
+ {
+ readBytes += in.read( header, readBytes, header.length-readBytes );
+ }
+ while( readBytes < header.length );
+
+ logger.fine( CommonMethods.formatByteArray( "Received message header",
+ header, 0, header.length ) );
+
+ // first check the crc
+ if ( CommonMethods.CRC16CCITT( header, 12 ) !=
+ CommonMethods.littleEndianBytesToInt( header, 12, 2 ) )
+ {
+ throw new HtiException( "Invalid header. CRC's do not match." );
+ }
+
+ // read the extension, if there is any
+ int extSize = header[11];
+ byte[] extension = new byte[extSize];
+ if( extSize > 0 )
+ {
+ int readExt = 0;
+ do
+ {
+ readExt += in.read( extension, readExt, extSize - readExt );
+ }
+ while( readExt < extSize );
+ }
+
+ // get the body size from the header
+ int bodySize = CommonMethods.littleEndianBytesToInt( header, 4, 4 );
+ logger.fine( "Body size: " + bodySize );
+
+ // read the body
+ byte[] body = new byte[bodySize];
+ readBytes = 0;
+ do
+ {
+ readBytes += in.read( body, readBytes, bodySize - readBytes );
+ }
+ while( readBytes < bodySize );
+
+ logger.fine( CommonMethods.formatByteArray( "Received message body",
+ body,
+ 0,
+ body.length ) );
+ return body;
+ }
+
+ /**
+ * Reads a HTI message from an input stream and writes the message body
+ * to the given file.
+ *
+ * @param in Input stream from which the HTI message is read.
+ * @param outputFile File to which the message body is written.
+ * @throws IOException if I/O error occurs.
+ * @throws HtiException if the HTI message header is not valid.
+ */
+ public static void receiveResponse( InputStream in, File outputFile )
+ throws IOException, HtiException
+ {
+ byte[] header = new byte[14];
+ int readBytes = 0;
+
+ //read the header
+ do
+ {
+ readBytes += in.read( header, readBytes, header.length-readBytes );
+ }
+ while( readBytes < header.length );
+
+ // check the crc
+ if ( CommonMethods.CRC16CCITT( header, 12 ) !=
+ CommonMethods.littleEndianBytesToInt( header, 12, 2 ) )
+ {
+ throw new HtiException( "Invalid header. CRC's do not match." );
+ }
+
+ // read the extension, if there is any
+ int extSize = header[11];
+ byte[] extension = new byte[extSize];
+ if( extSize > 0 )
+ {
+ int readExt = 0;
+ do
+ {
+ readExt += in.read( extension, readExt, extSize - readExt );
+ }
+ while( readExt < extSize );
+ }
+
+ // get the body size from the header
+ int bodySize = CommonMethods.littleEndianBytesToInt( header, 4, 4 );
+
+ // read the body
+ byte[] body = new byte[bodySize];
+ readBytes = 0;
+ do
+ {
+ readBytes += in.read( body, readBytes, bodySize - readBytes );
+ }
+ while( readBytes < bodySize );
+
+ // write the message body to the output file
+ FileOutputStream fos = new FileOutputStream( outputFile );
+ fos.write( body );
+ fos.flush();
+ fos.close();
+ }
+
+ /**
+ * Sends a press key command to the HTI's key event service with given
+ * key code and verifies the OK response.
+ *
+ * @param out Output stream to which the HTI message is written
+ * @param in Input strem from which the response is read
+ * @param keyCode The key code for the key to be pressed
+ * @throws IOException if writing to or reading from stream fails
+ * @throws HtiException if no OK reply is received
+ */
+ public static void pressKey( OutputStream out,
+ InputStream in,
+ int keyCode )
+ throws IOException, HtiException
+ {
+ byte[] keyBytes = new byte[2];
+ CommonMethods.intToLittleEndianBytes( keyCode, keyBytes, 0, 2 );
+ byte[] msg =
+ HtiHelper.createHtiMessage( HtiConstants.SERVICE_UID_KEYEVENT,
+ HtiConstants.CMD_KEYEVENT_PRESSKEY,
+ keyBytes );
+ HtiHelper.sendHtiMessage( msg, out );
+ byte[] response = HtiHelper.receiveResponse( in );
+ if( (byte)HtiConstants.CMD_KEYEVENT_OK != response[0] )
+ {
+ throw new HtiException( "Pressing key failed with key code: " +
+ keyCode );
+ }
+ }
+
+ /**
+ * Formats an HTI error response to a human readable form
+ *
+ * @param response The response bytes received from HTI
+ * @return HTI error code, service error code, plugin UID
+ * and error description. Empty string if data is not HTI error msg.
+ * @throws HtiException if no OK reply is received
+ */
+ public static String formatHtiErrorMsg( byte[] response )
+ {
+ if ( response.length < 10 ) return "";
+ if ( response[0] != (byte) 0xFF ) return "";
+
+ StringBuffer sb = new StringBuffer();
+ sb.append( "HtiError = " );
+ if ( response[1] == HtiConstants.ERROR_HTI_MSG_TOO_BIG )
+ sb.append( "MessageTooBig" );
+ else if ( response[1] == HtiConstants.ERROR_HTI_OUT_OF_MEMORY )
+ sb.append( "OutOfMemory" );
+ else if ( response[1] == HtiConstants.ERROR_HTI_SERVICE_NOT_FOUND )
+ sb.append( "ServiceNotFound" );
+ else if ( response[1] == HtiConstants.ERROR_HTI_SERVICE_ERROR )
+ sb.append( "ServiceError" );
+ else if ( response[1] == HtiConstants.ERROR_HTI_NOT_AUTHORIZED )
+ sb.append( "NotAuthorized" );
+ else if ( response[1] == HtiConstants.ERROR_HTI_FAILED_UNWRAP )
+ sb.append( "FailedUnwrap" );
+ else
+ sb.append( "Unknown" );
+
+ sb.append( "\nServiceErrorCode = " );
+ sb.append( CommonMethods.littleEndianBytesToInt( response, 2, 4 ) );
+ sb.append( "\nPluginUID = " );
+ sb.append( CommonMethods.littleEndianBytesToInt(response, 6, 4 ) );
+ sb.append( "\nDescription = " );
+ if ( response.length > 10 )
+ {
+ sb.append( new String ( response ).substring( 10 ) );
+ }
+ return sb.toString();
+ }
+
+
+
+//==============================================================================
+//Protected methods
+
+//==============================================================================
+//Private methods
+
+ /**
+ * Creates a HTI message from given destination service UID,
+ * command, parameters and priority.
+ *
+ * @param serviceUid The UID of the destination service.
+ * @param command The command for the destination service.
+ * @param params Optional parameters for the command.
+ * @param priority The priority in HTI message.
+ * @param withCommand Flag indicating if the command is present or omited.
+ * @return The created HTI message as a byte array.
+ */
+ private static byte[] createHtiMessage( int serviceUid,
+ int command,
+ byte[] params,
+ int priority,
+ boolean withCommand )
+ {
+ // first construct the message header
+ byte[] headerBytes = new byte[14];
+ Arrays.fill( headerBytes, (byte)0 );
+
+ // add service UID, 4 bytes
+ CommonMethods.intToLittleEndianBytes( serviceUid, headerBytes, 0, 4 );
+
+ // add body size, 4 bytes
+ int bodySize = withCommand ? 1 + params.length : params.length;
+ CommonMethods.intToLittleEndianBytes( bodySize, headerBytes, 4, 4 );
+
+ // hti message version
+ headerBytes[8] = (byte)1;
+
+ // hti message priority
+ headerBytes[9] = (byte)priority;
+
+ // leave flags and ext size to zero
+
+ // add the crc
+ int crc = CommonMethods.CRC16CCITT( headerBytes, 12 );
+ CommonMethods.intToLittleEndianBytes( crc, headerBytes, 12, 2 );
+
+
+ // next, construct the whole message, header + command + params
+ byte[] messageBytes = new byte[headerBytes.length + bodySize];
+ System.arraycopy( headerBytes, 0, messageBytes, 0, headerBytes.length );
+ if( withCommand )
+ {
+ messageBytes[headerBytes.length] = (byte)command;
+ System.arraycopy( params,
+ 0,
+ messageBytes,
+ headerBytes.length + 1,
+ params.length );
+ }
+ else
+ {
+ System.arraycopy( params,
+ 0,
+ messageBytes,
+ headerBytes.length,
+ params.length );
+ }
+
+ logger.info( CommonMethods.formatByteArray( "Created message",
+ messageBytes,
+ 0,
+ messageBytes.length ) );
+
+ return messageBytes;
+ }
+
+//==============================================================================
+//Protected attributes
+
+//==============================================================================
+//Private attributes
+
+//==============================================================================
+//Static initialization block
+
+ public static Logger logger;
+ static
+ {
+ logger = CommonMethods.getSimpleLogger( HtiHelper.class.getName(),
+ Level.SEVERE );
+ }
+
+//==============================================================================
+//Inner classes
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/src/com/nokia/hti/common/HtiProperties.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: A singleton class providing connection properties used in
+* system tests and tools.
+* The properties are defined in HTI.properties file.
+*
+*/
+
+
+package com.nokia.hti.common;
+
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * A singleton class providing connection properties used in the system tests
+ * and tools. The properties are defined in HTI.properties file.
+ */
+public class HtiProperties
+{
+//==============================================================================
+//Public constants
+
+//==============================================================================
+//Public methods
+
+ public static HtiProperties getInstance()
+ {
+ return getInstance( Locale.getDefault() );
+ }
+
+ public static HtiProperties getInstance( Locale locale )
+ {
+ HtiProperties htiProps = (HtiProperties)instances.get( locale );
+ if( htiProps == null )
+ {
+ htiProps = new HtiProperties( locale );
+ instances.put( locale, htiProps );
+ }
+
+ return htiProps;
+ }
+
+ public int getInt( String key )
+ {
+ return Integer.parseInt( bundle.getString( key ) );
+ }
+
+ public String getString( String key )
+ {
+ try
+ {
+ return bundle.getString( key );
+ }
+ catch( Exception e )
+ {
+ return null;
+ }
+ }
+
+//==============================================================================
+//Protected methods
+
+//==============================================================================
+//Private methods
+
+ private HtiProperties( Locale locale )
+ {
+ bundle = ResourceBundle.getBundle( "HTI", locale );
+ }
+
+//==============================================================================
+//Protected attributes
+
+//==============================================================================
+//Private attributes
+
+ private ResourceBundle bundle;
+ private static HashMap instances = new HashMap();
+
+//==============================================================================
+//Static initialization block
+
+//==============================================================================
+//Inner classes
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/src/com/nokia/hti/common/SimpleLogFormatter.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Simple log formatter used with Java's logger.
+*
+*/
+
+
+package com.nokia.hti.common;
+
+import java.util.logging.Formatter;
+import java.util.logging.LogRecord;
+
+/**
+ * Simple log formatter used with Java's logger.
+ *
+ */
+public class SimpleLogFormatter extends Formatter
+{
+
+//==============================================================================
+//Public constants
+
+//==============================================================================
+//Public methods
+
+ public String format( LogRecord record )
+ {
+ return record.getMessage() == null
+ ? "\n"
+ : record.getMessage() + "\n";
+ }
+
+//==============================================================================
+//Protected methods
+
+//==============================================================================
+//Private methods
+
+//==============================================================================
+//Protected attributes
+
+//==============================================================================
+//Private attributes
+
+//==============================================================================
+//Static initialization block
+
+//==============================================================================
+//Inner classes
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/src/com/nokia/testfw/testrunner/LogMsgWriter.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.testrunner;
+
+import java.io.*;
+
+public class LogMsgWriter {
+ public static final String DEFAULT_LOG_FILE = "";
+ public static final String FMT_START_TEST = "StartTest[%s]\n";
+ public static final String END_TEST = "EndTest\n";
+ public static final String FMT_LIST_CASE = "ListCase[%s]\n";
+ public static final String FMT_START_CASE = "StartCase[%s]\n";
+ public static final String FMT_TEST_FAILED_MSG = "TestFailedMsg[%s]\n";
+ public static final String FMT_LONG_TEST_FAILED_MSG = "TestFailedMsg[%s]File[%s]Line[%d]\n";
+ public static final String FMT_END_CASE = "EndCase Result[%s]Time[%d]ms\n";
+ public static final String PASSED = "passed";
+ public static final String FAILED = "failed";
+
+ public LogMsgWriter() {
+ try {
+ logger = new FileWriter(DEFAULT_LOG_FILE, true);
+ } catch (IOException e) {
+ System.err.println(e);
+ }
+ }
+
+ public LogMsgWriter(String logName) {
+ try {
+ logger = new FileWriter(logName, true);
+ } catch (IOException e) {
+ System.err.println(e);
+ }
+ }
+
+ // Methods to write log.
+ public void writeStartTest(String msg) {
+ try {
+ String line = String.format(FMT_START_CASE, msg);
+ write(line);
+ } catch (IOException e) {
+ System.err.println(e);
+ }
+ }
+
+ public void writeEndTest() {
+ try {
+ write(END_TEST);
+ } catch (IOException e) {
+ System.err.println(e);
+ }
+ }
+
+ public void writeCaseList(String[] caseNames) {
+ try {
+ for (int i = 0; i < caseNames.length; ++i) {
+ String line = String.format(FMT_LIST_CASE, caseNames[i]);
+ write(line);
+ }
+ } catch (IOException e) {
+ System.err.println(e);
+ }
+ }
+
+ public void writeStartCase(String msg) {
+ try {
+ String line = String.format(FMT_START_CASE, msg);
+ write(line);
+ } catch (IOException e) {
+ System.err.println(e);
+ }
+ }
+
+ public void writeTestFailureMsg(String msg) {
+ try {
+ String line = String.format(FMT_TEST_FAILED_MSG, msg);
+ write(line);
+ } catch (IOException e) {
+ System.err.println(e);
+ }
+ }
+
+ public void writeLongTestFailureMsg(String msg, String fileName, int lineNo) {
+ try {
+ String line = String.format(FMT_LONG_TEST_FAILED_MSG, msg, fileName, lineNo);
+ write(line);
+ } catch (IOException e) {
+ System.err.println(e);
+ }
+ }
+
+ public void writeEndCaseResult(boolean passed, int timeSpent) {
+ try {
+ String line = String.format(FMT_END_CASE, passed ? PASSED : FAILED, timeSpent);
+ write(line);
+ } catch (IOException e) {
+ System.err.println(e);
+ }
+ }
+
+ // This should be called explicitly.
+ public void close() {
+ try {
+ logger.flush();
+ logger.close();
+ } catch (IOException e) {
+ System.err.println(e);
+ }
+ }
+
+ private void write(String msg) throws IOException {
+ logger.write(msg);
+ logger.flush();
+ }
+
+ private FileWriter logger = null;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/src/com/nokia/testfw/testrunner/SymbianUnitTestCommandLineParser.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,110 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: A tool that parse command line parser.
+*
+*/
+
+
+package com.nokia.testfw.testrunner;
+
+public class SymbianUnitTestCommandLineParser {
+
+ public static final String TEST_CASE_KEY = "-cases=";
+ public static final String TEST_CASE_KEY_SHORT = "-c=";
+ public static final String TESTS_KEY = "-tests=";
+ public static final String TESTS_KEY_SHORT = "-t=";
+ public static final String EPOC_ROOT = "-epocroot=";
+ public static final String EPOC_ROOT_SHORT = "-e=";
+ public static final String ALLOC_KEY = "-alloc";
+ public static final String ALLOC_KEY_SHORT = "-a";
+ public static final String OUTPUT_KEY = "-output=";
+ public static final String OUTPUT_KEY_SHORT = "-o=";
+// public static final String NO_PROMPT_KEY = "-noprompt";
+ public static final String TIMEOUT_KEY = "-timeout=";
+ public static final String TIMEOUT_KEY_SHORT = "-to=";
+ public static final String DEFAULT_OUTPUT_FORMAT = "html";
+ public static final String OUTPUT_FILE_NAME = "SymbianUnitTestResults";
+ public static final String DEVICE_KEY = "-device";
+ public static final String DEVICE_KEY_SHORT = "-d";
+
+ public static final int SYMBIAN_UNIT_TEST_DEFAULT_TIMEOUT = 30;
+
+ public static String findArgument(String[] arguments, String key, String shortKey) {
+ boolean found = false;
+ String value = null;
+
+ if (arguments == null)
+ throw new NullPointerException();
+
+ for (int i = 0; i < arguments.length; ++i) {
+ if (arguments[i].compareTo(key) == 0 || arguments[i].compareTo(shortKey) == 0) {
+ int equalsPos = arguments[i].indexOf('=');
+ if (equalsPos > 0 & equalsPos < arguments[i].length() - 1) {
+ value = arguments[i].substring(equalsPos + 1);
+ found = true;
+ }
+ }
+ }
+ return found? value : null;
+ }
+
+ public static boolean hasArgument(String[] arguments, String key, String shortKey){
+ boolean found = false;
+ for (int i = 0; i < arguments.length; ++i){
+ if (arguments[i].compareTo(key) == 0 || arguments[i].compareTo(shortKey) == 0){
+ found = true;
+ }
+ }
+ return found;
+ }
+
+ public static String[] getTestCaseNames(String[] arguments){
+ return findArgument(arguments, TEST_CASE_KEY, TEST_CASE_KEY_SHORT).split(",");
+ }
+
+ public static String[] getTestDllNames(String[] arguments){
+ return findArgument(arguments, TESTS_KEY, TESTS_KEY_SHORT).split(",");
+ }
+
+ public static int getTimeout(String[] arguments) {
+ String timeOut = findArgument(arguments, TIMEOUT_KEY, TIMEOUT_KEY_SHORT);
+ if (timeOut == null)
+ return SYMBIAN_UNIT_TEST_DEFAULT_TIMEOUT;
+ else
+ return Integer.parseInt(timeOut);
+ }
+
+ public static String getOutputFormat(String[] arguments){
+ String outputFormat = findArgument(arguments, OUTPUT_KEY, OUTPUT_KEY_SHORT);
+ if (outputFormat == null)
+ outputFormat = DEFAULT_OUTPUT_FORMAT;
+ return outputFormat;
+ }
+
+ public static String getOutputFileName(){
+ return OUTPUT_FILE_NAME;
+ }
+
+ public static boolean getMemoryAllocationFailureSimulation(String[] arguments){
+ return hasArgument(arguments, ALLOC_KEY, ALLOC_KEY_SHORT);
+ }
+
+ public static String getEpocRoot(String[] arguments){
+ return findArgument(arguments, EPOC_ROOT, EPOC_ROOT_SHORT);
+ }
+
+ public static boolean getRunOnDevice(String[] arguments){
+ return hasArgument(arguments, DEVICE_KEY, DEVICE_KEY_SHORT);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/src/com.nokia.testfw.testrunner/src/com/nokia/testfw/testrunner/TestRunner.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,22 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.testrunner;
+
+public class TestRunner {
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/com.nokia.testfw.cmdtool"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/com.nokia.testfw.codegen"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.cmdtool.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/.settings/org.eclipse.jdt.core.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,12 @@
+#Wed Dec 23 11:15:09 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+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.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/src/com/nokia/testfw/cmdtool/test/GccxmlWrapperTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: wrapper class for manual test.
+*
+*/
+package com.nokia.testfw.cmdtool.test;
+
+import java.util.Vector;
+
+import com.nokia.testfw.cmdtool.cbrowserwrapper.*;
+
+public class GccxmlWrapperTest implements IParseListener {
+
+
+ public GccxmlWrapperTest()
+ {
+ }
+
+ public void Run(String bldfilename)
+ {
+ IParseWrapper wrapper = new CBrowserWrapper();
+ wrapper.AddParseListener(this);
+ Vector<SymCMMPInfo> mmpList = wrapper.Parse(bldfilename);
+ for(int i=0;i<mmpList.size();i++)
+ {
+ SymCMMPInfo mmpInfo = mmpList.get(i);
+ System.out.println("======================================");
+ System.out.println("MMP FILE:" + mmpInfo.Name);
+
+ for(SymCClassInfo classInfo: mmpInfo.ClassList())
+ {
+ System.out.println(" Class:" + classInfo.Name);
+
+ for(SymCMethodInfo methodInfo : classInfo.FunctionList())
+ {
+ System.out.print(" " + methodInfo.toString() + "\r\n");
+ System.out.print(" >>>md: " + methodInfo.DefinitionFile + "\r\n");
+ System.out.print(" >>>mi: " + methodInfo.ImplementationFile + "\r\n");
+ }
+ }
+
+ }
+
+ System.out.println("**********************************************************");
+
+ }
+
+ public void GetParseMessage(ParseEventType type, String message) {
+ // TODO Auto-generated method stub
+ if(type == ParseEventType.Done)
+ {
+ System.out.println("Done!");
+ }
+ else if(type == ParseEventType.Failed)
+ {
+ System.out.println("Error: " + message);
+ }
+ else
+ {
+ System.out.println(message);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/src/com/nokia/testfw/cmdtool/test/TParseTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,191 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Unit test for cmdtool.
+* 6 cases included in the test.
+* 1, standard project test: a mmp file in a bld.inf file.
+* 2, multi-mmp files in a bld.inf file.
+* 3, multi bld.inf files in a bld.inf file.
+* 4, error command
+* 5, help command
+* 6, version command
+*
+*/
+package com.nokia.testfw.cmdtool.test;
+
+import java.util.Map;
+
+import com.nokia.testfw.cmdtool.ui.Executor;
+import com.nokia.testfw.cmdtool.util.CmdExecutor;
+import com.nokia.testfw.cmdtool.util.PathUtil;
+import com.nokia.testfw.codegen.model.ProjectNodeImpl;
+
+import junit.framework.TestCase;
+
+public class TParseTest extends TestCase {
+
+ /*NOTICE:
+ Before Start your test.
+ please modify these two lines to locate your testing resource and test tool.
+ */
+ //Location of testing resource.
+ private String testcaseresourcelocation = "z:\\unittest\\";
+ //location of SymUTCreator.bat
+ private String symutcreatorlocation = "D:\\TestTools\\project\\STF\\2.development";
+
+ private String case1filename = "standard\\testThread\\group\\bld.inf";
+ private String case1prjname = "testThread";
+ private String case1basepath = "standard\\testThread";
+ private int case1libnumber = 1;
+ private int case1userincnumber = 1;
+ private int case1sysincnumber = 1;
+ private int case1classnumber = 2;
+
+ private String case2filename = "several.mmp.in.one.path\\SysLibs\\ECom\\bld.inf";
+ private String case2prjname = "SysLibs";
+ private String case2basepath = "several.mmp.in.one.path\\SysLibs";
+ private int case2libnumber = 2;
+ private int case2userincnumber = 4;
+ private int case2sysincnumber = 4;
+ private int case2classnumber = 4;
+
+ private String case3filename = "several.bld.inf\\multiprj\\bld.inf";
+ private String case3prjname = "multiprj";
+ private String case3basepath = "several.bld.inf\\multiprj";
+ private int case3libnumber = 1;
+ private int case3userincnumber = 2;
+ private int case3sysincnumber = 1;
+ private int case3classnumber = 2;
+
+ public TParseTest()
+ {}
+
+ public void testCase1_standard()
+ {
+ Testing(case1filename,
+ case1prjname,
+ case1basepath,
+ case1libnumber,
+ case1userincnumber,
+ case1sysincnumber,
+ case1classnumber);
+ }
+
+ public void testCase2_multiMMP()
+ {
+ Testing(case2filename,
+ case2prjname,
+ case2basepath,
+ case2libnumber,
+ case2userincnumber,
+ case2sysincnumber,
+ case2classnumber);
+ }
+
+ public void testCase3_multiBLDINF()
+ {
+ Testing(case3filename,
+ case3prjname,
+ case3basepath,
+ case3libnumber,
+ case3userincnumber,
+ case3sysincnumber,
+ case3classnumber);
+ }
+
+ public void testCase4_ErrorCommand()
+ {
+ String exe = PathUtil.Combine(symutcreatorlocation, "SymUTCreator");
+ String result = CmdExecutor.Execute(exe + " -x", symutcreatorlocation);
+ assertTrue("User input a error command!", result.startsWith("ERROR"));
+ }
+
+ public void testCase5_HelpCommand()
+ {
+ String exe = PathUtil.Combine(symutcreatorlocation, "SymUTCreator");
+ String result = CmdExecutor.Execute(exe + " -?", symutcreatorlocation);
+ assertFalse("User input a correct command!", result.startsWith("ERROR"));
+ }
+
+ public void testCase6_VersionCommand()
+ {
+ String exe = PathUtil.Combine(symutcreatorlocation, "SymUTCreator");
+ String result = CmdExecutor.Execute(exe + " -v", symutcreatorlocation);
+ assertFalse("User input a correct command!", result.startsWith("ERROR"));
+ }
+
+
+
+
+ private void Testing(String filename, String prjname, String basepath, int libnumber, int userincnumber, int sysincnumber, int classnumber)
+ {
+ Executor executor = new Executor();
+ Map<String, Object> data = executor.Parse(PathUtil.Combine(testcaseresourcelocation, filename));
+ assertEquals(data.get("project_name").toString(), prjname);
+ assertEquals(data.get("basepath").toString().toLowerCase(), PathUtil.Combine(testcaseresourcelocation,basepath).toLowerCase());
+ ProjectNodeImpl projectNode = (ProjectNodeImpl)data.get("project_object");
+ assertEquals(libnumber, projectNode.getLibrarys().size());
+ assertEquals(userincnumber, projectNode.getUserIncludes().size());
+ assertEquals(sysincnumber, projectNode.getSystemIncludes().size());
+ assertEquals(classnumber, projectNode.getChildren().size());
+ String target = PathUtil.Combine(data.get("basepath").toString(), "unittest");
+ executor.RunCodegen(data, target);
+ assertTrue("Code generated failed!", PathUtil.Exist(target));
+ target = PathUtil.Combine(target, "group");
+ Compile(target);
+ String epoc32root = getEPOC32Path(target);
+ assertTrue("EPOC32 path not exist!",!epoc32root.equals(""));
+ target = PathUtil.Combine(epoc32root, "\\release\\winscw\\udeb\\ut_" + prjname + ".dll");
+ assertTrue("Code compiled failed!", PathUtil.Exist(target));
+
+
+ }
+
+ private String getEPOC32Path(String path)
+ {
+ String epocroot = CmdExecutor.Execute("set EPOCROOT", path);
+ if(epocroot.length() < 10)
+ {
+ return "";
+ }
+ // EPOCROOT=\
+ epocroot = epocroot.substring(9);
+
+
+ if(epocroot.startsWith("\\"))
+ {
+ //relative path
+ epocroot = path.substring(0, 2) + epocroot; // drive path.
+ epocroot += "epoc32";
+ }
+ else
+ {
+ //absolute path
+ epocroot = PathUtil.Combine(epocroot, "epoc32");
+ }
+ return epocroot;
+
+ }
+
+ private void Compile(String path)
+ {
+ CmdExecutor.Execute("bldmake clean", path);
+ CmdExecutor.Execute("bldmake bldfiles", path);
+ CmdExecutor.Execute("abld test clean winscw udeb", path);
+ CmdExecutor.Execute("abld test build winscw udeb", path);
+ CmdExecutor.Execute("bldmake clean", path);
+ }
+
+ public static void main(String[] args)
+ {}
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/src/com/nokia/testfw/cmdtool/test/testMain.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Console based testing portal.
+*
+*/
+package com.nokia.testfw.cmdtool.test;
+
+import java.io.IOException;
+
+public class testMain {
+ public static void main(String args[])
+ {
+ if(args.length != 1)
+ {
+ System.out.println("Please input a invalid bld file path");
+ return;
+ }
+
+ try {
+ GccxmlWrapperTest tester = new GccxmlWrapperTest();
+ tester.Run(args[0]);
+ System.out.println("test done! Press any key to exit.");
+ System.in.read();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/readme.txt Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,6 @@
+these source code just used for testing.
+BEFORE TESTING.
+You should copy these testing code into a folder under EPOCROOT.
+And open the TParseTest.java file.
+Modify the location of the testing resource.
+You should change the value both "testcaseresourcelocation" and "symutcreatorlocation".
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/bld.inf Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,4 @@
+//this is an example.
+
+#include "multiprj1/group/bld.inf"
+#include "multiprj2/group/bld.inf"
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj1/.cproject Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,240 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?fileVersion 4.0.0?>
+
+<cproject>
+<storageModule buildFromInf="true" buildingTestComps="true" cleanLevel="2" concurrentBuildJobs="4" defaultMMPChangedAction="0" infBuildComponents="" infFileLocation="group/bld.inf" macrosFile="" makeEngineToUse="make" manageDependencies="true" moduleId="com.nokia.carbide.cdt.builder.carbideCPPBuilder" overrideMakeEngine="false" overrideWorkspaceSettings="false" promptForMMPChangedAction="false" useConcurrentBuilding="true" useDebugMode="false" useIncrementalBuilder="false" useKeepGoing="false" useMMPMacros="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.settings">
+<cconfiguration id="Emulator Debug (WINSCW) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Emulator Debug (WINSCW) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Emulator Debug (WINSCW) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj1\group\bld.inf;D:\Carbide\workspace\multiprj1\group\multiprj1.mmp;" includesCache="D:/Carbide/workspace/multiprj1/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__EXE__;__WINSCW__;__SUPPORT_CPP_EXCEPTIONS__;__SYMBIAN32__;_UNICODE;_DEBUG;__WINS__;__CW32__;" moduleId="configDataCache" sourcesCache="/multiprj1/inc;/multiprj1/src;" timestampCache="1256289530794" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV5) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV5) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV5) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj1\group\bld.inf;D:\Carbide\workspace\multiprj1\group\multiprj1.mmp;" includesCache="D:/Carbide/workspace/multiprj1/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SUPPORT_CPP_EXCEPTIONS__;__SYMBIAN32__;_UNICODE;__ARMCC_2_2__;__EPOC32__;__EABI__;_DEBUG;__MARM_ARMV5__;__ARMCC__;__MARM__;" moduleId="configDataCache" sourcesCache="/multiprj1/inc;/multiprj1/src;" timestampCache="1256289530810" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV5) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV5) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV5) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj1\group\bld.inf;D:\Carbide\workspace\multiprj1\group\multiprj1.mmp;" includesCache="D:/Carbide/workspace/multiprj1/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SUPPORT_CPP_EXCEPTIONS__;__SYMBIAN32__;_UNICODE;__ARMCC_2_2__;__EPOC32__;__EABI__;__MARM_ARMV5__;NDEBUG;__ARMCC__;__MARM__;" moduleId="configDataCache" sourcesCache="/multiprj1/inc;/multiprj1/src;" timestampCache="1256289530826" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (GCCE) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (GCCE) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (GCCE) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCEErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj1\group\bld.inf;D:\Carbide\workspace\multiprj1\group\multiprj1.mmp;" includesCache="D:/Carbide/workspace/multiprj1/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SUPPORT_CPP_EXCEPTIONS__;__SYMBIAN32__;_UNICODE;__EPOC32__;__EABI__;_DEBUG;__GCCE__;__MARM_ARMV5__;__MARM__;" moduleId="configDataCache" sourcesCache="/multiprj1/inc;/multiprj1/src;" timestampCache="1256289530826" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (GCCE) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (GCCE) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (GCCE) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCEErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj1\group\bld.inf;D:\Carbide\workspace\multiprj1\group\multiprj1.mmp;" includesCache="D:/Carbide/workspace/multiprj1/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SUPPORT_CPP_EXCEPTIONS__;__SYMBIAN32__;_UNICODE;__EPOC32__;__EABI__;__GCCE__;__MARM_ARMV5__;NDEBUG;__MARM__;" moduleId="configDataCache" sourcesCache="/multiprj1/inc;/multiprj1/src;" timestampCache="1256289530841" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV6) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV6) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV6) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj1\group\bld.inf;D:\Carbide\workspace\multiprj1\group\multiprj1.mmp;" includesCache="D:/Carbide/workspace/multiprj1/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;_DEBUG;__ARMV6__;__MARM_ARMV5__;" moduleId="configDataCache" sourcesCache="/multiprj1/inc;/multiprj1/src;" timestampCache="1256289530841" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV6) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV6) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV6) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj1\group\bld.inf;D:\Carbide\workspace\multiprj1\group\multiprj1.mmp;" includesCache="D:/Carbide/workspace/multiprj1/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;NDEBUG;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;__ARMV6__;__MARM_ARMV5__;" moduleId="configDataCache" sourcesCache="/multiprj1/inc;/multiprj1/src;" timestampCache="1256289530857" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV6_ABIV2) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV6_ABIV2) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV6_ABIV2) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj1\group\bld.inf;D:\Carbide\workspace\multiprj1\group\multiprj1.mmp;" includesCache="D:/Carbide/workspace/multiprj1/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__ARMCC_2__;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;_DEBUG;__MARM_ARMV5__;__ARMV6_ABIV2__;" moduleId="configDataCache" sourcesCache="/multiprj1/inc;/multiprj1/src;" timestampCache="1256289530872" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV6_ABIV2) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV6_ABIV2) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV6_ABIV2) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj1\group\bld.inf;D:\Carbide\workspace\multiprj1\group\multiprj1.mmp;" includesCache="D:/Carbide/workspace/multiprj1/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__ARMCC_2__;NDEBUG;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;__MARM_ARMV5__;__ARMV6_ABIV2__;" moduleId="configDataCache" sourcesCache="/multiprj1/inc;/multiprj1/src;" timestampCache="1256289530888" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+</storageModule>
+</cproject>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj1/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>multiprj1</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.nokia.carbide.cdt.builder.carbideCPPBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>com.nokia.carbide.cdt.builder.carbideCPPBuilderNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj1/group/bld.inf Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,15 @@
+/*
+============================================================================
+ Name : bld.inf
+ Author : Yue Zhang
+ Copyright : Test Product Team, Symbian
+ Description : This file provides the information required for building the
+ whole of a multiprj1.
+============================================================================
+*/
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_MMPFILES
+multiprj1.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj1/group/multiprj1.mmp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,24 @@
+/*
+============================================================================
+ Name : multiprj1.mmp
+ Author : Yue Zhang
+ Copyright : Test Product Team, Symbian
+ Description : This is the project specification file for multiprj1.
+============================================================================
+*/
+
+TARGET multiprj1.exe
+TARGETTYPE exe
+UID 0 0xEC62CD06
+
+USERINCLUDE ..\inc
+SYSTEMINCLUDE \epoc32\include
+
+SOURCEPATH ..\src
+SOURCE multiprj1.cpp class1.cpp
+
+LIBRARY euser.lib
+
+#ifdef ENABLE_ABIV2_MODE
+DEBUGGABLE_UDEBONLY
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj1/inc/class1.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,27 @@
+/*
+ * class1.h
+ *
+ * Created on: 2009-10-23
+ * Author: y183zhan
+ */
+
+#ifndef CLASS1_H_
+#define CLASS1_H_
+
+#include <e32def.h>
+
+class CClass1
+ {
+public:
+ CClass1();
+ ~CClass1();
+public:
+ TInt PubFoo1(TInt a);
+protected:
+ TInt protFoo2();
+private:
+ void Foo3();
+
+ };
+
+#endif /* CLASS1_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj1/inc/multiprj1.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,22 @@
+/*
+ ============================================================================
+ Name : multiprj1.h
+ Author : Yue Zhang
+ Copyright : Test Product Team, Symbian
+ Description : Exe header file
+ ============================================================================
+ */
+
+#ifndef __MULTIPRJ1_H__
+#define __MULTIPRJ1_H__
+
+// Include Files
+
+#include <e32base.h>
+
+// Function Prototypes
+
+GLDEF_C TInt E32Main();
+
+#endif // __MULTIPRJ1_H__
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj1/sis/multiprj1_EKA2.pkg Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,24 @@
+; Installation file for Symbian OS 9.x for generic console application
+; Installation file for multiprj1 EXE
+;
+; This is an auto-generated PKG file by Carbide.
+; This file uses variables specific to Carbide builds that will not work
+; on command-line builds. If you want to use this generated PKG file from the
+; command-line tools you will need to modify the variables with the appropriate
+; values: $(EPOCROOT), $(PLATFORM), $(TARGET)
+;
+
+;
+; UID is the exe's UID
+;
+#{"multiprj1 EXE"},(0xEC62CD06),1,0,0
+
+
+;Localised Vendor name
+%{"Vendor-EN"}
+
+;Unique Vendor name
+:"Vendor"
+
+"$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\multiprj1.exe" -"!:\sys\bin\multiprj1.exe"
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj1/src/class1.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,34 @@
+/*
+ * class1.cpp
+ *
+ * Created on: 2009-10-23
+ * Author: y183zhan
+ */
+
+#include "class1.h"
+
+CClass1::CClass1()
+ {
+ //nothing
+ }
+
+CClass1::~CClass1()
+ {
+ //nothing
+ }
+
+TInt CClass1::PubFoo1(TInt a)
+ {
+ return a++;
+ }
+
+
+TInt CClass1::protFoo2()
+ {
+ return 0;
+ }
+
+void CClass1::Foo3()
+ {
+ //nothing
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj1/src/multiprj1.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,77 @@
+/*
+ ============================================================================
+ Name : multiprj1.cpp
+ Author : Yue Zhang
+ Copyright : Test Product Team, Symbian
+ Description : Exe source file
+ ============================================================================
+ */
+
+// Include Files
+
+#include "multiprj1.h"
+#include <e32base.h>
+#include <e32std.h>
+#include <e32cons.h> // Console
+
+// Constants
+
+_LIT(KTextConsoleTitle, "Console");
+_LIT(KTextFailed, " failed, leave code = %d");
+_LIT(KTextPressAnyKey, " [press any key]\n");
+
+// Global Variables
+
+LOCAL_D CConsoleBase* console; // write all messages to this
+
+
+// Local Functions
+
+LOCAL_C void MainL()
+ {
+ //
+ // add your program code here, example code below
+ //
+ console->Write(_L("Hello, world!\n"));
+ }
+
+LOCAL_C void DoStartL()
+ {
+ // Create active scheduler (to run active objects)
+ CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
+ CleanupStack::PushL(scheduler);
+ CActiveScheduler::Install(scheduler);
+
+ MainL();
+
+ // Delete active scheduler
+ CleanupStack::PopAndDestroy(scheduler);
+ }
+
+// Global Functions
+
+GLDEF_C TInt E32Main()
+ {
+ // Create cleanup stack
+ __UHEAP_MARK;
+ CTrapCleanup* cleanup = CTrapCleanup::New();
+
+ // Create output console
+ TRAPD(createError, console = Console::NewL(KTextConsoleTitle, TSize(
+ KConsFullScreen, KConsFullScreen)));
+ if (createError)
+ return createError;
+
+ // Run application code inside TRAP harness, wait keypress when terminated
+ TRAPD(mainError, DoStartL());
+ if (mainError)
+ console->Printf(KTextFailed, mainError);
+ console->Printf(KTextPressAnyKey);
+ console->Getch();
+
+ delete console;
+ delete cleanup;
+ __UHEAP_MARKEND;
+ return KErrNone;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj2/.cproject Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,240 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?fileVersion 4.0.0?>
+
+<cproject>
+<storageModule buildFromInf="true" buildingTestComps="true" cleanLevel="2" concurrentBuildJobs="4" defaultMMPChangedAction="0" infBuildComponents="" infFileLocation="group/bld.inf" macrosFile="" makeEngineToUse="make" manageDependencies="true" moduleId="com.nokia.carbide.cdt.builder.carbideCPPBuilder" overrideMakeEngine="false" overrideWorkspaceSettings="false" promptForMMPChangedAction="false" useConcurrentBuilding="true" useDebugMode="false" useIncrementalBuilder="false" useKeepGoing="false" useMMPMacros="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.settings">
+<cconfiguration id="Emulator Debug (WINSCW) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Emulator Debug (WINSCW) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Emulator Debug (WINSCW) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj2\group\multiprj2.mmp;D:\Carbide\workspace\multiprj2\group\bld.inf;" includesCache="D:/Carbide/workspace/multiprj2/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__EXE__;__WINSCW__;__SUPPORT_CPP_EXCEPTIONS__;__SYMBIAN32__;_UNICODE;_DEBUG;__WINS__;__CW32__;" moduleId="configDataCache" sourcesCache="/multiprj2/inc;/multiprj2/src;" timestampCache="1256289754399" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV5) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV5) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV5) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj2\group\multiprj2.mmp;D:\Carbide\workspace\multiprj2\group\bld.inf;" includesCache="D:/Carbide/workspace/multiprj2/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SUPPORT_CPP_EXCEPTIONS__;__SYMBIAN32__;_UNICODE;__ARMCC_2_2__;__EPOC32__;__EABI__;_DEBUG;__MARM_ARMV5__;__ARMCC__;__MARM__;" moduleId="configDataCache" sourcesCache="/multiprj2/inc;/multiprj2/src;" timestampCache="1256289754415" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV5) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV5) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV5) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj2\group\multiprj2.mmp;D:\Carbide\workspace\multiprj2\group\bld.inf;" includesCache="D:/Carbide/workspace/multiprj2/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SUPPORT_CPP_EXCEPTIONS__;__SYMBIAN32__;_UNICODE;__ARMCC_2_2__;__EPOC32__;__EABI__;__MARM_ARMV5__;NDEBUG;__ARMCC__;__MARM__;" moduleId="configDataCache" sourcesCache="/multiprj2/inc;/multiprj2/src;" timestampCache="1256289754415" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (GCCE) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (GCCE) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (GCCE) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCEErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj2\group\multiprj2.mmp;D:\Carbide\workspace\multiprj2\group\bld.inf;" includesCache="D:/Carbide/workspace/multiprj2/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SUPPORT_CPP_EXCEPTIONS__;__SYMBIAN32__;_UNICODE;__EPOC32__;__EABI__;_DEBUG;__GCCE__;__MARM_ARMV5__;__MARM__;" moduleId="configDataCache" sourcesCache="/multiprj2/inc;/multiprj2/src;" timestampCache="1256289754431" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (GCCE) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (GCCE) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (GCCE) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCEErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj2\group\multiprj2.mmp;D:\Carbide\workspace\multiprj2\group\bld.inf;" includesCache="D:/Carbide/workspace/multiprj2/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SUPPORT_CPP_EXCEPTIONS__;__SYMBIAN32__;_UNICODE;__EPOC32__;__EABI__;__GCCE__;__MARM_ARMV5__;NDEBUG;__MARM__;" moduleId="configDataCache" sourcesCache="/multiprj2/inc;/multiprj2/src;" timestampCache="1256289754431" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV6) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV6) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV6) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj2\group\multiprj2.mmp;D:\Carbide\workspace\multiprj2\group\bld.inf;" includesCache="D:/Carbide/workspace/multiprj2/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;_DEBUG;__ARMV6__;__MARM_ARMV5__;" moduleId="configDataCache" sourcesCache="/multiprj2/inc;/multiprj2/src;" timestampCache="1256289754446" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV6) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV6) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV6) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj2\group\multiprj2.mmp;D:\Carbide\workspace\multiprj2\group\bld.inf;" includesCache="D:/Carbide/workspace/multiprj2/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;NDEBUG;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;__ARMV6__;__MARM_ARMV5__;" moduleId="configDataCache" sourcesCache="/multiprj2/inc;/multiprj2/src;" timestampCache="1256289754446" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV6_ABIV2) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV6_ABIV2) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV6_ABIV2) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj2\group\multiprj2.mmp;D:\Carbide\workspace\multiprj2\group\bld.inf;" includesCache="D:/Carbide/workspace/multiprj2/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__ARMCC_2__;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;_DEBUG;__MARM_ARMV5__;__ARMV6_ABIV2__;" moduleId="configDataCache" sourcesCache="/multiprj2/inc;/multiprj2/src;" timestampCache="1256289754462" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV6_ABIV2) [TK9.1]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV6_ABIV2) [TK9.1]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV6_ABIV2) [TK9.1]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="D:\TK9.1\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Carbide\workspace\multiprj2\group\multiprj2.mmp;D:\Carbide\workspace\multiprj2\group\bld.inf;" includesCache="D:/Carbide/workspace/multiprj2/inc[LOCAL];D:/TK9.1/epoc32/INCLUDE;" macrosCache="__GENERIC_MARM__;__EXE__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__ARMCC_2__;NDEBUG;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;__MARM_ARMV5__;__ARMV6_ABIV2__;" moduleId="configDataCache" sourcesCache="/multiprj2/inc;/multiprj2/src;" timestampCache="1256289754462" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+</storageModule>
+</cproject>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj2/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>multiprj2</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.nokia.carbide.cdt.builder.carbideCPPBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>com.nokia.carbide.cdt.builder.carbideCPPBuilderNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj2/group/bld.inf Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,15 @@
+/*
+============================================================================
+ Name : bld.inf
+ Author : Yue Zhang
+ Copyright : Test Product Team, Symbian
+ Description : This file provides the information required for building the
+ whole of a multiprj2.
+============================================================================
+*/
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_MMPFILES
+multiprj2.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj2/group/multiprj2.mmp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,24 @@
+/*
+============================================================================
+ Name : multiprj2.mmp
+ Author : Yue Zhang
+ Copyright : Test Product Team, Symbian
+ Description : This is the project specification file for multiprj2.
+============================================================================
+*/
+
+TARGET multiprj2.exe
+TARGETTYPE exe
+UID 0 0xE5274371
+
+USERINCLUDE ..\inc
+SYSTEMINCLUDE \epoc32\include
+
+SOURCEPATH ..\src
+SOURCE multiprj2.cpp class2.cpp
+
+LIBRARY euser.lib
+
+#ifdef ENABLE_ABIV2_MODE
+DEBUGGABLE_UDEBONLY
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj2/inc/class2.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,27 @@
+/*
+ * class2.h
+ *
+ * Created on: 2009-10-23
+ * Author: y183zhan
+ */
+
+#ifndef CLASS2_H_
+#define CLASS2_H_
+
+#include <e32def.h>
+
+class CClass2
+ {
+public:
+ CClass2();
+ ~CClass2();
+public:
+ TInt PubFoo1(TInt a, TInt b);
+ TInt PubFoo2();
+ static TInt staFoo4();
+private:
+ void Foo3();
+
+ };
+
+#endif /* CLASS2_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj2/inc/multiprj2.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,22 @@
+/*
+ ============================================================================
+ Name : multiprj2.h
+ Author : Yue Zhang
+ Copyright : Test Product Team, Symbian
+ Description : Exe header file
+ ============================================================================
+ */
+
+#ifndef __MULTIPRJ2_H__
+#define __MULTIPRJ2_H__
+
+// Include Files
+
+#include <e32base.h>
+
+// Function Prototypes
+
+GLDEF_C TInt E32Main();
+
+#endif // __MULTIPRJ2_H__
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj2/sis/multiprj2_EKA2.pkg Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,24 @@
+; Installation file for Symbian OS 9.x for generic console application
+; Installation file for multiprj2 EXE
+;
+; This is an auto-generated PKG file by Carbide.
+; This file uses variables specific to Carbide builds that will not work
+; on command-line builds. If you want to use this generated PKG file from the
+; command-line tools you will need to modify the variables with the appropriate
+; values: $(EPOCROOT), $(PLATFORM), $(TARGET)
+;
+
+;
+; UID is the exe's UID
+;
+#{"multiprj2 EXE"},(0xE5274371),1,0,0
+
+
+;Localised Vendor name
+%{"Vendor-EN"}
+
+;Unique Vendor name
+:"Vendor"
+
+"$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\multiprj2.exe" -"!:\sys\bin\multiprj2.exe"
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj2/src/class2.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,39 @@
+/*
+ * class2.cpp
+ *
+ * Created on: 2009-10-23
+ * Author: y183zhan
+ */
+
+#include "class2.h"
+
+CClass2::CClass2()
+ {
+ //nothing
+ }
+
+CClass2::~CClass2()
+ {
+ //nothing
+ }
+
+TInt CClass2::PubFoo1(TInt a, TInt b)
+ {
+ return a+b;
+ }
+
+
+TInt CClass2::PubFoo2()
+ {
+ return 0;
+ }
+
+void CClass2::Foo3()
+ {
+ //nothing
+ }
+
+TInt CClass2::staFoo4()
+ {
+ return 100;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/multiprj2/src/multiprj2.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,77 @@
+/*
+ ============================================================================
+ Name : multiprj2.cpp
+ Author : Yue Zhang
+ Copyright : Test Product Team, Symbian
+ Description : Exe source file
+ ============================================================================
+ */
+
+// Include Files
+
+#include "multiprj2.h"
+#include <e32base.h>
+#include <e32std.h>
+#include <e32cons.h> // Console
+
+// Constants
+
+_LIT(KTextConsoleTitle, "Console");
+_LIT(KTextFailed, " failed, leave code = %d");
+_LIT(KTextPressAnyKey, " [press any key]\n");
+
+// Global Variables
+
+LOCAL_D CConsoleBase* console; // write all messages to this
+
+
+// Local Functions
+
+LOCAL_C void MainL()
+ {
+ //
+ // add your program code here, example code below
+ //
+ console->Write(_L("Hello, world!\n"));
+ }
+
+LOCAL_C void DoStartL()
+ {
+ // Create active scheduler (to run active objects)
+ CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
+ CleanupStack::PushL(scheduler);
+ CActiveScheduler::Install(scheduler);
+
+ MainL();
+
+ // Delete active scheduler
+ CleanupStack::PopAndDestroy(scheduler);
+ }
+
+// Global Functions
+
+GLDEF_C TInt E32Main()
+ {
+ // Create cleanup stack
+ __UHEAP_MARK;
+ CTrapCleanup* cleanup = CTrapCleanup::New();
+
+ // Create output console
+ TRAPD(createError, console = Console::NewL(KTextConsoleTitle, TSize(
+ KConsFullScreen, KConsFullScreen)));
+ if (createError)
+ return createError;
+
+ // Run application code inside TRAP harness, wait keypress when terminated
+ TRAPD(mainError, DoStartL());
+ if (mainError)
+ console->Printf(KTextFailed, mainError);
+ console->Printf(KTextPressAnyKey);
+ console->Getch();
+
+ delete console;
+ delete cleanup;
+ __UHEAP_MARKEND;
+ return KErrNone;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/unittest/BWINS/ut_multiprjU.DEF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,2 @@
+EXPORTS
+ ?CreateTestL@@YAPAVMSymbianUnitTestInterface@@XZ @ 1 NONAME ; class MSymbianUnitTestInterface * CreateTestL(void)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/unittest/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+3
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/unittest/EABI/ut_multiprjU.DEF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+EXPORTS
+ _Z11CreateTestLv @ 1 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/unittest/group/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+3
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/unittest/group/bld.inf Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Symbian Unit Testing framework
+*
+*/
+
+PRJ_TESTMMPFILES
+ut_multiprj.mmp
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/unittest/group/ut_multiprj.mmp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+TARGET ut_multiprj.dll
+TARGETTYPE dll
+UID 0x20022E76 0x20022E76
+
+MACRO SYMBIAN_UNIT_TEST
+
+SOURCEPATH ../../multiprj1/src
+SOURCE class1.cpp
+
+SOURCEPATH ../../multiprj2/src
+SOURCE class2.cpp
+
+
+SOURCEPATH ../src
+SOURCE dllEntry.cpp
+SOURCE ut_CClass1.cpp
+SOURCE ut_CClass2.cpp
+
+USERINCLUDE ../inc
+USERINCLUDE ../../multiprj1/inc
+USERINCLUDE ../../multiprj2/inc
+
+SYSTEMINCLUDE /epoc32/include
+SYSTEMINCLUDE /epoc32/include/symbianunittest
+
+LIBRARY euser.lib
+LIBRARY symbianunittestfw.lib
+
+VENDORID 0x101FB657
+
+CAPABILITY ALL -TCB
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/unittest/inc/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+3
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/unittest/inc/ut_CClass1.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef UT_CCLASS1_H
+#define UT_CCLASS1_H
+
+// INCLUDES
+#include <symbianunittest.h>
+
+// FORWARD DECLARATIONS
+class CClass1;
+
+// CLASS DECLARATION
+class UT_CClass1: public CSymbianUnitTest
+{
+public: // Constructors and destructor
+
+ static UT_CClass1* NewL();
+ static UT_CClass1* NewLC();
+ ~UT_CClass1();
+
+protected: // From CSymbianUnitTest
+
+ void SetupL();
+ void Teardown();
+
+protected: // Test functions
+
+ void UT_Constructor_CClass1();
+ void UT_Destructor_CClass1();
+ void UT_PubFoo1();
+
+private: // Constructors
+
+ UT_CClass1();
+ void ConstructL();
+
+private: // Data
+
+ // The object to be tested as a member variable:
+ CClass1 *iCClass1;
+};
+
+#endif // UT_CCLASS1_H
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/unittest/inc/ut_CClass2.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef UT_CCLASS2_H
+#define UT_CCLASS2_H
+
+// INCLUDES
+#include <symbianunittest.h>
+
+// FORWARD DECLARATIONS
+class CClass2;
+
+// CLASS DECLARATION
+class UT_CClass2: public CSymbianUnitTest
+{
+public: // Constructors and destructor
+
+ static UT_CClass2* NewL();
+ static UT_CClass2* NewLC();
+ ~UT_CClass2();
+
+protected: // From CSymbianUnitTest
+
+ void SetupL();
+ void Teardown();
+
+protected: // Test functions
+
+ void UT_Constructor_CClass2();
+ void UT_Destructor_CClass2();
+ void UT_PubFoo1();
+ void UT_PubFoo2();
+ void UT_staFoo4();
+
+private: // Constructors
+
+ UT_CClass2();
+ void ConstructL();
+
+private: // Data
+
+ // The object to be tested as a member variable:
+ CClass2 *iCClass2;
+};
+
+#endif // UT_CCLASS2_H
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/unittest/src/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+3
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/unittest/src/dllentry.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include "ut_CClass1.h"
+#include "ut_CClass2.h"
+#include <symbianunittestsuite.h>
+
+// Exactly one exported function returning
+// the pointer to the suite of tests for the SymbianUnit framework.
+//
+EXPORT_C MSymbianUnitTestInterface* CreateTestL()
+{
+ CSymbianUnitTestSuite* testSuite =
+ CSymbianUnitTestSuite::NewLC( _L("ut_multiprj") );
+
+ testSuite->AddL( UT_CClass1::NewLC() );
+ testSuite->AddL( UT_CClass2::NewLC() );
+ CleanupStack::Pop();
+
+ CleanupStack::Pop( testSuite );
+ return testSuite;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/unittest/src/ut_CClass1.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ut_CClass1.h"
+#include "class1.h"
+#include <symbianunittestmacros.h>
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+UT_CClass1* UT_CClass1::NewL()
+ {
+ UT_CClass1* self = UT_CClass1::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+UT_CClass1* UT_CClass1::NewLC()
+ {
+ UT_CClass1* self = new( ELeave )UT_CClass1();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+UT_CClass1::UT_CClass1()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void UT_CClass1::ConstructL()
+ {
+ BASE_CONSTRUCT
+ ADD_SUT( UT_Constructor_CClass1 )
+ ADD_SUT( UT_Destructor_CClass1 )
+ ADD_SUT( UT_PubFoo1 )
+
+ // Setup and teardown functions can be changed for each test function
+ // Usually this is not needed, but this is possible.
+ // ADD_SUT_WITH_SETUP_AND_TEARDOWN( SetupL, UT_YouFunc, Teardown )
+ }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+UT_CClass1::~UT_CClass1()
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// SetupL
+// -----------------------------------------------------------------------------
+//
+void UT_CClass1::SetupL()
+ {
+ //iCClass1 = CClass1::NewL(); ??
+ }
+
+// -----------------------------------------------------------------------------
+// Teardown
+// -----------------------------------------------------------------------------
+//
+void UT_CClass1::Teardown()
+ {
+ delete iCClass1;
+ iCClass1 = NULL;
+ }
+
+
+// -----------------------------------------------------------------------------
+// test CClass1::CClass1 ()
+// -----------------------------------------------------------------------------
+//
+void UT_CClass1::UT_Constructor_CClass1()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CClass1::~CClass1 ()
+// -----------------------------------------------------------------------------
+//
+void UT_CClass1::UT_Destructor_CClass1()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CClass1::PubFoo1 ()
+// -----------------------------------------------------------------------------
+//
+void UT_CClass1::UT_PubFoo1()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.bld.inf/multiprj/unittest/src/ut_CClass2.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ut_CClass2.h"
+#include "class2.h"
+#include <symbianunittestmacros.h>
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+UT_CClass2* UT_CClass2::NewL()
+ {
+ UT_CClass2* self = UT_CClass2::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+UT_CClass2* UT_CClass2::NewLC()
+ {
+ UT_CClass2* self = new( ELeave )UT_CClass2();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+UT_CClass2::UT_CClass2()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void UT_CClass2::ConstructL()
+ {
+ BASE_CONSTRUCT
+ ADD_SUT( UT_Constructor_CClass2 )
+ ADD_SUT( UT_Destructor_CClass2 )
+ ADD_SUT( UT_PubFoo1 )
+ ADD_SUT( UT_PubFoo2 )
+ ADD_SUT( UT_staFoo4 )
+
+ // Setup and teardown functions can be changed for each test function
+ // Usually this is not needed, but this is possible.
+ // ADD_SUT_WITH_SETUP_AND_TEARDOWN( SetupL, UT_YouFunc, Teardown )
+ }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+UT_CClass2::~UT_CClass2()
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// SetupL
+// -----------------------------------------------------------------------------
+//
+void UT_CClass2::SetupL()
+ {
+ //iCClass2 = CClass2::NewL(); ??
+ }
+
+// -----------------------------------------------------------------------------
+// Teardown
+// -----------------------------------------------------------------------------
+//
+void UT_CClass2::Teardown()
+ {
+ delete iCClass2;
+ iCClass2 = NULL;
+ }
+
+
+// -----------------------------------------------------------------------------
+// test CClass2::CClass2 ()
+// -----------------------------------------------------------------------------
+//
+void UT_CClass2::UT_Constructor_CClass2()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CClass2::~CClass2 ()
+// -----------------------------------------------------------------------------
+//
+void UT_CClass2::UT_Destructor_CClass2()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CClass2::PubFoo1 ()
+// -----------------------------------------------------------------------------
+//
+void UT_CClass2::UT_PubFoo1()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CClass2::PubFoo2 ()
+// -----------------------------------------------------------------------------
+//
+void UT_CClass2::UT_PubFoo2()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CClass2::staFoo4 ()
+// -----------------------------------------------------------------------------
+//
+void UT_CClass2::UT_staFoo4()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/.cproject Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,660 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?fileVersion 4.0.0?>
+
+<cproject>
+<storageModule buildFromInf="true" buildingTestComps="true" cleanLevel="2" concurrentBuildJobs="4" defaultMMPChangedAction="0" infBuildComponents="" infFileLocation="unittest\group\bld.inf" macrosFile="" makeEngineToUse="make" manageDependencies="true" moduleId="com.nokia.carbide.cdt.builder.carbideCPPBuilder" overrideMakeEngine="false" overrideWorkspaceSettings="false" promptForMMPChangedAction="false" useConcurrentBuilding="true" useDebugMode="false" useIncrementalBuilder="false" useKeepGoing="false" useMMPMacros="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.settings">
+<cconfiguration id="Emulator Debug (WINSCW) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Emulator Debug (WINSCW) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Emulator Debug (WINSCW) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__WINSCW__;__SUPPORT_CPP_EXCEPTIONS__;__SYMBIAN32__;_UNICODE;SYMBIAN_UNIT_TEST;_DEBUG;__DLL__;__WINS__;__CW32__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546009" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Emulator Release (WINSCW) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Emulator Release (WINSCW) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Emulator Release (WINSCW) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__WINSCW__;__SUPPORT_CPP_EXCEPTIONS__;__SYMBIAN32__;_UNICODE;SYMBIAN_UNIT_TEST;__DLL__;NDEBUG;__WINS__;__CW32__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546040" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV5) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV5) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV5) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__ARMCC_2__;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;SYMBIAN_UNIT_TEST;_DEBUG;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546056" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV5) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV5) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV5) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__ARMCC_2__;NDEBUG;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;SYMBIAN_UNIT_TEST;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546071" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (GCCE) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (GCCE) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (GCCE) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCEErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__SUPPORT_CPP_EXCEPTIONS__;__SYMBIAN32__;_UNICODE;__EPOC32__;__EABI__;SYMBIAN_UNIT_TEST;_DEBUG;__MARM_ARMV5__;__GCCE__;__DLL__;__MARM__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546087" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (GCCE) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (GCCE) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (GCCE) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCEErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__SUPPORT_CPP_EXCEPTIONS__;__SYMBIAN32__;_UNICODE;__EPOC32__;__EABI__;SYMBIAN_UNIT_TEST;__MARM_ARMV5__;__GCCE__;__DLL__;NDEBUG;__MARM__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546102" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV5SMP) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV5SMP) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV5SMP) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__ARMV5SMP__;__GENERIC_MARM__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__ARMCC_2__;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;SYMBIAN_UNIT_TEST;_DEBUG;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546102" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV5SMP) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV5SMP) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV5SMP) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__ARMV5SMP__;__GENERIC_MARM__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__ARMCC_2__;NDEBUG;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;SYMBIAN_UNIT_TEST;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546134" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV6) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV6) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV6) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__ARMCC_2__;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;SYMBIAN_UNIT_TEST;_DEBUG;__ARMV6__;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546134" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV6) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV6) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV6) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__ARMCC_2__;NDEBUG;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;SYMBIAN_UNIT_TEST;__ARMV6__;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546165" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV6SMP) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV6SMP) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV6SMP) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__ARMCC_2__;__ARMCC__;__MARM__;__ARMV6SMP__;__ARMCC_2_2__;_UNICODE;SYMBIAN_UNIT_TEST;_DEBUG;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546181" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV6SMP) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV6SMP) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV6SMP) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__ARMCC_2__;NDEBUG;__ARMCC__;__MARM__;__ARMV6SMP__;__ARMCC_2_2__;_UNICODE;SYMBIAN_UNIT_TEST;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546196" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV6T2) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV6T2) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV6T2) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__ARMV6T2__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__ARMCC_2__;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;SYMBIAN_UNIT_TEST;_DEBUG;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546212" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV6T2) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV6T2) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV6T2) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__ARMV6T2__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__ARMCC_2__;NDEBUG;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;SYMBIAN_UNIT_TEST;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546227" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV6_ABIV1) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV6_ABIV1) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV6_ABIV1) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__ARMCC__;__MARM__;__ARMV5_ABIV1__;__ARMCC_2_2__;_UNICODE;__ARMV6_ABIV1__;_DEBUG;SYMBIAN_UNIT_TEST;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546259" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV6_ABIV1) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV6_ABIV1) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV6_ABIV1) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;NDEBUG;__ARMCC__;__MARM__;__ARMV5_ABIV1__;__ARMCC_2_2__;_UNICODE;__ARMV6_ABIV1__;SYMBIAN_UNIT_TEST;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546274" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV7) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV7) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV7) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__ARMV7__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__ARMCC_2__;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;SYMBIAN_UNIT_TEST;_DEBUG;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546290" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV7) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV7) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV7) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__ARMV7__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__ARMCC_2__;NDEBUG;__ARMCC__;__MARM__;__ARMCC_2_2__;_UNICODE;SYMBIAN_UNIT_TEST;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546306" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (GCCEV6) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (GCCEV6) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (GCCEV6) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCEErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeSisErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RomBuildErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.BldmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__GCCE__;__MARM__;_UNICODE;__GCCEV6__;_DEBUG;SYMBIAN_UNIT_TEST;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546306" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (GCCEV6) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (GCCEV6) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (GCCEV6) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCEErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeSisErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RomBuildErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.BldmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__GCCE__;NDEBUG;__MARM__;_UNICODE;__GCCEV6__;SYMBIAN_UNIT_TEST;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546321" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (GCCEV6T2) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (GCCEV6T2) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (GCCEV6T2) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCEErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeSisErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RomBuildErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.BldmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__GCCEV6T2__;__EABI__;__GCCE__;__MARM__;_UNICODE;_DEBUG;SYMBIAN_UNIT_TEST;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546337" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (GCCEV6T2) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (GCCEV6T2) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (GCCEV6T2) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCEErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeSisErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RomBuildErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.BldmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__GCCEV6T2__;__EABI__;__GCCE__;NDEBUG;__MARM__;_UNICODE;SYMBIAN_UNIT_TEST;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546352" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (GCCEV7) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (GCCEV7) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (GCCEV7) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCEErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeSisErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RomBuildErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.BldmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__GCCEV7__;__GCCE__;__MARM__;_UNICODE;_DEBUG;SYMBIAN_UNIT_TEST;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546368" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (GCCEV7) [MSF00167_Symbian_OS_vtb101sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (GCCEV7) [MSF00167_Symbian_OS_vtb101sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (GCCEV7) [MSF00167_Symbian_OS_vtb101sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCEErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeSisErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RomBuildErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.BldmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="Z:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\ut_SysLibs.mmp;Z:\unittest\several.mmp.in.one.path\SysLibs\unittest\group\bld.inf;" includesCache="Z:/unittest/several.mmp.in.one.path/SysLibs/unittest/inc[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/CommonFramework[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition[LOCAL];Z:/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation[LOCAL];Z:/epoc32/include;Z:/epoc32/include/ecom;Z:/epoc32/include/symbianunittest;" macrosCache="__GENERIC_MARM__;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EPOC32__;__EABI__;__GCCEV7__;__GCCE__;NDEBUG;__MARM__;_UNICODE;SYMBIAN_UNIT_TEST;__MARM_ARMV5__;__DLL__;" moduleId="configDataCache" sourcesCache="/ut_SysLibs/CommonFramework;/ut_SysLibs/ECom;/ut_SysLibs/unittest;" timestampCache="1256795546384" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cconfiguration>
+</storageModule>
+</cproject>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ut_SysLibs</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.nokia.carbide.cdt.builder.carbideCPPBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>com.nokia.carbide.cdt.builder.carbideCPPBuilderNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/CommonFramework/CommonFramework.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,50 @@
+// CommonFramework.h
+//
+// Copyright (c) 2000 Symbian Ltd. All rights reserved.
+
+
+#ifndef __CommonFramework_H
+#define __CommonFramework_H
+
+#include <e32base.h>
+#include <e32cons.h>
+
+_LIT(KTxtEPOC32EX,"EXAMPLES");
+_LIT(KTxtExampleCode,"Symbian OS Example Code");
+_LIT(KFormatFailed,"failed: leave code=%d");
+_LIT(KTxtOK,"ok");
+_LIT(KTxtPressAnyKey," [press any key]");
+
+// public
+LOCAL_D CConsoleBase* console; // write all your messages to this
+LOCAL_C void doExampleL(); // code this function for the real example
+
+// private
+LOCAL_C void callExampleL(); // initialize with cleanup stack, then do example
+
+GLDEF_C TInt E32Main() // main function called by E32
+ {
+ __UHEAP_MARK;
+ CTrapCleanup* cleanup=CTrapCleanup::New(); // get clean-up stack
+ TRAPD(error,callExampleL()); // more initialization, then do example
+ __ASSERT_ALWAYS(!error,User::Panic(KTxtEPOC32EX,error));
+ delete cleanup; // destroy clean-up stack
+ __UHEAP_MARKEND;
+ return 0; // and return
+ }
+
+LOCAL_C void callExampleL() // initialize and call example code under cleanup stack
+ {
+ console=Console::NewL(KTxtExampleCode,TSize(KConsFullScreen,KConsFullScreen));
+ CleanupStack::PushL(console);
+ TRAPD(error,doExampleL()); // perform example function
+ if (error)
+ console->Printf(KFormatFailed, error);
+ else
+ console->Printf(KTxtOK);
+ console->Printf(KTxtPressAnyKey);
+ console->Getch(); // get and ignore character
+ CleanupStack::PopAndDestroy(); // close console
+ }
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/CommonFramework/CommonStreamStore.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,58 @@
+// CommonStreamStore.h
+//
+// Copyright (c) 2000 Symbian Ltd. All rights reserved.
+
+
+#ifndef __CommonStreamStore_H
+#define __CommonStreamStore_H
+
+#include <e32cons.h>
+#include <f32file.h>
+
+// public
+LOCAL_D CConsoleBase* console; // write all your messages to this
+LOCAL_C void doExampleL(); // code this function for the real example
+LOCAL_D RFs fsSession;
+
+// private
+LOCAL_C void callExampleL(); // initialize with cleanup stack, then do example
+
+_LIT(KTxtStore,"STORE");
+
+GLDEF_C TInt E32Main() // main function called by E32
+ {
+ __UHEAP_MARK;
+ CTrapCleanup* cleanup=CTrapCleanup::New(); // get clean-up stack
+ TRAPD(error,callExampleL()); // more initialization, then do example
+ __ASSERT_ALWAYS(!error,User::Panic(KTxtStore,error));
+ delete cleanup; // destroy clean-up stack
+ __UHEAP_MARKEND;
+ return 0; // and return
+ }
+
+_LIT(KTxtExampleCode,"STORES Example Code");
+_LIT(KTxtConnectFailed,"file session connect failed: return code=%d");
+_LIT(KTxtFailed,"failed: leave code=%d");
+_LIT(KTxtOK,"ok");
+_LIT(KTxtPressAnyKey," [press any key]");
+
+LOCAL_C void callExampleL() // initialize and call example code under cleanup stack
+ {
+ console=Console::NewL(KTxtExampleCode,TSize(KConsFullScreen,KConsFullScreen));
+ CleanupStack::PushL(console);
+ TInt fsret = fsSession.Connect(); // start a file session
+ if (fsret != KErrNone)
+ {
+ console->Printf(KTxtConnectFailed,fsret);
+ User::Leave(fsret);
+ }
+ TRAPD(error,doExampleL()); // perform example function
+ if (error) console->Printf(KTxtFailed, error);
+ else console->Printf(KTxtOK);
+ console->Printf(KTxtPressAnyKey);
+ console->Getch(); // get and ignore character
+ fsSession.Close(); //close the file session
+ CleanupStack::PopAndDestroy(); // close console
+ }
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/CommonFramework/CommonToDBMSEx.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,57 @@
+// DBSTD.H
+//
+// Copyright (c) 1997-1999 Symbian Ltd. All rights reserved.
+//
+
+#ifndef __DBSTD_H
+#define __DBSTD_H
+
+#include <e32cons.h>
+#include <s32file.h>
+#include <d32dbms.h>
+
+// public
+LOCAL_D CConsoleBase* console; // write all your messages to this
+LOCAL_C void doExampleL(); // code this function for the real example
+LOCAL_D RFs fsSession;
+
+// private
+LOCAL_C void callExampleL(); // initialize with cleanup stack, then do example
+
+GLDEF_C TInt E32Main() // main function called by E32
+ {
+ _LIT(KDbmsExample,"DBMS-Example");
+ CTrapCleanup* cleanup=CTrapCleanup::New(); // get clean-up stack
+ TRAPD(error,callExampleL()); // more initialization, then do example
+ __ASSERT_ALWAYS(!error,User::Panic(KDbmsExample,error));
+ delete cleanup; // destroy clean-up stack
+ return 0; // and return
+ }
+
+LOCAL_C void callExampleL() // initialize and call example code under cleanup stack
+ {
+ _LIT(KDbmsSdkExampleCode,"DBMS SDK Example Code");
+ _LIT(KFileSessionConnectFailed,"file session connect failed: return code=%d");
+ _LIT(KFailed,"failed: leave code=%d");
+ _LIT(KOk,"ok");
+ _LIT(KPressAnyKey," [press any key]");
+
+ console=Console::NewL(KDbmsSdkExampleCode,
+ TSize(KConsFullScreen,KConsFullScreen));
+ CleanupStack::PushL(console);
+ TInt fsret = fsSession.Connect(); // start a file session
+ if (fsret != KErrNone)
+ {
+ console->Printf(KFileSessionConnectFailed,fsret);
+ User::Leave(fsret);
+ }
+ TRAPD(error,doExampleL()); // perform example function
+ if (error) console->Printf(KFailed, error);
+ else console->Printf(KOk);
+ console->Printf(KPressAnyKey);
+ console->Getch(); // get and ignore character
+ fsSession.Close(); // close the file session
+ CleanupStack::Pop(); // close console
+ }
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/CommonFramework/CommonToResourceFilesEx.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,57 @@
+// BASTD.H
+//
+// Copyright (c) 1997-1999 Symbian Ltd. All rights reserved.
+//
+
+#ifndef __BASTD_H
+#define __BASTD_H
+
+#include <e32cons.h>
+#include <f32file.h>
+#include <barsc.h>
+#include <barsread.h>
+
+
+// public
+LOCAL_D CConsoleBase* console; // write all your messages to this
+LOCAL_D RFs fsSession;
+LOCAL_C void doExampleL(); // code this function for the real example
+
+// private
+LOCAL_C void callExampleL(); // initialize with cleanup stack, then do example
+
+GLDEF_C TInt E32Main() // main function called by E32
+ {
+ _LIT(KBaflEx,"BAFLEX");
+ __UHEAP_MARK;
+ if (fsSession.Connect()!=KErrNone)
+ return KErrGeneral;
+ CTrapCleanup* cleanup=CTrapCleanup::New(); // get clean-up stack
+ TRAPD(error,callExampleL()); // more initialization, then do example
+ fsSession.Close();
+ __ASSERT_ALWAYS(!error,User::Panic(KBaflEx,error));
+ delete cleanup; // destroy clean-up stack
+ __UHEAP_MARKEND;
+ return 0; // and return
+ }
+
+LOCAL_C void callExampleL() // initialize and call example code under cleanup stack
+ {
+ _LIT(KExampleCode,"SDK Example Code");
+ _LIT(KFailedLeave,"failed: leave code=%d");
+ _LIT(KOk,"ok");
+ _LIT(KPressAnyKey," [press any key]");
+
+ console=Console::NewL(KExampleCode,TSize(KConsFullScreen,KConsFullScreen));
+ CleanupStack::PushL(console);
+ TRAPD(error,doExampleL()); // perform example function
+ if (error)
+ console->Printf(KFailedLeave, error);
+ else
+ console->Printf(KOk);
+ console->Printf(KPressAnyKey);
+ console->Getch(); // get and ignore character
+ CleanupStack::PopAndDestroy(); // close console
+ }
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/CommonFramework/DISTRIBUTION.POLICY Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,2 @@
+Category G
+OSD: Test/Reference Tools
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/Bld.inf Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,14 @@
+// BLD.INF
+// Component description file
+//
+// Copyright (c) 2001 Symbian Ltd. All rights reserved.
+
+// Export the interface definition
+PRJ_EXPORTS
+InterfaceDefinition\Interface.h
+InterfaceDefinition\Interface.inl
+
+PRJ_MMPFILES
+InterfaceImplementation\InterfaceImplementation.mmp
+InterfaceClient\InterfaceClient.mmp
+InterfaceDefinition\InterfaceDefinition.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/DISTRIBUTION.POLICY Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,2 @@
+Category G
+OSD: Test/Reference Tools
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient/DISTRIBUTION.POLICY Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,2 @@
+Category G
+OSD: Test/Reference Tools
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient/InterfaceClient.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,121 @@
+// InterfaceClient.cpp
+//
+// Copyright (c) 2001 Symbian Ltd. All rights reserved.
+
+#include <badesca.h>
+
+#include <Interface.h>
+
+#include "CommonFramework.h"
+#include "InterfaceClient.h"
+
+// Utility clean up function
+void CleanupEComArray(TAny* aArray);
+
+// do the example
+LOCAL_C void doExampleL()
+ {
+ _LIT(KText,"ECom client example\n\n");
+ console->Printf(KText);
+
+ TInterfaceClient client;
+ client.GetDefaultL();
+ client.GetBySpecificationL();
+ client.GetByDiscoveryL();
+
+ REComSession::FinalClose();
+ }
+
+void TInterfaceClient::GetDefaultL()
+ {
+ _LIT(KText,"Case 1: getting the default implementation\n");
+ console->Printf(KText);
+
+ // Get the default implementation and call its method
+ CExampleInterface* ex1 = CExampleInterface::NewL();
+ CleanupStack::PushL(ex1);
+ TBuf<100> buf;
+ ex1 -> DoMethodL(buf);
+ CleanupStack::PopAndDestroy(); //ex1
+
+ // Print results
+ console -> Printf(buf);
+ }
+
+void TInterfaceClient::GetBySpecificationL()
+ {
+ _LIT(KText,"\nCase 2: getting an implementation by specification\n");
+ console->Printf(KText);
+
+ // Prepare data to pass to implementation
+ CExampleInterface::TExampleInterfaceInitParams p;
+ p.integer = 0;
+ _LIT(KMsg1,"Data in value: %d\n");
+ console -> Printf(KMsg1,p.integer);
+
+ // Get the implementation that has a data identifier text/xml
+ _LIT8(KSpec,"text/xml");
+ CExampleInterface* ex1 = CExampleInterface::NewL(KSpec,p);
+ CleanupStack::PushL(ex1);
+ TBuf<100> buf;
+ ex1 -> DoMethodL(buf);
+ CleanupStack::PopAndDestroy(); //ex1
+
+ // Print results
+ console -> Printf(buf);
+ _LIT(KMsg2,"Data out value: %d\n");
+ console -> Printf(KMsg2,p.integer);
+ }
+
+
+void TInterfaceClient::GetByDiscoveryL()
+ {
+ _LIT(KText,"\nCase 3: getting all implementations\n");
+ console->Printf(KText);
+
+ // Read info about all implementations into infoArray
+ RImplInfoPtrArray infoArray;
+ // Note that a special cleanup function is required to reset and destroy
+ // all items in the array, and then close it.
+ TCleanupItem cleanup(CleanupEComArray, &infoArray);
+ CleanupStack::PushL(cleanup);
+ CExampleInterface::ListAllImplementationsL(infoArray);
+
+ // Loop through each info for each implementation
+ // and create and use each in turn
+ CExampleInterface* ex;
+ TBuf<255> buf;
+ for (TInt i=0; i< infoArray.Count(); i++)
+ {
+ // Slice off first sub-section in the data section
+ TPtrC8 type = infoArray[i]->DataType();
+ type.Set(type.Left(type.Locate('|')));
+ // Need to convert narrow descriptor to be wide in order to print it
+ buf.Copy(type);
+ console -> Printf(buf);
+ console -> Printf(_L(": "));
+
+ // Create object of type and call its function
+ ex = CExampleInterface::NewL(type);
+ CleanupStack::PushL(ex);
+ ex -> DoMethodL(buf);
+ CleanupStack::PopAndDestroy(); //ex
+
+ // Print results
+ console -> Printf(buf);
+
+ ex = NULL;
+ buf.Zero();
+ }
+
+ // Clean up
+ CleanupStack::PopAndDestroy(); //infoArray, results in a call to CleanupEComArray
+ }
+
+// CleanupEComArray function is used for cleanup support of locally declared arrays
+void CleanupEComArray(TAny* aArray)
+ {
+ (static_cast<RImplInfoPtrArray*> (aArray))->ResetAndDestroy();
+ (static_cast<RImplInfoPtrArray*> (aArray))->Close();
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient/InterfaceClient.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,27 @@
+// InterfaceClient.h
+//
+// Copyright (c) 2001 Symbian Ltd. All rights reserved.
+
+#ifndef __CINTERFACECLIENT_H
+#define __CINTERFACECLIENT_H
+
+#include <Interface.h>
+
+// Example ECOM client that uses the InterfaceImplementation plug-ins
+// through the InterfaceDefinition (CExampleInterface) interface
+class TInterfaceClient
+ {
+public:
+ // Gets the default implementation of CExampleInterface
+ void GetDefaultL();
+
+ // Gets a CExampleInterface implementation by requesting
+ // a specific types of capability
+ void GetBySpecificationL();
+
+ // Gets all the CExampleInterface implementations
+ void GetByDiscoveryL();
+ };
+
+#endif
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceClient/InterfaceClient.mmp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,21 @@
+// InterfaceClient.mmp
+//
+// Copyright (c) 2001 Symbian Ltd. All rights reserved.
+
+TARGET InterfaceClient.exe
+TARGETTYPE exe
+UID 0xE8000077
+VENDORID 0x70000001
+
+SOURCEPATH .
+SOURCE InterfaceClient.cpp
+
+USERINCLUDE .
+USERINCLUDE ..\..\CommonFramework
+SYSTEMINCLUDE \Epoc32\include
+SYSTEMINCLUDE \Epoc32\include\ecom
+
+LIBRARY euser.lib ECom.lib
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition/DISTRIBUTION.POLICY Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,2 @@
+Category G
+OSD: Test/Reference Tools
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition/E8000078.rss Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,32 @@
+// E8000078.RSS
+//
+// Copyright (c) 1997-2001 Symbian Ltd. All rights reserved.
+//
+
+#include "RegistryInfo.rh"
+
+// Declares the interface implementation provided: a custom resolver
+RESOURCE REGISTRY_INFO theInfo
+ {
+ dll_uid = 0xE8000078;
+ interfaces =
+ {
+ INTERFACE_INFO
+ {
+ // Interface UID of resolvers
+ interface_uid = 0x10009D90;
+ implementations =
+ {
+ IMPLEMENTATION_INFO
+ {
+ implementation_uid = 0x10009DD0;
+ version_no = 1;
+ display_name = "";
+ default_data = "";
+ opaque_data = "";
+ }
+ };
+ }
+ };
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition/ExampleResolver.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,147 @@
+//
+// ExampleResolver.cpp
+// Copyright © 1997-2001 Symbian Ltd. All rights reserved.
+//
+
+
+#include <ECom.h>
+#include <EComErrorCodes.h>
+#include <EComResolverParams.h>
+#include <ImplementationInformation.h>
+#include <PublicRegistry.h>
+
+#include "ExampleResolver.h"
+
+CExampleResolver* CExampleResolver::NewL(MPublicRegistry& aRegistry)
+ {
+ return new(ELeave) CExampleResolver(aRegistry);
+ }
+
+CExampleResolver::~CExampleResolver()
+ {
+ if(iImplementationInfoArray)
+ {
+ iImplementationInfoArray->Reset();
+ delete iImplementationInfoArray;
+ }
+ }
+
+CExampleResolver::CExampleResolver(MPublicRegistry& aRegistry)
+: CResolver(aRegistry)
+ {
+ // Do nothing here
+ }
+
+TUid CExampleResolver::IdentifyImplementationL(TUid aInterfaceUid,
+ const TEComResolverParams& aAdditionalParameters) const
+ {
+ RImplInfoArray& implementationsInfo = iRegistry.ListImplementationsL(aInterfaceUid);
+ TUid found = KNullUid;
+ if(implementationsInfo.Count())
+ {
+ found = Resolve(implementationsInfo, aAdditionalParameters);
+ }
+ return found;
+ }
+
+TUid CExampleResolver::Resolve(const RImplInfoArray& aImplementationsInfo,
+ const TEComResolverParams& aAdditionalParameters) const
+ {
+ // Loop through the implementations matching on type
+ const TInt count = aImplementationsInfo.Count();
+ for(TInt index = 0; index < count; ++index)
+ {
+ const CImplementationInformation& impData = *aImplementationsInfo[index];
+ // As soon as we get a match on the datatype then return uid of the
+ // implementation found.
+ if (Match(impData.DataType(), // The Datatype of this implementation
+ aAdditionalParameters.DataType(), // The type we are trying to find
+ aAdditionalParameters.IsWildcardMatch())) // If wildcards should be used
+ return impData.ImplementationUid();
+ }
+
+ return KNullUid;
+ }
+
+RImplInfoArray* CExampleResolver::ListAllL(TUid aInterfaceUid,
+ const TEComResolverParams& aAdditionalParameters) const
+ {
+ // Use the member var to create the array so that we get proper cleanup behaviour
+ iImplementationInfoArray = new(ELeave) RImplInfoArray;
+ RImplInfoArray* retList = iImplementationInfoArray;
+
+ RImplInfoArray& fullList = iRegistry.ListImplementationsL(aInterfaceUid);
+
+ const TBool useWildcards = aAdditionalParameters.IsWildcardMatch();
+ const TDesC8& matchType = aAdditionalParameters.DataType();
+ const TInt numImps = fullList.Count();
+ for(TInt index = 0; index < numImps; ++index)
+ {
+ if(Match(fullList[index]->DataType(), matchType, useWildcards))
+ {
+ User::LeaveIfError(retList->Append(fullList[index]));
+ }
+ }
+
+ // Reset the member variable because we are passing ownership back
+ iImplementationInfoArray = NULL;
+ return retList;
+ }
+
+TBool CExampleResolver::Match(const TDesC8& aImplementationType,
+ const TDesC8& aMatchType,
+ TBool aUseWildcards) const
+ {
+ TInt matchPos = KErrNotFound;
+
+ _LIT8(dataSeparator, "||");
+ const TInt separatorLength = dataSeparator().Length();
+
+ // Look for the section separator marker '||'
+ TInt separatorPos = aImplementationType.Find(dataSeparator);
+ if(separatorPos == KErrNotFound)
+ {
+ // Match against the whole string
+ if(aUseWildcards)
+ matchPos = aImplementationType.Match(aMatchType);
+ else
+ matchPos = aImplementationType.Compare(aMatchType);
+ }
+ else
+ {
+ // Find the first section, up to the separator
+ TPtrC8 dataSection = aImplementationType.Left(separatorPos);
+ TPtrC8 remainingData = aImplementationType.Mid(separatorPos + separatorLength);
+ // Match against each section in turn
+ while(separatorPos != KErrNotFound)
+ {
+ // Search this section
+ if(aUseWildcards)
+ matchPos = dataSection.Match(aMatchType);
+ else
+ matchPos = dataSection.Compare(aMatchType);
+
+ // If we found it then no need to continue, so return
+ if(matchPos != KErrNotFound)
+ return ETrue;
+
+ // Move on to the next section
+ separatorPos = remainingData.Find(dataSeparator);
+ if(separatorPos != KErrNotFound)
+ {
+ dataSection.Set(remainingData.Left(separatorPos));
+ remainingData.Set(remainingData.Mid(separatorPos + separatorLength));
+ }
+ else
+ dataSection.Set(remainingData);
+ }
+
+ // Check the final part
+ if(aUseWildcards)
+ matchPos = dataSection.Match(aMatchType);
+ else
+ matchPos = dataSection.Compare(aMatchType);
+
+ }
+ return matchPos != KErrNotFound;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition/ExampleResolver.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,88 @@
+//
+// ExampleResolver.h
+// Copyright © 2001 Symbian Ltd. All rights reserved.
+//
+
+#ifndef __EXAMPLERESOLVER_H__
+#define __EXAMPLERESOLVER_H__
+
+#include <Resolver.h>
+#include <PublicRegistry.h>
+
+class TEComResolverParams;
+
+// Example resolver's UID
+const TUid KExResolverUid = {0x10009DD0};
+
+/**
+ Implements a non-default resolver.
+
+ This controls the identification, (resolution), of which implementation
+ will be used to satisfy an interface implementation instantiation.
+ */
+class CExampleResolver : public CResolver
+ {
+public:
+ // Factory function:
+ static CExampleResolver* NewL(MPublicRegistry & aRegistry);
+ ~CExampleResolver();
+
+ /**
+ Request that the resolver identify the most appropriate interface implementation.
+ @param aInterfaceUid The interface for which implementations are requested
+ @param aAdditionalParameters Data to be used to refine the search further
+ @return The Uid of the best fit interface implementation - KNullUid if no match is found
+ */
+ TUid IdentifyImplementationL(TUid aInterfaceUid,
+ const TEComResolverParams& aAdditionalParameters) const;
+
+ /**
+ List all the implementations which satisfy the specified interface.
+ @param aInterfaceUid The interface for which implementations are requested
+ @param aAdditionalParameters Data to be used to refine the search further
+ @return Pointer to an array of suitable implementations. Ownership of this array
+ is passed to the calling function.
+ */
+ RImplInfoArray* ListAllL(TUid aInterfaceUid,
+ const TEComResolverParams& aAdditionalParameters) const;
+
+private:
+ // Ctor
+ explicit CExampleResolver(MPublicRegistry& aRegistry);
+
+ /**
+ Called by IdentifyImplementationL to select an appropriate implementation from a list of possibles
+ @param aImplementationsInfo Information on the potential implementations
+ @param aAdditionalParameters The data to match against to detemine the
+ implementation
+ @return The Uid of the selected implementation - KNullUid if no match is found
+ */
+ TUid Resolve(const RImplInfoArray& aImplementationsInfo,
+ const TEComResolverParams& aAdditionalParameters) const;
+
+/**
+ Searches for a match of a data type on an implementation type.
+ Match returns ETrue if aMatchType is found within aImplementationType according to
+ the following rules:
+ 1) aImplementationType is treated as a series of descriptors separated by double
+ bars (||). ETrue is returned if aMatchType matches exactly any of the short
+ descriptors. If no double bar is present then aImplementationType is treated as a
+ single descriptor.
+ 2) If aUseWildcards == ETrue then a '?' in aMatchType will be matched to any single
+ character and '*' will be matched to any series of characters.
+
+ @param aImplementationType The implementation data type to search for a match
+ @param aMatchType The data to search for
+ @param aUseWildcards ETrue if wildcard matching should be allowed
+ @return ETrue if a match was found, EFalse otherwise
+ */
+ TBool Match(const TDesC8& aImplementationType,
+ const TDesC8& aMatchType,
+ TBool aUseWildcards) const;
+
+private:
+ mutable RImplInfoArray* iImplementationInfoArray;
+ };
+
+#endif // __EXAMPLERESOLVER_H__
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition/Interface.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,73 @@
+//
+// Interface.h
+// Copyright © 1997-2001 Symbian Ltd. All rights reserved.
+//
+
+#ifndef _CEXAMPLEINTERFACE__
+#define _CEXAMPLEINTERFACE__
+
+#include <e32base.h>
+#include <ECom.h>
+#include <badesca.h>
+
+// UID of this interface
+const TUid KCExampleInterfaceUid = {0x10009DC0};
+
+/**
+ An example abstract class being representative of the
+ concrete class which the client wishes to use.
+
+ It acts as a base, for a real class to provide all the
+ functionality that a client requires.
+ It supplies instantiation & destruction by using
+ the ECom framework, and functional services
+ by using the methods of the actual class.
+ */
+class CExampleInterface : public CBase
+ {
+public:
+ // The interface for passing initialisation parameters
+ // to the derived class constructor.
+ struct TExampleInterfaceInitParams
+ {
+ TInt integer;
+ const TDesC* descriptor;
+ };
+
+ // Instantiates an object of this type
+ static CExampleInterface* NewL();
+
+ // Instantiates an object of this type
+ // using the aMatchString as the resolver parameters.
+ static CExampleInterface* NewL(const TDesC8& aMatchString);
+
+ // Instantiates an object of this type
+ // using the aMatchString as the resolver parameters
+ // and passing the aParams parameters
+ static CExampleInterface* NewL(const TDesC8& aMatchString, TExampleInterfaceInitParams& aParams);
+
+ // Destructor.
+ virtual ~CExampleInterface();
+
+ // Request a list of all available implementations which
+ // satisfy this given interface.
+ static void ListAllImplementationsL(RImplInfoPtrArray& aImplInfoArray);
+
+ // Pure interface method
+ // Representative of a method provided on the interface by
+ // the interface definer.
+ virtual void DoMethodL(TDes& aString) = 0;
+
+protected:
+ //Default c'tor
+ inline CExampleInterface();
+
+private:
+ // Unique instance identifier key
+ TUid iDtor_ID_Key;
+ };
+
+#include "Interface.inl"
+
+#endif
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition/Interface.inl Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,79 @@
+//
+// Interface.inl
+// Copyright © 1997-2001 Symbian Ltd. All rights reserved.
+//
+
+// Set default to be first implementation found by resolver
+_LIT8(KDefaultImplementation,"*");
+
+inline CExampleInterface::CExampleInterface()
+ {
+ }
+
+inline CExampleInterface::~CExampleInterface()
+ {
+ // Destroy any instance variables and then
+ // inform the framework that this specific
+ // instance of the interface has been destroyed.
+ REComSession::DestroyedImplementation(iDtor_ID_Key);
+ }
+
+inline CExampleInterface* CExampleInterface::NewL()
+ {
+ // Set up the interface find for the default resolver.
+ TEComResolverParams resolverParams;
+ resolverParams.SetDataType(KDefaultImplementation());
+ resolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching
+
+ // Set up some empty initialisation parameters
+ TExampleInterfaceInitParams initParams;
+ initParams.integer = 0;
+ initParams.descriptor = NULL;
+
+ const TUid KExResolverUid = {0x10009DD0};
+ return REINTERPRET_CAST(CExampleInterface*,
+ REComSession::CreateImplementationL(KCExampleInterfaceUid,
+ _FOFF(CExampleInterface,iDtor_ID_Key),
+ &initParams,
+ resolverParams,
+ KExResolverUid));
+ }
+
+inline CExampleInterface* CExampleInterface::NewL(const TDesC8& aMatchString)
+ {
+ // Set up the interface find for the default resolver.
+ TEComResolverParams resolverParams;
+ resolverParams.SetDataType(aMatchString);
+ resolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching
+
+ // Set up some empty initialisation parameters
+ TExampleInterfaceInitParams initParams;
+ initParams.integer = 0;
+ initParams.descriptor = NULL;
+
+ return REINTERPRET_CAST(CExampleInterface*,
+ REComSession::CreateImplementationL(KCExampleInterfaceUid,
+ _FOFF(CExampleInterface,iDtor_ID_Key),
+ &initParams,
+ resolverParams));
+ }
+
+inline CExampleInterface* CExampleInterface::NewL(const TDesC8& aMatchString, TExampleInterfaceInitParams& aParams)
+ {
+ // Set up the interface find for the default resolver.
+ TEComResolverParams resolverParams;
+ resolverParams.SetDataType(aMatchString);
+ resolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching
+
+ // The CreateImplementationL method will return
+ // the created item.
+ return REINTERPRET_CAST(CExampleInterface*, REComSession::CreateImplementationL(KCExampleInterfaceUid,
+ _FOFF(CExampleInterface,iDtor_ID_Key),
+ &aParams,
+ resolverParams));
+ }
+
+inline void CExampleInterface::ListAllImplementationsL(RImplInfoPtrArray& aImplInfoArray)
+ {
+ REComSession::ListImplementationsL(KCExampleInterfaceUid, aImplInfoArray);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition/InterfaceDefinition.mmp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,27 @@
+// InterfaceDefinition.mmp
+//
+// Copyright (c) 2001 Symbian Ltd. All rights reserved.
+//
+
+TARGET ExampleResolver.dll
+TARGETTYPE PLUGIN
+
+// ECom Dll recognition UID followed by the unique UID for this dll
+UID 0x10009D8D 0xE8000078
+VENDORID 0x70000001
+CAPABILITY All -TCB
+
+SOURCEPATH .
+SOURCE main.cpp
+SOURCE Proxy.cpp
+SOURCE ExampleResolver.cpp
+
+USERINCLUDE .
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE \epoc32\include\ecom
+
+start resource E8000078.rss
+TARGET ExampleResolver.rsc
+end
+
+LIBRARY euser.lib
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition/Main.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,6 @@
+//
+// main.cpp
+// Copyright © 1997-2001 Symbian Ltd. All rights reserved.
+//
+
+// No entry point required
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceDefinition/Proxy.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,25 @@
+//
+// Proxy.cpp
+// Copyright © 1997-2001 Symbian Ltd. All rights reserved.
+//
+
+#include <e32std.h>
+#include <ImplementationProxy.h>
+
+#include "ExampleResolver.h"
+
+
+// Map the interface UIDs
+const TImplementationProxy ImplementationTable[] =
+ {
+ IMPLEMENTATION_PROXY_ENTRY(0x10009DD0, CExampleResolver::NewL)
+ };
+
+// Exported proxy for instantiation method resolution
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+ {
+ aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+
+ return ImplementationTable;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation/CImplementationClassOne.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,50 @@
+//
+// CImplementationClassOne.cpp
+// Copyright © 1997-2001 Symbian Ltd. All rights reserved.
+//
+
+#include "CImplementationClassOne.h"
+
+// Construction and destruction functions
+
+CImplementationClassOne* CImplementationClassOne::NewL(TAny* aInitParams)
+ {
+ CImplementationClassOne* self=new(ELeave) CImplementationClassOne(aInitParams);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop();
+ return self;
+ }
+
+CImplementationClassOne::~CImplementationClassOne()
+ {
+ delete iDescriptor;
+ }
+
+CImplementationClassOne::CImplementationClassOne(TAny* aInitParams)
+// Store input/output parameters
+: iInitParams((CExampleInterface::TExampleInterfaceInitParams*)aInitParams)
+ {
+ // See ConstructL() for initialisation completion.
+ }
+
+void CImplementationClassOne::ConstructL()
+// Safely complete the initialization of the constructed object
+ {
+ // Set up the data on the heap to pass back
+ _LIT(KDescriptor, "Using Implementation One\n");
+ iDescriptor = KDescriptor().AllocL();
+ }
+
+
+// Implementation of CExampleInterface
+
+void CImplementationClassOne::DoMethodL(TDes& aString)
+ {
+ aString = *iDescriptor;
+
+ // Set the parameter to something significant
+ if (iInitParams)
+ iInitParams->integer=1;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation/CImplementationClassOne.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,36 @@
+//
+// CImplementationClassOne.h
+// Copyright © 2001 Symbian Ltd. All rights reserved.
+//
+
+#ifndef _CIMPLEMENTATIONCLASSONE__
+#define _CIMPLEMENTATIONCLASSONE__
+
+#include <Interface.h>
+
+// An implementation of the CExampleInterface definition
+class CImplementationClassOne : public CExampleInterface
+ {
+public:
+ // Standardised safe construction which leaves nothing the cleanup stack.
+ static CImplementationClassOne* NewL(TAny* aInitParams);
+ // Destructor
+ ~CImplementationClassOne();
+
+ // Implementation of CExampleInterface
+ void DoMethodL(TDes& aString);
+
+private:
+ // Construction
+ CImplementationClassOne(TAny* aParams);
+ void ConstructL();
+
+private:
+ // Data to pass back from implementation to client
+ HBufC* iDescriptor;
+ // Parameters taken from client
+ CExampleInterface::TExampleInterfaceInitParams* iInitParams;
+ };
+
+#endif
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation/CImplementationClassTwo.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,48 @@
+//
+// CImplementationClassTwo.cpp
+// Copyright © 1997-2001 Symbian Ltd. All rights reserved.
+//
+
+#include "CImplementationClassTwo.h"
+
+// Construction and destruction functions
+
+CImplementationClassTwo* CImplementationClassTwo::NewL(TAny* aParams)
+ {
+ CImplementationClassTwo* self=new(ELeave) CImplementationClassTwo(aParams);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop();
+ return self;
+ }
+
+CImplementationClassTwo::~CImplementationClassTwo()
+ {
+ delete iDescriptor;
+ }
+
+CImplementationClassTwo::CImplementationClassTwo(TAny* aInitParams)
+: iInitParams((CExampleInterface::TExampleInterfaceInitParams*)aInitParams)
+ {
+ // See ConstructL() for initialisation completion.
+ }
+
+void CImplementationClassTwo::ConstructL()
+// Safely complete the initialization of the constructed object
+ {
+ // Set up the data to pass back
+ _LIT(KDescriptor, "Using Implementation Two\n");
+ iDescriptor = KDescriptor().AllocL();
+ }
+
+
+// Implementation of CExampleInterface
+
+void CImplementationClassTwo::DoMethodL(TDes& aString)
+ {
+ aString = *iDescriptor;
+
+ if (iInitParams)
+ iInitParams->integer=2;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation/CImplementationClassTwo.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,35 @@
+//
+// CImplementationClassTwo.h
+// Copyright © 2001 Symbian Ltd. All rights reserved.
+//
+
+#ifndef _CIMPLEMENTATIONCLASSTWO__
+#define _CIMPLEMENTATIONCLASSTWO__
+
+#include <Interface.h>
+
+// An implementation of the CExampleInterface definition
+class CImplementationClassTwo : public CExampleInterface
+ {
+public:
+ // Standardised safe construction which leaves nothing the cleanup stack.
+ static CImplementationClassTwo* NewL(TAny* aInitParams);
+ // Destructor
+ ~CImplementationClassTwo();
+
+ // Implementation of CExampleInterface
+ void DoMethodL(TDes& aString);
+
+private:
+ // Construction
+ CImplementationClassTwo(TAny* aInitParams);
+ void ConstructL();
+
+private:
+ // Data to pass back from implementation to client
+ HBufC* iDescriptor;
+ // Parameters taken from client
+ CExampleInterface::TExampleInterfaceInitParams* iInitParams;
+ };
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation/DISTRIBUTION.POLICY Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,2 @@
+Category G
+OSD: Test/Reference Tools
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation/E8000079.rss Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,46 @@
+// E8000079.RSS
+//
+// Copyright (c) 1997-2001 Symbian Ltd. All rights reserved.
+//
+// Registry file for the Example Interface Implementation Collection
+
+
+#include "RegistryInfo.rh"
+
+// Declares info for two implementations
+RESOURCE REGISTRY_INFO theInfo
+ {
+ // UID for the DLL
+ dll_uid = 0x10009DB1;
+ // Declare array of interface info
+ interfaces =
+ {
+ INTERFACE_INFO
+ {
+ // UID of interface that is implemented
+ interface_uid = 0x10009DC0;
+ implementations =
+ {
+ // Info for CImplementation1
+ IMPLEMENTATION_INFO
+ {
+ implementation_uid = 0x10009DC3;
+ version_no = 1;
+ display_name = "Implementation 1";
+ default_data = "text/wml||This is the type of data that this implementation understands. (Can be anything which will allow the resolver to identify this implementation as the correct one at run time. In this case it is a mime type).";
+ opaque_data = "test_params";
+ },
+ // Info for CImplementation2
+ IMPLEMENTATION_INFO
+ {
+ implementation_uid = 0x10009DC4;
+ version_no = 1;
+ display_name = "Implementation 1||Copyright © 1997-2001 Symbian Ltd. All Rights Reserved.||";
+ default_data = "text/xml||Type of data handled";
+ opaque_data = "";
+ }
+ };
+ }
+ };
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation/InterfaceImplementation.mmp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,28 @@
+// EComExample.mmp
+//
+// Copyright (c) 2001 Symbian Ltd. All rights reserved.
+//
+
+TARGET EComExample.dll
+TARGETTYPE PLUGIN
+
+// ECom Dll recognition UID followed by the unique UID for this dll
+UID 0x10009D8D 0xE8000079
+VENDORID 0x70000001
+CAPABILITY All -TCB
+
+SOURCEPATH .
+SOURCE main.cpp
+SOURCE Proxy.cpp
+SOURCE CImplementationClassOne.cpp
+SOURCE CImplementationClassTwo.cpp
+
+USERINCLUDE .
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE \epoc32\include\ecom
+
+start resource E8000079.rss
+TARGET EComExample.rsc
+end
+
+LIBRARY euser.lib ECom.lib
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation/Main.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,6 @@
+//
+// main.cpp
+// Copyright © 1997-2001 Symbian Ltd. All rights reserved.
+//
+
+// No entry point requried for EKA2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/ECom/InterfaceImplementation/Proxy.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,26 @@
+//
+// Proxy.cpp
+// Copyright © 1997-2001 Symbian Ltd. All rights reserved.
+//
+
+#include <e32std.h>
+#include <ImplementationProxy.h>
+
+#include "CImplementationClassOne.h"
+#include "CImplementationClassTwo.h"
+
+// Map the interface UIDs to implementation factory functions
+const TImplementationProxy ImplementationTable[] =
+ {
+ IMPLEMENTATION_PROXY_ENTRY(0x10009DC3, CImplementationClassOne::NewL),
+ IMPLEMENTATION_PROXY_ENTRY(0x10009DC4, CImplementationClassTwo::NewL)
+ };
+
+// Exported proxy for instantiation method resolution
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+ {
+ aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+
+ return ImplementationTable;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/BWINS/ut_SysLibsU.DEF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,2 @@
+EXPORTS
+ ?CreateTestL@@YAPAVMSymbianUnitTestInterface@@XZ @ 1 NONAME ; class MSymbianUnitTestInterface * CreateTestL(void)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+3
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/EABI/ut_SysLibsU.DEF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+EXPORTS
+ _Z11CreateTestLv @ 1 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/group/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+3
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/group/bld.inf Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Symbian Unit Testing framework
+*
+*/
+
+PRJ_TESTMMPFILES
+ut_SysLibs.mmp
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/group/ut_SysLibs.mmp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+TARGET ut_SysLibs.dll
+TARGETTYPE dll
+UID 0x20022E76 0x20022E76
+
+MACRO SYMBIAN_UNIT_TEST
+
+SOURCEPATH ../../ECom/InterfaceClient
+SOURCE InterfaceClient.cpp
+
+SOURCEPATH ../../ECom/InterfaceDefinition
+SOURCE ExampleResolver.cpp
+
+SOURCEPATH ../../ECom/InterfaceImplementation
+SOURCE CImplementationClassOne.cpp
+SOURCE CImplementationClassTwo.cpp
+
+
+SOURCEPATH ../src
+SOURCE dllEntry.cpp
+SOURCE ut_CExampleResolver.cpp
+SOURCE ut_CImplementationClassOne.cpp
+SOURCE ut_CImplementationClassTwo.cpp
+SOURCE ut_TInterfaceClient.cpp
+
+USERINCLUDE ../inc
+USERINCLUDE ../../CommonFramework
+USERINCLUDE ../../ECom/InterfaceClient
+USERINCLUDE ../../ECom/InterfaceDefinition
+USERINCLUDE ../../ECom/InterfaceImplementation
+
+SYSTEMINCLUDE /Epoc32/include
+SYSTEMINCLUDE /Epoc32/include/ecom
+SYSTEMINCLUDE /epoc32/include
+SYSTEMINCLUDE /epoc32/include/ecom
+SYSTEMINCLUDE /epoc32/include/symbianunittest
+
+LIBRARY ECom.lib
+LIBRARY euser.lib
+LIBRARY symbianunittestfw.lib
+
+VENDORID 0x101FB657
+
+CAPABILITY ALL -TCB
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/inc/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+3
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/inc/ut_CExampleResolver.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef UT_CEXAMPLERESOLVER_H
+#define UT_CEXAMPLERESOLVER_H
+
+// INCLUDES
+#include <symbianunittest.h>
+
+// FORWARD DECLARATIONS
+class CExampleResolver;
+
+// CLASS DECLARATION
+class UT_CExampleResolver: public CSymbianUnitTest
+{
+public: // Constructors and destructor
+
+ static UT_CExampleResolver* NewL();
+ static UT_CExampleResolver* NewLC();
+ ~UT_CExampleResolver();
+
+protected: // From CSymbianUnitTest
+
+ void SetupL();
+ void Teardown();
+
+protected: // Test functions
+
+ void UT_Destructor_CExampleResolver();
+ void UT_IdentifyImplementationL();
+ void UT_ListAllL();
+ void UT_NewL();
+
+private: // Constructors
+
+ UT_CExampleResolver();
+ void ConstructL();
+
+private: // Data
+
+ // The object to be tested as a member variable:
+ CExampleResolver *iCExampleResolver;
+};
+
+#endif // UT_CEXAMPLERESOLVER_H
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/inc/ut_CImplementationClassOne.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef UT_CIMPLEMENTATIONCLASSONE_H
+#define UT_CIMPLEMENTATIONCLASSONE_H
+
+// INCLUDES
+#include <symbianunittest.h>
+
+// FORWARD DECLARATIONS
+class CImplementationClassOne;
+
+// CLASS DECLARATION
+class UT_CImplementationClassOne: public CSymbianUnitTest
+{
+public: // Constructors and destructor
+
+ static UT_CImplementationClassOne* NewL();
+ static UT_CImplementationClassOne* NewLC();
+ ~UT_CImplementationClassOne();
+
+protected: // From CSymbianUnitTest
+
+ void SetupL();
+ void Teardown();
+
+protected: // Test functions
+
+ void UT_Destructor_CImplementationClassOne();
+ void UT_DoMethodL();
+ void UT_NewL();
+
+private: // Constructors
+
+ UT_CImplementationClassOne();
+ void ConstructL();
+
+private: // Data
+
+ // The object to be tested as a member variable:
+ CImplementationClassOne *iCImplementationClassOne;
+};
+
+#endif // UT_CIMPLEMENTATIONCLASSONE_H
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/inc/ut_CImplementationClassTwo.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef UT_CIMPLEMENTATIONCLASSTWO_H
+#define UT_CIMPLEMENTATIONCLASSTWO_H
+
+// INCLUDES
+#include <symbianunittest.h>
+
+// FORWARD DECLARATIONS
+class CImplementationClassTwo;
+
+// CLASS DECLARATION
+class UT_CImplementationClassTwo: public CSymbianUnitTest
+{
+public: // Constructors and destructor
+
+ static UT_CImplementationClassTwo* NewL();
+ static UT_CImplementationClassTwo* NewLC();
+ ~UT_CImplementationClassTwo();
+
+protected: // From CSymbianUnitTest
+
+ void SetupL();
+ void Teardown();
+
+protected: // Test functions
+
+ void UT_Destructor_CImplementationClassTwo();
+ void UT_DoMethodL();
+ void UT_NewL();
+
+private: // Constructors
+
+ UT_CImplementationClassTwo();
+ void ConstructL();
+
+private: // Data
+
+ // The object to be tested as a member variable:
+ CImplementationClassTwo *iCImplementationClassTwo;
+};
+
+#endif // UT_CIMPLEMENTATIONCLASSTWO_H
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/inc/ut_TInterfaceClient.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef UT_TINTERFACECLIENT_H
+#define UT_TINTERFACECLIENT_H
+
+// INCLUDES
+#include <symbianunittest.h>
+
+// FORWARD DECLARATIONS
+class TInterfaceClient;
+
+// CLASS DECLARATION
+class UT_TInterfaceClient: public CSymbianUnitTest
+{
+public: // Constructors and destructor
+
+ static UT_TInterfaceClient* NewL();
+ static UT_TInterfaceClient* NewLC();
+ ~UT_TInterfaceClient();
+
+protected: // From CSymbianUnitTest
+
+ void SetupL();
+ void Teardown();
+
+protected: // Test functions
+
+ void UT_GetByDiscoveryL();
+ void UT_GetBySpecificationL();
+ void UT_GetDefaultL();
+
+private: // Constructors
+
+ UT_TInterfaceClient();
+ void ConstructL();
+
+private: // Data
+
+ // The object to be tested as a member variable:
+ TInterfaceClient *iTInterfaceClient;
+};
+
+#endif // UT_TINTERFACECLIENT_H
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/src/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+3
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/src/dllentry.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include "ut_CExampleResolver.h"
+#include "ut_CImplementationClassOne.h"
+#include "ut_CImplementationClassTwo.h"
+#include "ut_TInterfaceClient.h"
+#include <symbianunittestsuite.h>
+
+// Exactly one exported function returning
+// the pointer to the suite of tests for the SymbianUnit framework.
+//
+EXPORT_C MSymbianUnitTestInterface* CreateTestL()
+{
+ CSymbianUnitTestSuite* testSuite =
+ CSymbianUnitTestSuite::NewLC( _L("ut_SysLibs") );
+
+ testSuite->AddL( UT_CExampleResolver::NewLC() );
+ testSuite->AddL( UT_CImplementationClassOne::NewLC() );
+ testSuite->AddL( UT_CImplementationClassTwo::NewLC() );
+ testSuite->AddL( UT_TInterfaceClient::NewLC() );
+ CleanupStack::Pop();
+
+ CleanupStack::Pop( testSuite );
+ return testSuite;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/src/ut_CExampleResolver.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ut_CExampleResolver.h"
+#include "ExampleResolver.h"
+#include <symbianunittestmacros.h>
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+UT_CExampleResolver* UT_CExampleResolver::NewL()
+ {
+ UT_CExampleResolver* self = UT_CExampleResolver::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+UT_CExampleResolver* UT_CExampleResolver::NewLC()
+ {
+ UT_CExampleResolver* self = new( ELeave )UT_CExampleResolver();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+UT_CExampleResolver::UT_CExampleResolver()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void UT_CExampleResolver::ConstructL()
+ {
+ BASE_CONSTRUCT
+ ADD_SUT( UT_Destructor_CExampleResolver )
+ ADD_SUT( UT_IdentifyImplementationL )
+ ADD_SUT( UT_ListAllL )
+ ADD_SUT( UT_NewL )
+
+ // Setup and teardown functions can be changed for each test function
+ // Usually this is not needed, but this is possible.
+ // ADD_SUT_WITH_SETUP_AND_TEARDOWN( SetupL, UT_YouFunc, Teardown )
+ }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+UT_CExampleResolver::~UT_CExampleResolver()
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// SetupL
+// -----------------------------------------------------------------------------
+//
+void UT_CExampleResolver::SetupL()
+ {
+ //iCExampleResolver = CExampleResolver::NewL(); ??
+ }
+
+// -----------------------------------------------------------------------------
+// Teardown
+// -----------------------------------------------------------------------------
+//
+void UT_CExampleResolver::Teardown()
+ {
+ delete iCExampleResolver;
+ iCExampleResolver = NULL;
+ }
+
+
+// -----------------------------------------------------------------------------
+// test CExampleResolver::~CExampleResolver ()
+// -----------------------------------------------------------------------------
+//
+void UT_CExampleResolver::UT_Destructor_CExampleResolver()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CExampleResolver::IdentifyImplementationL ()
+// -----------------------------------------------------------------------------
+//
+void UT_CExampleResolver::UT_IdentifyImplementationL()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CExampleResolver::ListAllL ()
+// -----------------------------------------------------------------------------
+//
+void UT_CExampleResolver::UT_ListAllL()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CExampleResolver::NewL ()
+// -----------------------------------------------------------------------------
+//
+void UT_CExampleResolver::UT_NewL()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/src/ut_CImplementationClassOne.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ut_CImplementationClassOne.h"
+#include "CImplementationClassOne.h"
+#include <symbianunittestmacros.h>
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+UT_CImplementationClassOne* UT_CImplementationClassOne::NewL()
+ {
+ UT_CImplementationClassOne* self = UT_CImplementationClassOne::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+UT_CImplementationClassOne* UT_CImplementationClassOne::NewLC()
+ {
+ UT_CImplementationClassOne* self = new( ELeave )UT_CImplementationClassOne();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+UT_CImplementationClassOne::UT_CImplementationClassOne()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void UT_CImplementationClassOne::ConstructL()
+ {
+ BASE_CONSTRUCT
+ ADD_SUT( UT_Destructor_CImplementationClassOne )
+ ADD_SUT( UT_DoMethodL )
+ ADD_SUT( UT_NewL )
+
+ // Setup and teardown functions can be changed for each test function
+ // Usually this is not needed, but this is possible.
+ // ADD_SUT_WITH_SETUP_AND_TEARDOWN( SetupL, UT_YouFunc, Teardown )
+ }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+UT_CImplementationClassOne::~UT_CImplementationClassOne()
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// SetupL
+// -----------------------------------------------------------------------------
+//
+void UT_CImplementationClassOne::SetupL()
+ {
+ //iCImplementationClassOne = CImplementationClassOne::NewL(); ??
+ }
+
+// -----------------------------------------------------------------------------
+// Teardown
+// -----------------------------------------------------------------------------
+//
+void UT_CImplementationClassOne::Teardown()
+ {
+ delete iCImplementationClassOne;
+ iCImplementationClassOne = NULL;
+ }
+
+
+// -----------------------------------------------------------------------------
+// test CImplementationClassOne::~CImplementationClassOne ()
+// -----------------------------------------------------------------------------
+//
+void UT_CImplementationClassOne::UT_Destructor_CImplementationClassOne()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CImplementationClassOne::DoMethodL ()
+// -----------------------------------------------------------------------------
+//
+void UT_CImplementationClassOne::UT_DoMethodL()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CImplementationClassOne::NewL ()
+// -----------------------------------------------------------------------------
+//
+void UT_CImplementationClassOne::UT_NewL()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/src/ut_CImplementationClassTwo.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ut_CImplementationClassTwo.h"
+#include "CImplementationClassTwo.h"
+#include <symbianunittestmacros.h>
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+UT_CImplementationClassTwo* UT_CImplementationClassTwo::NewL()
+ {
+ UT_CImplementationClassTwo* self = UT_CImplementationClassTwo::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+UT_CImplementationClassTwo* UT_CImplementationClassTwo::NewLC()
+ {
+ UT_CImplementationClassTwo* self = new( ELeave )UT_CImplementationClassTwo();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+UT_CImplementationClassTwo::UT_CImplementationClassTwo()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void UT_CImplementationClassTwo::ConstructL()
+ {
+ BASE_CONSTRUCT
+ ADD_SUT( UT_Destructor_CImplementationClassTwo )
+ ADD_SUT( UT_DoMethodL )
+ ADD_SUT( UT_NewL )
+
+ // Setup and teardown functions can be changed for each test function
+ // Usually this is not needed, but this is possible.
+ // ADD_SUT_WITH_SETUP_AND_TEARDOWN( SetupL, UT_YouFunc, Teardown )
+ }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+UT_CImplementationClassTwo::~UT_CImplementationClassTwo()
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// SetupL
+// -----------------------------------------------------------------------------
+//
+void UT_CImplementationClassTwo::SetupL()
+ {
+ //iCImplementationClassTwo = CImplementationClassTwo::NewL(); ??
+ }
+
+// -----------------------------------------------------------------------------
+// Teardown
+// -----------------------------------------------------------------------------
+//
+void UT_CImplementationClassTwo::Teardown()
+ {
+ delete iCImplementationClassTwo;
+ iCImplementationClassTwo = NULL;
+ }
+
+
+// -----------------------------------------------------------------------------
+// test CImplementationClassTwo::~CImplementationClassTwo ()
+// -----------------------------------------------------------------------------
+//
+void UT_CImplementationClassTwo::UT_Destructor_CImplementationClassTwo()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CImplementationClassTwo::DoMethodL ()
+// -----------------------------------------------------------------------------
+//
+void UT_CImplementationClassTwo::UT_DoMethodL()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CImplementationClassTwo::NewL ()
+// -----------------------------------------------------------------------------
+//
+void UT_CImplementationClassTwo::UT_NewL()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/several.mmp.in.one.path/SysLibs/unittest/src/ut_TInterfaceClient.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ut_TInterfaceClient.h"
+#include "InterfaceClient.h"
+#include <symbianunittestmacros.h>
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+UT_TInterfaceClient* UT_TInterfaceClient::NewL()
+ {
+ UT_TInterfaceClient* self = UT_TInterfaceClient::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+UT_TInterfaceClient* UT_TInterfaceClient::NewLC()
+ {
+ UT_TInterfaceClient* self = new( ELeave )UT_TInterfaceClient();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+UT_TInterfaceClient::UT_TInterfaceClient()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void UT_TInterfaceClient::ConstructL()
+ {
+ BASE_CONSTRUCT
+ ADD_SUT( UT_GetByDiscoveryL )
+ ADD_SUT( UT_GetBySpecificationL )
+ ADD_SUT( UT_GetDefaultL )
+
+ // Setup and teardown functions can be changed for each test function
+ // Usually this is not needed, but this is possible.
+ // ADD_SUT_WITH_SETUP_AND_TEARDOWN( SetupL, UT_YouFunc, Teardown )
+ }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+UT_TInterfaceClient::~UT_TInterfaceClient()
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// SetupL
+// -----------------------------------------------------------------------------
+//
+void UT_TInterfaceClient::SetupL()
+ {
+ //iTInterfaceClient = TInterfaceClient::NewL(); ??
+ }
+
+// -----------------------------------------------------------------------------
+// Teardown
+// -----------------------------------------------------------------------------
+//
+void UT_TInterfaceClient::Teardown()
+ {
+ delete iTInterfaceClient;
+ iTInterfaceClient = NULL;
+ }
+
+
+// -----------------------------------------------------------------------------
+// test TInterfaceClient::GetByDiscoveryL ()
+// -----------------------------------------------------------------------------
+//
+void UT_TInterfaceClient::UT_GetByDiscoveryL()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test TInterfaceClient::GetBySpecificationL ()
+// -----------------------------------------------------------------------------
+//
+void UT_TInterfaceClient::UT_GetBySpecificationL()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test TInterfaceClient::GetDefaultL ()
+// -----------------------------------------------------------------------------
+//
+void UT_TInterfaceClient::UT_GetDefaultL()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/.cdtproject Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse-cdt version="2.0"?>
+
+<cdtproject id="com.nokia.carbide.cpp.project.core.carbidecppproject">
+<extension id="com.nokia.carbide.cpp.project.core.CarbideCPPScannerProvider" point="org.eclipse.cdt.core.ScannerInfoProvider"/>
+<extension id="com.nokia.carbide.cdt.builder" point="com.nokia.carbide.cdt.builder.carbideCPPBuilder">
+<attribute key="infFileLocation" value="group/bld.inf"/>
+<attribute key="defaultBuildConfig" value="Emulator Debug (WINSCW) [M04353_Symbian_OS_v9.5]"/>
+<attribute key="buildFromInf" value="true"/>
+<attribute key="verboseFlag" value="true"/>
+<attribute key="debugTargetMMP" value="testThread.mmp"/>
+<attribute key="cleanCommand" value="clean"/>
+<attribute key="buildingTestComps" value="true"/>
+<attribute key="infBuildComponents" value=""/>
+</extension>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<data>
+<item id="org.eclipse.cdt.core.pathentry">
+<pathentry kind="src" path="src"/>
+<pathentry kind="src" path="inc"/>
+<pathentry kind="con" path="com.nokia.carbide.cpp.project.core.CARBIDE_CPP_PATH_INFO"/>
+</item>
+</data>
+</cdtproject>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>testThread</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.nokia.carbide.cdt.builder.carbideCPPBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.nokia.carbide.cdt.rombuilder.carbideRomBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>com.nokia.carbide.cdt.builder.carbideCPPBuilderNature</nature>
+ <nature>com.nokia.carbide.cdt.rombuilder.carbideRomBuildNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/.settings/.carbide_build_settings Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CarbideBuilderConfigInfo version="1">
+ <configuration name="Emulator Debug (WINSCW) [M04353_Symbian_OS_v9.5]">
+ <sisBuilder additionalOptions="" cert="" contentSearchLocation="" key="" outputFileName="" password="" pkgFile="(none)" signedFileName=""/>
+ <envVars/>
+ </configuration>
+ <configuration name="Emulator Release (WINSCW) [M04353_Symbian_OS_v9.5]">
+ <sisBuilder additionalOptions="" cert="" contentSearchLocation="" key="" outputFileName="" password="" pkgFile="(none)" signedFileName=""/>
+ <envVars/>
+ </configuration>
+ <configuration name="Phone Debug (ARMV5) [M04353_Symbian_OS_v9.5]">
+ <sisBuilder additionalOptions="" cert="" contentSearchLocation="" key="" outputFileName="" password="" pkgFile="(none)" signedFileName=""/>
+ <envVars/>
+ </configuration>
+ <configuration name="Phone Release (ARMV5) [M04353_Symbian_OS_v9.5]">
+ <sisBuilder additionalOptions="" cert="" contentSearchLocation="" key="" outputFileName="" password="" pkgFile="(none)" signedFileName=""/>
+ <envVars/>
+ </configuration>
+ <configuration name="Phone Debug (GCCE) [M04353_Symbian_OS_v9.5]">
+ <sisBuilder additionalOptions="" cert="" contentSearchLocation="" key="" outputFileName="" password="" pkgFile="(none)" signedFileName=""/>
+ <envVars/>
+ </configuration>
+ <configuration name="Phone Release (GCCE) [M04353_Symbian_OS_v9.5]">
+ <sisBuilder additionalOptions="" cert="" contentSearchLocation="" key="" outputFileName="" password="" pkgFile="(none)" signedFileName=""/>
+ <envVars/>
+ </configuration>
+</CarbideBuilderConfigInfo>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/.settings/org.eclipse.cdt.core.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+#Mon Dec 24 14:12:36 CST 2007
+eclipse.preferences.version=1
+indexerId=org.eclipse.cdt.core.fastIndexer
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/group/bld.inf Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,15 @@
+/*
+============================================================================
+ Name : bld.inf
+ Author : Yue Zhang
+ Copyright : Test Product Team, Symbian
+ Description : This file provides the information required for building the
+ whole of a testThread.
+============================================================================
+*/
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_MMPFILES
+testThread.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/group/testThread.mmp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,22 @@
+/*
+============================================================================
+ Name : testThread.mmp
+ Author : Yue Zhang
+ Copyright : Test Product Team, Symbian
+ Description : This is the project specification file for testThread.
+============================================================================
+*/
+
+TARGET testThread.exe
+TARGETTYPE exe
+UID 0 0xEE0ED66F
+
+USERINCLUDE ..\inc
+SYSTEMINCLUDE \epoc32\include
+
+SOURCEPATH ..\src
+SOURCE testThread.cpp test1.cpp child.cpp
+
+LIBRARY euser.lib
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/inc/child.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,14 @@
+#ifndef CHILD_H_
+#define CHILD_H_
+
+#include "parent.h"
+
+class CChild : public MParent2, public MParent
+{
+public:
+ CChild();
+ ~CChild();
+ void Add();
+ void Del();
+};
+#endif /*CHILD_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/inc/parent.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,16 @@
+#ifndef PARENT_H_
+#define PARENT_H_
+
+class MParent
+{
+public:
+ virtual void Add() = 0;
+};
+
+class MParent2
+{
+public:
+ virtual void Del() = 0;
+};
+
+#endif /*PARENT_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/inc/test1.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,19 @@
+#ifndef TEST1_H_
+#define TEST1_H_
+
+#include <e32base.h>
+
+class CTest1
+{
+
+public:
+ CTest1();
+ ~CTest1();
+
+public:
+ static TInt threadFunc(TAny*);
+ void Start();
+
+};
+
+#endif /*TEST1_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/inc/testThread.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,26 @@
+/*
+============================================================================
+ Name : testThread.h
+ Author : Yue Zhang
+ Copyright : Test Product Team, Symbian
+ Description : Exe header file
+============================================================================
+*/
+
+#ifndef __TESTTHREAD_H__
+#define __TESTTHREAD_H__
+
+
+// Include Files
+
+#include <e32base.h>
+
+
+// Function Prototypes
+
+GLDEF_C TInt E32Main();
+
+
+#endif // __TESTTHREAD_H__
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/sis/testThread_EKA1.pkg Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,22 @@
+; Installation file for ARMI & THUMB Build for generic EKA1 console application
+; Installation file for testThread application
+;
+; This is an auto-generated PKG file by Carbide.
+; This file uses variables specific to Carbide builds that will not work
+; on command-line builds. If you want to use this generated PKG file from the
+; command-line tools you will need to modify the variables with the appropriate
+; values: $(EPOCROOT), $(PLATFORM), $(TARGET)
+;
+;
+; UID is the exe's UID
+;
+#{"testThread EXE"},(0x0),1,0,0
+
+;Localised Vendor name
+;%{"Vendor-EN"}
+
+;Unique Vendor name
+;:"Vendor"
+
+"$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\testThread.exe" -"!:\system\programs\testThread.exe"
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/sis/testThread_EKA2.pkg Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,24 @@
+; Installation file for Symbian OS 9.x for generic console application
+; Installation file for testThread EXE
+;
+; This is an auto-generated PKG file by Carbide.
+; This file uses variables specific to Carbide builds that will not work
+; on command-line builds. If you want to use this generated PKG file from the
+; command-line tools you will need to modify the variables with the appropriate
+; values: $(EPOCROOT), $(PLATFORM), $(TARGET)
+;
+
+;
+; UID is the exe's UID
+;
+#{"testThread EXE"},(0xEE0ED66F),1,0,0
+
+
+;Localised Vendor name
+%{"Vendor-EN"}
+
+;Unique Vendor name
+:"Vendor"
+
+"$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\testThread.exe" -"!:\sys\bin\testThread.exe"
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/src/child.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,22 @@
+#include "child.h"
+#include <e32std.h>
+
+CChild::CChild()
+ {
+ //nothing
+ }
+
+CChild::~CChild()
+ {
+ //nothing
+ }
+
+void CChild::Add()
+ {
+ User::InfoPrint(_L("Child.Add"));
+ }
+
+void CChild::Del()
+ {
+ User::InfoPrint(_L("Child.Del"));
+ }
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/src/test1.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,32 @@
+#include "test1.h"
+#include <e32base.h>
+#include <e32std.h>
+#include <e32cons.h> // Console
+
+CTest1::CTest1()
+ {
+ //nothing
+ }
+
+CTest1::~CTest1()
+ {
+
+ }
+
+TInt CTest1::threadFunc(TAny*)
+ {
+ for(TInt i=0;i<10;++i)
+ {
+ User::InfoPrint(_L("Thread..."));
+ User::After(4000000);
+ }
+ return 0;
+ }
+
+void CTest1::Start()
+ {
+ RThread thd;
+ User::LeaveIfError(thd.Create(_L("MyThread"), threadFunc , KDefaultStackSize,NULL, NULL));
+ thd.Resume();
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/src/testThread.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,99 @@
+/*
+============================================================================
+ Name : testThread.cpp
+ Author : Yue Zhang
+ Copyright : Test Product Team, Symbian
+ Description : Exe source file
+============================================================================
+*/
+
+// Include Files
+
+#include "testThread.h"
+#include <e32base.h>
+#include <e32std.h>
+#include <e32cons.h> // Console
+#include "child.h"
+
+
+// Constants
+
+_LIT(KTextConsoleTitle, "Console");
+_LIT(KTextFailed, " failed, leave code = %d");
+_LIT(KTextPressAnyKey, " [press any key]\n");
+
+// Global Variables
+
+LOCAL_D CConsoleBase* console; // write all messages to this
+
+/*
+TInt threadFunc(TAny*)
+ {
+ for(TInt i=0;i<10;++i)
+ {
+ User::InfoPrint(_L("Thread..."));
+ User::After(4000000);
+ }
+ return 0;
+ }
+*/
+
+// Local Functions
+LOCAL_C void MainL()
+ {
+ //
+ // add your program code here, example code below
+ //
+ MParent* a = new (ELeave)CChild();
+ static_cast<CChild*>(a)->Add();
+ delete a;
+ a = NULL;
+ console->Write(_L("Hello, world!\n"));
+
+ //RThread thd;
+ //User::LeaveIfError(thd.Create(_L("MyThread"), threadFunc, KDefaultStackSize,NULL, NULL));
+ //thd.Resume();
+ }
+
+LOCAL_C void DoStartL()
+ {
+ // Create active scheduler (to run active objects)
+ CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
+ CleanupStack::PushL(scheduler);
+ CActiveScheduler::Install(scheduler);
+
+ MainL();
+
+ // Delete active scheduler
+ CleanupStack::PopAndDestroy(scheduler);
+ }
+
+
+// Global Functions
+
+GLDEF_C TInt E32Main()
+ {
+ // Create cleanup stack
+ __UHEAP_MARK;
+ CTrapCleanup* cleanup = CTrapCleanup::New();
+
+ // Create output console
+ TRAPD(createError, console = Console::NewL(KTextConsoleTitle, TSize(KConsFullScreen,KConsFullScreen)));
+ if (createError)
+ return createError;
+
+ // Run application code inside TRAP harness, wait keypress when terminated
+ TRAPD(mainError, DoStartL());
+ if (mainError)
+ console->Printf(KTextFailed, mainError);
+ console->Printf(KTextPressAnyKey);
+ console->Getch();
+
+ delete console;
+ delete cleanup;
+ __UHEAP_MARKEND;
+ return KErrNone;
+ }
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/unittest/BWINS/ut_testThreadU.DEF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,2 @@
+EXPORTS
+ ?CreateTestL@@YAPAVMSymbianUnitTestInterface@@XZ @ 1 NONAME ; class MSymbianUnitTestInterface * CreateTestL(void)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/unittest/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+3
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/unittest/EABI/ut_testThreadU.DEF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+EXPORTS
+ _Z11CreateTestLv @ 1 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/unittest/group/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+3
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/unittest/group/bld.inf Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Symbian Unit Testing framework
+*
+*/
+
+PRJ_TESTMMPFILES
+ut_testThread.mmp
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/unittest/group/ut_testThread.mmp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+TARGET ut_testThread.dll
+TARGETTYPE dll
+UID 0x20022E76 0x20022E76
+
+MACRO SYMBIAN_UNIT_TEST
+
+SOURCEPATH ../../src
+SOURCE child.cpp
+SOURCE test1.cpp
+
+
+SOURCEPATH ../src
+SOURCE dllEntry.cpp
+SOURCE ut_CChild.cpp
+SOURCE ut_CTest1.cpp
+
+USERINCLUDE ../inc
+USERINCLUDE ../../inc
+
+SYSTEMINCLUDE /epoc32/include
+SYSTEMINCLUDE /epoc32/include/symbianunittest
+
+LIBRARY euser.lib
+LIBRARY symbianunittestfw.lib
+
+VENDORID 0x101FB657
+
+CAPABILITY ALL -TCB
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/unittest/inc/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+3
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/unittest/inc/ut_CChild.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef UT_CCHILD_H
+#define UT_CCHILD_H
+
+// INCLUDES
+#include <symbianunittest.h>
+
+// FORWARD DECLARATIONS
+class CChild;
+
+// CLASS DECLARATION
+class UT_CChild: public CSymbianUnitTest
+{
+public: // Constructors and destructor
+
+ static UT_CChild* NewL();
+ static UT_CChild* NewLC();
+ ~UT_CChild();
+
+protected: // From CSymbianUnitTest
+
+ void SetupL();
+ void Teardown();
+
+protected: // Test functions
+
+ void UT_Add();
+ void UT_Constructor_CChild();
+ void UT_Del();
+ void UT_Destructor_CChild();
+
+private: // Constructors
+
+ UT_CChild();
+ void ConstructL();
+
+private: // Data
+
+ // The object to be tested as a member variable:
+ CChild *iCChild;
+};
+
+#endif // UT_CCHILD_H
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/unittest/inc/ut_CTest1.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef UT_CTEST1_H
+#define UT_CTEST1_H
+
+// INCLUDES
+#include <symbianunittest.h>
+
+// FORWARD DECLARATIONS
+class CTest1;
+
+// CLASS DECLARATION
+class UT_CTest1: public CSymbianUnitTest
+{
+public: // Constructors and destructor
+
+ static UT_CTest1* NewL();
+ static UT_CTest1* NewLC();
+ ~UT_CTest1();
+
+protected: // From CSymbianUnitTest
+
+ void SetupL();
+ void Teardown();
+
+protected: // Test functions
+
+ void UT_Constructor_CTest1();
+ void UT_Destructor_CTest1();
+ void UT_Start();
+ void UT_threadFunc();
+
+private: // Constructors
+
+ UT_CTest1();
+ void ConstructL();
+
+private: // Data
+
+ // The object to be tested as a member variable:
+ CTest1 *iCTest1;
+};
+
+#endif // UT_CTEST1_H
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/unittest/src/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+3
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/unittest/src/dllentry.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include "ut_CChild.h"
+#include "ut_CTest1.h"
+#include <symbianunittestsuite.h>
+
+// Exactly one exported function returning
+// the pointer to the suite of tests for the SymbianUnit framework.
+//
+EXPORT_C MSymbianUnitTestInterface* CreateTestL()
+{
+ CSymbianUnitTestSuite* testSuite =
+ CSymbianUnitTestSuite::NewLC( _L("ut_testThread") );
+
+ testSuite->AddL( UT_CChild::NewLC() );
+ testSuite->AddL( UT_CTest1::NewLC() );
+ CleanupStack::Pop();
+
+ CleanupStack::Pop( testSuite );
+ return testSuite;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/unittest/src/ut_CChild.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ut_CChild.h"
+#include "child.h"
+#include <symbianunittestmacros.h>
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+UT_CChild* UT_CChild::NewL()
+ {
+ UT_CChild* self = UT_CChild::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+UT_CChild* UT_CChild::NewLC()
+ {
+ UT_CChild* self = new( ELeave )UT_CChild();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+UT_CChild::UT_CChild()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void UT_CChild::ConstructL()
+ {
+ BASE_CONSTRUCT
+ ADD_SUT( UT_Add )
+ ADD_SUT( UT_Constructor_CChild )
+ ADD_SUT( UT_Del )
+ ADD_SUT( UT_Destructor_CChild )
+
+ // Setup and teardown functions can be changed for each test function
+ // Usually this is not needed, but this is possible.
+ // ADD_SUT_WITH_SETUP_AND_TEARDOWN( SetupL, UT_YouFunc, Teardown )
+ }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+UT_CChild::~UT_CChild()
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// SetupL
+// -----------------------------------------------------------------------------
+//
+void UT_CChild::SetupL()
+ {
+ //iCChild = CChild::NewL(); ??
+ }
+
+// -----------------------------------------------------------------------------
+// Teardown
+// -----------------------------------------------------------------------------
+//
+void UT_CChild::Teardown()
+ {
+ delete iCChild;
+ iCChild = NULL;
+ }
+
+
+// -----------------------------------------------------------------------------
+// test CChild::Add ()
+// -----------------------------------------------------------------------------
+//
+void UT_CChild::UT_Add()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CChild::CChild ()
+// -----------------------------------------------------------------------------
+//
+void UT_CChild::UT_Constructor_CChild()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CChild::Del ()
+// -----------------------------------------------------------------------------
+//
+void UT_CChild::UT_Del()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CChild::~CChild ()
+// -----------------------------------------------------------------------------
+//
+void UT_CChild::UT_Destructor_CChild()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.cmdtool.test/test.resource/unittest/standard/testThread/unittest/src/ut_CTest1.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ut_CTest1.h"
+#include "test1.h"
+#include <symbianunittestmacros.h>
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+UT_CTest1* UT_CTest1::NewL()
+ {
+ UT_CTest1* self = UT_CTest1::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+UT_CTest1* UT_CTest1::NewLC()
+ {
+ UT_CTest1* self = new( ELeave )UT_CTest1();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+UT_CTest1::UT_CTest1()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void UT_CTest1::ConstructL()
+ {
+ BASE_CONSTRUCT
+ ADD_SUT( UT_Constructor_CTest1 )
+ ADD_SUT( UT_Destructor_CTest1 )
+ ADD_SUT( UT_Start )
+ ADD_SUT( UT_threadFunc )
+
+ // Setup and teardown functions can be changed for each test function
+ // Usually this is not needed, but this is possible.
+ // ADD_SUT_WITH_SETUP_AND_TEARDOWN( SetupL, UT_YouFunc, Teardown )
+ }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+UT_CTest1::~UT_CTest1()
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// SetupL
+// -----------------------------------------------------------------------------
+//
+void UT_CTest1::SetupL()
+ {
+ //iCTest1 = CTest1::NewL(); ??
+ }
+
+// -----------------------------------------------------------------------------
+// Teardown
+// -----------------------------------------------------------------------------
+//
+void UT_CTest1::Teardown()
+ {
+ delete iCTest1;
+ iCTest1 = NULL;
+ }
+
+
+// -----------------------------------------------------------------------------
+// test CTest1::CTest1 ()
+// -----------------------------------------------------------------------------
+//
+void UT_CTest1::UT_Constructor_CTest1()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CTest1::~CTest1 ()
+// -----------------------------------------------------------------------------
+//
+void UT_CTest1::UT_Destructor_CTest1()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CTest1::Start ()
+// -----------------------------------------------------------------------------
+//
+void UT_CTest1::UT_Start()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
+// -----------------------------------------------------------------------------
+// test CTest1::threadFunc ()
+// -----------------------------------------------------------------------------
+//
+void UT_CTest1::UT_threadFunc()
+ {
+ SUT_ASSERT_LEAVE_WITH(_L("test case not implemented"), KErrNotReady);
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.test/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="lib/commons-collections-3.2.1.jar"/>
+ <classpathentry kind="lib" path="lib/commons-lang-2.4.jar"/>
+ <classpathentry kind="lib" path="lib/velocity-1.6.2.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/com.nokia.testfw.codegen"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.test/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.codegen.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.test/.settings/org.eclipse.jdt.core.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,12 @@
+#Wed Dec 23 11:14:56 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+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.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.test/build.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="com.nokia.testfw.codegen.test" default="test" basedir=".">
+
+ <property name="sources.src.dir" value="src"/>
+ <property name="sources.lib.dir" value="lib"/>
+ <property name="classes.dest.dir" value="bin"/>
+ <property name="tests.target.dir" value="../com.nokia.testfw.codegen"/>
+ <property name="tests.target.jar" value="${tests.target.dir}/jar/tfw_codegen.jar"/>
+ <property name="tests.report.dir" value="report"/>
+
+ <target name="init">
+ <ant antfile="build.xml" dir="${tests.target.dir}"/>
+ <copy file="${tests.target.jar}" todir="${sources.lib.dir}"/>
+ </target>
+
+ <target name="compiletest" depends="init">
+ <mkdir dir="${classes.dest.dir}" />
+ <javac srcdir="${sources.src.dir}"
+ destdir="${classes.dest.dir}"
+ excludes="**/.svn/**"
+ optimize="on"
+ nowarn="no"
+ deprecation="on">
+ <classpath>
+ <fileset dir="lib">
+ <include name="*.jar"/>
+ </fileset>
+ </classpath>
+ </javac>
+ </target>
+
+ <target name="test" depends="compiletest">
+ <mkdir dir="${tests.report.dir}" />
+ <junit printsummary="yes" haltonfailure="no">
+ <classpath>
+ <pathelement location="${classes.dest.dir}"/>
+ <fileset dir="lib">
+ <include name="*.jar"/>
+ </fileset>
+ </classpath>
+
+ <batchtest fork="yes" todir="${tests.report.dir}">
+ <formatter type="xml"/>
+ <fileset dir="${classes.dest.dir}">
+ <include name="**/*Test*.class"/>
+ <exclude name="**/AllPureJUnitTests.class"/>
+ </fileset>
+ </batchtest>
+ </junit>
+ <junitreport todir="${tests.report.dir}">
+ <fileset dir="${tests.report.dir}" includes="TEST-*.xml"/>
+ <report format="frames" todir="${tests.report.dir}"/>
+ </junitreport>
+ </target>
+
+ <target name="clean">
+ <delete dir="${classes.dest.dir}"/>
+ <delete dir="${outputs.jar.dir}"/>
+ </target>
+
+</project>
Binary file testdev/ite/test/com.nokia.testfw.codegen.test/lib/commons-collections-3.2.1.jar has changed
Binary file testdev/ite/test/com.nokia.testfw.codegen.test/lib/commons-lang-2.4.jar has changed
Binary file testdev/ite/test/com.nokia.testfw.codegen.test/lib/velocity-1.6.2.jar has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.test/src/com/nokia/testfw/codegen/AllPureJUnitTests.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.codegen;
+
+import com.nokia.testfw.codegen.model.ClassNodeImplTest;
+import com.nokia.testfw.codegen.model.MethodNodeImplTest;
+import com.nokia.testfw.codegen.model.ProjectNodeImplTest;
+import com.nokia.testfw.codegen.templates.CMDTemplateBuilderTest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllPureJUnitTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(
+ "JUNIT Test for com.nokia.testfw.codegen");
+ // $JUnit-BEGIN$
+ suite.addTestSuite(CodegenEngineTest.class);
+ suite.addTestSuite(StringResourceLoaderTest.class);
+ suite.addTestSuite(ClassNodeImplTest.class);
+ suite.addTestSuite(MethodNodeImplTest.class);
+ suite.addTestSuite(ProjectNodeImplTest.class);
+ suite.addTestSuite(CMDTemplateBuilderTest.class);
+ // $JUnit-END$
+ return suite;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.test/src/com/nokia/testfw/codegen/CodegenEngineTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.codegen;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import com.nokia.testfw.codegen.model.ClassNodeImpl;
+import com.nokia.testfw.codegen.model.MethodNodeImpl;
+import com.nokia.testfw.codegen.model.ProjectNodeImpl;
+import com.nokia.testfw.codegen.templates.CMDTemplateBuilder;
+import com.nokia.testfw.codegen.templates.TemplateBuilderFactory;
+
+import junit.framework.TestCase;
+
+public class CodegenEngineTest extends TestCase {
+
+ CodegenEngine ce;
+ CodegenEngine ge;
+
+ @SuppressWarnings("unchecked")
+ protected void setUp() throws Exception {
+ System.setProperty(TemplateBuilderFactory.TEMPLATEBUILDERCLASS,
+ CMDTemplateBuilder.class.getName());
+
+ Map<String, Comparable> data = new HashMap<String, Comparable>();
+ ProjectNodeImpl lProjectNode = new ProjectNodeImpl("TestModule"); //test_project
+ data.put("project_name", "TestModule"); //test_project
+ data.put("project_object", lProjectNode);
+ data.put("suite_name", "TestSuite");
+ data.put("location", "test");
+ data.put("target_type", "EXE");
+ data.put("UID3", "0x10000001");
+ data.put("auther_name", "kevin");
+ data.put("copyright", "");
+
+ ClassNodeImpl lClassNode = new ClassNodeImpl("testClass", lProjectNode);
+ lClassNode.setDeclLocation("C:\\testHeader.h");
+ Set<String> set = new TreeSet<String>();
+ set.add("C:\\testCpp.cpp");
+ lClassNode.setImplLocation(set);
+ MethodNodeImpl lMethodNode = new MethodNodeImpl("testMethod",
+ lClassNode);
+ lMethodNode.addParameters("String", "param1");
+ lMethodNode.addParameters("String", "param2");
+ lClassNode.addChild(lMethodNode);
+ lProjectNode.addChild(lClassNode);
+
+ ce = new CodegenEngine("C:\\Temp\\STF_hardcode", data);
+
+ Map<String, Comparable> data1 = new HashMap<String, Comparable>();
+ ProjectNodeImpl lProjectNode1 = new ProjectNodeImpl("TestModule"); //test_project
+ data1.put("project_name", "TestModule"); //test_project
+ data1.put("project_object", lProjectNode1);
+ data1.put("suite_name", "TestSuite");
+ data1.put("location", "test");
+ data1.put("target_type", "EXE");
+ data1.put("UID3", "0x10000001");
+ data1.put("auther_name", "kevin");
+ data1.put("copyright", "");
+
+ ClassNodeImpl lClassNode1 = new ClassNodeImpl("testClass", lProjectNode1);
+ lClassNode1.setDeclLocation("C:\\testHeader.h");
+ Set<String> set1 = new TreeSet<String>();
+ set1.add("C:\\testCpp.cpp");
+ lClassNode1.setImplLocation(set1);
+ MethodNodeImpl lMethodNode1 = new MethodNodeImpl("testMethod",
+ lClassNode1);
+ lMethodNode1.addParameters("String", "param1");
+ lMethodNode1.addParameters("String", "param2");
+ lClassNode1.addChild(lMethodNode1);
+ lProjectNode1.addChild(lClassNode1);
+
+ ge = new CodegenEngine("C:\\Temp\\STF_Script", data1);
+ }
+
+ public void testGenerate() {
+ try {
+ ce.init();
+ ge.init();
+ assertTrue(ce.isInit);
+ } catch (Exception e) {
+ fail("CodegenEngine init failed.");
+ }
+ try {
+ ce.generate("STF_hardcode");
+ ge.generate("STF_Script");
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("CodegenEngine generation failed.");
+ }
+// try {
+// ce.generate("SymbianUnitTest");
+// } catch (Exception e) {
+// e.printStackTrace();
+// fail("CodegenEngine generation failed.");
+// }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.test/src/com/nokia/testfw/codegen/StringResourceLoaderTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+
+public class StringResourceLoaderTest extends TestCase {
+
+ StringResourceLoader loader;
+
+ protected void setUp() throws Exception {
+ loader = new StringResourceLoader();
+ }
+
+ public void testGetLastModifiedResource() {
+ assertEquals(loader.getLastModified(null), 0);
+ }
+
+ public void testGetResourceStreamAndGetString() {
+ try {
+ InputStream stream = loader.getResourceStream("ABC");
+ assertEquals(StringResourceLoader.getString(stream), "ABC");
+ } catch (IOException e) {
+ fail(e.getMessage());
+ }
+ }
+
+ public void testIsSourceModifiedResource() {
+ assertFalse(loader.isSourceModified(null));
+ }
+
+ public void testInitExtendedProperties() {
+ loader.init(null);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.test/src/com/nokia/testfw/codegen/model/ClassNodeImplTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.model;
+
+import java.util.HashSet;
+
+import junit.framework.TestCase;
+
+public class ClassNodeImplTest extends TestCase {
+
+ ClassNodeImpl iClassNodeImpl;
+ ProjectNodeImpl iProjectNode;
+
+ protected void setUp() throws Exception {
+ iProjectNode = new ProjectNodeImpl("testProject");
+ iClassNodeImpl = new ClassNodeImpl("class", iProjectNode);
+ iProjectNode.addChild(iClassNodeImpl);
+ }
+
+ public void testSetGetDeclLocation() {
+ iClassNodeImpl.setDeclLocation("location");
+ assertEquals(iClassNodeImpl.getDeclLocation(), "location");
+ iClassNodeImpl.getHeaderFileName();
+ iClassNodeImpl.setDeclLocation(null);
+ assertNull(iClassNodeImpl.getDeclLocation());
+ }
+
+ public void testAddGetSetImplLocation() {
+ iClassNodeImpl.addImplLocation("location");
+ assertEquals(iClassNodeImpl.getImplLocation().length, 1);
+ iClassNodeImpl.setImplLocation(new HashSet<String>());
+ assertEquals(iClassNodeImpl.getImplLocation().length, 0);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.test/src/com/nokia/testfw/codegen/model/MethodNodeImplTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.testfw.codegen.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+public class MethodNodeImplTest extends TestCase {
+
+ MethodNodeImpl iMethodNode;
+ ClassNodeImpl iClassNode;
+ ProjectNodeImpl iProjectNode;
+
+ protected void setUp() throws Exception {
+ iProjectNode = new ProjectNodeImpl("testProject");
+ iClassNode = new ClassNodeImpl("testClass", iProjectNode);
+ iProjectNode.addChild(iClassNode);
+ iMethodNode = new MethodNodeImpl("method", iClassNode);
+ iClassNode.addChild(iMethodNode);
+ iMethodNode.addParameters("String", "name");
+ iMethodNode.addParameters("int", "index");
+ }
+
+ public void testSetName() {
+ iMethodNode.setName("myMethod");
+ assertEquals(iMethodNode.getName(), "myMethod");
+ assertEquals(iMethodNode.getFullName(), "myMethod (String, int)");
+ assertEquals(iMethodNode.getNormalisedName(), "myMethod_String_int");
+ iMethodNode.setName("method");
+ }
+
+ public void testIsValid() {
+ assertTrue(iMethodNode.isValid());
+ }
+
+ public void testCompareTo() {
+ MethodNodeImpl lMethodNode = new MethodNodeImpl("method", iClassNode);
+ lMethodNode.addParameters("String", "name");
+ lMethodNode.addParameters("int", "index");
+
+ assertEquals(iMethodNode.compareTo(lMethodNode), 0);
+ }
+
+ public void testIsAsync() {
+ assertFalse(iMethodNode.isAsync());
+ }
+
+ public void testSetAsync() {
+ iMethodNode.setAsync(true);
+ assertTrue(iMethodNode.isAsync());
+ iMethodNode.setAsync(false);
+ assertFalse(iMethodNode.isAsync());
+ }
+
+ public void testSetGetAddParameters() {
+ assertNotNull(iMethodNode.getParameters());
+ assertTrue(iMethodNode.getParameters().size() == 2);
+ List<String[]> parameters = new ArrayList<String[]>();
+ iMethodNode.setParameters(parameters);
+ assertTrue(iMethodNode.getParameters().size() == 0);
+ iMethodNode.addParameters("String", "name");
+ assertTrue(iMethodNode.getParameters().size() == 1);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.test/src/com/nokia/testfw/codegen/model/ProjectNodeImplTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.testfw.codegen.model;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.TreeSet;
+
+import junit.framework.TestCase;
+
+public class ProjectNodeImplTest extends TestCase {
+
+ ProjectNodeImpl node;
+
+ protected void setUp() throws Exception {
+ node = new ProjectNodeImpl("node");
+ ClassNodeImpl lClassNode = new ClassNodeImpl("testClass", node);
+ node.addChild(lClassNode);
+ MethodNodeImpl lMethodNode = new MethodNodeImpl("method", lClassNode);
+ lClassNode.addChild(lMethodNode);
+ lMethodNode.addParameters("String", "name");
+ lMethodNode.addParameters("int", "index");
+ }
+
+ public void testGetName() {
+ assertEquals(node.getName(), "node");
+ assertEquals(node.getNameUpperCase(), "NODE");
+ assertEquals(node.getNameLowerCase(), "node");
+ }
+
+ public void testSetName() {
+ node.setName("project");
+ assertEquals(node.getName(), "project");
+ node.setName("node");
+ assertEquals(node.getName(), "node");
+ }
+
+ public void testGetParent() {
+ assertNull(node.getParent());
+ }
+
+ public void testSetParent() {
+ ProjectNodeImpl parent = new ProjectNodeImpl("parent");
+ node.setParent(parent);
+ assertEquals(node.getParent(), parent);
+ node.setParent(null);
+ assertNull(node.getParent());
+ }
+
+ public void testGetChildren() {
+ assertNotNull(node.getChildren());
+ assertTrue(node.getChildren().size() == 1);
+ }
+
+ public void testSetChildren() {
+ Set<INode> set = node.getChildren();
+ node.setChildren(new TreeSet<INode>());
+ assertNotNull(node.getChildren());
+ assertTrue(node.getChildren().size() == 0);
+ node.setChildren(set);
+ }
+
+ public void testAddRemoveChild() {
+ ClassNodeImpl classnode = new ClassNodeImpl("class", node);
+ node.addChild(classnode);
+ assertNotNull(node.getChildren());
+ assertTrue(node.getChildren().size() == 2);
+ node.removeChild(classnode);
+ assertNotNull(node.getChildren());
+ assertTrue(node.getChildren().size() == 1);
+ }
+
+ public void testCompareTo() {
+ assertEquals(node.compareTo(new ProjectNodeImpl("node")), 0);
+ }
+
+ public void testSetGetSystemIncludes() {
+ node.setSystemIncludes(new HashSet<String>());
+ assertNotNull(node.getSystemIncludes());
+ }
+
+ public void testSetGetUserIncludes() {
+ node.setUserIncludes(new HashSet<String>());
+ assertNotNull(node.getUserIncludes());
+ }
+
+ public void testSetGetLibrarys() {
+ node.setLibrarys(new HashSet<String>());
+ assertNotNull(node.getLibrarys());
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.test/src/com/nokia/testfw/codegen/templates/CMDTemplateBuilderTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.templates;
+
+import java.io.IOException;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+public class CMDTemplateBuilderTest extends TestCase {
+
+ CMDTemplateBuilder builder;
+
+ protected void setUp() throws Exception {
+ builder = new CMDTemplateBuilder();
+ }
+
+ public void testSUTBulid() {
+ try {
+ Map<String, String> map = builder.build("SymbianUnitTest");
+ assertTrue(map.size() > 0);
+ } catch (IOException e) {
+ fail();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.test/src/com/nokia/testfw/codegen/templates/TemplateBuilderFactoryTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.templates;
+
+import com.nokia.testfw.codegen.templates.CMDTemplateBuilder;
+import com.nokia.testfw.codegen.templates.TemplateBuilder;
+import com.nokia.testfw.codegen.templates.TemplateBuilderFactory;
+
+import junit.framework.TestCase;
+
+public class TemplateBuilderFactoryTest extends TestCase {
+
+ public void testNewCMDTemplateBuilder() {
+ System.setProperty(TemplateBuilderFactory.TEMPLATEBUILDERCLASS,
+ CMDTemplateBuilder.class.getName());
+ TemplateBuilderFactory factory = TemplateBuilderFactory.newInstance();
+ TemplateBuilder builder = null;
+ try {
+ builder = factory.newTemplateBuilder();
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("creating CMDTemplateBuilder failed.");
+ }
+ assertTrue(builder instanceof CMDTemplateBuilder);
+ System.setProperty(TemplateBuilderFactory.TEMPLATEBUILDERCLASS,
+ TemplateBuilderFactory.DEFAULTTEMPLATEBUILDERCLASS);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,8 @@
+<?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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/com.nokia.testfw.codegen"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.codegen.ui.test</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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/.settings/org.eclipse.jdt.core.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,12 @@
+#Wed Dec 23 11:14:45 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+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.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/META-INF/MANIFEST.MF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Test Fragment
+Bundle-SymbolicName: com.nokia.testfw.codegen.ui.test
+Bundle-Version: 1.0.0
+Bundle-Vendor: Nokia
+Fragment-Host: com.nokia.testfw.codegen.ui
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.junit4,
+ com.nokia.testfw.test
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/build.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/.cproject Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject>
+<storageModule buildFromInf="true" buildingTestComps="true" cleanLevel="0" concurrentBuildJobs="4" defaultMMPChangedAction="0" infBuildComponents="" infFileLocation="bld.inf" macrosFile="" makeEngineToUse="make" manageDependencies="true" moduleId="com.nokia.carbide.cdt.builder.carbideCPPBuilder" overrideMakeEngine="false" overrideWorkspaceSettings="false" promptForMMPChangedAction="true" useConcurrentBuilding="true" useDebugMode="false" useIncrementalBuilder="false" useKeepGoing="false" useMMPMacros="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.settings">
+<cconfiguration id="Emulator Debug (WINSCW) [TB91SF_112_Symbian_OS_vtb91sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Emulator Debug (WINSCW) [TB91SF_112_Symbian_OS_vtb91sf]" moduleId="org.eclipse.cdt.core.settings" name="Emulator Debug (WINSCW) [TB91SF_112_Symbian_OS_vtb91sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="M:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Eclipse341\workspace\com.nokia.testfw.codegen.ui.test\resource\HelloWorld\HelloWorld.mmp;D:\Eclipse341\workspace\com.nokia.testfw.codegen.ui.test\resource\HelloWorld\Bld.inf;" includesCache="D:/Eclipse341/workspace/com.nokia.testfw.codegen.ui.test/resource/HelloWorld[LOCAL];M:/epoc32/include;M:/epoc32/include/techview;" macrosCache="_UNICODE;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EXE__;__CW32__;__WINS__;__WINSCW__;_DEBUG;" moduleId="configDataCache" sourcesCache="" timestampCache="1257241147383" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+</cconfiguration>
+<cconfiguration id="Emulator Release (WINSCW) [TB91SF_112_Symbian_OS_vtb91sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Emulator Release (WINSCW) [TB91SF_112_Symbian_OS_vtb91sf]" moduleId="org.eclipse.cdt.core.settings" name="Emulator Release (WINSCW) [TB91SF_112_Symbian_OS_vtb91sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="M:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Eclipse341\workspace\com.nokia.testfw.codegen.ui.test\resource\HelloWorld\HelloWorld.mmp;D:\Eclipse341\workspace\com.nokia.testfw.codegen.ui.test\resource\HelloWorld\Bld.inf;" includesCache="D:/Eclipse341/workspace/com.nokia.testfw.codegen.ui.test/resource/HelloWorld[LOCAL];M:/epoc32/include;M:/epoc32/include/techview;" macrosCache="_UNICODE;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__EXE__;__CW32__;NDEBUG;__WINS__;__WINSCW__;" moduleId="configDataCache" sourcesCache="" timestampCache="1257241147446" useMmpMacrosCache="true"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV5) [TB91SF_112_Symbian_OS_vtb91sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV5) [TB91SF_112_Symbian_OS_vtb91sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV5) [TB91SF_112_Symbian_OS_vtb91sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="M:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Eclipse341\workspace\com.nokia.testfw.codegen.ui.test\resource\HelloWorld\HelloWorld.mmp;D:\Eclipse341\workspace\com.nokia.testfw.codegen.ui.test\resource\HelloWorld\Bld.inf;" includesCache="D:/Eclipse341/workspace/com.nokia.testfw.codegen.ui.test/resource/HelloWorld[LOCAL];M:/epoc32/include;M:/epoc32/include/techview;" macrosCache="_UNICODE;__SUPPORT_CPP_EXCEPTIONS__;__MARM_ARMV5__;__ARMCC__;__ARMCC_2_2__;__SYMBIAN32__;__MARM__;__EXE__;__ARMCC_2__;__EPOC32__;__GENERIC_MARM__;__EABI__;_DEBUG;" moduleId="configDataCache" sourcesCache="" timestampCache="1257241147461" useMmpMacrosCache="true"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV5) [TB91SF_112_Symbian_OS_vtb91sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV5) [TB91SF_112_Symbian_OS_vtb91sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV5) [TB91SF_112_Symbian_OS_vtb91sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="M:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Eclipse341\workspace\com.nokia.testfw.codegen.ui.test\resource\HelloWorld\HelloWorld.mmp;D:\Eclipse341\workspace\com.nokia.testfw.codegen.ui.test\resource\HelloWorld\Bld.inf;" includesCache="D:/Eclipse341/workspace/com.nokia.testfw.codegen.ui.test/resource/HelloWorld[LOCAL];M:/epoc32/include;M:/epoc32/include/techview;" macrosCache="_UNICODE;__SUPPORT_CPP_EXCEPTIONS__;__MARM_ARMV5__;NDEBUG;__ARMCC__;__ARMCC_2_2__;__SYMBIAN32__;__MARM__;__EXE__;__ARMCC_2__;__EPOC32__;__GENERIC_MARM__;__EABI__;" moduleId="configDataCache" sourcesCache="" timestampCache="1257241153070" useMmpMacrosCache="true"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (GCCE) [TB91SF_112_Symbian_OS_vtb91sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (GCCE) [TB91SF_112_Symbian_OS_vtb91sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (GCCE) [TB91SF_112_Symbian_OS_vtb91sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCEErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="M:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Eclipse341\workspace\com.nokia.testfw.codegen.ui.test\resource\HelloWorld\HelloWorld.mmp;D:\Eclipse341\workspace\com.nokia.testfw.codegen.ui.test\resource\HelloWorld\Bld.inf;" includesCache="D:/Eclipse341/workspace/com.nokia.testfw.codegen.ui.test/resource/HelloWorld[LOCAL];M:/epoc32/include;M:/epoc32/include/techview;" macrosCache="_UNICODE;__SYMBIAN32__;__GCCE__;__SUPPORT_CPP_EXCEPTIONS__;__MARM__;__EXE__;__MARM_ARMV5__;__GENERIC_MARM__;__EPOC32__;__EABI__;_DEBUG;" moduleId="configDataCache" sourcesCache="" timestampCache="1257241153086" useMmpMacrosCache="true"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (GCCE) [TB91SF_112_Symbian_OS_vtb91sf]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (GCCE) [TB91SF_112_Symbian_OS_vtb91sf]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (GCCE) [TB91SF_112_Symbian_OS_vtb91sf]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.GCCEErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="M:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="D:\Eclipse341\workspace\com.nokia.testfw.codegen.ui.test\resource\HelloWorld\HelloWorld.mmp;D:\Eclipse341\workspace\com.nokia.testfw.codegen.ui.test\resource\HelloWorld\Bld.inf;" includesCache="D:/Eclipse341/workspace/com.nokia.testfw.codegen.ui.test/resource/HelloWorld[LOCAL];M:/epoc32/include;M:/epoc32/include/techview;" macrosCache="_UNICODE;__SYMBIAN32__;__GCCE__;__SUPPORT_CPP_EXCEPTIONS__;__MARM__;__EXE__;NDEBUG;__MARM_ARMV5__;__GENERIC_MARM__;__EPOC32__;__EABI__;" moduleId="configDataCache" sourcesCache="" timestampCache="1257241153102" useMmpMacrosCache="true"/>
+</cconfiguration>
+</storageModule>
+</cproject>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>testProject</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.nokia.carbide.cdt.builder.carbideCPPBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>com.nokia.carbide.cdt.builder.carbideCPPBuilderNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/Bld.inf Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,23 @@
+//
+// Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+PRJ_MMPFILES
+
+HelloWorld.mmp
+
+
+PRJ_TESTMMPFILES
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/DISTRIBUTION.policy Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,2 @@
+Category G
+OSD: Test/Reference Tools
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/HelloWorld.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef __HELLOWORLD_H
+#define __HELLOWORLD_H
+
+#include <coeccntx.h>
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikmenup.h>
+
+#include <eikon.hrh>
+
+#include <helloworld.rsg>
+#include "helloworld.hrh"
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleApplication
+//
+////////////////////////////////////////////////////////////////////////
+
+class CExampleApplication : public CEikApplication
+ {
+private:
+ // Inherited from class CApaApplication
+ CApaDocument* CreateDocumentL();
+ TUid AppDllUid() const;
+ };
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppView
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppView : public CCoeControl
+ {
+public:
+ static CExampleAppView* NewL(const TRect& aRect);
+ CExampleAppView();
+ ~CExampleAppView();
+ void ConstructL(const TRect& aRect);
+
+private:
+ // Inherited from CCoeControl
+ void Draw(const TRect& /*aRect*/) const;
+
+private:
+ HBufC* iExampleText;
+ };
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleAppUi
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleAppUi : public CEikAppUi
+ {
+public:
+ void ConstructL();
+ ~CExampleAppUi();
+
+private:
+ // Inherirted from class CEikAppUi
+ void HandleCommandL(TInt aCommand);
+
+private:
+ CCoeControl* iAppView;
+ };
+
+////////////////////////////////////////////////////////////////////////
+//
+// CExampleDocument
+//
+////////////////////////////////////////////////////////////////////////
+class CExampleDocument : public CEikDocument
+ {
+public:
+ static CExampleDocument* NewL(CEikApplication& aApp);
+ CExampleDocument(CEikApplication& aApp);
+ void ConstructL();
+private:
+ // Inherited from CEikDocument
+ CEikAppUi* CreateAppUiL();
+ };
+
+#endif
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/HelloWorld.hrh Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+enum TExampleMenuCommands
+ {
+ EExampleItem0 = 200,
+ EExampleItem1,
+ EExampleItem2
+ };
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/HelloWorld.mmp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+TARGET HelloWorld.exe
+TARGETTYPE exe
+UID 0x100039CE 0xE800005A
+VENDORID 0x70000001
+SOURCEPATH .
+SOURCE HelloWorld_Main.cpp
+SOURCE HelloWorld_Application.cpp
+SOURCE HelloWorld_Document.cpp
+SOURCE HelloWorld_AppUi.cpp
+SOURCE HelloWorld_AppView.cpp
+USERINCLUDE .
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE \epoc32\include\techview
+
+START RESOURCE HelloWorld.RSS
+HEADER
+TARGETPATH \Resource\Apps
+end
+
+START RESOURCE HelloWorld_reg.rss
+TARGETPATH \private\10003a3f\apps
+END
+
+START BITMAP HelloWorld.mbm
+TARGETPATH \Resource\Apps
+SOURCE c8,1 icon24.bmp icon2m.bmp icon32.bmp icon3m.bmp icon48.bmp icon4m.bmp
+END
+
+LIBRARY euser.lib apparc.lib cone.lib eikcore.lib gdi.lib
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/HelloWorld.pkg Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,48 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+;
+; Basic install file for HelloWorld application
+;
+
+; List of languages supported.
+; Here, only UK English is supported.
+&EN
+
+; List of localised vendor names.
+; Here, only UK English version is specified.
+%{"Symbian Software Ltd."}
+
+; Single, non-localised (global) vendor name.
+:"Symbian Software Ltd."
+
+; Installation header.
+; Only specifies one component name as we only support English.
+; The UID is the package UID - this is not the same as the app's UID,
+; which is specified in HelloWorld.mmp.
+
+#{"Hello World"},(0xE8000091),1,0,0
+
+; Four files to install for the minimal application
+"HelloWorld.exe"-"!:\sys\bin\HelloWorld.exe"
+"HelloWorld.rsc"-"!:\resource\apps\HelloWorld.rsc"
+"HelloWorld.mbm" - "!:\resource\apps\HelloWorld.mbm"
+"HelloWorld_reg.rsc" - "!:\private\10003a3f\import\apps\HelloWorld_reg.rsc"
+
+; Required files
+; None
+
+; Component .sis files
+; None
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/HelloWorld.rss Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+NAME HEWO
+
+#include <eikon.rh>
+#include <eikcore.rsg>
+#include <appinfo.rh>
+
+#include "helloworld.hrh"
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+ {
+ hotkeys=r_example_hotkeys;
+ menubar=r_example_menubar;
+ }
+
+RESOURCE HOTKEYS r_example_hotkeys
+ {
+ control=
+ {
+ HOTKEY { command=EEikCmdExit; key='e'; }
+ };
+ }
+
+RESOURCE MENU_BAR r_example_menubar
+ {
+ titles=
+ {
+ MENU_TITLE { menu_pane=r_example_first_menu; txt="HelloWld"; }
+ };
+ }
+
+RESOURCE MENU_PANE r_example_first_menu
+ {
+ items=
+ {
+ MENU_ITEM { command=EExampleItem0; txt="Item 0"; },
+ MENU_ITEM { command=EExampleItem1; txt="Item 1"; },
+ MENU_ITEM { command=EExampleItem2; txt="Item 2"; },
+ MENU_ITEM { command=EEikCmdExit; txt="Close"; }
+ };
+ }
+
+
+RESOURCE TBUF r_example_text_Hello { buf="Hello World!"; }
+RESOURCE TBUF r_example_text_Item0 { buf="Item 0"; }
+RESOURCE TBUF r_example_text_Item1 { buf="Item 1"; }
+RESOURCE TBUF r_example_text_Item2 { buf="Item 2"; }
+
+RESOURCE LOCALISABLE_APP_INFO r_lai
+ {
+ short_caption = "HW";
+ caption_and_icon =
+ {
+ CAPTION_AND_ICON_INFO
+ {
+ caption = "helloworld";
+ number_of_icons = 3; // each icon must be a bitmap/mask pair
+ icon_file = "z:\\resource\\apps\\helloworld.mbm";
+ }
+ };
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/HelloWorld_AppUi.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "HelloWorld.h"
+
+// The second phase constructor of the application UI class.
+// The application UI creates and owns the one and only view.
+//
+void CExampleAppUi::ConstructL()
+ {
+ // BaseConstructL() completes the UI framework's
+ // construction of the App UI.
+ BaseConstructL();
+ // Create the single application view in which to
+ // draw the text "Hello World!", passing into it
+ // the rectangle available to it.
+ iAppView = CExampleAppView::NewL(ClientRect());
+ }
+
+
+// The app Ui owns the two views and is.
+// therefore, responsible for destroying them
+//
+CExampleAppUi::~CExampleAppUi()
+ {
+ delete iAppView;
+ }
+
+
+// Called by the UI framework when a command has been issued.
+// In this example, a command can originate through a
+// hot-key press or by selection of a menu item.
+// The command Ids are defined in the .hrh file
+// and are 'connected' to the hot-key and menu item in the
+// resource file.
+// Note that the EEikCmdExit is defined by the UI
+// framework and is pulled in by including eikon.hrh
+//
+void CExampleAppUi::HandleCommandL(TInt aCommand)
+ {
+ switch (aCommand)
+ {
+ // Just issue simple info messages to show that
+ // the menu items have been selected
+ case EExampleItem0:
+ iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM0);
+ break;
+
+
+ case EExampleItem1:
+ iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM1);
+ break;
+
+ case EExampleItem2:
+ iEikonEnv->InfoMsg(R_EXAMPLE_TEXT_ITEM2);
+ break;
+ // Exit the application. The call is
+ // implemented by the UI framework.
+
+ case EEikCmdExit:
+ Exit();
+ break;
+ }
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/HelloWorld_AppView.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "HelloWorld.h"
+
+//
+// Constructor for the view.
+//
+CExampleAppView::CExampleAppView()
+ {
+ }
+
+
+// Static NewL() function to start the standard two
+// phase construction.
+//
+CExampleAppView* CExampleAppView::NewL(const TRect& aRect)
+ {
+ CExampleAppView* self = new(ELeave) CExampleAppView();
+ CleanupStack::PushL(self);
+ self->ConstructL(aRect);
+ CleanupStack::Pop();
+ return self;
+ }
+
+
+//
+// Destructor for the view.
+//
+CExampleAppView::~CExampleAppView()
+ {
+ delete iExampleText;
+ }
+
+
+// Second phase construction.
+//
+void CExampleAppView::ConstructL(const TRect& aRect)
+ {
+ // Fetch the text from the resource file.
+ iExampleText = iEikonEnv->AllocReadResourceL(R_EXAMPLE_TEXT_HELLO);
+ // Control is a window owning control
+ CreateWindowL();
+ // Extent of the control. This is
+ // the whole rectangle available to application.
+ // The rectangle is passed to us from the application UI.
+ SetRect(aRect);
+ // At this stage, the control is ready to draw so
+ // we tell the UI framework by activating it.
+ ActivateL();
+ }
+
+
+// Drawing the view - in this example,
+// consists of drawing a simple outline rectangle
+// and then drawing the text in the middle.
+// We use the Normal font supplied by the UI.
+//
+// In this example, we don't use the redraw
+// region because it's easier to redraw to
+// the whole client area.
+//
+void CExampleAppView::Draw(const TRect& /*aRect*/) const
+ {
+ // Window graphics context
+ CWindowGc& gc = SystemGc();
+ // Area in which we shall draw
+ TRect drawRect = Rect();
+ // Font used for drawing text
+ const CFont* fontUsed;
+
+ // Start with a clear screen
+ gc.Clear();
+ // Draw an outline rectangle (the default pen
+ // and brush styles ensure this) slightly
+ // smaller than the drawing area.
+ drawRect.Shrink(10,10);
+ gc.DrawRect(drawRect);
+ // Use the title font supplied by the UI
+ fontUsed = iEikonEnv->TitleFont();
+ gc.UseFont(fontUsed);
+ // Draw the text in the middle of the rectangle.
+ TInt baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2;
+ gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
+ // Finished using the font
+ gc.DiscardFont();
+ }
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/HelloWorld_Application.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "HelloWorld.h"
+
+const TUid KUidHelloWorld = { 0xE800005A };
+
+// The function is called by the UI framework to ask for the
+// application's UID. The returned value is defined by the
+// constant KUidHelloWorlde and must match the second value
+// defined in the project definition file.
+//
+TUid CExampleApplication::AppDllUid() const
+ {
+ return KUidHelloWorld;
+ }
+
+// This function is called by the UI framework at
+// application start-up. It creates an instance of the
+// document class.
+//
+CApaDocument* CExampleApplication::CreateDocumentL()
+ {
+ return new (ELeave) CExampleDocument(*this);
+ }
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/HelloWorld_Document.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "HelloWorld.h"
+
+// The constructor of the document class just passes the
+// supplied reference to the constructor initialisation list.
+// The document has no real work to do in this application.
+//
+CExampleDocument::CExampleDocument(CEikApplication& aApp)
+ : CEikDocument(aApp)
+ {
+ }
+
+
+// This is called by the UI framework as soon as the
+// document has been created. It creates an instance
+// of the ApplicationUI. The Application UI class is
+// an instance of a CEikAppUi derived class.
+//
+CEikAppUi* CExampleDocument::CreateAppUiL()
+ {
+ return new(ELeave) CExampleAppUi;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/HelloWorld_Main.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#include "HelloWorld.h"
+
+// The entry point for the application code. It creates
+// an instance of the CApaApplication derived
+// class, CExampleApplication.
+//
+
+#if defined(EKA2)
+
+#include <eikstart.h>
+LOCAL_C CApaApplication* NewApplication()
+ {
+ return new CExampleApplication;
+ }
+
+GLDEF_C TInt E32Main()
+ {
+ return EikStart::RunApplication(NewApplication);
+ }
+
+#endif
+
+#if defined(__WINS__) && !defined(EKA2)
+// This function is required by all Symbian OS DLLs. In this
+// example, it does nothing.
+
+EXPORT_C CApaApplication* NewApplication()
+ {
+ return new CExampleApplication;
+ }
+
+GLDEF_C TInt E32Dll(TDllReason)
+ {
+ return KErrNone;
+ }
+
+EXPORT_C TInt WinsMain(TDesC* aCmdLine)
+ {
+ return EikStart::RunApplication(NewApplication, aCmdLine);
+ }
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/HelloWorld_reg.rss Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <appinfo.rh>
+#include <HelloWorld.rsg>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0xE800005A // application UID
+
+RESOURCE APP_REGISTRATION_INFO
+ {
+ app_file = "HelloWorld";
+ localisable_resource_file = "\\resource\\apps\\HelloWorld";
+ localisable_resource_id = R_LAI;
+ }
+
Binary file testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/icon24.BMP has changed
Binary file testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/icon2M.BMP has changed
Binary file testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/icon32.BMP has changed
Binary file testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/icon3M.BMP has changed
Binary file testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/icon48.BMP has changed
Binary file testdev/ite/test/com.nokia.testfw.codegen.ui.test/resource/HelloWorld/icon4M.BMP has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/src/com/nokia/testfw/codegen/ui/AllJUnitPlugInTests.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui;
+
+import com.nokia.testfw.codegen.ui.preferences.PreferenceUtilTest;
+import com.nokia.testfw.codegen.ui.preferences.TESTFWPropertiesPreferencePageTest;
+import com.nokia.testfw.codegen.ui.preferences.TESTFWTemplatePreferencePageTest;
+import com.nokia.testfw.codegen.ui.templates.EclipseTemplateBuilderTest;
+import com.nokia.testfw.codegen.ui.templates.TemplateBuilderFactoryTest;
+import com.nokia.testfw.codegen.ui.wizard.NewTestCaseWizardTest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllJUnitPlugInTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(
+ "JUNIT Plugin Test for com.nokia.testfw.codegen");
+ // $JUnit-BEGIN$
+ suite.addTestSuite(CodegenUIPluginTest.class);
+ // preference
+ suite.addTestSuite(PreferenceUtilTest.class);
+ suite.addTestSuite(TESTFWPropertiesPreferencePageTest.class);
+ suite.addTestSuite(TESTFWTemplatePreferencePageTest.class);
+ // templates
+ suite.addTestSuite(EclipseTemplateBuilderTest.class);
+ suite.addTestSuite(TemplateBuilderFactoryTest.class);
+ // wizard
+ suite.addTestSuite(NewTestCaseWizardTest.class);
+ // $JUnit-END$
+ return suite;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/src/com/nokia/testfw/codegen/ui/CodegenUIPluginTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui;
+
+import junit.framework.TestCase;
+
+public class CodegenUIPluginTest extends TestCase {
+
+ CodegenUIPlugin plugin;
+
+ protected void setUp() throws Exception {
+ plugin = CodegenUIPlugin.getDefault();
+ }
+
+ public void testGetTemplateStore() {
+ assertNotNull(plugin.getTemplateStore());
+ }
+
+ public void testGetContextTypeRegistry() {
+ assertNotNull(plugin.getContextTypeRegistry());
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/src/com/nokia/testfw/codegen/ui/preferences/PreferenceUtilTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui.preferences;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+public class PreferenceUtilTest extends TestCase {
+
+ protected void setUp() throws Exception {
+ }
+
+ protected void tearDown() throws Exception {
+ }
+
+ public void testGetTestFolderName() {
+ String folder = PreferenceUtil.getTestFolderName(null);
+ assertNotNull(folder);
+ String folder2 = PreferenceUtil.getTestFolderName("base");
+ assertTrue(folder2.equals("base" + File.separator + folder));
+ }
+
+ public void testGetRandomAppUIDAndValidateAppUIDText() {
+ String uid = PreferenceUtil.getRandomAppUID();
+ assertNotNull(uid);
+ assertTrue(PreferenceUtil.validateAppUIDText(uid));
+ }
+
+ public void testCreateCanonicalHexString() {
+ String hexString = PreferenceUtil.createCanonicalHexString(10);
+ assertEquals(hexString, "0x0000000A");
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/src/com/nokia/testfw/codegen/ui/preferences/TESTFWPropertiesPreferencePageTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui.preferences;
+
+import com.nokia.testfw.test.framework.PreferenceTestCase;
+import com.nokia.testfw.test.utils.TestUtils;
+
+public class TESTFWPropertiesPreferencePageTest extends PreferenceTestCase {
+
+ TESTFWPropertiesPreferencePage page;
+
+ @Override
+ protected String getPageId() {
+ return "com.nokia.testfw.codegen.ui.preferences.TESTFWPropertiesPreferencePage";
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ page = (TESTFWPropertiesPreferencePage) dialog.getSelectedPage();
+ }
+
+ public void testUID3MaxValue() {
+ assertTrue(page.isValid());
+ String oldValue = page.iUID3MaxValue.getStringValue();
+ page.iUID3MaxValue.setStringValue("abcdefg");
+ assertFalse(page.isValid());
+ TestUtils.delay(3000);
+ page.iUID3MaxValue.setStringValue(oldValue);
+ assertTrue(page.isValid());
+ TestUtils.delay(3000);
+ }
+
+ public void testUID3MinValue() {
+ assertTrue(page.isValid());
+ String oldValue = page.iUID3MinValue.getStringValue();
+ page.iUID3MinValue.setStringValue("abcdefg");
+ assertFalse(page.isValid());
+ TestUtils.delay(3000);
+ page.iUID3MinValue.setStringValue(oldValue);
+ assertTrue(page.isValid());
+ TestUtils.delay(3000);
+ }
+
+ public void testTestFolderName() {
+ assertTrue(page.isValid());
+ String oldValue = page.iTestFolderName.getStringValue();
+ page.iTestFolderName.setStringValue("");
+ assertFalse(page.isValid());
+ TestUtils.delay(3000);
+ page.iTestFolderName.setStringValue(oldValue);
+ assertTrue(page.isValid());
+ TestUtils.delay(3000);
+ }
+
+ public void testAutherName() {
+ assertTrue(page.isValid());
+ String oldValue = page.iAutherName.getStringValue();
+ page.iAutherName.setStringValue("");
+ assertTrue(page.isValid());
+ TestUtils.delay(3000);
+ page.iAutherName.setStringValue(oldValue);
+ assertTrue(page.isValid());
+ TestUtils.delay(3000);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/src/com/nokia/testfw/codegen/ui/preferences/TESTFWTemplatePreferencePageTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui.preferences;
+
+import com.nokia.testfw.test.framework.PreferenceTestCase;
+import com.nokia.testfw.test.utils.TestUtils;
+
+public class TESTFWTemplatePreferencePageTest extends PreferenceTestCase {
+
+ public void testPerform() {
+
+ TestUtils.delay(5000);
+ }
+
+ @Override
+ protected String getPageId() {
+ return "com.nokia.testfw.codegen.ui.preferences.TESTFWTemplatePreferencePage";
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/src/com/nokia/testfw/codegen/ui/templates/EclipseTemplateBuilderTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui.templates;
+
+import java.util.Map;
+
+import org.eclipse.jface.text.templates.Template;
+
+import junit.framework.TestCase;
+
+public class EclipseTemplateBuilderTest extends TestCase {
+
+ EclipseTemplateBuilder builder;
+
+ protected void setUp() throws Exception {
+ builder = new EclipseTemplateBuilder();
+ }
+
+ public void testGetPathTemplateMap() {
+ Map<String, Template> map = EclipseTemplateBuilder
+ .getPathTemplateMap("SymbianUnitTest");
+ assertNotNull(map);
+ assertTrue(map.size() > 0);
+ }
+
+ public void testFindAllOriTemplates() {
+ Map<String, Template> map = EclipseTemplateBuilder
+ .findAllOriTemplates();
+ assertNotNull(map);
+ assertTrue(map.size() > 0);
+ }
+
+ public void testBulid() {
+ Map<String, String> map = builder.build("SymbianUnitTest");
+ assertNotNull(map);
+ assertTrue(map.size() > 0);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/src/com/nokia/testfw/codegen/ui/templates/TemplateBuilderFactoryTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.testfw.codegen.ui.templates;
+
+import com.nokia.testfw.codegen.templates.CMDTemplateBuilder;
+import com.nokia.testfw.codegen.templates.TemplateBuilder;
+import com.nokia.testfw.codegen.templates.TemplateBuilderFactory;
+
+import junit.framework.TestCase;
+
+public class TemplateBuilderFactoryTest extends TestCase {
+
+ public void testNewCMDTemplateBuilder() {
+ System.setProperty(TemplateBuilderFactory.TEMPLATEBUILDERCLASS,
+ CMDTemplateBuilder.class.getName());
+ TemplateBuilderFactory factory = TemplateBuilderFactory.newInstance();
+ TemplateBuilder builder = null;
+ try {
+ builder = factory.newTemplateBuilder();
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("creating CMDTemplateBuilder failed.");
+ }
+ assertTrue(builder instanceof CMDTemplateBuilder);
+ System.setProperty(TemplateBuilderFactory.TEMPLATEBUILDERCLASS,
+ TemplateBuilderFactory.DEFAULTTEMPLATEBUILDERCLASS);
+ }
+
+ public void testNewEclipseTemplateBuilder() {
+ System.setProperty(TemplateBuilderFactory.TEMPLATEBUILDERCLASS,
+ EclipseTemplateBuilder.class.getName());
+ TemplateBuilderFactory factory = TemplateBuilderFactory.newInstance();
+ TemplateBuilder builder = null;
+ try {
+ builder = factory.newTemplateBuilder();
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("creating EclipseTemplateBuilder failed.");
+ }
+ assertTrue(builder instanceof EclipseTemplateBuilder);
+ System.setProperty(TemplateBuilderFactory.TEMPLATEBUILDERCLASS,
+ TemplateBuilderFactory.DEFAULTTEMPLATEBUILDERCLASS);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.codegen.ui.test/src/com/nokia/testfw/codegen/ui/wizard/NewTestCaseWizardTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.codegen.ui.wizard;
+
+import java.io.File;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.ui.PlatformUI;
+
+import com.nokia.testfw.test.framework.WizardTestCase;
+import com.nokia.testfw.test.utils.ProjectUtils;
+import com.nokia.testfw.test.utils.TestUtils;
+
+public class NewTestCaseWizardTest extends WizardTestCase {
+ IProject targetProject;
+
+ protected void setUp() throws Exception {
+ targetProject = ProjectUtils.getTargetProject("testProject");
+ if (targetProject == null) {
+ // targetProject.delete(true, true, new NullProgressMonitor());
+ String projectPath = (new File("resource/HelloWorld"))
+ .getCanonicalPath();
+ String bldInfPath = "Bld.inf";
+ targetProject = ProjectUtils.createTargetProject("testProject",
+ projectPath, bldInfPath);
+ }
+ ProjectUtils.selectProject(targetProject);
+ super.setUp();
+ }
+
+ SUTNewTestWizard wizard;
+
+ protected IWizard getWizard() {
+ wizard = new SUTNewTestWizard();
+ wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(
+ targetProject));
+ return wizard;
+ }
+
+ public void testCreateTestSuitePerform() {
+ wizard.setShowChooseProjectPage(true);
+ dialog.open();
+ TestUtils.delay(3000);
+ IWizardPage currentPage = dialog.getCurrentPage();
+ dialog.showPage(currentPage.getNextPage());
+ TestUtils.delay(3000);
+ currentPage = dialog.getCurrentPage();
+ dialog.showPage(currentPage.getNextPage());
+ TestUtils.delay(3000);
+ currentPage = dialog.getCurrentPage();
+ dialog.showPage(currentPage.getNextPage());
+ TestUtils.delay(3000);
+ dialog.getShell().getDisplay().syncExec(new Runnable() {
+ public void run() {
+ wizard.performFinish();
+ }
+ });
+ dialog.close();
+ TestUtils.delay(3000);
+
+ IFolder testfolder = targetProject.getFolder("tsrc");
+ assertTrue(testfolder.exists());
+ }
+
+ public void testCreateTestCasePerform() {
+ wizard.setShowChooseProjectPage(false);
+ dialog.open();
+ TestUtils.delay(3000);
+ IWizardPage currentPage = dialog.getCurrentPage();
+ dialog.showPage(currentPage.getNextPage());
+ TestUtils.delay(3000);
+ currentPage = dialog.getCurrentPage();
+ dialog.showPage(currentPage.getNextPage());
+ TestUtils.delay(3000);
+ currentPage = dialog.getCurrentPage();
+ dialog.showPage(currentPage.getNextPage());
+ TestUtils.delay(3000);
+ currentPage = dialog.getCurrentPage();
+ if (currentPage instanceof LocationAndPropertyPage) {
+ ((LocationAndPropertyPage) currentPage).setShowPreviewChanges(true);
+ dialog.updateButtons();
+ }
+ dialog.showPage(currentPage.getNextPage());
+ TestUtils.delay(3000);
+ dialog.getShell().getDisplay().syncExec(new Runnable() {
+ public void run() {
+ wizard.performFinish();
+ }
+ });
+ dialog.close();
+ TestUtils.delay(3000);
+
+ IFolder testfolder = targetProject.getFolder("tsrc");
+ assertTrue(testfolder.exists());
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.core.test/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.core.test/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.core.test</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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.core.test/.settings/org.eclipse.jdt.core.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,12 @@
+#Wed Dec 23 11:14:31 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+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.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.core.test/META-INF/MANIFEST.MF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Test Fragment
+Bundle-SymbolicName: com.nokia.testfw.core.test
+Bundle-Version: 1.0.0
+Bundle-Vendor: Nokia
+Fragment-Host: com.nokia.testfw.core
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.junit4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.core.test/build.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ resource/,\
+ stfscript.cfg
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.core.test/src/com/nokia/testfw/core/AllPureJUnitTests.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.core;
+
+import com.nokia.testfw.core.model.TestCaseTest;
+import com.nokia.testfw.core.model.TestSuiteTest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class AllPureJUnitTests extends TestSuite {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("com.nokia.testfw.core.junit");
+ suite.addTestSuite(TestCaseTest.class);
+ suite.addTestSuite(TestSuiteTest.class);
+ return suite;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.core.test/src/com/nokia/testfw/core/model/AllTests.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.core.model;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class AllTests extends TestSuite {
+
+ /**
+ * Returns the suite. This is required to
+ * use the JUnit Launcher.
+ */
+ public static Test suite() {
+ return new AllTests();
+ }
+
+ /**
+ * Construct the test suite.
+ */
+ public AllTests() {
+ addTest(new TestSuite(TestSuiteTest.class));
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.core.test/src/com/nokia/testfw/core/model/TestCaseTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.core.model;
+
+import com.nokia.testfw.core.model.TestResult.TestStatus;
+
+import junit.framework.TestCase;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class TestCaseTest extends TestCase {
+ com.nokia.testfw.core.model.TestCase testCase;
+
+ protected void setUp() {
+ testCase = new com.nokia.testfw.core.model.TestCase("Test1");
+ }
+
+ protected void tearDown() {
+ testCase = null;
+ }
+
+ public void testProperty() {
+ testCase.addProperty("key1", "value1");
+ testCase.addProperty("key2", "value2");
+ assertEquals("value1", testCase.getProperty("key1"));
+ assertEquals("value2", testCase.getProperties().get("key2"));
+ }
+
+ public void testAttributes() {
+ assertEquals("Test1", testCase.getIdentifier());
+ testCase.setIdentifier("Test2");
+ assertEquals("Test2", testCase.getIdentifier());
+
+ String version="v0.1";
+ testCase.setVersion(version);
+ assertEquals(version, testCase.getVersion());
+
+ String desc="model test caes";
+ testCase.setDescription(desc);
+ assertEquals(desc, testCase.getDescription());
+
+ String spec="REQ001";
+ testCase.setSpecRef(spec);
+ assertEquals(spec, testCase.getSpecRef());
+
+ String purpose = "reason1";
+ testCase.setPurpose(purpose);
+ assertEquals(purpose, testCase.getPurpose());
+ testCase.toString();
+
+ }
+
+ public void testEqual() {
+ testCase.setIdentifier("case1");
+ com.nokia.testfw.core.model.TestCase case1 = new com.nokia.testfw.core.model.TestCase("case1");
+ com.nokia.testfw.core.model.TestCase case2 = new com.nokia.testfw.core.model.TestCase("case2");
+ assertTrue(testCase.equals(case1));
+ assertFalse(testCase.equals(case2));
+ }
+
+ public void testStartStop() {
+ //test success case
+ com.nokia.testfw.core.model.TestSuite suite = new com.nokia.testfw.core.model.TestSuite();
+ testCase.setSuite(suite);
+ testCase.getSuite();
+ testCase.start();
+ testCase.stop(TestStatus.SUCCESS, null);
+
+ //check test result
+ TestResult result = testCase.getResult();
+ result.toString();
+ assertTrue(result.getStartTime() != 0);
+ assertTrue(result.getEndTime() != 0);
+ assertTrue(result.status == TestStatus.SUCCESS);
+
+ //test failure case
+ com.nokia.testfw.core.model.TestCase case2 = new com.nokia.testfw.core.model.TestCase("case2");
+ case2.setSuite(suite);
+ case2.start();
+ case2.stop(TestStatus.FAILURE, "assert error");
+ //check test result
+ result = case2.getResult();
+ assertTrue(result.getStartTime() != 0);
+ assertTrue(result.getEndTime() != 0);
+ assertTrue(result.status == TestStatus.FAILURE);
+ assertNotNull(result.getFailure());
+
+ }
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.core.test/src/com/nokia/testfw/core/model/TestSuiteTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.core.model;
+
+import com.nokia.testfw.core.model.TestResult.TestStatus;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class TestSuiteTest extends junit.framework.TestCase {
+
+ TestSuite suite;
+
+ protected void setUp() {
+ suite = new TestSuite();
+ }
+
+ protected void tearDown() {
+ suite = null;
+ }
+
+ public void testAddTestCase() {
+ TestCase t1 = new TestCase("case1");
+ suite.addTestCase(t1);
+ TestCase t2 = new TestCase("case1");
+ suite.addTestCase(t2);
+ assertEquals(suite.getTestCases().size(), 2);
+ suite.toString();
+ }
+
+ public void testSuiteResult() {
+ TestCase t1 = new TestCase("case1");
+ suite.addTestCase(t1);
+ TestCase t2 = new TestCase("case2");
+ suite.addTestCase(t2);
+ TestCase t3 = new TestCase("case3");
+ suite.addTestCase(t3);
+ TestCase t4 = new TestCase("case4");
+ suite.addTestCase(t4);
+ TestCase t5 = new TestCase("case5");
+ suite.addTestCase(t5);
+
+ updateStatus(t1, TestStatus.SUCCESS);
+ updateStatus(t2, TestStatus.SUCCESS);
+ updateStatus(t3, TestStatus.FAILURE);
+ updateStatus(t4, TestStatus.SKIP);
+
+ //check the counter, should be
+ assertEquals(suite.getSuiteResult().getTestCount(), 5);
+ assertEquals(suite.getSuiteResult().getPassedTestCount(), 2);
+ assertEquals(suite.getSuiteResult().getFailedTestCount(), 1);
+ assertEquals(suite.getSuiteResult().getSkippedTestCount(), 1);
+ }
+
+ private void updateStatus(TestCase t, TestStatus status)
+ {
+ t.start();
+ try {
+ Thread.sleep(50);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ t.stop(status, null);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.core.test/src/com/nokia/testfw/core/utils/STFScriptUtilsTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.core.utils;
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.ArrayList;
+
+import junit.framework.TestCase;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class STFScriptUtilsTest extends TestCase {
+ static final String TEST_SCRIPT_FILE = "stfscript.cfg";
+ public void testLoadTestCase() {
+ ArrayList<String> testCases;
+ try {
+ if (new File(TEST_SCRIPT_FILE).exists()) {
+ testCases = STFScriptUtils.getTestCasesFromScript(TEST_SCRIPT_FILE);
+ } else {
+ InputStream fileStream = this.getClass().getClassLoader().getResourceAsStream(TEST_SCRIPT_FILE);
+ testCases = STFScriptUtils.getTestCasesFromScript(fileStream);
+ }
+ assertNotNull(testCases);
+ assertEquals(testCases.size(), 12);
+ assertEquals(testCases.get(0), "timeout (abort case)");
+
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.core.test/stfscript.cfg Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,79 @@
+
+#manual cases(can be used as combined together)
+
+[Test]
+title timeout (abort case)
+timeout 2000
+run demomodule Demo.cfg 0 testid=demo ini=ini.txt expect=0 category=timeout
+[Endtest]
+
+[Test]
+title exit case
+run testmodule c.cfg 26 expect=-1
+[Endtest]
+
+[Test]
+title manualtest TestCombiner demo event set
+set demo
+[Endtest]
+
+[Test]
+title manualtest TestCombiner demo state event set
+set demo state=1
+[Endtest]
+
+[Test]
+title manualtest TestCombiner demo state event unset
+unset demo
+[Endtest]
+
+[Test]
+title manualtest TestCombiner req-wait-rel demo event
+request demo
+wait demo
+release demo
+[Endtest]
+
+[Test]
+title manualtest TestCombiner req-wait-wait-rel demo event
+request demo
+wait demo
+wait demo
+release demo
+[Endtest]
+
+[Test]
+title manualtest TestCombiner req-wait-rel-req-wait-rel demo event
+request demo
+wait demo
+release demo
+request demo
+wait demo
+release demo
+[Endtest]
+
+[Test]
+title manualtest set and unset TestModuleState1 event in TestCombiner
+set TestModuleState1 state=1
+unset TestModuleState1
+[Endtest]
+
+[Test]
+title manualtest req-wait-rel TestModuleState1 event in TestCombiner
+request TestModuleState1
+wait TestModuleState1
+release TestModuleState1
+[Endtest]
+
+[Test]
+title manualtest run TestModuleState1 event testmodule wait
+run testmodule ex.cfg 17
+[Endtest]
+
+[Test]
+title manualtest run TestModuleState1 event testmodule set
+run testmodule ex.cfg 18
+[Endtest]
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.launch.test</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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/.settings/org.eclipse.jdt.core.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,12 @@
+#Wed Dec 23 11:14:16 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+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.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/META-INF/MANIFEST.MF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Test Fragment
+Bundle-SymbolicName: com.nokia.testfw.launch.test
+Bundle-Version: 1.0.0
+Bundle-Vendor: Nokia
+Fragment-Host: com.nokia.testfw.launch;bundle-version="1.0.0"
+Require-Bundle: org.junit4,
+ com.nokia.testfw.test;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/build.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/.cproject Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+<storageModule buildFromInf="true" buildingTestComps="true" cleanLevel="0" concurrentBuildJobs="4" defaultMMPChangedAction="0" extraSBSv2Args="" infBuildComponents="" infFileLocation="tsrc\group\bld.inf" macrosFile="" makeEngineToUse="make" manageDependencies="true" moduleId="com.nokia.carbide.cdt.builder.carbideCPPBuilder" overrideMakeEngine="false" overrideWorkspaceSettings="false" promptForMMPChangedAction="false" useConcurrentBuilding="true" useDebugMode="false" useIncrementalBuilder="false" useKeepGoing="false" useMMPMacros="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.settings">
+<cconfiguration id="Emulator Debug (WINSCW) [TB91SF]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Emulator Debug (WINSCW) [TB91SF]" moduleId="org.eclipse.cdt.core.settings" name="Emulator Debug (WINSCW) [TB91SF]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="N:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="M:\workspace\symbianunittestfw\sutfw\sutfwexamples\sutfwracecarexample\tsrc\group\bld.inf;M:\workspace\symbianunittestfw\sutfw\sutfwexamples\sutfwracecarexample\tsrc\group\ut_racecar.mmp;" includesCache="M:/workspace/symbianunittestfw/sutfw/sutfwexamples/sutfwracecarexample/tsrc/inc[LOCAL];M:/workspace/symbianunittestfw/sutfw/sutfwexamples/sutfwracecarexample/inc[LOCAL];N:/epoc32/include;N:/epoc32/include/symbianunittest;" macrosCache="__DLL__;_UNICODE;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__CW32__;__WINS__;SYMBIAN_UNIT_TEST;__WINSCW__;_DEBUG;" moduleId="configDataCache" sourcesCache="/ut_racecar/inc;/ut_racecar/src;/ut_racecar/tsrc/inc;/ut_racecar/tsrc/src;" timestampCache="1260410625066" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+</cconfiguration>
+<cconfiguration id="Emulator Release (WINSCW) [TB91SF]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Emulator Release (WINSCW) [TB91SF]" moduleId="org.eclipse.cdt.core.settings" name="Emulator Release (WINSCW) [TB91SF]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="N:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="M:\workspace\symbianunittestfw\sutfw\sutfwexamples\sutfwracecarexample\tsrc\group\bld.inf;M:\workspace\symbianunittestfw\sutfw\sutfwexamples\sutfwracecarexample\tsrc\group\ut_racecar.mmp;" includesCache="M:/workspace/symbianunittestfw/sutfw/sutfwexamples/sutfwracecarexample/tsrc/inc[LOCAL];M:/workspace/symbianunittestfw/sutfw/sutfwexamples/sutfwracecarexample/inc[LOCAL];N:/epoc32/include;N:/epoc32/include/symbianunittest;" macrosCache="__DLL__;_UNICODE;__SYMBIAN32__;__SUPPORT_CPP_EXCEPTIONS__;__CW32__;NDEBUG;__WINS__;SYMBIAN_UNIT_TEST;__WINSCW__;" moduleId="configDataCache" sourcesCache="/ut_racecar/inc;/ut_racecar/src;/ut_racecar/tsrc/inc;/ut_racecar/tsrc/src;" timestampCache="1260410625066" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+</cconfiguration>
+</storageModule>
+</cproject>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>sutfwracecarexample</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.nokia.carbide.cdt.builder.carbideCPPBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>com.nokia.carbide.cdt.builder.carbideCPPBuilderNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/inc/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/inc/racecar.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef CRACECAR_H
+#define CRACECAR_H
+
+// INCLUDES
+#include <e32base.h>
+#include "symbianunittestmacros.h"
+
+// CONSTANTS
+const TInt KMaxTyreAngle( 45 );
+
+// CLASS DECLARATION
+class CRaceCar : public CBase
+ {
+ public: // Constructors and Destructor
+
+ static CRaceCar* NewL( const TDesC& aColor, TUint aFuelTankSize );
+ static CRaceCar* NewLC( const TDesC& aColor, TUint aFuelTankSize );
+ ~CRaceCar();
+
+ public: // New functions
+
+ TUint FuelTankSize() const;
+
+ TUint FuelLeft() const;
+
+ TUint AddFuel( TUint aFuel );
+
+ TInt Steer( TInt aAngle );
+
+ TInt Direction() const;
+
+ TInt Accelerate( TUint aForce );
+
+ TUint Speed() const;
+
+ void Brake( TUint aForce );
+
+ const TDesC& Color() const;
+
+ void ChangeColorL( const TDesC& aNewColor );
+
+ private: // Constructors
+
+ void ConstructL( const TDesC& aColor );
+ CRaceCar( TUint aFuelTankSize );
+
+ private: // Data
+
+ TUint iFuelTankSize;
+ HBufC* iColor;
+ TUint iFuel;
+ TInt iDirection;
+ TUint iSpeed;
+
+ private: // Test class
+
+ SYMBIAN_UNIT_TEST_CLASS( UT_CRaceCar )
+ };
+
+#endif // CRACECAR_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/src/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/src/racecar.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "racecar.h"
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CRaceCar* CRaceCar::NewL( const TDesC& aColor, TUint aFuelTankSize )
+ {
+ CRaceCar* self = NewLC( aColor, aFuelTankSize );
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CRaceCar* CRaceCar::NewLC( const TDesC& aColor, TUint aFuelTankSize )
+ {
+ CRaceCar* self = new( ELeave )CRaceCar( aFuelTankSize );
+ CleanupStack::PushL( self );
+ self->ConstructL( aColor );
+ return self;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CRaceCar::CRaceCar( TUint aFuelTankSize )
+ : iFuelTankSize( aFuelTankSize )
+ {
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CRaceCar::ConstructL( const TDesC& aColor )
+ {
+ iColor = aColor.AllocL();
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+CRaceCar::~CRaceCar()
+ {
+ delete iColor;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TUint CRaceCar::FuelTankSize() const
+ {
+ return iFuelTankSize;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TUint CRaceCar::FuelLeft() const
+ {
+ return iFuel;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TUint CRaceCar::AddFuel( TUint aFuel )
+ {
+ TUint extraFuel = 0;
+ if ( aFuel > iFuelTankSize - iFuel )
+ {
+ extraFuel = aFuel- ( iFuelTankSize - iFuel );
+ iFuel = iFuelTankSize;
+ }
+ else
+ {
+ iFuel += aFuel;
+ }
+ return extraFuel;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TInt CRaceCar::Steer( TInt aAngle )
+ {
+ if ( ( iDirection + aAngle ) < -KMaxTyreAngle ||
+ ( iDirection + aAngle ) > KMaxTyreAngle )
+ {
+ return KErrArgument;
+ }
+ iDirection += aAngle;
+ return KErrNone;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TInt CRaceCar::Direction() const
+ {
+ return iDirection;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TInt CRaceCar::Accelerate( TUint aForce )
+ {
+ if ( iFuel == 0 )
+ {
+ return KErrGeneral;
+ }
+ else
+ {
+ iFuel--;
+ iSpeed += aForce;
+ }
+ return KErrNone;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+TUint CRaceCar::Speed() const
+ {
+ return iSpeed;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CRaceCar::Brake( TUint aForce )
+ {
+ if ( iSpeed < aForce )
+ {
+ iSpeed = 0;
+ }
+ else
+ {
+ iSpeed -= aForce;
+ }
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+const TDesC& CRaceCar::Color() const
+ {
+ return *iColor;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CRaceCar::ChangeColorL( const TDesC& aNewColor )
+ {
+ __ASSERT_ALWAYS ( aNewColor.Length() > 0, User::Leave( KErrArgument ) );
+
+ HBufC* tmpColor = aNewColor.AllocL();
+ delete iColor;
+ iColor = tmpColor;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/tsrc/BWINS/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/tsrc/BWINS/ut_racecarU.DEF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+EXPORTS
+ ?CreateTestL@@YAPAVMSymbianUnitTestInterface@@XZ @ 1 NONAME ; class MSymbianUnitTestInterface * CreateTestL(void)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/tsrc/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/tsrc/EABI/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/tsrc/EABI/ut_racecarU.DEF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,4 @@
+EXPORTS
+ _Z11CreateTestLv @ 1 NONAME
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/tsrc/group/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/tsrc/group/bld.inf Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Symbian Unit Testing framework
+*
+*/
+
+PRJ_TESTMMPFILES
+ut_racecar.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/tsrc/group/ut_racecar.mmp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+TARGET ut_racecar.dll
+TARGETTYPE dll
+UID 0x20022E76 0x20022E76
+
+MACRO SYMBIAN_UNIT_TEST
+
+SOURCEPATH ../../src
+SOURCE racecar.cpp
+
+SOURCEPATH ../src
+SOURCE dllEntry.cpp
+SOURCE ut_racecar.cpp
+
+USERINCLUDE ../inc
+USERINCLUDE ../../inc
+
+SYSTEMINCLUDE /epoc32/include
+SYSTEMINCLUDE /epoc32/include/symbianunittest
+
+LIBRARY euser.lib
+LIBRARY symbianunittestfw.lib
+
+VENDORID 0x101FB657
+
+CAPABILITY ALL -TCB
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/tsrc/inc/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/tsrc/inc/ut_racecar.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef UT_RACECAR_H
+#define UT_RACECAR_H
+
+// INCLUDES
+#include <symbianunittest.h>
+
+// FORWARD DECLARATIONS
+class CRaceCar;
+
+// CLASS DECLARATION
+class UT_CRaceCar : public CSymbianUnitTest
+ {
+ public: // Constructors and destructor
+
+ static UT_CRaceCar* NewL();
+ static UT_CRaceCar* NewLC();
+ ~UT_CRaceCar();
+
+ protected: // From CSymbianUnitTest
+
+ void SetupL();
+ void Teardown();
+
+ protected: // Test functions
+
+ void UT_FuelL();
+ void UT_SteeringL();
+ void UT_SpeedL();
+ void UT_ColorL();
+ void UT_TimeoutL();
+ void UT_CrashL();
+ void UT_QuitL();
+
+ private: // Contructors
+
+ UT_CRaceCar();
+ void ConstructL();
+
+ private: // Data
+
+ // The object to be tested as a member variable:
+ CRaceCar *iRaceCar;
+ };
+
+#endif // UT_RACECAR_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/tsrc/src/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+7
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/tsrc/src/dllentry.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ut_racecar.h"
+#include <symbianunittestsuite.h>
+
+
+// Exactly one exported function returning
+// the pointer to the suite of tests for the SymbianUnit framework.
+//
+EXPORT_C MSymbianUnitTestInterface* CreateTestL()
+ {
+ CSymbianUnitTestSuite* testSuite =
+ CSymbianUnitTestSuite::NewLC( _L("ut_racecar") );
+
+ testSuite->AddL( UT_CRaceCar::NewLC() );
+ CleanupStack::Pop();
+
+ // Add more tests to the test suite here when testing multiple classes
+
+ CleanupStack::Pop( testSuite );
+ return testSuite;
+ }
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/Racecar/tsrc/src/ut_racecar.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,229 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "ut_racecar.h"
+#include "racecar.h"
+#include <symbianunittestmacros.h>
+
+_LIT( KRed, "red" );
+_LIT( KBlue, "blue" );
+const TInt KInitialFuel( 100 );
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+UT_CRaceCar* UT_CRaceCar::NewL()
+ {
+ UT_CRaceCar* self = UT_CRaceCar::NewLC();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+UT_CRaceCar* UT_CRaceCar::NewLC()
+ {
+ UT_CRaceCar* self = new( ELeave )UT_CRaceCar();
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+UT_CRaceCar::UT_CRaceCar()
+ {
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void UT_CRaceCar::ConstructL()
+ {
+ BASE_CONSTRUCT
+ ADD_SUT( UT_FuelL )
+ ADD_SUT( UT_SteeringL )
+ ADD_SUT( UT_SpeedL )
+ // Setup and teardown functions can be changed for each test function
+ // Usually this is not needed, but this is possible.
+ ADD_SUT_WITH_SETUP_AND_TEARDOWN( SetupL, UT_ColorL, Teardown )
+
+ ADD_SUT( UT_TimeoutL )
+ ADD_SUT(UT_CrashL )
+ ADD_SUT(UT_QuitL )
+
+
+ }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+UT_CRaceCar::~UT_CRaceCar()
+ {
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void UT_CRaceCar::SetupL()
+ {
+ iRaceCar = CRaceCar::NewL( KRed, KInitialFuel );
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void UT_CRaceCar::Teardown()
+ {
+ delete iRaceCar;
+ iRaceCar = NULL;
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void UT_CRaceCar::UT_FuelL()
+ {
+ // Test the initial fuel
+ SUT_ASSERT_EQUALS( KInitialFuel, iRaceCar->FuelTankSize() )
+ SUT_ASSERT_EQUALS( 0, iRaceCar->FuelLeft() )
+
+ // Add a proper amount of fuel
+ SUT_ASSERT_EQUALS( 0, iRaceCar->AddFuel( KInitialFuel ) )
+ SUT_ASSERT_EQUALS( KInitialFuel, iRaceCar->FuelLeft() )
+
+ // Add too much fuel
+ SUT_ASSERT_EQUALS( 2, iRaceCar->AddFuel( 1 ) ) //expect to leave
+ SUT_ASSERT_EQUALS( KInitialFuel, iRaceCar->FuelLeft() )
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void UT_CRaceCar::UT_SteeringL()
+ {
+ // Try to steer beyond the allowed values
+ SUT_ASSERT( iRaceCar->Steer( -( KMaxTyreAngle + 1 ) ) != KErrNone )
+ SUT_ASSERT_EQUALS( 0, iRaceCar->Direction() )
+ SUT_ASSERT( iRaceCar->Steer( KMaxTyreAngle + 1 ) != KErrNone )
+ SUT_ASSERT_EQUALS( 0, iRaceCar->Direction() )
+
+ // Steer with the an allowed value
+ SUT_ASSERT_EQUALS( KErrNone, iRaceCar->Steer( KMaxTyreAngle ) )
+ SUT_ASSERT_EQUALS( KMaxTyreAngle, iRaceCar->Direction() )
+
+ // Try beyond the allowed value
+ SUT_ASSERT( iRaceCar->Steer( 1 ) != KErrNone )
+ SUT_ASSERT_EQUALS( KMaxTyreAngle, iRaceCar->Direction() )
+
+ // Steer to the opposite maximum
+ SUT_ASSERT_EQUALS( KErrNone, iRaceCar->Steer( -2 * KMaxTyreAngle ) )
+ SUT_ASSERT_EQUALS( -KMaxTyreAngle, iRaceCar->Direction() )
+
+ // Try beyond the allowed value
+ SUT_ASSERT( iRaceCar->Steer( -1 ) != KErrNone )
+ SUT_ASSERT_EQUALS( -KMaxTyreAngle, iRaceCar->Direction() )
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void UT_CRaceCar::UT_SpeedL()
+ {
+ // Try to accelerate without fuel
+ SUT_ASSERT_EQUALS( 0, iRaceCar->Speed() )
+ SUT_ASSERT( iRaceCar->Accelerate( 1 ) != KErrNone )
+
+ // Add fuel and accelerate
+ iRaceCar->AddFuel( 2 );
+ SUT_ASSERT_EQUALS( 2, iRaceCar->FuelLeft() )
+ SUT_ASSERT_EQUALS( KErrNone, iRaceCar->Accelerate( 100 ) )
+ SUT_ASSERT_EQUALS( 100, iRaceCar->Speed() )
+ SUT_ASSERT_EQUALS( 1, iRaceCar->FuelLeft() )
+ SUT_ASSERT_EQUALS( KErrNone, iRaceCar->Accelerate( 50 ) )
+ SUT_ASSERT_EQUALS( 150, iRaceCar->Speed() )
+ SUT_ASSERT_EQUALS( 0, iRaceCar->FuelLeft() )
+
+ // Try braking
+ iRaceCar->Brake( 70 );
+ SUT_ASSERT_EQUALS( 80, iRaceCar->Speed() )
+ iRaceCar->Brake( 90 );
+ SUT_ASSERT_EQUALS( 0, iRaceCar->Speed() )
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void UT_CRaceCar::UT_ColorL()
+ {
+ // Check the initial color
+ SUT_ASSERT_EQUALS( KRed, iRaceCar->Color() )
+
+ // Try to paint the car, color allowed
+ iRaceCar->ChangeColorL( KBlue );
+ SUT_ASSERT_EQUALS( KBlue, iRaceCar->Color() )
+
+ // Try to paint the car, color not allowed
+ SUT_ASSERT_LEAVE( iRaceCar->ChangeColorL( KNullDesC ) )
+
+ SUT_ASSERT_LEAVE_WITH(
+ iRaceCar->ChangeColorL( KNullDesC ), KErrArgument )
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void UT_CRaceCar::UT_TimeoutL()
+ {
+ //the car is too slow (:
+ User::After(7 * 1000000);
+ }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void UT_CRaceCar::UT_CrashL()
+ {
+ //the car is totaled (:
+ User::Panic(_L("Crash"), -100);
+ }
+
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void UT_CRaceCar::UT_QuitL()
+ {
+ User::Leave(-100);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/TestModule/Bmarm/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+1
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/TestModule/Bmarm/Testu.def Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+EXPORTS
+ LibEntryL__Fv @ 1 NONAME R3UNUSED ; LibEntryL(void)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/TestModule/Bwins/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+1
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/TestModule/Bwins/Testu.def Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+EXPORTS
+ ?LibEntryL@@YAPAVCTestModuleTest@@XZ @ 1 NONAME ; class CTestModuleTest * __cdecl LibEntryL(void)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/TestModule/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+1
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/TestModule/eabi/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+1
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/TestModule/eabi/Testu.def Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,3 @@
+EXPORTS
+ _Z9LibEntryLv @ 1 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/TestModule/group/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+1
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/TestModule/group/TestModuleTests.cfg Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,55 @@
+[Test]
+title Passing case
+run testmodule dummyfile 0
+[Endtest]
+
+[Test]
+title Failing case
+run testmodule dummyfile 1 expect=-2
+[Endtest]
+
+[Test]
+title One line print
+run testmodule dummyfile 2
+[Endtest]
+
+[Test]
+title One line print with parsing
+run testmodule dummyfile 3
+[Endtest]
+
+[Test]
+title Printing with negative priority
+run testmodule dummyfile 4
+[Endtest]
+
+[Test]
+title Printing with too long description
+run testmodule dummyfile 5
+[Endtest]
+
+[Test]
+title Printing with too long text
+run testmodule dummyfile 6
+[Endtest]
+
+[Test]
+title Printing with too long desc&text
+run testmodule dummyfile 7
+[Endtest]
+
+[Test]
+title Printing with empty desc
+run testmodule dummyfile 8
+[Endtest]
+
+[Test]
+title Printing with empty text
+run testmodule dummyfile 9
+[Endtest]
+
+
+[Test]
+title Printing with empty desc twice
+run testmodule dummyfile 10
+[Endtest]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/TestModule/group/Testmodule.mmp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MMP file for STIF Test Framework's Normal test module.
+*
+*/
+
+#include <platform_paths.hrh>
+
+SMPSAFE
+
+TARGET Testmodule.dll
+TARGETTYPE dll
+
+CAPABILITY ALL -TCB
+VENDORID 0x101FB657
+
+DEFFILE Test.def
+
+USERINCLUDE ../inc
+
+OS_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH ../src
+
+SOURCE Test.cpp
+
+LIBRARY euser.lib
+LIBRARY stiftestinterface.lib
+
+// First UID is DLL UID, Second UID is STIF Test Framework UID
+UID 0x1000008D 0x101FB3E7
+
+#ifndef WINSCW
+epocstacksize 0x4000
+start wins
+ win32_library chkstk.obj
+end
+#endif
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/TestModule/group/bld.inf Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+PRJ_PLATFORMS
+// Specify the platforms your component needs to be built for here.
+// If not specified all platforms can be built.
+
+ DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_TESTEXPORTS
+
+ ../group/TestModuleTests.cfg +/wins/c/TestFramework/TestModuleTests.cfg
+ ../group/TestModuleTests.cfg +/winscw/c/TestFramework/TestModuleTests.cfg
+ ../group/TestModuleTests.cfg +/data/z/system/data/TestModuleTests.cfg
+
+PRJ_MMPFILES
+
+PRJ_TESTMMPFILES
+
+ Testmodule.MMP
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/TestModule/inc/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+1
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/TestModule/inc/Test.h Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,350 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This file contains the header file of the Test
+* test module of the Test Framework.
+*
+*/
+
+#ifndef TEST_H
+#define TEST_H
+
+// INCLUDES
+#include "StifTestModule.h"
+
+// CONSTANTS
+//const <type constant_var = constant;>
+//Mark "None" if not any, this goes for other sections as well.
+
+
+static TPtrC8 CaseName( TInt aNumber )
+{
+ static const char* const casenames[] =
+ {
+ ("Passing case"),
+ ("Failing case"),
+ ("One line print"),
+ ("One line print with parsing"),
+ ("Printing with negative priority"),
+ ("Printing with too long description"),
+ ("Printing with too long text"),
+ ("Printing with too long desc&text"),
+ ("Printing with empty desc"),
+ ("Printing with empty text"),
+ ("Printing with empty desc twice"),
+ ("Print overflows when parsing"),
+ ("Print queue overflow"),
+ ("Print queue overflow with leave"),
+ ("Print queue overflow with kill (does not work in Visual Studio)"),
+ ("Printing"),
+ ("Sleep"),
+ ("Wait state event"),
+ ("Set and unset state event"),
+ ("Wait indication and print"),
+ ("Set indication event 20 times in every 1 sec"),
+ ("Test module crash (does not work in Visual Studio) "),
+ ("Test module kill"),
+ ("Test module exception"),
+ ("Test module leaves"),
+ ("Test module panic"),
+ ("Test module two state event set"),
+ ("Test module two indication event sending"),
+ ("Non existing test case1"),
+ ("A test case with a very long case name which will cause clipping here and there to fit it to buffers in server, engine or in UI"),
+ ("memory leak (fail case)"),
+ ("alloved memory leak"),
+ ("Max size of the result description"),
+ ("Test result setting"),
+ ("Test result setting (fail case)"),
+ ("Test result setting with max desc length"),
+ ("Test result setting with too length desc. Description will cutted"),
+ ("TL Macro testing"),
+ ("T1L,T2L,T3L, T4L, T5L Macro testing with multible expected result"),
+ ("TL Macro(fail case, -6) Macro testing, TL"),
+ ("Verify that test case passes after macro testing"),
+ ("T1L Macro(fail case, -6, result 0) STIF TF's macro testing with multible expected result"),
+ ("Verify that test case passes after macro testing"),
+ ("T2L Macro(fail case, -6, result 0) STIF TF's macro testing with multible expected result"),
+ ("Verify that test case passes after macro testing"),
+ ("T3L Macro(fail case, -6, result 0) STIF TF's macro testing with multible expected result"),
+ ("Verify that test case passes after macro testing"),
+ ("T3L Macro(fail case, -2, result -2) STIF TF's macro testing with multible expected result"),
+ ("Verify that test case passes after macro testing"),
+ ("T4L Macro(fail case, -6, result 0) STIF TF's macro testing with multible expected result"),
+ ("Verify that test case passes after macro testing"),
+ ("T4L Macro(fail case, -2, result -2) STIF TF's macro testing with multible expected result"),
+ ("Verify that test case passes after macro testing"),
+ ("T5L Macro(fail case, -6, result 0) STIF TF's macro testing with multible expected result"),
+ ("Verify that test case passes after macro testing"),
+ ("T5L Macro(fail case, -2, result -2) STIF TF's macro testing with multible expected result"),
+
+ ("Verify that test case passes after macro testing"),
+ ("Test SetExitReason with killing test thread (passes)"),
+ ("Test module sleeps one minute (passes)"),
+ ("T5L Macro(fail case, -222, result -222)"),
+ ("TAL-TA5L Macros tests with allow results"),
+ ("Test module fails always with -222 (fails)"),
+
+ };
+
+ const TUint8 **keys = (const TUint8**) casenames;
+ TPtrC8 keyword( keys[ aNumber ] );
+ return keyword;
+
+ };
+
+// MACROS
+//#define <macro macro_def>
+
+
+// DATA TYPES
+//enum <declaration>
+//typedef <declaration>
+//extern <data_type;>
+
+
+// FUNCTION PROTOTYPES
+//<type function_name(arg_list);>
+
+
+// FORWARD DECLARATIONS
+//<class FORWARD_CLASSNAME;>
+
+
+// CLASS DECLARATION
+
+
+// DESCRIPTION
+// <one line short description>
+// <other description lines>
+
+NONSHARABLE_CLASS(CTestModuleTest)
+ :public CTestModuleBase
+ {
+ public: // Enumerations
+
+ private: // Enumerations
+ enum TestModuleTestCases
+ {
+ KTestModuleCasePass,
+ KTestModuleCaseFail,
+ KTestModuleOneLinePrint,
+ KTestModuleSimplePrintParsing,
+ KTestModuleNegativePriorityPrint,
+ KTestModuleTooLongDescription,
+ KTestModuleTooLongText,
+ KTestModuleTooLongDescAndText,
+ KTestModuleEmptyDescription,
+ KTestmoduleEmptyText,
+ KTestModuleEmptyDescriptionTwice,
+ KTestModulePrintParseOverflow,
+ KPrintQueueOverflow,
+ KPrintQueueOverflowWithLeave,
+ KPrintQueueOverflowWithKill,
+ KTestModulePrinting,
+ KTestModuleSleep,
+ KTestModuleStateEventWait,
+ KTestModuleStateEventSetAndUnset,
+ KTestModuleEventWait,
+ KTestModuleEventSet,
+ KTestModuleCrash,
+ KTestModuleKill,
+ KTestModuleException,
+ KTestModuleLeave,
+ KTestModulePanic,
+ KTestModuleTwoStateEventSetAndUnset,
+ KTestModuleTwoEventSet,
+ KTestModuleCaseNonExisting,
+ KCaseWithALongName,
+ KCaseMemLeak,
+ KCaseMemLeakAllowed,
+ KCaseTestMaxResultDes,
+ KCaseTestResultSetting,
+ KCaseTestResultSettingFail,
+ KCaseTestResultSettingWithMaxLength,
+ KCaseTestResultSettingWithTooLength,
+ KStifMacroTesting,
+ KStifMacroTesting_INT,
+ KStifMacroTesting_TL_fail_1,
+ KCaseVerifyThatTestCasePassesAfterMacro1,
+ KStifMacroTesting_T1L_fail_1,
+ KCaseVerifyThatTestCasePassesAfterMacro2,
+ KStifMacroTesting_T2L_fail_1,
+ KCaseVerifyThatTestCasePassesAfterMacro3,
+ KStifMacroTesting_T3L_fail_1,
+ KCaseVerifyThatTestCasePassesAfterMacro4,
+ KStifMacroTesting_T3L_fail_2,
+ KCaseVerifyThatTestCasePassesAfterMacro5,
+ KStifMacroTesting_T4L_fail_1,
+ KCaseVerifyThatTestCasePassesAfterMacro6,
+ KStifMacroTesting_T4L_fail_2,
+ KCaseVerifyThatTestCasePassesAfterMacro7,
+ KStifMacroTesting_T5L_fail_1,
+ KCaseVerifyThatTestCasePassesAfterMacro8,
+ KStifMacroTesting_T5L_fail_2,
+ KCaseVerifyThatTestCasePassesAfterMacro9,
+ KTestSetExitReasonWithKillingTestThread,
+ KSleepOneMinute,
+ KStifMacroTesting_General_1,
+ KStifTAL_TA5LMacrosWithAllowresults,
+ KFailAlways,
+ KLastCase // This must be last one
+ };
+
+ public: // Constructors and destructor
+
+ /**
+ * Two-phased constructor.
+ */
+ static CTestModuleTest* NewL();
+
+ /**
+ * Destructor.
+ */
+ ~CTestModuleTest();
+
+ public: // New functions
+
+ /**
+ * <member_description.>
+ */
+ //<type member_function( type arg1 );>
+
+ public: // Functions from base classes
+
+ /**
+ * Init is used to initialize the Test Module. The Test Modules can use
+ * the config file to read parameters for Test Module initialization but
+ * they can also have their own config file or some other routine to
+ * initialize themselves.
+ * This method is pure virtual and the Test Module shall implement it.
+ */
+ TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+ /**
+ * Test cases are inquired from the Test Module by calling GetTestCases.
+ * Test cases are read from the config file specified by aConfigFile.
+ * If the Test Module does not use config files for test case definition
+ * it does not use aConfigFile parameter. Test cases are appended
+ * to CArrayPtrFlat<TTestCaseInfo> that is a list consisting of
+ * several TTestCaseInfo objects.
+ * TTestCaseInfo class defines individual test cases and, if needed,
+ * a test set where the test case belongs to. TTestCaseInfo is
+ * defined in Table 9.
+ * This method is pure virtual and the Test Module shall implement it.
+ */
+ TInt GetTestCasesL( const TFileName& aConfigFile,
+ RPointerArray<TTestCaseInfo>& aTestCases );
+ /**
+ * RunTestCase is used to run an individual test case specified
+ * by aTestCase. Test cases that can be run are requested from
+ * Test Module by GetTestCases method before calling RunTestCase.
+ * This method is pure virtual and the Test Module shall implement it.
+ */
+ TInt RunTestCaseL( const TInt aCaseNumber,
+ const TFileName& aConfig,
+ TTestResult& aResult );
+
+ protected: // New functions
+
+ /**
+ * <member_description.>
+ */
+ //<type member_function( type arg1 );>
+
+ protected: // Functions from base classes
+
+ /**
+ * From <base_class member_description>
+ */
+ //<type member_function();>
+
+ private:
+
+ /**
+ * C++ default constructor.
+ */
+ CTestModuleTest();
+
+ /**
+ * By default Symbian OS constructor is private.
+ */
+ void ConstructL();
+
+ // Prohibit copy constructor if not deriving from CBase.
+ // <classname( const classname& );>
+ // Prohibit assigment operator if not deriving from CBase.
+ // <classname& operator= ( const classname& );>
+
+ /**
+ * Get thread status.
+ */
+ void ThreadStatus();
+
+ /**
+ *
+ */
+ TInt MacroTestInt_1();
+
+ /**
+ *
+ */
+ TInt MacroTestInt_2();
+
+ /**
+ *
+ */
+ TInt MacroTestInt_General( TInt aReturn );
+
+ /**
+ *
+ */
+ TBuf<50> MacroTestString_1();
+
+ /**
+ *
+ */
+ TBool MacroTestBool_1();
+
+ /**
+ *
+ */
+ TBool MacroTestBool_2();
+
+ /**
+ *
+ */
+ TInt TALMacrosWithAllowresults();
+
+ public: //Data
+ //<data_declaration;>
+
+ protected: // Data
+ //<data_declaration;>
+
+ private: // Data
+ //<data_declaration;>
+
+ public: // Friend classes
+ //<friend_class_declaration;>
+
+ protected: // Friend classes
+ //<friend_class_declaration;>
+
+ private: // Friend classes
+ //<friend_class_declaration;>
+
+ };
+
+#endif // TEST_H
+
+// End of File
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/TestModule/src/Distribution.Policy.S60 Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1 @@
+1
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/TestModule/src/Test.cpp Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,1326 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+// INCLUDE FILES
+#include <e32math.h>
+#include <e32svr.h>
+#include <StifTestModule.h>
+#include "Test.h"
+#include "StifTestEventInterface.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+_LIT (KTooLongDesc, "CTestModuleTest::123456789012345678901234567890");
+_LIT (KTooLongText, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"); // 90
+_LIT (KAlmostTooLongText, "123456789012345678901234567890123456789012345678901234567890123456789012345678%d"); // 78+2
+_LIT (KDesc, "TestModule");
+
+_LIT (KStifMacro_1, "macro testing");
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ==================== LOCAL FUNCTIONS =======================================
+
+
+/*
+-------------------------------------------------------------------------------
+
+ Function: <function name>
+
+ Description: <one line description>
+
+ <Description of the functionality
+ description continues and...
+ continues>
+
+ Parameters: <arg1>: <in/out/inout>: <accepted values>: <Description>
+
+ Return Values: <value_1: Description
+ value_n: Description line 1
+ description line 2>
+
+ Errors/Exceptions: <description how errors and exceptions are handled>
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+/*
+<type function_name(
+ <arg_type arg,>
+ <arg_type arg >)
+ {
+ // <comment>
+ <code>
+
+ // <comment>
+ <code>
+ }
+*/
+
+
+/*
+-------------------------------------------------------------------------------
+
+ DESCRIPTION
+
+ <This module contains the implementation of xxx class
+ member functions...>
+
+-------------------------------------------------------------------------------
+*/
+
+// ================= MEMBER FUNCTIONS =========================================
+
+/*
+-------------------------------------------------------------------------------
+
+ Class: CTestModuleTest
+
+ Method: CTestModuleTest
+
+ Description: Default constructor
+
+ C++ default constructor can NOT contain any code, that
+ might leave.
+
+ Parameters: None
+
+ Return Values: None
+
+ Errors/Exceptions: None
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+CTestModuleTest::CTestModuleTest()
+
+ {
+ return;
+ }
+
+/*
+-------------------------------------------------------------------------------
+
+ Class: CTestModuleTest
+
+ Method: ConstructL
+
+ Description: Symbian OS second phase constructor
+
+ Symbian OS default constructor can leave.
+
+ Parameters: None
+
+ Return Values: None
+
+ Errors/Exceptions: <description how errors and exceptions are handled>
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+void CTestModuleTest::ConstructL()
+ {
+
+ return;
+ }
+
+/*
+-------------------------------------------------------------------------------
+
+ Class: CTestModuleTest
+
+ Method: NewL
+
+ Description: Two-phased constructor.
+
+ Parameters: None
+
+ Return Values: CTestModuleTest*: new object
+
+ Errors/Exceptions: <description how errors and exceptions are handled>
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+CTestModuleTest* CTestModuleTest::NewL()
+ {
+ CTestModuleTest* self = new (ELeave) CTestModuleTest();
+
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop();
+
+ return self;
+ }
+
+/*
+-------------------------------------------------------------------------------
+
+ Class: CTestModuleTest
+
+ Method: ~CTestModuleTest
+
+ Description: Destructor
+
+ Parameters: None
+
+ Return Values: None
+
+ Errors/Exceptions: None
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+CTestModuleTest::~CTestModuleTest()
+ {
+
+ }
+
+/*
+-------------------------------------------------------------------------------
+
+ Class: CTestModuleTest
+
+ Method: Init
+
+ Description: Initialization function
+
+ Init is used to initialize the Test Module.
+
+ Parameters: TName& aIniFile: in: <accepted values>:
+ Configuration file for the test module
+
+ Return Values: KErrnone: No error
+ <value_1: Description
+ value_n: Description line 1
+ description line 2>
+
+ Errors/Exceptions: <description how errors and exceptions are handled>
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+TInt CTestModuleTest::InitL( TFileName& /* aIniFile */,
+ TBool /* aFirstTime*/ )
+ {
+
+
+// TestModuleIf().Printf( 0, _L("CTestModuleTest::Init"), _L("Initializing"));
+
+
+// TestModuleIf().Printf( 0, _L("CTestModuleTest::Init"), _L("Done"));
+ return KErrNone;
+ }
+
+/*
+-------------------------------------------------------------------------------
+
+ Class: CTestModuleTest
+
+ Method: GetTestCases
+
+ Description: Get test cases.
+
+ GetTestCases is used to inquired test cases from the Test Module.
+
+ Parameters: const TName& aConfigFile: in: <accepted values>:
+ Config file name descriptor
+ CArrayPtrFlat<TTestCaseInfo>& aTestCases: out:
+ <accepted values>: Array of TestCases
+
+ Return Values: KErrNone: No error
+ <value_1: Description
+ value_n: Description line 1
+ description line 2>
+
+ Errors/Exceptions: <description how errors and exceptions are handled>
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+TInt CTestModuleTest::GetTestCasesL( const TFileName& /* aConfigFile */,
+ RPointerArray<TTestCaseInfo>& aTestCases )
+ {
+
+ for ( TUint i = 0; i <KLastCase; i++)
+ {
+ TTestCaseInfo* tc = new ( ELeave ) TTestCaseInfo();
+ CleanupStack::PushL( tc );
+ tc->iCaseNumber = i;
+
+ tc->iTitle.Copy( CaseName(i) );
+ aTestCases.Append( tc );
+ CleanupStack::Pop( tc );
+ }
+
+ return KErrNone;
+ }
+
+/*
+-------------------------------------------------------------------------------
+
+ Class: CTestModuleTest
+
+ Method: RunTestCase
+
+ Description: Run a specified testcase.
+
+ RunTestCase is used to run an individual test case specified
+ by aTestCase. Test cases that can be run are requested from
+ Test Module by GetTestCases method before calling RunTestCase.
+ This method is synchronous and test case result is returned as
+ function return value (KErrNone = Passed).
+
+ Parameters: const TInt aCaseNumber: in: <accepted values>: Testcase number
+ const TDesC8& aConfig: in: <accepted values>: Configuration
+
+ Return Values: KErrNone: Passed.
+ <value_1: Description
+ value_n: Description line 1
+ description line 2>
+
+ Errors/Exceptions: <description how errors and exceptions are handled>
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+TInt CTestModuleTest::RunTestCaseL( const TInt aCaseNumber,
+ const TFileName& aConfig,
+ TTestResult& aResult )
+ {
+ TInt execStatus = KErrNone;
+
+ TestModuleIf().Printf( 0, KDesc, _L("Enter"));
+
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Case number %i, aConfig: %S"), aCaseNumber, &aConfig );
+
+ TEventIf event;
+
+ switch( aCaseNumber )
+ {
+
+ // A Passing case
+ case KTestModuleCasePass:
+ aResult.iResult = KErrNone;
+ break;
+ // A failing case
+
+ case KTestModuleCaseFail:
+ aResult.iResult = KErrGeneral;
+ break;
+
+ case KTestModuleOneLinePrint:
+ TestModuleIf().Printf( 0, KDesc, _L("Simple print"));
+ aResult.iResult = KErrNone;
+ break;
+
+ case KTestModuleSimplePrintParsing:
+ TestModuleIf().Printf( 0, KDesc, _L("Simple print %d"), 0xdeaddead);
+ aResult.iResult = KErrNone;
+ break;
+
+ case KTestModuleNegativePriorityPrint:
+ TestModuleIf().Printf( -1, KDesc, _L("Simple print "));
+ aResult.iResult = KErrNone;
+ break;
+
+ case KTestModuleTooLongDescription:
+ TestModuleIf().Printf( 0, KTooLongDesc, _L(""));
+ aResult.iResult = KErrNone;
+ break;
+
+ case KTestModuleTooLongText:
+ TestModuleIf().Printf( 0, KDesc, KTooLongText);
+ aResult.iResult = KErrNone;
+ break;
+
+ case KTestModuleTooLongDescAndText:
+ TestModuleIf().Printf( 0, KTooLongDesc, KTooLongText);
+ aResult.iResult = KErrNone;
+ break;
+
+ case KTestModuleEmptyDescription:
+ TestModuleIf().Printf( 0, _L(""), _L("Something"));
+ aResult.iResult = KErrNone;
+ break;
+
+ case KTestmoduleEmptyText:
+ TestModuleIf().Printf( 0, KDesc, _L(""));
+ aResult.iResult = KErrNone;
+ break;
+
+ case KTestModuleEmptyDescriptionTwice:
+ TestModuleIf().Printf( 0, _L(""), _L("Something"));
+ TestModuleIf().Printf( 0, _L(""), _L("Something else"));
+ aResult.iResult = KErrNone;
+ break;
+
+ case KTestModulePrintParseOverflow:
+ TestModuleIf().Printf( 0, KDesc, KAlmostTooLongText, 0xdeaddead );
+ aResult.iResult = KErrNone;
+ break;
+
+ case KPrintQueueOverflow:
+ {
+ for (int i = 0; i < 100000;i++)
+ {
+ TestModuleIf().Printf( 0, KDesc, _L("") );
+ }
+ aResult.iResult = KErrNone;
+ break;
+ }
+
+ case KPrintQueueOverflowWithLeave:
+ {
+ for (int i = 0; i < 100000;i++)
+ {
+ TestModuleIf().Printf( 0, KDesc, _L("") );
+ }
+ User::Leave(-1);
+ aResult.iResult = KErrNone;
+ break;
+ }
+
+ case KPrintQueueOverflowWithKill:
+ {
+ for (int i = 0; i < 100000;i++)
+ {
+ TestModuleIf().Printf( 0, KDesc, _L("") );
+ }
+ RThread t;
+ t.Kill(-1);
+ aResult.iResult = KErrNone;
+ break;
+ }
+
+
+ case KTestModulePrinting:
+ {
+ /* Simple print and wait loop */
+ for( TInt i=0; i<10; i++)
+ {
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Complete in %i secs"), 10-i);
+ User::After( 1000000 );
+ }
+ }
+ aResult.iResult = KErrNone;
+ break;
+
+ case KTestModuleSleep:
+ /* simple 10 sec sleeping */
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Sleep 10 secs"));
+ User::After( 10000000 );
+ break;
+ case KTestModuleStateEventWait:
+ {
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Request event"));
+ event.Set( TEventIf::EReqEvent,
+ _L("TestModuleState1"), TEventIf::EState );
+ User::LeaveIfError( TestModuleIf().Event( event ) );
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Wait event"));
+ event.SetType( TEventIf::EWaitEvent );
+ User::LeaveIfError( TestModuleIf().Event( event ) );
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Got event"));
+ User::After( 3000000 );
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Release event"));
+ event.SetType( TEventIf::ERelEvent );
+ User::LeaveIfError( TestModuleIf().Event( event ) );
+ }
+ aResult.iResult = KErrNone;
+ break;
+ case KTestModuleStateEventSetAndUnset:
+ {
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Set event"));
+ event.Set( TEventIf::ESetEvent,
+ _L("TestModuleState1"), TEventIf::EState );
+ User::LeaveIfError( TestModuleIf().Event( event ) );
+ User::After( 4000000 );
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Unset event"));
+ event.SetName( _L("TestModuleState1") );
+ event.SetType( TEventIf::EUnsetEvent );
+ User::LeaveIfError( TestModuleIf().Event( event ) );
+ User::After( 200000 );
+ }
+ aResult.iResult = KErrNone;
+ break;
+ case KTestModuleEventWait:
+ {
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Request event"));
+ event.Set( TEventIf::EReqEvent, _L("TestModuleIndication1") );
+ User::LeaveIfError( TestModuleIf().Event( event ) );
+ TInt i = 1;
+ FOREVER
+ {
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Wait event %i"), i);
+ event.SetType( TEventIf::EWaitEvent );
+ User::LeaveIfError( TestModuleIf().Event( event ) );
+ TestModuleIf().Printf( 1, KDesc,
+ _L("Got event %i"), i++);
+ }
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Release event"));
+ event.SetType( TEventIf::ERelEvent );
+ User::LeaveIfError( TestModuleIf().Event( event ));
+ }
+ aResult.iResult = KErrNone;
+ break;
+ case KTestModuleEventSet:
+ {
+ event.Set( TEventIf::ESetEvent, _L("TestModuleIndication1") );
+ for(TInt i = 0; i < 20; i++)
+ {
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Set event %i"), i+1);
+ User::LeaveIfError( TestModuleIf().Event( event ) );
+ User::After( 1000000 );
+ }
+ }
+ break;
+
+ case KTestModuleCrash:
+ {
+ // Do something illegal
+ TUint*p = (TUint*) 0xdeadbeef;
+ *p = 1;
+ }
+ break;
+
+ case KTestModuleKill:
+ User::After( 1000000 );
+ {
+ RThread t;
+ t.Kill(-1);
+ }
+ break;
+
+ case KTestModuleException:
+ User::After( 1000000 );
+ {
+ User().RaiseException( (TExcType) KExceptionAbort);
+ }
+ break;
+
+ case KTestModuleLeave:
+ User::After( 1000000 );
+ {
+ User::Leave(-1);
+ }
+ break;
+
+ case KTestModulePanic:
+ User::After( 1000000 );
+ {
+ User::Panic( _L("TestPanic"), -1);
+ }
+ break;
+
+ case KCaseWithALongName:
+ aResult.iResult = KErrNone;
+ break;
+
+ case KTestModuleTwoStateEventSetAndUnset:
+ {
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Set event"));
+ event.Set( TEventIf::ESetEvent,
+ _L("TestModuleState1"), TEventIf::EState );
+ User::LeaveIfError( TestModuleIf().Event( event ) );
+ event.SetName( _L("TestModuleState2") );
+ User::LeaveIfError( TestModuleIf().Event( event ) );
+ User::After( 4000000 );
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Unset event"));
+ event.SetType( TEventIf::EUnsetEvent );
+ User::LeaveIfError( TestModuleIf().Event( event ) );
+ event.SetName( _L("TestModuleState1") );
+ User::LeaveIfError( TestModuleIf().Event( event ) );
+ User::After( 200000 );
+ }
+ aResult.iResult = KErrNone;
+ break;
+ case KTestModuleTwoEventSet:
+ {
+ event.Set( TEventIf::ESetEvent, _L("TestModuleIndication1") );
+ TEventIf event2( TEventIf::ESetEvent, _L("TestModuleIndication2") );
+ for(TInt i = 0; i < 20; i++)
+ {
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Set events %i"), i+1);
+ User::LeaveIfError( TestModuleIf().Event( event ) );
+ User::LeaveIfError( TestModuleIf().Event( event2 ) );
+ User::After( 1000000 );
+ }
+ }
+ break;
+
+ case KCaseMemLeak:
+ {
+ HBufC* tmp = NULL;
+ tmp = HBufC::NewL( 1 );
+ }
+ break;
+ case KCaseMemLeakAllowed:
+ {
+ TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksMem );
+ HBufC* tmp = NULL;
+ tmp = HBufC::NewL( 1 );
+ }
+ break;
+
+ case KCaseTestMaxResultDes:
+ {
+ aResult.iResult = KErrNone;
+ aResult.iResultDes = (_L( "Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text 128 XXX") );
+ break;
+ }
+ case KCaseTestResultSetting:
+ {
+ aResult.SetResult( KErrNone, _L( "aResult.SetResult passed") );
+ break;
+ }
+ case KCaseTestResultSettingFail:
+ {
+ aResult.SetResult( KErrGeneral, _L( "aResult.SetResult failed(OK)") );
+ break;
+ }
+ case KCaseTestResultSettingWithMaxLength:
+ {
+ aResult.SetResult( KErrNone, _L( "Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text Long text 128 XXX") );
+ break;
+ }
+ case KCaseTestResultSettingWithTooLength:
+ {
+ aResult.SetResult( KErrNone, _L( "Long text Long text Long text Long text Long text Long text Long >> Description is over 128 so cutting this description XXXXXXXXThis not seen anymore") );
+ break;
+ }
+ case KStifMacroTesting:
+ {
+ // Definitions
+ TBool bool_false(EFalse);
+
+ TBuf<50> met_buf;
+ met_buf.Copy( _L( "macro testing" ) );
+
+ TBuf<20> buf1;
+ TBuf<20> buf2;
+ buf1.Copy( _L( "Test 1" ) );
+ buf2.Copy( _L( "Test 2" ) );
+
+ // ---- STIF macro testing ----
+
+ // Error codes
+ TL( MacroTestInt_1() == KErrNone );
+ TL( MacroTestInt_2() == KErrGeneral );
+
+ // Comparison
+ TL( 8 >= 6 );
+ TL( 6 <= 8 );
+ TL( 6 == 6 );
+
+ // Boolean
+ TL( EFalse == bool_false );
+ //TL( MacroTestBool_1() == ETrue ); // Cannot compare to ETrue(1) ETrue is all other but not EFalse(0)
+ TL( MacroTestBool_1() );
+ TL( MacroTestBool_2() == EFalse );
+ TL( MacroTestBool_1() != EFalse );
+ TL( EFalse == MacroTestBool_2() );
+ TL( EFalse != MacroTestBool_1() );
+
+ // String
+ TL( _L( "a" ) == _L( "a" ) );
+ TL( _L( "a" ) != _L( "b" ) );
+ TL( KStifMacro_1() == KStifMacro_1() );
+ TL( KStifMacro_1() != _L( "abc123" ) );
+
+
+ //TL( KStifMacro_1() == MacroTestString_1() );
+ //TL( MacroTestString_1() == KStifMacro_1() );
+ TL( met_buf == MacroTestString_1() );
+ TL( MacroTestString_1() == met_buf );
+
+ TL( KStifMacro_1() == KStifMacro_1() );
+
+ TL( buf1 != buf2 );
+ buf2.Copy( _L( "Test 1" ) );
+ TL( buf1 == buf2 );
+
+
+// TAL ->
+ buf1.Copy( _L( "Test 1" ) );
+ buf2.Copy( _L( "Test 2" ) );
+
+ // Error codes
+ TAL( MacroTestInt_1() == KErrNone );
+ TAL( MacroTestInt_2() == KErrGeneral );
+
+ // Comparison
+ TAL( 8 >= 6 );
+ TAL( 6 <= 8 );
+ TAL( 6 == 6 );
+
+ // Boolean
+ TAL( EFalse == bool_false );
+ //TL( MacroTestBool_1() == ETrue ); // Cannot compare to ETrue(1) ETrue is all other but not EFalse(0)
+ TAL( MacroTestBool_1() );
+ TAL( MacroTestBool_2() == EFalse );
+ TAL( MacroTestBool_1() != EFalse );
+ TAL( EFalse == MacroTestBool_2() );
+ TAL( EFalse != MacroTestBool_1() );
+
+ // String
+ TAL( _L( "a" ) == _L( "a" ) );
+ TAL( _L( "a" ) != _L( "b" ) );
+ TAL( KStifMacro_1() == KStifMacro_1() );
+ TAL( KStifMacro_1() != _L( "abc123" ) );
+
+
+ //TL( KStifMacro_1() == MacroTestString_1() );
+ //TL( MacroTestString_1() == KStifMacro_1() );
+ TAL( met_buf == MacroTestString_1() );
+ TAL( MacroTestString_1() == met_buf );
+
+ TAL( KStifMacro_1() == KStifMacro_1() );
+
+ TAL( buf1 != buf2 );
+ buf2.Copy( _L( "Test 1" ) );
+ TAL( buf1 == buf2 );
+
+ break;
+ }
+ case KStifMacroTesting_INT:
+ {
+ T1L( MacroTestInt_1(), KErrNone );
+ T1L( MacroTestInt_2(), KErrGeneral );
+
+ T2L( MacroTestInt_1(), KErrNone, KErrNone );
+ T2L( MacroTestInt_1(), KErrNone, KErrNotFound );
+ T2L( MacroTestInt_1(), KErrNotFound, KErrNone );
+ T2L( MacroTestInt_2(), KErrGeneral, KErrGeneral );
+ T2L( MacroTestInt_2(), KErrGeneral, KErrAlreadyExists );
+ T2L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral );
+
+ T3L( MacroTestInt_1(), KErrNone, KErrNone, KErrNone );
+ T3L( MacroTestInt_1(), KErrNone, KErrNone, KErrNotFound );
+ T3L( MacroTestInt_1(), KErrNone, KErrNotFound, KErrNotFound );
+ T3L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNone );
+ T3L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNone );
+ T3L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNotFound );
+ T3L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrGeneral );
+ T3L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrAlreadyExists );
+ T3L( MacroTestInt_2(), KErrGeneral, KErrAlreadyExists, KErrAlreadyExists );
+ T3L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrGeneral );
+ T3L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrGeneral );
+ T3L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrAlreadyExists );
+
+ T4L( MacroTestInt_1(), KErrNone, KErrNone, KErrNone, KErrNone );
+ T4L( MacroTestInt_1(), KErrNone, KErrNone, KErrNone, KErrNotFound );
+ T4L( MacroTestInt_1(), KErrNone, KErrNone, KErrNotFound , KErrNotFound );
+ T4L( MacroTestInt_1(), KErrNone, KErrNotFound, KErrNotFound, KErrNotFound );
+ T4L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNone, KErrNone );
+ T4L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNone, KErrNone );
+ T4L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNotFound, KErrNone );
+ T4L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNone, KErrNotFound );
+ T4L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNone, KErrNotFound );
+ T4L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNotFound, KErrNotFound );
+ T4L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrGeneral, KErrGeneral );
+ T4L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrGeneral, KErrAlreadyExists );
+ T4L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrAlreadyExists, KErrAlreadyExists );
+ T4L( MacroTestInt_2(), KErrGeneral, KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists );
+ T4L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrGeneral, KErrGeneral );
+ T4L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrGeneral, KErrGeneral );
+ T4L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists, KErrGeneral );
+ T4L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrGeneral, KErrAlreadyExists );
+ T4L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrGeneral, KErrAlreadyExists );
+ T4L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrAlreadyExists, KErrAlreadyExists );
+
+ T5L( MacroTestInt_1(), KErrNone, KErrNone, KErrNone, KErrNone, KErrNone );
+ T5L( MacroTestInt_1(), KErrNone, KErrNone, KErrNone, KErrNone, KErrNotFound );
+ T5L( MacroTestInt_1(), KErrNone, KErrNone, KErrNone, KErrNotFound , KErrNotFound );
+ T5L( MacroTestInt_1(), KErrNone, KErrNone, KErrNotFound, KErrNotFound, KErrNotFound );
+ T5L( MacroTestInt_1(), KErrNone, KErrNotFound, KErrNotFound, KErrNotFound, KErrNotFound );
+ T5L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNone, KErrNone, KErrNone );
+ T5L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNone, KErrNone, KErrNone );
+ T5L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNotFound, KErrNone, KErrNone );
+ T5L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNotFound, KErrNotFound, KErrNone );
+ T5L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNone, KErrNone, KErrNotFound );
+ T5L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNone, KErrNone, KErrNotFound );
+ T5L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNotFound, KErrNone, KErrNotFound );
+ T5L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNone, KErrNotFound, KErrNotFound );
+ T5L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNotFound, KErrNotFound, KErrNotFound );
+ T5L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrGeneral, KErrGeneral, KErrGeneral );
+ T5L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrGeneral, KErrGeneral, KErrAlreadyExists );
+ T5L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrGeneral, KErrAlreadyExists, KErrAlreadyExists );
+ T5L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists );
+ T5L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrGeneral, KErrGeneral, KErrGeneral );
+ T5L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrGeneral, KErrGeneral, KErrGeneral );
+ T5L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists, KErrGeneral, KErrGeneral );
+ T5L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists, KErrGeneral );
+ T5L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrGeneral, KErrGeneral, KErrAlreadyExists );
+ T5L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrGeneral, KErrGeneral, KErrAlreadyExists );
+ T5L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists, KErrGeneral, KErrAlreadyExists );
+ T5L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrGeneral, KErrAlreadyExists, KErrAlreadyExists );
+ T5L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists );
+
+// TAL ->
+ TA1L( MacroTestInt_1(), KErrNone );
+ TA1L( MacroTestInt_2(), KErrGeneral );
+
+ TA2L( MacroTestInt_1(), KErrNone, KErrNone );
+ TA2L( MacroTestInt_1(), KErrNone, KErrNotFound );
+ TA2L( MacroTestInt_1(), KErrNotFound, KErrNone );
+ TA2L( MacroTestInt_2(), KErrGeneral, KErrGeneral );
+ TA2L( MacroTestInt_2(), KErrGeneral, KErrAlreadyExists );
+ TA2L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral );
+
+ TA3L( MacroTestInt_1(), KErrNone, KErrNone, KErrNone );
+ TA3L( MacroTestInt_1(), KErrNone, KErrNone, KErrNotFound );
+ TA3L( MacroTestInt_1(), KErrNone, KErrNotFound, KErrNotFound );
+ TA3L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNone );
+ TA3L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNone );
+ TA3L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNotFound );
+ TA3L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrGeneral );
+ TA3L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrAlreadyExists );
+ TA3L( MacroTestInt_2(), KErrGeneral, KErrAlreadyExists, KErrAlreadyExists );
+ TA3L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrGeneral );
+ TA3L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrGeneral );
+ TA3L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrAlreadyExists );
+
+ TA4L( MacroTestInt_1(), KErrNone, KErrNone, KErrNone, KErrNone );
+ TA4L( MacroTestInt_1(), KErrNone, KErrNone, KErrNone, KErrNotFound );
+ TA4L( MacroTestInt_1(), KErrNone, KErrNone, KErrNotFound , KErrNotFound );
+ TA4L( MacroTestInt_1(), KErrNone, KErrNotFound, KErrNotFound, KErrNotFound );
+ TA4L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNone, KErrNone );
+ TA4L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNone, KErrNone );
+ TA4L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNotFound, KErrNone );
+ TA4L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNone, KErrNotFound );
+ TA4L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNone, KErrNotFound );
+ TA4L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNotFound, KErrNotFound );
+ TA4L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrGeneral, KErrGeneral );
+ TA4L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrGeneral, KErrAlreadyExists );
+ TA4L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrAlreadyExists, KErrAlreadyExists );
+ TA4L( MacroTestInt_2(), KErrGeneral, KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists );
+ TA4L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrGeneral, KErrGeneral );
+ TA4L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrGeneral, KErrGeneral );
+ TA4L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists, KErrGeneral );
+ TA4L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrGeneral, KErrAlreadyExists );
+ TA4L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrGeneral, KErrAlreadyExists );
+ TA4L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrAlreadyExists, KErrAlreadyExists );
+
+ TA5L( MacroTestInt_1(), KErrNone, KErrNone, KErrNone, KErrNone, KErrNone );
+ TA5L( MacroTestInt_1(), KErrNone, KErrNone, KErrNone, KErrNone, KErrNotFound );
+ TA5L( MacroTestInt_1(), KErrNone, KErrNone, KErrNone, KErrNotFound , KErrNotFound );
+ TA5L( MacroTestInt_1(), KErrNone, KErrNone, KErrNotFound, KErrNotFound, KErrNotFound );
+ TA5L( MacroTestInt_1(), KErrNone, KErrNotFound, KErrNotFound, KErrNotFound, KErrNotFound );
+ TA5L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNone, KErrNone, KErrNone );
+ TA5L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNone, KErrNone, KErrNone );
+ TA5L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNotFound, KErrNone, KErrNone );
+ TA5L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNotFound, KErrNotFound, KErrNone );
+ TA5L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNone, KErrNone, KErrNotFound );
+ TA5L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNone, KErrNone, KErrNotFound );
+ TA5L( MacroTestInt_1(), KErrNotFound, KErrNotFound, KErrNotFound, KErrNone, KErrNotFound );
+ TA5L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNone, KErrNotFound, KErrNotFound );
+ TA5L( MacroTestInt_1(), KErrNotFound, KErrNone, KErrNotFound, KErrNotFound, KErrNotFound );
+ TA5L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrGeneral, KErrGeneral, KErrGeneral );
+ TA5L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrGeneral, KErrGeneral, KErrAlreadyExists );
+ TA5L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrGeneral, KErrAlreadyExists, KErrAlreadyExists );
+ TA5L( MacroTestInt_2(), KErrGeneral, KErrGeneral, KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists );
+ TA5L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrGeneral, KErrGeneral, KErrGeneral );
+ TA5L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrGeneral, KErrGeneral, KErrGeneral );
+ TA5L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists, KErrGeneral, KErrGeneral );
+ TA5L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists, KErrGeneral );
+ TA5L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrGeneral, KErrGeneral, KErrAlreadyExists );
+ TA5L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrGeneral, KErrGeneral, KErrAlreadyExists );
+ TA5L( MacroTestInt_2(), KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists, KErrGeneral, KErrAlreadyExists );
+ TA5L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrGeneral, KErrAlreadyExists, KErrAlreadyExists );
+ TA5L( MacroTestInt_2(), KErrAlreadyExists, KErrGeneral, KErrAlreadyExists, KErrAlreadyExists, KErrAlreadyExists );
+
+ break;
+ }
+ case KStifMacroTesting_TL_fail_1:
+ {
+ TL( MacroTestInt_1() == KErrNone ); // Pass
+ TL( MacroTestInt_2() == KErrNone ); // Fail(Leave)
+ break;
+ }
+ case KStifMacroTesting_T1L_fail_1:
+ {
+ T1L( MacroTestInt_1(), KErrNone ); // Pass
+ T1L( MacroTestInt_1(), KErrNotFound ); // Fail(Leave)
+ break;
+ }
+ case KStifMacroTesting_T2L_fail_1:
+ {
+ T2L( MacroTestInt_1(), KErrNone, KErrNotFound ); // Pass
+ T2L( MacroTestInt_1(), KErrNotFound, KErrNotFound ); // Fail(Leave)
+ break;
+ }
+ case KStifMacroTesting_T3L_fail_1:
+ {
+ T3L( MacroTestInt_1(), KErrNone, KErrNotFound, KErrTotalLossOfPrecision ); // Pass
+ T3L( MacroTestInt_1(), KErrNotFound, KErrDied, KErrTotalLossOfPrecision ); // Fail(Leave)
+ break;
+ }
+ case KStifMacroTesting_T3L_fail_2:
+ {
+ T3L( MacroTestInt_2(), KErrGeneral, KErrNotFound, KErrTotalLossOfPrecision ); // Pass
+ T3L( MacroTestInt_2(), KErrNotFound, KErrDied, KErrTotalLossOfPrecision ); // Fail(Leave)
+ break;
+ }
+ case KStifMacroTesting_T4L_fail_1:
+ {
+ T4L( MacroTestInt_1(), KErrNone, KErrNotFound, KErrTotalLossOfPrecision, KErrDisMounted ); // Pass
+ T4L( MacroTestInt_1(), KErrNotFound, KErrDied, KErrTotalLossOfPrecision, KErrDisMounted ); // Fail(Leave)
+ break;
+ }
+ case KStifMacroTesting_T4L_fail_2:
+ {
+ T4L( MacroTestInt_2(), KErrGeneral, KErrNotFound, KErrTotalLossOfPrecision, KErrDisMounted ); // Pass
+ T4L( MacroTestInt_2(), KErrNotFound, KErrDied, KErrTotalLossOfPrecision, KErrDisMounted ); // Fail(Leave)
+ break;
+ }
+ case KStifMacroTesting_T5L_fail_1:
+ {
+ T5L( MacroTestInt_1(), KErrNone, KErrNotFound, KErrTotalLossOfPrecision, KErrDisMounted, KErrCommsLineFail ); // Pass
+ T5L( MacroTestInt_1(), KErrNotFound, KErrDied, KErrTotalLossOfPrecision, KErrDisMounted, KErrCommsLineFail ); // Fail(Leave)
+ break;
+ }
+ case KStifMacroTesting_T5L_fail_2:
+ {
+ T5L( MacroTestInt_2(), KErrGeneral, KErrNotFound, KErrTotalLossOfPrecision, KErrDisMounted, KErrCommsLineFail ); // Pass
+ T5L( MacroTestInt_2(), KErrNotFound, KErrDied, KErrTotalLossOfPrecision, KErrDisMounted, KErrCommsLineFail ); // Fail(Leave)
+ break;
+ }
+ case KCaseVerifyThatTestCasePassesAfterMacro1:
+ {
+ aResult.SetResult( KErrNone, _L( "Test case passed after macros") );
+ break;
+ }
+ case KCaseVerifyThatTestCasePassesAfterMacro2:
+ {
+ aResult.SetResult( KErrNone, _L( "Test case passed after macros") );
+ break;
+ }
+ case KCaseVerifyThatTestCasePassesAfterMacro3:
+ {
+ aResult.SetResult( KErrNone, _L( "Test case passed after macros") );
+ break;
+ }
+ case KCaseVerifyThatTestCasePassesAfterMacro4:
+ {
+ aResult.SetResult( KErrNone, _L( "Test case passed after macros") );
+ break;
+ }
+ case KCaseVerifyThatTestCasePassesAfterMacro5:
+ {
+ aResult.SetResult( KErrNone, _L( "Test case passed after macros") );
+ break;
+ }
+ case KCaseVerifyThatTestCasePassesAfterMacro6:
+ {
+ aResult.SetResult( KErrNone, _L( "Test case passed after macros") );
+ break;
+ }
+ case KCaseVerifyThatTestCasePassesAfterMacro7:
+ {
+ aResult.SetResult( KErrNone, _L( "Test case passed after macros") );
+ break;
+ }
+ case KCaseVerifyThatTestCasePassesAfterMacro8:
+ {
+ aResult.SetResult( KErrNone, _L( "Test case passed after macros") );
+ break;
+ }
+ case KCaseVerifyThatTestCasePassesAfterMacro9:
+ {
+ aResult.SetResult( KErrNone, _L( "Test case passed after macros") );
+ break;
+ }
+ case KTestSetExitReasonWithKillingTestThread:
+ {
+ // Test case kills current thread, but we're expecting it to happen
+ // with SetExitReason, so test case should go to passed category
+
+ TestModuleIf().SetExitReason( CTestModuleIf::EException, -222 );
+
+ RThread myself;
+ myself.Kill(-222);
+
+ //Thread can also be killed calling User::Exit(-222);
+ // Should have already killed test thread and never come here..
+
+ // Sets test case result and description
+ aResult.SetResult( KErrGeneral, _L("KillThreadTest failed - didn't panic!!!") );
+
+ // Test case execution failed!!!
+ execStatus = KErrGeneral;
+ break;
+ }
+ case KSleepOneMinute: // This is changed to 30s
+ {
+ TTime time;
+ time.HomeTime();
+
+ TTimeIntervalSeconds timeToAdd = 30;
+
+ time += timeToAdd;
+ User::At(time);
+
+ aResult.SetResult( KErrNone, _L("Sleep one minute passed!") );
+ break;
+ }
+ case KFailAlways:
+ {
+ User::After(2000000);
+
+ aResult.SetResult( -222, _L("FailsAlways failed") );
+ break;
+ }
+
+ case KStifMacroTesting_General_1:
+ {
+ T5L( MacroTestInt_General( -222 ), KErrNone, KErrNotFound, KErrTotalLossOfPrecision, KErrDisMounted, KErrCommsLineFail ); // fail
+ break;
+ }
+ case KStifTAL_TA5LMacrosWithAllowresults:
+ {
+ TestModuleIf().SetAllowResult( KErrNone );
+ TestModuleIf().SetAllowResult( -222 );
+ TA5L( MacroTestInt_General( -222 ), KErrNone, KErrNotFound, KErrTotalLossOfPrecision, KErrDisMounted, KErrCommsLineFail ); // fail
+ TestModuleIf().ResetAllowResult();
+ aResult.SetResult( -KErrNone, _L("KStifTAL_TA5LMacrosWithAllowresults") );
+ break;
+ }
+
+ case KTestModuleCaseNonExisting:
+ User::After( 1000000 );
+ // Fall
+
+ default:
+ TestModuleIf().Printf( 0, KDesc,
+ _L("Case number %i, default behaviour"), aCaseNumber);
+ User::After( 10000000 );
+ execStatus = KErrNotFound;
+ aResult.iResult = KErrNotFound;
+ break;
+ }
+
+ return execStatus;
+ }
+
+/*
+-------------------------------------------------------------------------------
+
+ Class: CTestModuleTest
+
+ Method: ThreadStatus
+
+ Description: Print thread status
+
+ Parameters: None
+
+ Return Values: None
+
+ Errors/Exceptions: <description how errors and exceptions are handled>
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+void CTestModuleTest::ThreadStatus()
+ {
+ RThread rt;
+// TTimeIntervalMicroSeconds cpuTime;
+// TInt heap, stack;
+ TThreadId id = rt.Id();
+
+// TProcessMemoryInfo info;
+// RProcess().GetMemoryInfo( info );
+TestModuleIf().Printf( 0, _L("CTestModuleTest::RunTestCase"),
+ _L("Thread: %i"),
+ id );
+ }
+
+/*
+-------------------------------------------------------------------------------
+
+ Class: CTestModuleTest
+
+ Method:
+
+ Description:
+
+ Parameters:
+
+ Return Values:
+
+ Errors/Exceptions:
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+TInt CTestModuleTest::MacroTestInt_1()
+ {
+ TInt ret( KErrNone );
+ return ret;
+
+ }
+
+/*
+-------------------------------------------------------------------------------
+
+ Class: CTestModuleTest
+
+ Method:
+
+ Description:
+
+ Parameters:
+
+ Return Values:
+
+ Errors/Exceptions:
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+TInt CTestModuleTest::MacroTestInt_2()
+ {
+ TInt ret( KErrGeneral );
+ return ret;
+ }
+
+/*
+-------------------------------------------------------------------------------
+
+ Class: CTestModuleTest
+
+ Method:
+
+ Description:
+
+ Parameters:
+
+ Return Values:
+
+ Errors/Exceptions:
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+TInt CTestModuleTest::MacroTestInt_General( TInt aReturn )
+ {
+ // This rdebug added to be sure that TL macro will called only once this
+ // method per check.
+ RDebug::Print( _L( "######## --- MacroTestInt_General with code[%d]" ), aReturn );
+
+ return aReturn;
+
+ }
+
+/*
+-------------------------------------------------------------------------------
+
+ Class: CTestModuleTest
+
+ Method:
+
+ Description:
+
+ Parameters:
+
+ Return Values:
+
+ Errors/Exceptions:
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+TBuf<50> CTestModuleTest::MacroTestString_1()
+ {
+ TBuf<50> buf;
+ buf.Copy( _L( "macro testing" ) );
+ return buf;
+
+ }
+
+/*
+-------------------------------------------------------------------------------
+
+ Class: CTestModuleTest
+
+ Method:
+
+ Description:
+
+ Parameters:
+
+ Return Values:
+
+ Errors/Exceptions:
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+TBool CTestModuleTest::MacroTestBool_1()
+ {
+ TBool bool_true(ETrue);
+ return bool_true;
+
+ }
+
+/*
+-------------------------------------------------------------------------------
+
+ Class: CTestModuleTest
+
+ Method:
+
+ Description:
+
+ Parameters:
+
+ Return Values:
+
+ Errors/Exceptions:
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+TBool CTestModuleTest::MacroTestBool_2()
+ {
+ TBool bool_false(EFalse);
+ return bool_false;
+
+ }
+
+/*
+-------------------------------------------------------------------------------
+
+ Class: CTestModuleTest
+
+ Method: TALMacrosWithAllowresults
+
+ Description:
+
+ Parameters:
+
+ Return Values:
+
+ Errors/Exceptions:
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+TInt TALMacrosWithAllowresults()
+ {
+ return KErrNone;
+
+ }
+
+// ================= OTHER EXPORTED FUNCTIONS =================================
+
+/*
+-------------------------------------------------------------------------------
+
+ Function: LibEntryL
+
+ Description: Polymorphic Dll Entry Point
+
+ <in a MARM implementation, the entry point is
+ called when a thread is attached to or detached from the DLL>
+
+ Parameters: <arg1>: <in/out/inout>: <accepted values>: <description>
+
+ Return Values: <value_1: Description
+ value_n: Description line 1
+ description line 2>
+
+ Errors/Exceptions: <description how errors and exceptions are handled>
+
+ Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+
+EXPORT_C CTestModuleTest* LibEntryL()
+ {
+ return CTestModuleTest::NewL();
+ }
+
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/stflog1.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Document : stflog2.xml.xml
+ Created on : 26. toukokuuta 2009, 13:24
+ Author : juvestma
+ Description:
+ Purpose of the document follows.
+-->
+
+<stflog
+xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns='http://xml.netbeans.org/schema/sftlog'
+ xsi:schemaLocation='http://xml.netbeans.org/schema/sftlog sftlog.xsd'
+ >
+ <testmodule name="default">
+ <testdata file="testdata.dat" />
+ <unittest>
+
+ <testdll name="epoc32/release/winscw/udeb/alltests.dll">
+ <build>2003-04-01T13:01:02</build>
+ <started>2003-04-01T13:01:02</started>
+
+ <testsuite name="AllTests" description="The developer written description of the test case" testcount="1">
+ <build>2003-04-01T13:01:02</build>
+ <started>2003-04-01T13:01:02</started>
+ <declaration>
+ <location file="toplevelsuite.h" line="11" column="8" />
+ </declaration>
+ <definition>
+ <location file="toplevelsuite.cpp" line="14" column="8" />
+ </definition>
+
+
+ <test name="TestFirstMethod" description="The developer written description of the test case">
+ <started>2003-04-01T13:01:02</started>
+ <declaration>
+ <location file="toplevelsuite.h" line="27" column="16" />
+ </declaration>
+ <definition>
+ <location file="toplevelsuite.cpp" line="46" column="16" />
+ </definition>
+
+ <assert type="STF_ASSERT_EQUALS" message="result is not 42" status="pass" >
+ <location file="toplevelsuite.cpp" line="49" column="16" />
+ </assert>
+
+ <log level="info">This is printed by STF_PRINT macro</log>
+
+ <assert type="STF_ASSERT_EQUALS" message="result is not 13" status="fail" >
+ <location file="toplevelsuite.cpp" line="50" column="16" />
+ </assert>
+
+ <assert type="STF_ASSERT_EQUALS" message="result is not 13" status="fail" >
+ <location file="toplevelsuite.cpp" line="50" column="16" />
+ </assert>
+
+
+ <status type="fail" />
+
+ <finished>2003-04-01T13:01:04</finished>
+
+ </test>
+
+
+
+ <finished>2003-04-01T13:01:12</finished>
+
+
+
+
+ </testsuite>
+ </testdll>
+
+ </unittest>
+ </testmodule>
+</stflog>
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/resource/stflog2.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?> <stflog xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns='http://xml.netbeans.org/schema/sftlog'
+ xsi:schemaLocation='http://xml.netbeans.org/schema/sftlog sftlog.xsd'
+ >
+ <testmodule>
+ <unittest>
+ <testdll name="demounittestcases.dll">
+ <testsuite name="default">
+ <test name="FirstTest">
+ <status type="pass" />
+ </test>
+ <test name="SecondTest">
+ <status type="pass" />
+ </test>
+ <test name="ThirdTest">
+ <status type="crash" />
+ </test>
+ <test name="FourthTest">
+ <status type="fail" />
+ </test>
+ <test name="FifthTest">
+ <status type="pass" />
+ </test>
+ </testsuite>
+ </testdll>
+ </unittest>
+ </testmodule>
+</stflog>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/src/com/nokia/testfw/launch/AllJUnitPlugInTests.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.launch;
+
+import com.nokia.testfw.launch.processor.SUTProcessorTest;
+import com.nokia.testfw.launch.processor.STFProcessorTest;
+import com.nokia.testfw.launch.ui.STFEmulationConfigTagGroupTest;
+import com.nokia.testfw.launch.ui.SUTEmulationConfigTagGroupTest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllJUnitPlugInTests extends TestSuite {
+ public static Test suite() {
+ TestSuite suite = new TestSuite(
+ "com.nokia.testfw.launch.junitplugin");
+ suite.addTestSuite(SUTProcessorTest.class);
+ suite.addTestSuite(SUTEmulationConfigTagGroupTest.class);
+ suite.addTestSuite(SUTEmulationLaunchTest.class);
+ suite.addTestSuite(STFProcessorTest.class);
+ suite.addTestSuite(STFEmulationConfigTagGroupTest.class);
+ suite.addTestSuite(STFEmulationLaunchTest.class);
+ return suite;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/src/com/nokia/testfw/launch/AllPureJUnitTests.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.launch;
+
+import com.nokia.testfw.launch.monitor.TailFileInputStreamTest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class AllPureJUnitTests extends TestSuite {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("com.nokia.testfw.launch.junit");
+ suite.addTestSuite(TailFileInputStreamTest.class);
+ return suite;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/src/com/nokia/testfw/launch/STFEmulationLaunchTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,104 @@
+package com.nokia.testfw.launch;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.nokia.testfw.test.utils.ProjectUtils;
+import com.nokia.testfw.test.utils.TestUtils;
+
+@SuppressWarnings("restriction")
+public class STFEmulationLaunchTest extends TestCase {
+
+ IProject targetProject;
+ ILaunchConfigurationWorkingCopy iLaunchConfigurationWorkingCopy;
+
+ @Before
+ public void setUp() throws Exception {
+ targetProject = ProjectUtils.getTargetProject("TestModule");
+ if (targetProject == null) {
+ String projectPath = (new File("resource/TestModule"))
+ .getCanonicalPath();
+ String bldInfPath = "group/bld.inf";
+ targetProject = ProjectUtils.createTargetProject("TestModule",
+ projectPath, bldInfPath);
+ }
+ ProjectUtils.selectProject(targetProject);
+ ILaunchManager lLaunchManager = DebugPlugin.getDefault()
+ .getLaunchManager();
+ ILaunchConfigurationType type = lLaunchManager
+ .getLaunchConfigurationType("com.nokia.testfw.launch.STFEmulationLaunch");
+ iLaunchConfigurationWorkingCopy = type.newInstance(null,
+ "STFEmulationLaunchTest");
+ }
+
+ @Test
+ public void testSUTEmulationLaunch() {
+ Shell shell = Display.getDefault().getShells()[0];
+ String groupIdentifier = "org.eclipse.debug.ui.launchGroup.run";
+
+ org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension ext = DebugUIPlugin
+ .getDefault().getLaunchConfigurationManager().getLaunchGroup(
+ groupIdentifier);
+ TestUtils.delay(1000);
+ if (ext != null) {
+ try {
+ ILaunchConfigurationTabGroup tabGroup = LaunchConfigurationPresentationManager
+ .getDefault().getTabGroup(
+ iLaunchConfigurationWorkingCopy,
+ ILaunchManager.RUN_MODE);
+ LaunchConfigurationsDialog dialog = new LaunchConfigurationsDialog(
+ shell, ext);
+ dialog.setInitialSelection(new StructuredSelection(
+ iLaunchConfigurationWorkingCopy.getType()));
+ dialog.setInitialStatus(null);
+ dialog.setOpenMode(3);
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+
+ tabGroup.createTabs(dialog, dialog.getMode());
+ ILaunchConfigurationTab tabs[] = tabGroup.getTabs();
+ for (int i = 0; i < tabs.length; i++)
+ tabs[i].setLaunchConfigurationDialog(dialog);
+
+ tabGroup.setDefaults(iLaunchConfigurationWorkingCopy);
+ iLaunchConfigurationWorkingCopy.doSave();
+ tabGroup.dispose();
+ TestUtils.delay(1000);
+ try {
+ dialog.getTabGroup().performApply(
+ iLaunchConfigurationWorkingCopy);
+ String script = iLaunchConfigurationWorkingCopy
+ .getAttribute(LaunchConfigurationConstants.SCRIPT_DEVICE_PATH,
+ (String) null);
+ assertNotNull(script);
+ assertEquals(script, "c:\\TestFramework\\TestModuleTests.cfg");
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ dialog.close();
+ TestUtils.delay(1000);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/src/com/nokia/testfw/launch/SUTEmulationLaunchTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,104 @@
+package com.nokia.testfw.launch;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.nokia.testfw.test.utils.ProjectUtils;
+import com.nokia.testfw.test.utils.TestUtils;
+
+@SuppressWarnings("restriction")
+public class SUTEmulationLaunchTest extends TestCase {
+
+ IProject targetProject;
+ ILaunchConfigurationWorkingCopy iLaunchConfigurationWorkingCopy;
+
+ @Before
+ public void setUp() throws Exception {
+ targetProject = ProjectUtils.getTargetProject("testRacecar");
+ if (targetProject == null) {
+ String projectPath = (new File("resource/Racecar"))
+ .getCanonicalPath();
+ String bldInfPath = "tsrc/group/bld.inf";
+ targetProject = ProjectUtils.createTargetProject("testRacecar",
+ projectPath, bldInfPath);
+ }
+ ProjectUtils.selectProject(targetProject);
+ ILaunchManager lLaunchManager = DebugPlugin.getDefault()
+ .getLaunchManager();
+ ILaunchConfigurationType type = lLaunchManager
+ .getLaunchConfigurationType("com.nokia.testfw.launch.SUTEmulationLaunch");
+ iLaunchConfigurationWorkingCopy = type.newInstance(null,
+ "SUTEmulationLaunchTest");
+ }
+
+ @Test
+ public void testSUTEmulationLaunch() {
+ Shell shell = Display.getDefault().getShells()[0];
+ String groupIdentifier = "org.eclipse.debug.ui.launchGroup.run";
+
+ org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension ext = DebugUIPlugin
+ .getDefault().getLaunchConfigurationManager().getLaunchGroup(
+ groupIdentifier);
+ TestUtils.delay(1000);
+ if (ext != null) {
+ try {
+ ILaunchConfigurationTabGroup tabGroup = LaunchConfigurationPresentationManager
+ .getDefault().getTabGroup(
+ iLaunchConfigurationWorkingCopy,
+ ILaunchManager.RUN_MODE);
+ LaunchConfigurationsDialog dialog = new LaunchConfigurationsDialog(
+ shell, ext);
+ dialog.setInitialSelection(new StructuredSelection(
+ iLaunchConfigurationWorkingCopy.getType()));
+ dialog.setInitialStatus(null);
+ dialog.setOpenMode(3);
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+
+ tabGroup.createTabs(dialog, dialog.getMode());
+ ILaunchConfigurationTab tabs[] = tabGroup.getTabs();
+ for (int i = 0; i < tabs.length; i++)
+ tabs[i].setLaunchConfigurationDialog(dialog);
+
+ tabGroup.setDefaults(iLaunchConfigurationWorkingCopy);
+ iLaunchConfigurationWorkingCopy.doSave();
+ tabGroup.dispose();
+ TestUtils.delay(1000);
+ try {
+ dialog.getTabGroup().performApply(
+ iLaunchConfigurationWorkingCopy);
+ String dll = iLaunchConfigurationWorkingCopy
+ .getAttribute(LaunchConfigurationConstants.DLLNAME,
+ (String) null);
+ assertNotNull(dll);
+ assertEquals(dll, "ut_racecar.dll");
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ dialog.close();
+ TestUtils.delay(1000);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/src/com/nokia/testfw/launch/monitor/LogFileWriter.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.launch.monitor;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author xiaoma
+ * This is a test class used to continue write content to a file
+ */
+public class LogFileWriter implements Runnable {
+
+ PrintWriter out;
+ int times;
+ public LogFileWriter(String file, int times) throws IOException {
+
+ out = new PrintWriter(new BufferedWriter(
+ new FileWriter(file, false)));
+ this.times = times;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+
+ out.println("oldtest");
+ out.flush();
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+
+ int time = 0;
+ System.err.println("write start to file");
+ while (time < times) {
+ try {
+ time++;
+ System.err.println("write to log");
+ out.println("test" + time);
+ out.flush();
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+ System.err.println("write log finished");
+ out.close();
+ out = null;
+
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/src/com/nokia/testfw/launch/monitor/LogXmlHandlerTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.launch.monitor;
+
+import java.io.InputStream;
+import java.util.Iterator;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.helpers.DefaultHandler;
+
+import com.nokia.testfw.core.model.result.TestResult;
+import com.nokia.testfw.core.model.result.TestRunResult;
+import com.nokia.testfw.core.model.result.TestSuiteResult;
+import com.nokia.testfw.core.model.result.TestResult.TestStatus;
+
+import junit.framework.TestCase;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class LogXmlHandlerTest extends TestCase {
+
+ static final String TEST_LOG_FILE = "/resource/stflog1.xml";
+ static final String TEST_LOG_FILE2 = "/resource/stflog2.xml";
+ InputStream is = null;
+ TestRunResult result;
+
+ protected void setUp() throws Exception {
+ result = new TestRunResult();
+
+ DefaultHandler handler = new LogXmlHandler(result);
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ try {
+ SAXParser parser = factory.newSAXParser();
+ is = this.getClass().getClassLoader().getResourceAsStream(
+ TEST_LOG_FILE);
+ parser.parse(is, handler);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ protected void tearDown() throws Exception {
+ is.close();
+ result = null;
+ }
+
+ public void testParse() {
+ TestResult[] results = result.getResults();
+ assertTrue(results[0] instanceof TestSuiteResult);
+ TestSuiteResult suiteResult = (TestSuiteResult) results[0];
+ assertEquals(suiteResult.getName(), "AllTests");
+
+ TestResult caseResult = suiteResult.getChildren().iterator().next();
+ assertEquals(caseResult.getName(), "TestFirstMethod");
+
+ statusTest(caseResult);
+ locationTest(caseResult, suiteResult);
+ startEndTimeTest(caseResult, suiteResult);
+ }
+
+ public void statusTest(TestResult caseResult) {
+ assertEquals(caseResult.getStatus(), TestStatus.FAILURE);
+ assertEquals(result.getfailedTestCount(), 1);
+ }
+
+ public void locationTest(TestResult caseResult, TestSuiteResult suiteResult) {
+ assertEquals(caseResult.getFile(), "toplevelsuite.cpp");
+ assertEquals(caseResult.getLine(), 46);
+ assertEquals(caseResult.getColumn(), 16);
+
+ assertEquals(suiteResult.getFile(), "toplevelsuite.cpp");
+ assertEquals(suiteResult.getLine(), 14);
+ assertEquals(suiteResult.getColumn(), 8);
+ }
+
+ public void startEndTimeTest(TestResult caseResult,
+ TestSuiteResult suiteResult) {
+ assertEquals(caseResult.getTime(), 2.0);
+ assertEquals(suiteResult.getTime(), 2.0);
+ }
+
+ public void testPartialLog() {
+
+ TestRunResult result2 = new TestRunResult();
+ DefaultHandler handler = new LogXmlHandler(result2);
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ try {
+ SAXParser parser = factory.newSAXParser();
+ is = this.getClass().getClassLoader().getResourceAsStream(
+ TEST_LOG_FILE2);
+ parser.parse(is, handler);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ TestResult[] results = result2.getResults();
+ assertTrue(results[0] instanceof TestSuiteResult);
+ TestSuiteResult suiteResult = (TestSuiteResult) results[0];
+ assertEquals(suiteResult.getName(), "default");
+
+ Iterator<TestResult> iter = suiteResult.getChildren().iterator();
+ assertEquals(((TestResult) iter.next()).getName(), "FirstTest");
+ assertEquals(((TestResult) iter.next()).getName(), "SecondTest");
+ assertEquals(((TestResult) iter.next()).getName(), "ThirdTest");
+ assertEquals(((TestResult) iter.next()).getName(), "FourthTest");
+ assertEquals(((TestResult) iter.next()).getName(), "FifthTest");
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/src/com/nokia/testfw/launch/monitor/TailFileInputStreamTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.launch.monitor;
+
+import junit.framework.TestCase;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class TailFileInputStreamTest extends TestCase {
+
+ private static final String TESTFILE = "tailstream.test";
+
+ // private File testFile;
+
+ // during setup, we will start a thread to write to disk file
+ protected void setUp() throws Exception {
+ // testFile = new File(TESTFILE);
+ LogFileWriter logWriter;
+ // write log every second in separate thread, last for 10 seconds
+ logWriter = new LogFileWriter(TESTFILE, 10);
+ Thread writerThread = new Thread(logWriter);
+ writerThread.start();
+ }
+
+ protected void tearDown() throws Exception {
+ // testFile.delete();
+ }
+
+ public void testTailFile() {
+ // use tail stream to read the file while other app is writing.
+ TailFileInputStream tis;
+ boolean finished = false;
+ StringBuffer sb = new StringBuffer();
+ try {
+ tis = new TailFileInputStream(TESTFILE);
+ byte[] bytes = new byte[10];
+ System.out.println("begin to read log file");
+ while (!finished) {
+ if (tis.available() > 0) {
+ int count = 0;
+ while ((count = tis.read(bytes)) != -1) {
+ String line = new String(bytes, 0, count).trim();
+ System.out.println("read log :" + line);
+ sb.append(line);
+ if (line.equalsIgnoreCase("test10")) {
+ finished = true;
+ break;
+ }
+ }
+ Thread.sleep(100);
+ }
+ }
+ tis.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail(e.toString());
+ }
+
+ String content = sb.toString();
+ System.out.println("log file content:" + content);
+ assertTrue(content.indexOf("oldtest") < 0);
+ assertTrue(content.indexOf("test4") > 0);
+ assertTrue(content.indexOf("test9") > 0);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/src/com/nokia/testfw/launch/processor/STFProcessorTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,183 @@
+package com.nokia.testfw.launch.processor;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.nokia.cdt.debug.cw.symbian.SettingsData;
+import com.nokia.testfw.core.model.result.TestCaseResult;
+import com.nokia.testfw.core.model.result.TestResultListener;
+import com.nokia.testfw.core.model.result.TestRunResult;
+import com.nokia.testfw.core.model.result.TestResult.TestStatus;
+import com.nokia.testfw.launch.LaunchConfigurationConstants;
+import com.nokia.testfw.test.utils.ProjectUtils;
+
+@SuppressWarnings("restriction")
+public class STFProcessorTest extends TestCase {
+
+ ILaunchConfigurationWorkingCopy iLaunchConfigurationWorkingCopy;
+ boolean isStarted = false;
+ boolean isFinished = false;
+ boolean isAddTestCase = false;
+ boolean isTestCaseStateChange = false;
+ IProject targetProject;
+
+ @Before
+ public void setUp() throws Exception {
+ targetProject = ProjectUtils.getTargetProject("TestModule");
+ if (targetProject == null) {
+ String projectPath = (new File("resource/TestModule"))
+ .getCanonicalPath();
+ String bldInfPath = "group/bld.inf";
+ targetProject = ProjectUtils.createTargetProject("TestModule",
+ projectPath, bldInfPath);
+ }
+ ProjectUtils.selectProject(targetProject);
+
+ ILaunchManager lLaunchManager = DebugPlugin.getDefault()
+ .getLaunchManager();
+ ILaunchConfigurationType type = lLaunchManager
+ .getLaunchConfigurationType("com.nokia.testfw.launch.STFEmulationLaunch");
+ iLaunchConfigurationWorkingCopy = type.newInstance(null,
+ "STFProcessorTest");
+
+ SettingsData
+ .setDefaults(
+ iLaunchConfigurationWorkingCopy,
+ "com.nokia.cdt.debug.cw.symbian.SettingsData.LaunchConfig_Emulator",
+ targetProject);
+ iLaunchConfigurationWorkingCopy.setAttribute(
+ "org.eclipse.cdt.launch.PROGRAM_ARGUMENTS",
+ "-m TestScripter -s C:\\TestFramework\\TestModuleTests.cfg");
+ String host_path = ResourcesPlugin.getWorkspace().getRoot()
+ .getLocation().append("TestModule\\group\\TestModuleTests.cfg")
+ .toString();
+ iLaunchConfigurationWorkingCopy.setAttribute(
+ LaunchConfigurationConstants.SCRIPT_HOST_PATH, host_path);
+ }
+
+ @Test
+ public void testProcess() {
+
+ TestRunResult lTestRunResult = new TestRunResult();
+ lTestRunResult.addResultListener(new TestResultListener() {
+
+ public void addTestCase(TestCaseResult result) {
+ isAddTestCase = true;
+ }
+
+ public void testCaseStateChange(TestCaseResult result,
+ TestStatus status) {
+ isTestCaseStateChange = true;
+ }
+
+ public void testFinished() {
+ isFinished = true;
+ }
+
+ public void testStarted() {
+ isStarted = true;
+ }
+ });
+ String info = "19.Jan.2010 09:01:29.596....############################################################\n"
+ + "19.Jan.2010 09:01:29.606....CTestEngine::AddTestModuleL, Adding Module:[testscripter]\n"
+ + "19.Jan.2010 09:01:29.606....NOTE: Test module is TestScripter and each test case(config) file(s) will have own server(s)\n"
+ + "19.Jan.2010 09:01:29.606....CTestEngine::AddTestModuleL, module added correctly\n"
+ + "19.Jan.2010 09:01:29.606....Adding config file [c:\testframework\testmoduletests.cfg] to [testscripter] module\n"
+ + "19.Jan.2010 09:01:29.606....CTestScripterController::AddConfigFileL aConfigFile=[c:\testframework\testmoduletests.cfg]\n"
+ + "19.Jan.2010 09:01:29.606....Creating CTestModuleController [testscripter_testmoduletests]\n"
+ + "19.Jan.2010 09:01:29.611....Initialising test module [testscripter_testmoduletests] with initialization file []\n"
+ + "19.Jan.2010 09:01:29.656....Initialising test module [testscripter_testmoduletests] with initialization file [] done\n"
+ + "19.Jan.2010 09:01:29.656....CTestModuleController::AddConfigFileL [testscripter_testmoduletests] aConfigFile=[c:\testframework\testmoduletests.cfg]\n"
+ + "19.Jan.2010 09:01:29.718....CTestEngine::EnumerateTestCasesL\n"
+ + "19.Jan.2010 09:01:29.718....Getting testcases from module [testscripter_testmoduletests], test case file[c:\testframework\testmoduletests.cfg]\n"
+ + "19.Jan.2010 09:01:29.801....RunL()'s GetTestCases method returns: 0\n"
+ + "19.Jan.2010 09:01:29.801....Test case enumeration completed, testcase count 11\n"
+ + "19.Jan.2010 09:01:29.801....Module controllers handling mode: normal\n"
+ + "19.Jan.2010 09:01:29.801....Find test module controller for [testscripter_testmoduletests]\n"
+ + "19.Jan.2010 09:01:29.801....Found test module controller for [testscripter_testmoduletests]\n"
+ + "19.Jan.2010 09:01:29.806.... Starting testcase [Passing case]\n"
+ + "19.Jan.2010 09:01:30.140.... TestCase [Passing case] finished with verdict[-2]\n"
+ + "19.Jan.2010 09:01:31.958....Module controllers handling mode: normal\n"
+ + "19.Jan.2010 09:01:31.958....Find test module controller for [testscripter_testmoduletests]\n"
+ + "19.Jan.2010 09:01:31.958....Found test module controller for [testscripter_testmoduletests]\n"
+ + "19.Jan.2010 09:01:31.958.... Starting testcase [Printing with too long text]\n"
+ + "19.Jan.2010 09:01:32.296.... TestCase [Printing with too long text] finished with verdict[-2]\n"
+ + "19.Jan.2010 09:01:32.301....Module controllers handling mode: normal\n"
+ + "19.Jan.2010 09:01:32.301....Find test module controller for [testscripter_testmoduletests]\n"
+ + "19.Jan.2010 09:01:32.301....Found test module controller for [testscripter_testmoduletests]\n"
+ + "19.Jan.2010 09:01:32.301.... Starting testcase [Printing with too long desc&text]\n"
+ + "19.Jan.2010 09:01:32.625.... TestCase [Printing with too long desc&text] finished with verdict[-2]\n"
+ + "19.Jan.2010 09:01:33.301....Module controllers handling mode: normal\n"
+ + "19.Jan.2010 09:01:33.301....Find test module controller for [testscripter_testmoduletests]\n"
+ + "19.Jan.2010 09:01:33.301....Found test module controller for [testscripter_testmoduletests]\n"
+ + "19.Jan.2010 09:01:33.301.... Starting testcase [Printing with empty desc twice]\n"
+ + "19.Jan.2010 09:01:33.640.... TestCase [Printing with empty desc twice] finished with verdict[-2]\n"
+ + "19.Jan.2010 09:01:33.645....CTestEngine::RemoveTestModuleL\n"
+ + "19.Jan.2010 09:01:33.645....Going to remove module controller [testscripter]\n"
+ + "19.Jan.2010 09:01:33.645....Removing module controller [testscripter]\n"
+ + "19.Jan.2010 09:01:33.650....CTestEngine::CloseTestEngineL\n"
+ + "19.Jan.2010 09:01:33.660....CTestEngine::CloseSession\n"
+ + "19.Jan.2010 09:01:33.660....---------------- Log Ended ----------------\n";
+ STFProcessor processor = new STFProcessor();
+ processor.initTestResult(lTestRunResult,
+ iLaunchConfigurationWorkingCopy);
+ processor.process(lTestRunResult, info);
+ assertTrue(isStarted);
+ assertTrue(isFinished);
+ assertTrue(isTestCaseStateChange);
+ }
+
+ @Test
+ public void testGetInputStream() {
+ assertNotNull(new STFProcessor()
+ .getInputStream(iLaunchConfigurationWorkingCopy));
+ }
+
+ @Test
+ public void testIsDealType() {
+ assertTrue(new STFProcessor()
+ .isDealType(iLaunchConfigurationWorkingCopy));
+ }
+
+ @Test
+ public void testCreateRetestLaunchConfiguration() {
+ return;
+ }
+
+ @Test
+ public void testInitTestResult() {
+ TestRunResult lTestRunResult = new TestRunResult();
+ lTestRunResult.addResultListener(new TestResultListener() {
+
+ public void addTestCase(TestCaseResult result) {
+ isAddTestCase = true;
+ }
+
+ public void testCaseStateChange(TestCaseResult result,
+ TestStatus status) {
+ isTestCaseStateChange = true;
+ }
+
+ public void testFinished() {
+ isFinished = true;
+ }
+
+ public void testStarted() {
+ isStarted = true;
+ }
+ });
+ new STFProcessor().initTestResult(lTestRunResult,
+ iLaunchConfigurationWorkingCopy);
+ assertTrue(isAddTestCase);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/src/com/nokia/testfw/launch/processor/SUTProcessorTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,129 @@
+package com.nokia.testfw.launch.processor;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.nokia.cdt.debug.cw.symbian.SettingsData;
+import com.nokia.testfw.core.model.result.TestCaseResult;
+import com.nokia.testfw.core.model.result.TestResult;
+import com.nokia.testfw.core.model.result.TestResultListener;
+import com.nokia.testfw.core.model.result.TestRunResult;
+import com.nokia.testfw.core.model.result.TestResult.TestStatus;
+import com.nokia.testfw.launch.LaunchConfigurationConstants;
+import com.nokia.testfw.test.utils.ProjectUtils;
+
+@SuppressWarnings("restriction")
+public class SUTProcessorTest extends TestCase {
+
+ ILaunchConfigurationWorkingCopy iLaunchConfigurationWorkingCopy;
+ boolean isStarted = false;
+ boolean isFinished = false;
+ boolean isAddTestCase = false;
+ boolean isTestCaseStateChange = false;
+ IProject targetProject;
+
+ @Before
+ public void setUp() throws Exception {
+ targetProject = ProjectUtils.getTargetProject("testRacecar");
+ if (targetProject == null) {
+ String projectPath = (new File("resource/Racecar"))
+ .getCanonicalPath();
+ String bldInfPath = "tsrc/group/Bld.inf";
+ targetProject = ProjectUtils.createTargetProject("testRacecar",
+ projectPath, bldInfPath);
+ }
+ ProjectUtils.selectProject(targetProject);
+
+ ILaunchManager lLaunchManager = DebugPlugin.getDefault()
+ .getLaunchManager();
+ ILaunchConfigurationType type = lLaunchManager
+ .getLaunchConfigurationType("com.nokia.testfw.launch.SUTEmulationLaunch");
+ iLaunchConfigurationWorkingCopy = type.newInstance(null,
+ "SUTProcessorTest");
+
+ SettingsData
+ .setDefaults(
+ iLaunchConfigurationWorkingCopy,
+ "com.nokia.cdt.debug.cw.symbian.SettingsData.LaunchConfig_Emulator",
+ targetProject);
+ iLaunchConfigurationWorkingCopy.setAttribute(
+ "org.eclipse.cdt.launch.PROGRAM_ARGUMENTS", "-d=ut_racecar.dll");
+ iLaunchConfigurationWorkingCopy.setAttribute(
+ LaunchConfigurationConstants.DLLNAME, "ut_racecar.dll");
+ }
+
+ @Test
+ public void testProcess() {
+
+ TestRunResult lTestRunResult = new TestRunResult();
+ lTestRunResult.addResultListener(new TestResultListener() {
+
+ public void addTestCase(TestCaseResult result) {
+ isAddTestCase = true;
+ }
+
+ public void testCaseStateChange(TestCaseResult result,
+ TestStatus status) {
+ isTestCaseStateChange = true;
+ }
+
+ public void testFinished() {
+ isFinished = true;
+ }
+
+ public void testStarted() {
+ isStarted = true;
+ }
+ });
+ String info = "SymbianUnitTest v1.0.0\n" + "TestCase[testcase1]\n"
+ + "StartCase[testcase1]\n" + "EndCase Result[fail] Time[5]ms\n"
+ + "SymbianUnitTest finished";
+ new SUTProcessor().process(lTestRunResult, info);
+ assertTrue(isStarted);
+ assertTrue(isFinished);
+ assertTrue(isAddTestCase);
+ assertTrue(isTestCaseStateChange);
+ }
+
+ @Test
+ public void testGetInputStream() {
+ assertNotNull(new SUTProcessor()
+ .getInputStream(iLaunchConfigurationWorkingCopy));
+ }
+
+ @Test
+ public void testIsDealType() {
+ assertTrue(new SUTProcessor()
+ .isDealType(iLaunchConfigurationWorkingCopy));
+ }
+
+ @Test
+ public void testCreateRetestLaunchConfiguration() {
+ TestResult[] retestResults = new TestResult[] { new TestCaseResult(
+ "testcase") };
+ ILaunchConfiguration newconfig = new SUTProcessor()
+ .createRetestLaunchConfiguration(
+ iLaunchConfigurationWorkingCopy, retestResults);
+ String args = null;
+ try {
+ args = newconfig.getAttribute(
+ "org.eclipse.cdt.launch.PROGRAM_ARGUMENTS", (String) null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ fail(e.toString());
+ }
+ assertNotNull(args);
+ assertTrue(args.indexOf("-c=testcase") > -1);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/src/com/nokia/testfw/launch/ui/STFEmulationConfigTagGroupTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,52 @@
+package com.nokia.testfw.launch.ui;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.junit.Test;
+
+public class STFEmulationConfigTagGroupTest extends TestCase {
+
+ STFEmulationConfigTagGroup iSTFEmulationConfigTagGroup = new STFEmulationConfigTagGroup();
+
+ @Test
+ public void testCreateTabs() {
+ iSTFEmulationConfigTagGroup.createTabs(null, "run");
+ assertTrue(iSTFEmulationConfigTagGroup.getTabs().length == 3);
+ iSTFEmulationConfigTagGroup.createTabs(null, "debug");
+ assertTrue(iSTFEmulationConfigTagGroup.getTabs().length == 7);
+ }
+
+ @Test
+ public void testSetDefaultsILaunchConfigurationWorkingCopy() {
+ ILaunchManager lLaunchManager = DebugPlugin.getDefault()
+ .getLaunchManager();
+ ILaunchConfigurationType type = lLaunchManager
+ .getLaunchConfigurationType("com.nokia.testfw.launch.STFEmulationLaunch");
+ ILaunchConfigurationWorkingCopy lLaunchConfigurationWorkingCopy = null;
+ try {
+ lLaunchConfigurationWorkingCopy = type.newInstance(null,
+ "STFProcessorTest");
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ iSTFEmulationConfigTagGroup.createTabs(null, "run");
+ iSTFEmulationConfigTagGroup
+ .setDefaults(lLaunchConfigurationWorkingCopy);
+ String hostApp = null;
+ try {
+ hostApp = lLaunchConfigurationWorkingCopy
+ .getAttribute(
+ "com.freescale.cdt.debug.cw.core.settings.DebuggerCommonData.Host App Path",
+ (String) null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ assertNotNull(hostApp);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/src/com/nokia/testfw/launch/ui/SUTEmulationConfigTagGroupTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,54 @@
+package com.nokia.testfw.launch.ui;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.junit.Test;
+
+public class SUTEmulationConfigTagGroupTest extends TestCase {
+
+ SUTEmulationConfigTagGroup iSUTEmulationConfigTagGroup = new SUTEmulationConfigTagGroup();
+
+ @Test
+ public void testCreateTabs() {
+ iSUTEmulationConfigTagGroup.createTabs(null, "run");
+ assertTrue(iSUTEmulationConfigTagGroup.getTabs().length == 3);
+ iSUTEmulationConfigTagGroup.createTabs(null, "debug");
+ assertTrue(iSUTEmulationConfigTagGroup.getTabs().length == 7);
+ }
+
+ @Test
+ public void testSetDefaultsILaunchConfigurationWorkingCopy() {
+ ILaunchManager lLaunchManager = DebugPlugin.getDefault()
+ .getLaunchManager();
+ ILaunchConfigurationType type = lLaunchManager
+ .getLaunchConfigurationType("com.nokia.testfw.launch.SUTEmulationLaunch");
+ ILaunchConfigurationWorkingCopy lLaunchConfigurationWorkingCopy = null;
+ try {
+ lLaunchConfigurationWorkingCopy = type.newInstance(null,
+ "SUTProcessorTest");
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ iSUTEmulationConfigTagGroup.createTabs(null, "run");
+ iSUTEmulationConfigTagGroup
+ .setDefaults(lLaunchConfigurationWorkingCopy);
+ String hostApp = null;
+ try {
+ hostApp = lLaunchConfigurationWorkingCopy
+ .getAttribute(
+ "com.freescale.cdt.debug.cw.core.settings.DebuggerCommonData.Host App Path",
+ (String) null);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ assertNotNull(hostApp);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.launch.test/tailstream.test Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,11 @@
+oldtest
+test1
+test2
+test3
+test4
+test5
+test6
+test7
+test8
+test9
+test10
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.resultview.test/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.resultview.test/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.resultview.test</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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.resultview.test/.settings/org.eclipse.jdt.core.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,12 @@
+#Wed Dec 23 11:14:00 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+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.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.resultview.test/META-INF/MANIFEST.MF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Test Fragment
+Bundle-SymbolicName: com.nokia.testfw.resultview.test
+Bundle-Version: 1.0.0
+Bundle-Vendor: Nokia
+Fragment-Host: com.nokia.testfw.resultview
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: com.nokia.testfw.test,
+ org.junit4
+Export-Package: com.nokia.testfw.resultview
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.resultview.test/build.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,6 @@
+javacSource=1.5
+javacTarget=1.5
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.resultview.test/src/com/nokia/testfw/resultview/Activator.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,50 @@
+package com.nokia.testfw.resultview;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "com.nokia.testfw.resultview.test";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.resultview.test/src/com/nokia/testfw/resultview/AllJUnitPlugInTests.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.resultview;
+
+import com.nokia.testfw.resultview.model.TestRunSessionTest;
+import com.nokia.testfw.resultview.view.CounterPanelTest;
+import com.nokia.testfw.resultview.view.ProgressBarTest;
+import com.nokia.testfw.resultview.view.TestResultTreeTest;
+import com.nokia.testfw.resultview.view.TestRunViewPartTest;
+import com.nokia.testfw.resultview.view.FailureTraceTest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class AllJUnitPlugInTests extends TestSuite {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(
+ "com.nokia.testfw.resultview.junitplugin");
+ suite.addTestSuite(TestRunSessionTest.class);
+ suite.addTestSuite(CounterPanelTest.class);
+ suite.addTestSuite(ProgressBarTest.class);
+ suite.addTestSuite(TestResultTreeTest.class);
+ suite.addTestSuite(TestRunViewPartTest.class);
+ suite.addTestSuite(FailureTraceTest.class);
+ return suite;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.resultview.test/src/com/nokia/testfw/resultview/model/TestRunSessionTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,194 @@
+package com.nokia.testfw.resultview.model;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.ISourceLocator;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.nokia.testfw.core.model.result.TestCaseResult;
+import com.nokia.testfw.core.model.result.TestResult;
+import com.nokia.testfw.core.model.result.TestResultListener;
+import com.nokia.testfw.core.model.result.TestRunResult;
+import com.nokia.testfw.core.model.result.TestResult.TestStatus;
+
+public class TestRunSessionTest extends TestCase {
+
+ TestRunSession iTestRunSession;
+
+ boolean isStarted = false;
+ boolean isFinished = false;
+ boolean isAddTestCase = false;
+ boolean isTestCaseStateChange = false;
+
+ @Before
+ public void setUp() throws Exception {
+
+ iTestRunSession = new TestRunSession(new ILaunch() {
+
+ public void addDebugTarget(IDebugTarget idebugtarget) {
+ }
+
+ public void addProcess(IProcess iprocess) {
+ }
+
+ public String getAttribute(String s) {
+ return null;
+ }
+
+ public Object[] getChildren() {
+ return null;
+ }
+
+ public IDebugTarget getDebugTarget() {
+ return null;
+ }
+
+ public IDebugTarget[] getDebugTargets() {
+ return null;
+ }
+
+ public ILaunchConfiguration getLaunchConfiguration() {
+ return null;
+ }
+
+ public String getLaunchMode() {
+ return null;
+ }
+
+ public IProcess[] getProcesses() {
+ return null;
+ }
+
+ public ISourceLocator getSourceLocator() {
+ return null;
+ }
+
+ public boolean hasChildren() {
+ return false;
+ }
+
+ public void removeDebugTarget(IDebugTarget idebugtarget) {
+ }
+
+ public void removeProcess(IProcess iprocess) {
+ }
+
+ public void setAttribute(String s, String s1) {
+ }
+
+ public void setSourceLocator(ISourceLocator isourcelocator) {
+ }
+
+ public boolean canTerminate() {
+ return false;
+ }
+
+ public boolean isTerminated() {
+ return false;
+ }
+
+ public void terminate() throws DebugException {
+ }
+
+ public Object getAdapter(Class arg0) {
+ return null;
+ }
+ }, new IDataProcessor() {
+
+ public void close() throws IOException {
+ }
+
+ public ILaunchConfiguration createRetestLaunchConfiguration(
+ ILaunchConfiguration configuration,
+ TestResult[] retestResults) {
+ return configuration;
+ }
+
+ public InputStream getInputStream(ILaunchConfiguration config) {
+ return new ByteArrayInputStream("TestRunSession".getBytes());
+ }
+
+ public boolean isDealType(ILaunchConfiguration config) {
+ return false;
+ }
+
+ public void process(TestRunResult result, String info) {
+ isTestCaseStateChange = true;
+ }
+
+ public void initTestResult(TestRunResult result,
+ ILaunchConfiguration config) {
+ }
+ });
+
+ iTestRunSession.addResultListener(new TestResultListener() {
+
+ public void addTestCase(TestCaseResult result) {
+ isAddTestCase = true;
+ }
+
+ public void testCaseStateChange(TestCaseResult result,
+ TestStatus status) {
+ isTestCaseStateChange = true;
+ }
+
+ public void testFinished() {
+ isFinished = true;
+ }
+
+ public void testStarted() {
+ isStarted = true;
+ }
+ });
+ }
+
+ @Test
+ public void testTestFinished() {
+ iTestRunSession.testFinished();
+ assertTrue(isFinished);
+ }
+
+ @Test
+ public void testGetLaunch() {
+ assertNotNull(iTestRunSession.getLaunch());
+ }
+
+ @Test
+ public void testClose() {
+ iTestRunSession.close();
+ assertTrue(iTestRunSession.isClosed());
+ }
+
+ @Test
+ public void testUpdate() {
+ String info = "TestCaseStateChange";
+ iTestRunSession.update(info);
+ assertTrue(isTestCaseStateChange);
+ }
+
+ @Test
+ public void testGetInputStream() {
+ assertNotNull(iTestRunSession.getInputStream());
+ }
+
+ @Test
+ public void testGetRetestLaunchConfiguration() {
+ assertNull(iTestRunSession.getRetestLaunchConfiguration(null, null));
+ }
+
+ @Test
+ public void testGetStartTime() {
+ assertNotNull(iTestRunSession.getStartTime());
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.resultview.test/src/com/nokia/testfw/resultview/view/CounterPanelTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.resultview.view;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+import com.nokia.testfw.test.framework.ControlTestCase;
+import com.nokia.testfw.test.utils.TestUtils;
+import com.nokia.testfw.resultview.view.CounterPanel;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class CounterPanelTest extends ControlTestCase {
+
+ CounterPanel counterPanel;
+
+ /* (non-Javadoc)
+ * @see com.nokia.testfw.test.framework.CompositeTestCase#createTestComposite(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createTestControl(Composite parent) {
+ counterPanel = new CounterPanel(parent);
+ return counterPanel;
+ }
+
+ public void testCounter() {
+ counterPanel.setCounter(10, 5, 3, 2);
+ TestUtils.delay(2000);
+ assertEquals(counterPanel.suiteLabel.getText(), "Runs: 5/10");
+ assertEquals(counterPanel.passedLabel.getText(), "Passed: 3");
+ assertEquals(counterPanel.failedLabel.getText(), "Failed: 2");
+ //test reset
+ counterPanel.setCounter(1000, 900, 800, 100);
+ counterPanel.reset();
+ TestUtils.delay(2000);
+ assertEquals(counterPanel.suiteLabel.getText(), "Runs: 0/0");
+ assertEquals(counterPanel.passedLabel.getText(), "Passed: 0");
+ assertEquals(counterPanel.failedLabel.getText(), "Failed: 0");
+ //test update counter on the fly
+ counterPanel.setTotalTests(20);
+ assertEquals(counterPanel.suiteLabel.getText(), "Runs: 0/20");
+ assertEquals(counterPanel.passedLabel.getText(), "Passed: 0");
+ assertEquals(counterPanel.failedLabel.getText(), "Failed: 0");
+ TestUtils.delay(2000);
+ counterPanel.addPassedTest();
+ counterPanel.addPassedTest();
+ TestUtils.delay(2000);
+ assertEquals(counterPanel.suiteLabel.getText(), "Runs: 2/20");
+ assertEquals(counterPanel.passedLabel.getText(), "Passed: 2");
+ assertEquals(counterPanel.failedLabel.getText(), "Failed: 0");
+ counterPanel.addFailedTest();
+ assertEquals(counterPanel.suiteLabel.getText(), "Runs: 3/20");
+ assertEquals(counterPanel.passedLabel.getText(), "Passed: 2");
+ assertEquals(counterPanel.failedLabel.getText(), "Failed: 1");
+ TestUtils.delay(2000);
+ }
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.resultview.test/src/com/nokia/testfw/resultview/view/FailureTraceTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,65 @@
+package com.nokia.testfw.resultview.view;
+
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.junit.Test;
+
+import com.nokia.testfw.core.model.result.TestCaseResult;
+import com.nokia.testfw.core.model.result.TestResult;
+import com.nokia.testfw.test.framework.ControlTestCase;
+import com.nokia.testfw.test.utils.TestUtils;
+
+public class FailureTraceTest extends ControlTestCase {
+
+ FailureTrace iFailureTrace;
+
+ protected Control createTestControl(Composite parent) {
+ parent.setLayout(new GridLayout());
+ iFailureTrace = new FailureTrace(parent);
+ return iFailureTrace.getTable();
+ }
+
+ public void testSetGetUpdate() {
+ iFailureTrace.setTestResult(null);
+ TestUtils.delay(1000);
+ assertEquals(iFailureTrace.getTable().getItemCount(), 0);
+
+ TestResult result = new TestCaseResult("testcase");
+ iFailureTrace.setTestResult(result);
+ TestUtils.delay(1000);
+ assertEquals(iFailureTrace.getTable().getItemCount(), 0);
+
+ result.setMessage("erroe message1");
+ iFailureTrace.update(result);
+ assertEquals(iFailureTrace.getTable().getItemCount(), 2);
+ String msg = iFailureTrace.getTable().getItem(1).getText().trim();
+ TestUtils.delay(1000);
+ assertEquals(msg, "erroe message1");
+
+ result = iFailureTrace.getTestResult();
+ TestUtils.delay(1000);
+ assertEquals(result.getName(), "testcase");
+ assertEquals(result.getMessage(), "erroe message1");
+ }
+
+ public void testSetGetUpdate2() {
+ iFailureTrace.setTestResult(null);
+ TestUtils.delay(1000);
+ assertEquals(iFailureTrace.getTable().getItemCount(), 0);
+
+ TestResult result = new TestCaseResult("testcase");
+ result.setMessage("erroe message1");
+ iFailureTrace.setTestResult(result);
+ TestUtils.delay(1000);
+ assertEquals(iFailureTrace.getTable().getItemCount(), 2);
+ String msg1 = iFailureTrace.getTable().getItem(1).getText().trim();
+ assertEquals(msg1, "erroe message1");
+
+ result.setMessage("erroe message2");
+ iFailureTrace.update(result);
+ TestUtils.delay(1000);
+ String msg2 = iFailureTrace.getTable().getItem(1).getText().trim();
+ assertEquals(msg2, "erroe message2");
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.resultview.test/src/com/nokia/testfw/resultview/view/ProgressBarTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.resultview.view;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+import com.nokia.testfw.test.framework.ControlTestCase;
+import com.nokia.testfw.test.utils.TestUtils;
+import com.nokia.testfw.resultview.view.TestProgressBar;
+
+
+/**
+ * @author xiaoma
+ *
+ */
+public class ProgressBarTest extends ControlTestCase {
+
+ TestProgressBar progressBar;
+ /* (non-Javadoc)
+ * @see com.nokia.testfw.test.framework.CompositeTestCase#createTestComposite(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createTestControl(Composite parent) {
+
+ progressBar = new TestProgressBar(parent);
+ return progressBar;
+ }
+
+ public void testUpdate() {
+ int maxLen = 10;
+ progressBar.setTestCounts(maxLen);
+ for (int i = 0 ; i < maxLen; i++) {
+ progressBar.step(true);
+ TestUtils.delay(200);
+ }
+ assertEquals(progressBar.totalCount, maxLen);
+ assertEquals(progressBar.currentCount, maxLen);
+ //test reset
+ progressBar.reset();
+ assertEquals(progressBar.currentCount, 0);
+ TestUtils.delay(2000);
+ progressBar.setTestCounts(5);
+ TestUtils.delay(2000);
+ }
+
+ public void testFailed() {
+ int maxLen = 6;
+ progressBar.setTestCounts(maxLen);
+ //two passed caess
+ progressBar.step(true);
+ progressBar.step(true);
+ TestUtils.delay(2000);
+ //one failed case, the color of the progress bar should change.
+ progressBar.step(false);
+ progressBar.step(false);
+ progressBar.step(false);
+ TestUtils.delay(2000);
+ progressBar.stopTest();
+ TestUtils.delay(2000);
+
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.resultview.test/src/com/nokia/testfw/resultview/view/TestResultTreeTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.resultview.view;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.TreeItem;
+
+import com.nokia.testfw.core.model.result.TestCaseResult;
+import com.nokia.testfw.core.model.result.TestRunResult;
+import com.nokia.testfw.core.model.result.TestSuiteResult;
+import com.nokia.testfw.core.model.result.TestResult.TestStatus;
+import com.nokia.testfw.test.framework.ControlTestCase;
+import com.nokia.testfw.test.utils.TestUtils;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class TestResultTreeTest extends ControlTestCase {
+
+ TestResultTree resultTree;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.testfw.test.framework.ControlTestCase#createTestControl(org
+ * .eclipse.swt.widgets.Composite)
+ */
+ protected Control createTestControl(Composite parent) {
+ resultTree = new TestResultTree(parent);
+ return resultTree.getTree();
+ }
+
+ /**
+ * test init the tree with empty result
+ */
+ public void testTree() {
+
+ TestRunResult runResult = new TestRunResult();
+ runResult.addTestCase("suite1", "case1");
+ runResult.addTestCase("suite1", "case2");
+ runResult.addTestCase("suite1", "case3");
+ runResult.addTestCase("suite2", "case1");
+ runResult.updateCaseStatus("suite1", "case1", TestStatus.FAILURE, 10);
+ runResult.updateCaseStatus("suite1", "case2", TestStatus.SUCCESS, 100);
+ runResult.updateCaseStatus("suite1", "case3", TestStatus.SKIP, 9);
+ resultTree.init(runResult);
+ TestUtils.delay(2000);
+ assertEquals(resultTree.getTree().getItemCount(), 2);
+ TreeItem item = resultTree.getTree().getItem(0);
+ assertEquals(item.getItemCount(), 3);
+
+ TestSuiteResult parent = new TestSuiteResult("New Test Suite");
+ TestCaseResult result = new TestCaseResult("New Test Case");
+ parent.addTestResult(result);
+ resultTree.addTestCase(result);
+ assertEquals(resultTree.getTree().getItemCount(), 3);
+ result.setStatus(TestStatus.SUCCESS);
+ resultTree.update(result);
+
+ resultTree.reset();
+ assertEquals(resultTree.getTree().getItemCount(), 0);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.resultview.test/src/com/nokia/testfw/resultview/view/TestRunViewPartTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.resultview.view;
+
+import com.nokia.testfw.core.model.result.TestResult.TestStatus;
+import com.nokia.testfw.test.framework.ViewPartTest;
+import com.nokia.testfw.test.utils.TestUtils;
+import com.nokia.testfw.resultview.model.TestRunSession;
+import com.nokia.testfw.resultview.view.TestRunnerViewPart;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class TestRunViewPartTest extends ViewPartTest {
+ TestRunSession iSession;
+
+ public void setUp() throws Exception {
+ super.setUp();
+ iSession = new TestRunSession(null, null);
+ iSession.addTestCase("suite1", "case1");
+ iSession.addTestCase("suite1", "case2");
+ iSession.addTestCase("suite1", "case3");
+ iSession.addTestCase("suite2", "case1");
+
+ }
+
+ protected String getViewId() {
+ return "com.nokia.testfw.resultview.testrunnerview";
+ }
+
+ public void testViewInit() {
+ ((TestRunnerViewPart) viewPart).addTestRunSession(iSession);
+ TestUtils.delay(1000);
+ TestResultTree tree = ((TestRunnerViewPart) viewPart).resultTree;
+ assertEquals(tree.getTree().getItemCount(), 2);
+ }
+
+ public void testDyncUpdate() {
+ ((TestRunnerViewPart) viewPart).clear();
+ ((TestRunnerViewPart) viewPart).addTestRunSession(iSession);
+ TestUtils.delay(1000);
+ iSession.updateCaseStatus("suite1", "case1", TestStatus.STARTED, -1);
+ TestUtils.delay(1000);
+ iSession.updateCaseStatus("suite1", "case1", TestStatus.SUCCESS, 10);
+ TestUtils.delay(1000);
+ iSession.updateCaseStatus("suite1", "case2", TestStatus.SUCCESS, 100);
+ TestUtils.delay(1000);
+ iSession.updateCaseStatus("suite1", "case3", TestStatus.SKIP, 9);
+ TestUtils.delay(1000);
+ iSession.updateCaseStatus("suite2", "case1", TestStatus.FAILURE, 1000);
+ TestUtils.delay(1000);
+ iSession.testFinished();
+ TestUtils.delay(1000);
+ // check counter
+ assertEquals(((TestRunnerViewPart) viewPart).counterPanel.suiteLabel
+ .getText(), "Runs: 3/4");
+ assertEquals(((TestRunnerViewPart) viewPart).counterPanel.passedLabel
+ .getText(), "Passed: 2");
+ assertEquals(((TestRunnerViewPart) viewPart).counterPanel.failedLabel
+ .getText(), "Failed: 1");
+ TestUtils.delay(1000);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.resultview.test/test.xml Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="testsuite" default="run" basedir=".">
+ <property environment="env"/>
+ <!-- The property ${eclipse-home} should be passed into this script -->
+ <!-- Set a meaningful default value for when it is not. -->
+ <property name="eclipse-home" value="${env.eclipse-home}"/>
+
+ <!-- sets the properties eclipse-home, and library-file -->
+ <property name="plugin-name" value="com.nokia.testfw.resultview.tests"/>
+ <property name="library-file"
+ value="${eclipse-home}/plugins/org.eclipse.test_3.2.0/library.xml"/>
+
+ <!-- This target holds all initialization code that needs to be done for -->
+ <!-- all tests that are to be run. Initialization for individual tests -->
+ <!-- should be done within the body of the suite target. -->
+ <target name="init">
+ <tstamp/>
+ <delete>
+ <fileset dir="${eclipse-home}" includes="org*.xml"/>
+ </delete>
+ </target>
+
+ <!-- This target defines the tests that need to be run. -->
+ <target name="suite">
+ <property name="resultview-folder"
+ value="${eclipse-home}/resultview_folder"/>
+ <delete dir="${resultview-folder}" quiet="true"/>
+ <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="data-dir" value="${resultview-folder}"/>
+ <property name="plugin-name" value="${plugin-name}"/>
+ <property name="classname"
+ value="com.nokia.testfw.resultview.AllJunitPluginTests"/>
+ </ant>
+ </target>
+
+ <!-- This target holds code to cleanup the testing environment after -->
+ <!-- after all of the tests have been run. You can use this target to -->
+ <!-- delete temporary files that have been created. -->
+ <target name="cleanup">
+ </target>
+
+ <!-- This target runs the test suite. Any actions that need to happen -->
+ <!-- after all the tests have been run should go here. -->
+ <target name="run" depends="init,suite,cleanup">
+ <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="includes" value="org*.xml"/>
+ <property name="output-file" value="${plugin-name}.xml"/>
+ </ant>
+ </target>
+ </project>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.test/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.test/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.test</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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.test/.settings/org.eclipse.jdt.core.prefs Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,7 @@
+#Thu Jun 11 14:17:33 CST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.test/META-INF/MANIFEST.MF Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Test Plug-in
+Bundle-SymbolicName: com.nokia.testfw.test
+Bundle-Version: 1.0.0
+Bundle-Activator: com.nokia.testfw.test.Activator
+Bundle-Vendor: Nokia
+Require-Bundle: com.nokia.carbide.cdt.builder,
+ com.nokia.carbide.cpp.project.core,
+ com.nokia.carbide.cpp.sdk.core,
+ org.eclipse.cdt.core,
+ org.eclipse.core.filesystem,
+ org.eclipse.core.resources,
+ org.eclipse.core.runtime,
+ org.eclipse.jface,
+ org.eclipse.ui,
+ org.eclipse.ui.navigator,
+ org.eclipse.ui.navigator.resources,
+ org.junit4
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: com.nokia.testfw.test.framework,
+ com.nokia.testfw.test.utils
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.test/build.properties Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,6 @@
+javacSource=1.5
+javacTarget=1.5
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.test/src/com/nokia/testfw/test/Activator.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,50 @@
+package com.nokia.testfw.test;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "com.nokia.testfw.test";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.test/src/com/nokia/testfw/test/framework/ControlTestCase.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.test.framework;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+import com.nokia.testfw.test.utils.TestUtils;
+
+import junit.framework.TestCase;
+
+/**
+ * This abstract is for Composite testing. It will create a dialog to
+ * hold target composite.
+ * <P>
+ * user need to implement the createTestComposite method to create
+ * the target composite for test
+ * @author xiaoma
+ *
+ */
+public abstract class ControlTestCase extends TestCase {
+ protected Dialog dialog;
+
+ /**
+ * Sets up the fixture, for example, open a network connection.
+ * This method is called before a test is executed.
+ */
+ protected void setUp() throws Exception {
+ Shell shell = Display.getDefault().getActiveShell();
+ dialog = new Dialog(shell) {
+ Control testComposite;
+ protected Control createDialogArea(Composite parent) {
+ testComposite = createTestControl(parent);
+
+ String title = "Test:";
+ if (testComposite != null) {
+ String clsName = testComposite.getClass().getName();
+ int index = clsName.lastIndexOf(".");
+ if (index > 0) {
+ clsName = clsName.substring(index + 1);
+ }
+ title = title + clsName;
+ }
+ parent.getShell().setText(title);
+
+ return testComposite;
+
+ }
+
+ };
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+ //delay for 2 seconds after dialog open
+ TestUtils.delay(2000);
+ }
+
+
+
+ /**
+ * Tears down the fixture, for example, close a network connection.
+ * This method is called after a test is executed.
+ */
+ protected void tearDown() throws Exception {
+ dialog.close();
+ }
+
+ abstract protected Control createTestControl(Composite parent);
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.test/src/com/nokia/testfw/test/framework/PreferenceTestCase.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.test.framework;
+
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.preference.PreferenceManager;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+
+import com.nokia.testfw.test.utils.TestUtils;
+
+import junit.framework.TestCase;
+
+/**
+ * This abstract is for Composite testing. It will create a WizardDialog to hold
+ * target composite.
+ * <P>
+ * user need to implement the getWizard method to create the target wizard for
+ * test
+ *
+ * @author Kevin Wang
+ *
+ */
+public abstract class PreferenceTestCase extends TestCase {
+ protected PreferenceDialog dialog;
+ protected PreferenceManager preferenceManager;
+
+ /**
+ * Sets up the fixture, for example, open a network connection. This method
+ * is called before a test is executed.
+ */
+ protected void setUp() throws Exception {
+ Shell shell = Display.getDefault().getActiveShell();
+ preferenceManager = PlatformUI.getWorkbench().getPreferenceManager();
+ dialog = new PreferenceDialog(shell, preferenceManager);
+ dialog.setBlockOnOpen(false);
+ dialog.setSelectedNode(getPageId());
+ dialog.open();
+ // delay for 2 seconds after dialog open
+ TestUtils.delay(2000);
+ }
+
+ /**
+ * Tears down the fixture, for example, close a network connection. This
+ * method is called after a test is executed.
+ */
+ protected void tearDown() throws Exception {
+ dialog.close();
+ }
+
+ protected abstract String getPageId();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.test/src/com/nokia/testfw/test/framework/ViewPartTest.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.test.framework;
+
+import junit.framework.TestCase;
+
+import org.eclipse.ui.IViewPart;
+
+import org.eclipse.ui.PlatformUI;
+
+//import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.After;
+
+
+/**
+ * this class is used to test a view part.
+ * the subclass need to implememnt getViewId() method to return the view id under test
+ * @author xiaoma
+ *
+ */
+public abstract class ViewPartTest extends TestCase{
+
+ protected IViewPart viewPart;
+
+ @Before
+ public void setUp() throws Exception {
+ viewPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(
+ getViewId());
+ if (viewPart == null) {
+ throw new RuntimeException("can't find view:" + getViewId());
+ }
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ viewPart.dispose();
+ }
+
+ protected abstract String getViewId();
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.test/src/com/nokia/testfw/test/framework/WizardTestCase.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.test.framework;
+
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+import junit.framework.TestCase;
+
+/**
+ * This abstract is for Composite testing. It will create a WizardDialog to hold
+ * target composite.
+ * <P>
+ * user need to implement the getWizard method to create the target wizard for
+ * test
+ *
+ * @author Kevin Wang
+ *
+ */
+public abstract class WizardTestCase extends TestCase {
+ protected WizardDialog dialog;
+
+ /**
+ * Sets up the fixture, for example, open a network connection. This method
+ * is called before a test is executed.
+ */
+ protected void setUp() throws Exception {
+ Shell shell = Display.getDefault().getActiveShell();
+ dialog = new WizardDialog(shell, getWizard());
+ dialog.setBlockOnOpen(false);
+ }
+
+ /**
+ * Tears down the fixture, for example, close a network connection. This
+ * method is called after a test is executed.
+ */
+ protected void tearDown() throws Exception {
+ }
+
+ protected abstract IWizard getWizard();
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.test/src/com/nokia/testfw/test/utils/ProjectUtils.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,132 @@
+package com.nokia.testfw.test.utils;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.navigator.CommonNavigator;
+import org.eclipse.ui.navigator.resources.ProjectExplorer;
+
+import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
+import com.nokia.carbide.cdt.builder.ICarbideBuildManager;
+import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils;
+import com.nokia.carbide.cpp.project.core.ProjectCorePlugin;
+import com.nokia.carbide.cpp.sdk.core.ISDKManager;
+import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
+import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
+
+public class ProjectUtils {
+
+ public static IProject getTargetProject(String projectName) {
+ ICarbideBuildManager iBuildManager = CarbideBuilderPlugin
+ .getBuildManager();
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ projectName);
+ if (project.exists() && iBuildManager.isCarbideProject(project)) {
+ return project;
+ }
+ return null;
+ }
+
+ public static void selectProject(IProject project) {
+ IViewPart part = null;
+ // = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ // .getActivePage().findView(ProjectExplorer.VIEW_ID);
+ try {
+ part = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getActivePage().showView(ProjectExplorer.VIEW_ID);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ if (part != null) {
+ ((CommonNavigator) part).selectReveal(new StructuredSelection(
+ project));
+ }
+ }
+
+ public static void removeTargetProject(String projectName) {
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ projectName);
+ if (project.exists()) {
+ try {
+ project.delete(true, true, null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public static IProject createTargetProject(String projectName,
+ String projectPath, String projectRelativeBldInfPath)
+ throws CoreException {
+
+ List<ISymbianBuildContext> choosenSDKs = new ArrayList<ISymbianBuildContext>();
+ boolean sbsv2 = false;
+
+ Object value = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getShell().getData("useSBSv2Builder");
+ if (value != null && (value instanceof Boolean)) {
+ sbsv2 = ((Boolean) value).booleanValue();
+ }
+
+ ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
+ List<ISymbianSDK> sdkList = sdkMgr.getSDKList();
+ if (sdkList == null)
+ return null;
+ List<ISymbianSDK> sdkListCopy = new ArrayList<ISymbianSDK>();
+ for (Iterator<ISymbianSDK> iterator = sdkList.iterator(); iterator
+ .hasNext();) {
+ ISymbianSDK currSDK = (ISymbianSDK) iterator.next();
+ if (currSDK.isEnabled())
+ sdkListCopy.add(currSDK);
+ }
+
+ if (sbsv2)
+ sdkListCopy = SBSv2Utils.getSupportedSDKs(sdkListCopy);
+
+ for (Iterator<ISymbianSDK> iter = sdkListCopy.iterator(); iter
+ .hasNext();) {
+ ISymbianSDK sdk = (ISymbianSDK) iter.next();
+ List<ISymbianBuildContext> configurations = sbsv2 ? SBSv2Utils
+ .getFilteredSBSv2BuildContexts(sdk) : sdk
+ .getFilteredBuildConfigurations();
+ for (Iterator<ISymbianBuildContext> iterator = configurations
+ .iterator(); iterator.hasNext();) {
+ ISymbianBuildContext config = (ISymbianBuildContext) iterator
+ .next();
+ choosenSDKs.add(config);
+ }
+ }
+
+ IPath destPath = ResourcesPlugin.getWorkspace().getRoot().getLocation()
+ .append(projectName);
+ IFileStore destStore = EFS.getLocalFileSystem().getStore(destPath);
+ destStore.delete(EFS.NONE, null);
+ IFileStore store = EFS.getLocalFileSystem().fromLocalFile(
+ new File(projectPath));
+ store.copy(destStore, EFS.OVERWRITE, null);
+
+ IProject createdProject;
+ createdProject = ProjectCorePlugin.createProject(projectName, destPath
+ .toOSString());
+
+ ProjectCorePlugin.postProjectCreatedActions(createdProject,
+ projectRelativeBldInfPath, choosenSDKs,
+ new ArrayList<String>(), null, null, new NullProgressMonitor());
+
+ return createdProject;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.test/src/com/nokia/testfw/test/utils/TestUtils.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.test.utils;
+
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class TestUtils {
+ /**
+ * Deploy for specified milliseconds and proces ui input if any.
+ *
+ * @param waitTimeMillis
+ * the number of milliseconds
+ */
+ public static void delay(long waitTimeMillis) {
+ Display display = Display.getCurrent();
+
+ // If this is the UI thread,
+ // then process input.
+
+ if (display != null) {
+ long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
+ while (System.currentTimeMillis() < endTimeMillis) {
+ if (display.isDisposed() == false && !display.readAndDispatch())
+ display.sleep();
+ }
+ if (display.isDisposed() == false)
+ display.update();
+ }
+ // Otherwise, perform a simple sleep.
+ else {
+ try {
+ Thread.sleep(waitTimeMillis);
+ } catch (InterruptedException e) {
+ // Ignored.
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.test/src/com/nokia/testfw/test/utils/WorkbenchUtils.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.testfw.test.utils;
+
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class WorkbenchUtils {
+
+ /**
+ * get view by view id
+ * @param id
+ * @return
+ */
+ public static IViewPart getView(String id) {
+ IViewReference viewReferences[] = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().getViewReferences();
+ for (int i = 0; i < viewReferences.length; i++) {
+ if (id.equals(viewReferences[i].getId())) {
+ return viewReferences[i].getView(false);
+ }
+ }
+ return null;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.testrunner.test/.classpath Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="lib" path="lib/junit.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.testrunner.test/.project Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.nokia.testfw.testrunner.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Binary file testdev/ite/test/com.nokia.testfw.testrunner.test/lib/junit.jar has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/testdev/ite/test/com.nokia.testfw.testrunner.test/src/com/nokia/testfw/testrunner/AllPureJUnitTests.java Tue Mar 30 14:39:29 2010 +0800
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Symbian Foundation License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.testfw.testrunner;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author xiaoma
+ *
+ */
+public class AllPureJUnitTests extends TestSuite {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("com.nokia.testfw.testrunner.junit");
+ // suite.addTestSuite(TailFileInputStreamTest.class);
+ return suite;
+ }
+
+}