Skip to content

Commit

Permalink
Upgraded eclipse libraries and got it working with 64 bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Jul 26, 2011
1 parent 6e5fe6e commit 683a865
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 43 deletions.
4 changes: 2 additions & 2 deletions Components/Core/Source/Factory/WindowFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public virtual Window CreateWindow(SearchCriteria searchCriteria, Process proces

public virtual Window FindWindow(Process process, Predicate<string> match, InitializeOption initializeOption, WindowSession windowSession)
{
AutomationElement foundElement =
WaitTillFound(() => FindWindowElement(process, match), "Could not find window matching condition");
string message = string.Format("Could not find window matching condition. ProcessName: {0}, ProcessId: {1}, MatchingConditionMethod: {2}, MatchingConditionTarget: {3}", process.ProcessName, process.Id, match.Method, match.Target);
AutomationElement foundElement = WaitTillFound(() => FindWindowElement(process, match), message);
return Create(foundElement, initializeOption, windowSession);
}

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions Components/Core/Tests/UITests/App.config.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<add key="SaveWindowItemsMap" value="true"/>
<add key="TestMode" value="@TestMode@"/>
<add key="JavaLocation" value="@JavaLocation@"/>
<add key="ProcessorType" value="@ProcessorType@"/>
</appSettings>
<NUnit>
<TestRunner>
Expand Down
28 changes: 21 additions & 7 deletions Components/Core/Tests/UITests/TestConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.IO;
Expand All @@ -8,8 +9,8 @@ namespace White.Core.UITests
{
public abstract class TestConfiguration
{
public static string WPFTestAppLocation = @"..\..\..\Components\Tests\WPFTestApp\bin\debug\WindowsPresentationFramework.exe";
public static string WinFormsTestAppLocation = @"..\..\..\Components\Tests\WinFormsTestApp\bin\debug\WinFormsTestApp.exe";
public static string WPFTestAppLocation = @"..\..\..\Components\Core\Tests\WPFTestApp\bin\debug\WindowsPresentationFramework.exe";
public static string WinFormsTestAppLocation = @"..\..\..\Components\Core\Tests\WinFormsTestApp\bin\debug\WinFormsTestApp.exe";

public static string SWTTestAppLocation = @"java.exe";

Expand Down Expand Up @@ -62,11 +63,24 @@ public WinFormTestConfiguration(string commandLineArguments) : base(WinFormsTest

public class SWTTestConfiguration : TestConfiguration
{
private static readonly Dictionary<String, String> SWTJarFiles = new Dictionary<string, string>
{
{"32bit", "org.eclipse.swt.win32.win32.x86_3.7.0.v3735b.jar"},
{"64bit", "org.eclipse.swt.win32.win32.x86_64_3.7.0.v3735b.jar"}
};

public SWTTestConfiguration(string commandLineArguments)
: base(
SWTAppFullPath(),
@" -classpath SampleSWTApp\bin;""%classpath%"";SampleSWTApp\org.eclipse.swt.win32.win32.x86_3.2.1.v3235.jar -Djava.library.path=SampleSWTApp Program " +
commandLineArguments) {}
: base(SWTAppFullPath(),
string.Format(@" -classpath SampleSWTApp\bin;""%classpath%"";SampleSWTApp\" + SWTJarFile() + @" -Djava.library.path=SampleSWTApp Program {0}", commandLineArguments)) { }

private static string SWTJarFile()
{
string processorType = ConfigurationManager.AppSettings["ProcessorType"];
string jarFile;
if (!SWTJarFiles.TryGetValue(processorType, out jarFile))
throw new ConfigurationErrorsException("ProcessorType property is not specified in AppSettings");
return jarFile;
}

private static string SWTAppFullPath()
{
Expand All @@ -77,7 +91,7 @@ private static string SWTAppFullPath()

protected override string WorkingDir
{
get { return @"..\..\..\TestApplications"; }
get { return @"..\..\..\Components\Core\Tests"; }
}
}
}
4 changes: 0 additions & 4 deletions Components/Core/Tests/WPFTestApp/WPFTestApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="White.CustomControls, Version=0.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Output\Components\customControls\White.CustomControls.dll</HintPath>
</Reference>
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
Expand Down
2 changes: 1 addition & 1 deletion Components/log4net4test.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
<root>
<level value="Info" />
<level value="Debug" />
<appender-ref ref="Console" />
</root>

Expand Down
2 changes: 1 addition & 1 deletion b.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
call tools\nant\NAnt.exe -nologo -buildfile:build\custom-nant.build compile.custom.nant -logfile:a.log
call tools\nant\NAnt.exe -nologo -buildfile:build\custom-nant.build compile.custom.nant -logfile:a.log -D:processor-type=64bit
call w %*
2 changes: 2 additions & 0 deletions b32bit.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
call tools\nant\NAnt.exe -nologo -buildfile:build\custom-nant.build compile.custom.nant -logfile:a.log -D:processor-type=32bit
call w %*
3 changes: 2 additions & 1 deletion build/Build.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
..\.gitignore = ..\.gitignore
..\b.bat = ..\b.bat
..\b32bit.bat = ..\b32bit.bat
component.build = component.build
components.build = components.build
core.build = core.build
Expand All @@ -18,9 +19,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
recorder.build = recorder.build
reporting.build = reporting.build
repository.build = repository.build
test-applications.build = test-applications.build
..\w.bat = ..\w.bat
..\w.log = ..\w.log
..\w32bit.bat = ..\w32bit.bat
webBrowser.build = webBrowser.build
white-nunit.build = white-nunit.build
white.build = white.build
Expand Down
8 changes: 4 additions & 4 deletions build/core.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<!--EXTERNAL_PROPERTIES: fixture;excludes;today;projectName;extension;minor.version;major.version-->
<!--EXTERNAL_PROPERTIES: fixture;excludes;today;projectName;extension;minor.version;major.version;java.location-->
<project name="Core">
<target name="core.clean">
<component-clean/>
Expand All @@ -11,11 +11,11 @@
<component-compile/>
</target>

<target name="core.uitest" depends="core.compile,core.wpf.uitest,core.winform.uitest,core.swt.uitest"/>
<target name="core.uitest" depends="core.swt.uitest"/>

<target name="core.swt.uitest" depends="core.compile">
<fail unless="${property::exists('java.location')}" message="Java location is not specified. Java is needed for running SWT tests"/>
<core-test excludes="WPF,WinForm,Normal" framework="SWT"/>
<fail unless="${property::exists('java.location')}" message="Java location is not specified. Java is needed for running SWT tests"/>
<core-test excludes="WPF,WinForm,Normal" framework="SWT" java.location="${java.location}"/>
</target>

<target name="core.winform.uitest" depends="core.compile">
Expand Down
44 changes: 22 additions & 22 deletions build/macrodefs.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<project name="Macrodefs">
<loadtasks assembly="..\tools\nant\CustomTasks\macrodef.dll"/>
<property name="framework.dir" value="c:\windows\microsoft.net\framework\v3.5"/>
<property name="nunit.exe" value="tools\nunit\nunit-console.exe"/>
<property name="nunit.exe" value="tools\nunit\nunit-console-x86.exe" if="${property::get-value('processor-type') == '64bit'}"/>
<property name="nunit.exe" value="tools\nunit\nunit-console.exe" if="${property::get-value('processor-type') == '32bit'}"/>

<macrodef name="component-compile">
<sequential>
Expand Down Expand Up @@ -63,59 +64,58 @@
</sequential>
</macrodef>

<macrodef name="nunit-test">
<attributes>
<attribute name="projects"/>
</attributes>
<sequential>
<property name="assemblies" value=""/>
<foreach item="String" in="${projects}" delim="," property="project">
<property name="assemblies" value="${assemblies} ${project}\bin\debug\White.${project}.dll"/>
</foreach>
<property name="nunit.exe" value="tools\nunit\nunit-console.exe"/>
<exec program="${nunit.exe}" commandline="/nologo /nothread ${assemblies} /xml:&quot;${build.output.dir}\TestResults.xml&quot;" failonerror="${fail.test.onerror}"/>
</sequential>
</macrodef>

<macrodef name="unit-test">
<sequential>
<copy file="..\Components\log4net4test.config" tofile="..\Output\Components\${component}\log4net.config"/>
<property name="nunit.arg" value="..\Output\Components\${component}\White.${component}.UnitTests.dll /xml:&quot;..\Output\Components\${component}\${component}_UnitTestResults.xml&quot;"/>
<exec program="${nunit.exe}" commandline="/nologo ${nunit.arg}" failonerror="${fail.test.onerror}"/>
<exec program="${nunit.exe}" commandline="/nologo /nothread ${nunit.arg}" failonerror="${fail.test.onerror}"/>
</sequential>
</macrodef>

<macrodef name="ui-test">
<sequential>
<copy file="..\Components\log4net4test.config" tofile="..\Output\Components\${component}\log4net.config"/>
<property name="nunit.arg" value="..\Output\Components\${component}\White.${component}.UITests.dll /xml:&quot;..\Output\Components\${component}\${component}_UITestResults.xml&quot;"/>
<exec program="${nunit.exe}" commandline="/nologo ${nunit.arg}" failonerror="${fail.test.onerror}"/>
<if test="${property::exists('test.fixture')}">
<property name="nunit.arg" value="..\Output\Components\${component}\White.${component}.UITests.dll /fixture:${test.fixture} /xml:&quot;..\Output\Components\${component}\${component}_UITestResults.xml&quot;"/>
</if>
<if test="${not property::exists('test.fixture')}">
<property name="nunit.arg" value="..\Output\Components\${component}\White.${component}.UITests.dll /xml:&quot;..\Output\Components\${component}\${component}_UITestResults.xml&quot;"/>
</if>
<exec program="${nunit.exe}" commandline="/nologo /nothread ${nunit.arg}" failonerror="${fail.test.onerror}"/>
</sequential>
</macrodef>

<macrodef name="core-test">
<attributes>
<attribute name="excludes" default=""/>
<attribute name="includes" default=""/>
<attribute name="java.location" default=""/>
<attribute name="framework"/>
</attributes>
<sequential>
<copy file="..\Components\log4net4test.config" tofile="..\Output\Components\Core\log4net.config"/>
<copy file="..\Components\Core\Tests\UITests\app.config.template" tofile="..\Output\Components\Core\White.Core.UITests.dll.config" overwrite="true">
<filterchain>
<replacetokens>
<token key="TestMode" value="${framework}" />
<token key="JavaLocation" value="${java.location}" />
<token key="ProcessorType" value="${processor-type}" />
</replacetokens>
</filterchain>
</copy>
<copy file="..\Components\log4net4test.config" tofile="..\Output\Components\${component}\log4net.config"/>

<property name="nunit.arg" value="..\Output\Components\Core\White.Core.UITests.dll /xml:&quot;..\Output\Components\Core\Core_UITestResults_${framework}_.xml&quot;"/>
<if test="${property::exists('test.fixture')}">
<property name="nunit.arg" value="..\Output\Components\Core\White.Core.UITests.dll /fixture:${test.fixture} /xml:&quot;..\Output\Components\Core\Core_UITestResults_${framework}_.xml&quot;"/>
</if>
<if test="${not property::exists('test.fixture')}">
<property name="nunit.arg" value="..\Output\Components\Core\White.Core.UITests.dll /xml:&quot;..\Output\Components\Core\Core_UITestResults_${framework}_.xml&quot;"/>
</if>

<if test="${excludes==''}">
<exec program="${nunit.exe}" commandline="/nologo ${nunit.arg} /include:&quot;${includes}&quot;" failonerror="${fail.test.onerror}"/>
<exec program="${nunit.exe}" commandline="/nologo /nothread ${nunit.arg} /include:&quot;${includes}&quot;" failonerror="${fail.test.onerror}"/>
</if>
<if test="${includes==''}">
<exec program="${nunit.exe}" commandline="/nologo ${nunit.arg} /exclude:&quot;${excludes}&quot;" failonerror="${fail.test.onerror}"/>
<exec program="${nunit.exe}" commandline="/nologo /nothread ${nunit.arg} /exclude:&quot;${excludes}&quot;" failonerror="${fail.test.onerror}"/>
</if>
</sequential>
</macrodef>
Expand Down
2 changes: 1 addition & 1 deletion w.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
call tools\nant\NAnt.exe -nologo -buildfile:build\master.build %* -logfile:w.log
call tools\nant\NAnt.exe -nologo -buildfile:build\master.build %* -logfile:w.log -D:processor-type=64bit
1 change: 1 addition & 0 deletions w32bit.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
call tools\nant\NAnt.exe -nologo -buildfile:build\master.build %* -logfile:w.log -D:processor-type=32bit

0 comments on commit 683a865

Please sign in to comment.