[tarantino] r150 committed - implemented the BatchJobs project

0 views
Skip to first unread message

codesite...@google.com

unread,
Dec 9, 2009, 3:01:28 PM12/9/09
to tarantino...@googlegroups.com
Revision: 150
Author: eric.hexter
Date: Wed Dec 9 12:00:36 2009
Log: implemented the BatchJobs project
http://code.google.com/p/tarantino/source/detail?r=150

Added:
/trunk/LatestVersion/BatchJobs.zip
/trunk/src/BatchJobs.Console
/trunk/src/BatchJobs.Console/App.config
/trunk/src/BatchJobs.Console/BatchJobs.Console.csproj
/trunk/src/BatchJobs.Console/Program.cs
/trunk/src/BatchJobs.Console/Properties
/trunk/src/BatchJobs.Console/Properties/AssemblyInfo.cs
/trunk/src/BatchJobs.Core
/trunk/src/BatchJobs.Core/BatchJobs.Core.csproj
/trunk/src/BatchJobs.Core/IJobAgent.cs
/trunk/src/BatchJobs.Core/IJobAgentFactory.cs
/trunk/src/BatchJobs.Core/IStateTransition.cs
/trunk/src/BatchJobs.Core/IStateTransitionFactory.cs
/trunk/src/BatchJobs.Core/JobAgentBase.cs
/trunk/src/BatchJobs.Core/Properties
/trunk/src/BatchJobs.Core/Properties/AssemblyInfo.cs
/trunk/src/BatchJobs.UnitTests
/trunk/src/BatchJobs.UnitTests/BatchJobs.UnitTests.csproj
/trunk/src/BatchJobs.UnitTests/JobAgentBaseTester.cs
/trunk/src/BatchJobs.UnitTests/ProgramTester.cs
/trunk/src/BatchJobs.UnitTests/Properties
/trunk/src/BatchJobs.UnitTests/Properties/AssemblyInfo.cs
Modified:
/trunk/LatestVersion/DatabaseManagement.zip
/trunk/LatestVersion/Deployer.zip
/trunk/LatestVersion/Tarantino.zip
/trunk/default.build
/trunk/src/Tarantino.sln

=======================================
--- /dev/null
+++ /trunk/LatestVersion/BatchJobs.zip Wed Dec 9 12:00:36 2009
Binary file, no diff available.
=======================================
--- /dev/null
+++ /trunk/src/BatchJobs.Console/App.config Wed Dec 9 12:00:36 2009
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <appSettings>
+ <add key="JobAgentFactoryType"
value="BatchJobs.Console.DebugerJobAgentFactory"/>
+ </appSettings>
+</configuration>
=======================================
--- /dev/null
+++ /trunk/src/BatchJobs.Console/BatchJobs.Console.csproj Wed Dec 9
12:00:36 2009
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)'
== '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{F4467244-E3C8-4536-8C5A-6BA33A2473E8}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>BatchJobs.Console</RootNamespace>
+ <AssemblyName>BatchJobs.Console</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|
AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|
AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.configuration" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\BatchJobs.Core\BatchJobs.Core.csproj">
+ <Project>{AD917904-9A71-4E80-96C3-91A0F8E77B2D}</Project>
+ <Name>BatchJobs.Core</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="App.config" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the
targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
=======================================
--- /dev/null
+++ /trunk/src/BatchJobs.Console/Program.cs Wed Dec 9 12:00:36 2009
@@ -0,0 +1,70 @@
+using System;
+using System.Configuration;
+using System.IO;
+using System.Reflection;
+using BatchJobs.Core;
+using BatchJobs.UnitTests;
+
+namespace BatchJobs.Console
+{
+ public class Program
+ {
+ public const string JobagentfactorytypeKey = "JobAgentFactoryType";
+
+ public Func<string> GetFactoryTypeName = () =>
ConfigurationManager.AppSettings[JobagentfactorytypeKey];
+
+ private static void Main(string[] args)
+ {
+ try
+ {
+ new Program().Run(args);
+ }
+ catch (Exception e)
+ {
+ System.Console.WriteLine(e);
+ }
+
+ }
+
+ public virtual void Run(string[] args)
+ {
+ IJobAgent jobAgent = Factory().Create(args[0]);
+ jobAgent.Execute();
+ }
+
+ public virtual IJobAgentFactory Factory()
+ {
+ string typename = GetFactoryTypeName();
+ string assemblyname = typename.Split(',')[1].Trim();
+ typename = typename.Split(',')[0].Trim();
+
+ Assembly a = null;
+ try
+ {
+ a = Assembly.Load(assemblyname);
+ }
+ catch (FileNotFoundException e)
+ {
+ System.Console.WriteLine(e.Message);
+ }
+ Type classType = a.GetType(typename);
+ return (IJobAgentFactory) Activator.CreateInstance(classType);
+ }
+ }
+ public class DebugerJobAgentFactory:IJobAgentFactory
+ {
+ public IJobAgent Create(string name)
+ {
+ System.Console.WriteLine(name);
+ return new DebugerJobAgent();
+ }
+ }
+
+ public class DebugerJobAgent : IJobAgent
+ {
+ public void Execute()
+ {
+ System.Console.WriteLine("Executing");
+ }
+ }
+}
=======================================
--- /dev/null
+++ /trunk/src/BatchJobs.Console/Properties/AssemblyInfo.cs Wed Dec 9
12:00:36 2009
@@ -0,0 +1,39 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the
following
+// set of attributes. Change these attribute values to modify the
information
+// associated with an assembly.
+
+[assembly: AssemblyTitle("BatchJobs.Console")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("BatchJobs.Console")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is
exposed to COM
+
+[assembly: Guid("4495da63-8855-40ea-a6bb-48f38e8364f5")]
+
+// Version information for an assembly consists of the following four
values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and
Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
=======================================
--- /dev/null
+++ /trunk/src/BatchJobs.Core/BatchJobs.Core.csproj Wed Dec 9 12:00:36 2009
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)'
== '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{AD917904-9A71-4E80-96C3-91A0F8E77B2D}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>BatchJobs.Core</RootNamespace>
+ <AssemblyName>BatchJobs.Core</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|
AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|
AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="IJobAgentFactory.cs" />
+ <Compile Include="JobAgentBase.cs" />
+ <Compile Include="IJobAgent.cs" />
+ <Compile Include="IStateTransitionFactory.cs" />
+ <Compile Include="IStateTransition.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the
targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
=======================================
--- /dev/null
+++ /trunk/src/BatchJobs.Core/IJobAgent.cs Wed Dec 9 12:00:36 2009
@@ -0,0 +1,7 @@
+namespace BatchJobs.Core
+{
+ public interface IJobAgent
+ {
+ void Execute();
+ }
+}
=======================================
--- /dev/null
+++ /trunk/src/BatchJobs.Core/IJobAgentFactory.cs Wed Dec 9 12:00:36 2009
@@ -0,0 +1,9 @@
+using BatchJobs.Core;
+
+namespace BatchJobs.UnitTests
+{
+ public interface IJobAgentFactory
+ {
+ IJobAgent Create(string name);
+ }
+}
=======================================
--- /dev/null
+++ /trunk/src/BatchJobs.Core/IStateTransition.cs Wed Dec 9 12:00:36 2009
@@ -0,0 +1,8 @@
+namespace BatchJobs.Core
+{
+ public interface IStateTransition<T>
+ {
+ bool IsValid(T batch);
+ void Execute(T batch);
+ }
+}
=======================================
--- /dev/null
+++ /trunk/src/BatchJobs.Core/IStateTransitionFactory.cs Wed Dec 9
12:00:36 2009
@@ -0,0 +1,9 @@
+using System.Collections.Generic;
+
+namespace BatchJobs.Core
+{
+ public interface IStateTransitionFactory
+ {
+ IEnumerable<IStateTransition<T>> GetAll<T>();
+ }
+}
=======================================
--- /dev/null
+++ /trunk/src/BatchJobs.Core/JobAgentBase.cs Wed Dec 9 12:00:36 2009
@@ -0,0 +1,31 @@
+using System.Collections.Generic;
+
+namespace BatchJobs.Core
+{
+ public abstract class JobAgentBase<T> : IJobAgent where T : class
+ {
+ private readonly IStateTransitionFactory _factory;
+
+ public JobAgentBase(IStateTransitionFactory factory)
+ {
+ _factory = factory;
+ }
+
+ public void Execute()
+ {
+ IEnumerable<IStateTransition<T>> transitions =
_factory.GetAll<T>();
+ T[] batches = GetNextEntites();
+
+ foreach (T batch in batches)
+ {
+ foreach (var transition in transitions)
+ {
+ if (transition.IsValid(batch))
+ transition.Execute(batch);
+ }
+ }
+ }
+
+ protected abstract T[] GetNextEntites();
+ }
+}
=======================================
--- /dev/null
+++ /trunk/src/BatchJobs.Core/Properties/AssemblyInfo.cs Wed Dec 9
12:00:36 2009
@@ -0,0 +1,39 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the
following
+// set of attributes. Change these attribute values to modify the
information
+// associated with an assembly.
+
+[assembly: AssemblyTitle("BatchJobs.Core")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("BatchJobs.Core")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is
exposed to COM
+
+[assembly: Guid("13970d68-159f-4911-b924-702dbd485038")]
+
+// Version information for an assembly consists of the following four
values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and
Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
=======================================
--- /dev/null
+++ /trunk/src/BatchJobs.UnitTests/BatchJobs.UnitTests.csproj Wed Dec 9
12:00:36 2009
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)'
== '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{C2D734F7-65CA-43D6-A8A5-26DA884877DB}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>BatchJobs.UnitTests</RootNamespace>
+ <AssemblyName>BatchJobs.UnitTests</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|
AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|
AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="nunit.framework, Version=2.4.6.0, Culture=neutral,
PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\lib\NUnit\2.4.3\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.configuration" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="JobAgentBaseTester.cs" />
+ <Compile Include="ProgramTester.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference
Include="..\BatchJobs.Console\BatchJobs.Console.csproj">
+ <Project>{F4467244-E3C8-4536-8C5A-6BA33A2473E8}</Project>
+ <Name>BatchJobs.Console</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\BatchJobs.Core\BatchJobs.Core.csproj">
+ <Project>{AD917904-9A71-4E80-96C3-91A0F8E77B2D}</Project>
+ <Name>BatchJobs.Core</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the
targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
=======================================
--- /dev/null
+++ /trunk/src/BatchJobs.UnitTests/JobAgentBaseTester.cs Wed Dec 9
12:00:36 2009
@@ -0,0 +1,89 @@
+using System;
+using System.Collections.Generic;
+using BatchJobs.Core;
+using NUnit.Framework;
+using NUnit.Framework.SyntaxHelpers;
+
+namespace BatchJobs.UnitTests
+{
+ [TestFixture]
+ public class JobAgentBaseTester
+ {
+ [Test]
+ public void Should_loop_through_the_batches()
+ {
+ StateTransitions.Called = 0;
+ var agent = new JobAgentStub(new StubAgentFactory(1));
+ agent.Execute();
+ Assert.That(StateTransitions.Called,Is.EqualTo(3));
+ }
+
+ [Test]
+ public void Should_loop_through_each_transitions_for_each_batch()
+ {
+ StateTransitions.Called = 0;
+ var agent = new JobAgentStub(new StubAgentFactory(3));
+ agent.Execute();
+ Assert.That(StateTransitions.Called, Is.EqualTo(9));
+ }
+ }
+
+ public class StubAgentFactory : IStateTransitionFactory
+ {
+ public StubAgentFactory():this(1)
+ {
+ }
+
+ public StubAgentFactory(int numberOfTransitions)
+ {
+ _numberOfTransitions = numberOfTransitions;
+ }
+
+ private int _numberOfTransitions;
+
+ public IEnumerable<IStateTransition<T>> GetAll<T>()
+ {
+ for (int i = 0; i < _numberOfTransitions; i++)
+ yield return (IStateTransition<T>)
+ new StateTransitions();
+ }
+ }
+
+ public class StateTransitions:IStateTransition<Batch>
+ {
+ public static int Called { get; set; }
+
+ public bool IsValid(Batch batch)
+ {
+ Called++;
+ return false;
+ }
+
+ public void Execute(Batch batch)
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ public class JobAgentStub:JobAgentBase<Batch>
+ {
+ public JobAgentStub(IStateTransitionFactory factory) :
base(factory)
+ {
+
+ }
+
+ protected override Batch[] GetNextEntites()
+ {
+ return new[]
+ {
+ new Batch(),
+ new Batch(),
+ new Batch(),
+ };
+ }
+ }
+
+ public class Batch
+ {
+ }
+}
=======================================
--- /dev/null
+++ /trunk/src/BatchJobs.UnitTests/ProgramTester.cs Wed Dec 9 12:00:36 2009
@@ -0,0 +1,67 @@
+using BatchJobs.Console;
+using BatchJobs.Core;
+using NUnit.Framework;
+using NUnit.Framework.SyntaxHelpers;
+
+namespace BatchJobs.UnitTests
+{
+ [TestFixture]
+ public class ProgramTester
+ {
+ [Test]
+ public void Should_create_a_factory()
+ {
+ var program = new Program();
+ program.GetFactoryTypeName = () => typeof
(FactoryStub).FullName + "," + GetType().Assembly.FullName;
+ IJobAgentFactory factory = program.Factory();
+ Assert.IsAssignableFrom(typeof (FactoryStub), factory);
+ }
+
+ [Test]
+ public void Should_locate_a_factory_and_execute_a_job()
+ {
+ var agent = new StubJob();
+ FactoryStub.JobAgent = agent;
+ var program = new Program();
+ program.GetFactoryTypeName = () => typeof
(FactoryStub).FullName + "," + GetType().Assembly.FullName;
+ program.Run(new[] {"foo"});
+ Assert.That(FactoryStub.Name, Is.EqualTo("foo"));
+ Assert.That(agent.Executed, Is.True);
+ }
+ }
+
+ public class StubJob : IJobAgent
+ {
+ public bool Executed { get; set; }
+
+
+ public void Execute()
+ {
+ Executed = true;
+ }
+ }
+
+ public class FactoryStub : IJobAgentFactory
+ {
+ public FactoryStub()
+ {
+ if(JobAgent==null)
+ {
+ JobAgent = new StubJob();
+ }
+ }
+
+ public static IJobAgent JobAgent { get; set; }
+
+ public static string Name { get; set; }
+
+
+ public IJobAgent Create(string name)
+ {
+ System.Console.WriteLine(name);
+ Name = name;
+ return JobAgent;
+ }
+
+ }
+}
=======================================
--- /dev/null
+++ /trunk/src/BatchJobs.UnitTests/Properties/AssemblyInfo.cs Wed Dec 9
12:00:36 2009
@@ -0,0 +1,39 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the
following
+// set of attributes. Change these attribute values to modify the
information
+// associated with an assembly.
+
+[assembly: AssemblyTitle("BatchJobs.UnitTests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("BatchJobs.UnitTests")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is
exposed to COM
+
+[assembly: Guid("f8f6ff4b-8a0a-42e2-b0b2-ffe0d9af0347")]
+
+// Version information for an assembly consists of the following four
values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and
Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
=======================================
--- /trunk/LatestVersion/DatabaseManagement.zip Wed Nov 25 06:47:15 2009
+++ /trunk/LatestVersion/DatabaseManagement.zip Wed Dec 9 12:00:36 2009
Binary file, no diff available.
=======================================
--- /trunk/LatestVersion/Deployer.zip Wed Nov 25 06:47:15 2009
+++ /trunk/LatestVersion/Deployer.zip Wed Dec 9 12:00:36 2009
File is too large to display a diff.
=======================================
--- /trunk/LatestVersion/Tarantino.zip Wed Nov 25 06:47:15 2009
+++ /trunk/LatestVersion/Tarantino.zip Wed Dec 9 12:00:36 2009
File is too large to display a diff.
=======================================
--- /trunk/default.build Wed Sep 2 08:24:31 2009
+++ /trunk/default.build Wed Dec 9 12:00:36 2009
@@ -23,6 +23,7 @@
<!-- Package settings -->
<property name="svn.exe" value="lib\subversion\1.4.3\svn.exe" />
<property name="dir.package" value="${dir.build}\package" dynamic="true"
/>
+ <property name="dir.batchjobs.package"
value="${dir.build}\batchjobspackage" dynamic="true" />
<property name="dir.dbmanager.package"
value="${dir.build}\dbmanagerpackage" dynamic="true" />
<property name="dir.deployer.package"
value="${dir.build}\deployerpackage" dynamic="true" />

@@ -143,7 +144,14 @@
</fileset>
</copy>

-
+
+ <delete dir="${dir.batchjobs.package}" failonerror="false" />
+ <copy todir="${dir.batchjobs.package}" verbose="false">
+ <fileset basedir="src\BatchJobs.Console\bin\${project.config}" >
+ <include name="*.*" />
+ </fileset>
+ </copy>
+
<delete dir="${dir.deployer.package}" failonerror="false" />
<copy todir="${dir.deployer.package}\Setup" verbose="false">
<fileset
basedir="src\Tarantino.DatabaseManager\bin\${project.config}" >
@@ -273,6 +281,16 @@
</fileset>
</zip>

+ <property name="zipFile" value="LatestVersion/BatchJobs.zip"/>
+
+ <delete file="${zipFile}" failonerror="false" />
+
+ <zip zipfile="${zipFile}" includeemptydirs="true" >
+ <fileset basedir="${dir.batchjobs.package}">
+ <include name="**" />
+ </fileset>
+ </zip>
+
<property name="zipFile" value="LatestVersion/Deployer.zip"/>

<delete file="${zipFile}" failonerror="false" />
=======================================
--- /trunk/src/Tarantino.sln Wed Sep 2 08:24:31 2009
+++ /trunk/src/Tarantino.sln Wed Dec 9 12:00:36 2009
@@ -45,6 +45,16 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}")
= "Tarantino.DatabaseManager.Console", "Tarantino.DatabaseManager.Console\Tarantino.DatabaseManager.Console.csproj", "{6C1BCF01-0508-42C0-9C95-8E9D3401400F}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}")
= "Deployer", "Deployer", "{92521A2A-F2B9-4C47-971A-C032254D812B}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}")
= "BatchJobs", "BatchJobs", "{A1C92749-EFCF-481C-A00F-3134AA6C0503}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}")
= "BatchJobs.Core", "BatchJobs.Core\BatchJobs.Core.csproj", "{AD917904-9A71-4E80-96C3-91A0F8E77B2D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}")
= "BatchJobs.Console", "BatchJobs.Console\BatchJobs.Console.csproj", "{F4467244-E3C8-4536-8C5A-6BA33A2473E8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}")
= "BatchJobs.UnitTests", "BatchJobs.UnitTests\BatchJobs.UnitTests.csproj", "{C2D734F7-65CA-43D6-A8A5-26DA884877DB}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -113,6 +123,18 @@
{6C1BCF01-0508-42C0-9C95-8E9D3401400F}.Debug|Any CPU.Build.0 = Debug|Any
CPU
{6C1BCF01-0508-42C0-9C95-8E9D3401400F}.Release|Any CPU.ActiveCfg =
Release|Any CPU
{6C1BCF01-0508-42C0-9C95-8E9D3401400F}.Release|Any CPU.Build.0 = Release|
Any CPU
+ {AD917904-9A71-4E80-96C3-91A0F8E77B2D}.Debug|Any CPU.ActiveCfg = Debug|
Any CPU
+ {AD917904-9A71-4E80-96C3-91A0F8E77B2D}.Debug|Any CPU.Build.0 = Debug|Any
CPU
+ {AD917904-9A71-4E80-96C3-91A0F8E77B2D}.Release|Any CPU.ActiveCfg =
Release|Any CPU
+ {AD917904-9A71-4E80-96C3-91A0F8E77B2D}.Release|Any CPU.Build.0 = Release|
Any CPU
+ {F4467244-E3C8-4536-8C5A-6BA33A2473E8}.Debug|Any CPU.ActiveCfg = Debug|
Any CPU
+ {F4467244-E3C8-4536-8C5A-6BA33A2473E8}.Debug|Any CPU.Build.0 = Debug|Any
CPU
+ {F4467244-E3C8-4536-8C5A-6BA33A2473E8}.Release|Any CPU.ActiveCfg =
Release|Any CPU
+ {F4467244-E3C8-4536-8C5A-6BA33A2473E8}.Release|Any CPU.Build.0 = Release|
Any CPU
+ {C2D734F7-65CA-43D6-A8A5-26DA884877DB}.Debug|Any CPU.ActiveCfg = Debug|
Any CPU
+ {C2D734F7-65CA-43D6-A8A5-26DA884877DB}.Debug|Any CPU.Build.0 = Debug|Any
CPU
+ {C2D734F7-65CA-43D6-A8A5-26DA884877DB}.Release|Any CPU.ActiveCfg =
Release|Any CPU
+ {C2D734F7-65CA-43D6-A8A5-26DA884877DB}.Release|Any CPU.Build.0 = Release|
Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -123,5 +145,11 @@
{1C8083DC-FF7D-4525-8724-49FD434A02D7} =
{AE91826A-2689-4B7C-BB5C-9B580E265A2D}
{4BD61AE4-68B6-489F-B433-A456FE10B5BE} =
{AE91826A-2689-4B7C-BB5C-9B580E265A2D}
{6C1BCF01-0508-42C0-9C95-8E9D3401400F} =
{AE91826A-2689-4B7C-BB5C-9B580E265A2D}
+ {001C4DB4-F834-486F-BD22-6D3F074B57AE} =
{92521A2A-F2B9-4C47-971A-C032254D812B}
+ {E3585B26-999B-4CB0-B134-06D061912ADE} =
{92521A2A-F2B9-4C47-971A-C032254D812B}
+ {53967760-40E5-426A-A0B6-CE4C693557F8} =
{92521A2A-F2B9-4C47-971A-C032254D812B}
+ {AD917904-9A71-4E80-96C3-91A0F8E77B2D} =
{A1C92749-EFCF-481C-A00F-3134AA6C0503}
+ {F4467244-E3C8-4536-8C5A-6BA33A2473E8} =
{A1C92749-EFCF-481C-A00F-3134AA6C0503}
+ {C2D734F7-65CA-43D6-A8A5-26DA884877DB} =
{A1C92749-EFCF-481C-A00F-3134AA6C0503}
EndGlobalSection
EndGlobal
Reply all
Reply to author
Forward
0 new messages