Initial version of Quartz 2.0 integration

This commit is contained in:
Marko Lahma
2012-02-11 17:55:35 +02:00
parent 387ba32476
commit fa894204d3
78 changed files with 134392 additions and 51635 deletions

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E4328F68-C3FC-43E2-9D63-30CEC55215B0}</ProjectGuid>
<OutputType>Library</OutputType>
@@ -33,9 +33,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\net\2.0\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Quartz, Version=0.7.0.15571, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Quartz, Version=1.0.3.2, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\net\2.0\Quartz.dll</HintPath>
<HintPath>..\..\..\lib\Quartz10\net\2.0\Quartz.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks, Version=2.9.6.40380, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>

View File

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E4328F68-C3FC-43E2-9D63-30CEC55215B0}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring</RootNamespace>
<AssemblyName>Spring.Scheduling.Quartz.Integration.Tests</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\build\VS.NET.2008\Spring.Scheduling.Quartz.Integration.Tests\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_2_0;NET_3_5</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\build\VS.NET.2008\Spring.Scheduling.Quartz.Integration.Tests\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0;NET_3_5</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=2.2.7.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\net\2.0\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Quartz, Version=1.0.3.2, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Quartz10\net\2.0\Quartz.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks, Version=2.9.6.40380, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Net\2.0\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<None Include="Spring.Scheduling.Quartz.Integration.Tests.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Compile Include="Scheduling\Quartz\LocalDataSourceJobStoreTest.cs" />
<Compile Include="Scheduling\Quartz\TestJob.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Scheduling\Quartz\LocalDataSourceJobStoreTest.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.2010.csproj">
<Project>{710961A3-0DF4-49E4-A26E-F5B9C044AC84}</Project>
<Name>Spring.Core.2010</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\src\Spring\Spring.Data\Spring.Data.2010.csproj">
<Project>{AE00E5AB-C39A-436F-86D2-33BFE33E2E40}</Project>
<Name>Spring.Data.2010</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\src\Spring\Spring.Scheduling.Quartz\Spring.Scheduling.Quartz.2010.csproj">
<Project>{E823D54C-CE82-4868-929F-5F95A999F61E}</Project>
<Name>Spring.Scheduling.Quartz.2010</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\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>

View File

@@ -44,8 +44,8 @@
<assemblyIdentity name="Common.Logging"
publicKeyToken="af08829b84f0328e" />
<!-- Assembly versions can be redirected in application, publisher policy, or machine configuration files. -->
<bindingRedirect oldVersion="1.1.0.0"
newVersion="1.2.0.0"/>
<bindingRedirect oldVersion="1.2.0.0"
newVersion="2.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

View File

@@ -14,15 +14,11 @@
* limitations under the License.
*/
using System;
using NUnit.Framework;
using Quartz;
using Quartz.Job;
using Quartz.Spi;
using Spring.Scheduling.Quartz;
namespace Spring.Scheduling.Quartz
{
/// <summary>
@@ -52,8 +48,12 @@ namespace Spring.Scheduling.Quartz
try
{
// this actually fails already in Quartz level
TriggerFiredBundle bundle = TestUtil.CreateMinimalFiredBundleWithTypedJobDetail(typeof(object));
TriggerFiredBundle bundle = TestUtil.CreateMinimalFiredBundleWithTypedJobDetail(typeof (object));
#if QUARTZ_2_0
jobFactory.NewJob(bundle, null);
#else
jobFactory.NewJob(bundle);
#endif
Assert.Fail("Created job which was not an IJob");
}
catch (ArgumentException)
@@ -85,14 +85,15 @@ namespace Spring.Scheduling.Quartz
[Test]
public void TestNewJob_NormalIJob()
{
TriggerFiredBundle bundle = TestUtil.CreateMinimalFiredBundleWithTypedJobDetail(typeof(NoOpJob));
TriggerFiredBundle bundle = TestUtil.CreateMinimalFiredBundleWithTypedJobDetail(typeof (NoOpJob));
#if QUARTZ_2_0
IJob job = jobFactory.NewJob(bundle, null);
#else
IJob job = jobFactory.NewJob(bundle);
#endif
Assert.IsNotNull(job, "Returned job was null");
}
}
internal class NoOpThreadStartJob : NoOpJob

View File

@@ -16,12 +16,16 @@
using System;
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using Quartz;
using Quartz.Job;
#if QUARTZ_2_0
using JobDetail = Quartz.Impl.JobDetailImpl;
#endif
namespace Spring.Scheduling.Quartz
{
/// <summary>
@@ -79,7 +83,7 @@ namespace Spring.Scheduling.Quartz
[Test]
public void TestJobDataAsMap()
{
Hashtable data = new Hashtable();
IDictionary data = new Dictionary<string, object>();
data["foo"] = "bar";
data["number"] = 123;
cronTrigger.JobDataAsMap = data;

View File

@@ -18,6 +18,10 @@ using NUnit.Framework;
using Quartz;
#if QUARTZ_2_0
using JobDetail = Quartz.Impl.JobDetailImpl;
#endif
namespace Spring.Scheduling.Quartz
{
/// <summary>
@@ -54,7 +58,9 @@ namespace Spring.Scheduling.Quartz
Assert.AreEqual(FACTORY_NAME, jd.Name, "job name did not default to factory name");
Assert.AreEqual(jd.JobType, typeof(MethodInvokingJob), "factory did not create method invoking job");
Assert.IsTrue(jd.Durable, "job was not durable");
#if !QUARTZ_2_0
Assert.IsTrue(jd.Volatile, "job was not volatile");
#endif
}
/// <summary>
@@ -70,6 +76,7 @@ namespace Spring.Scheduling.Quartz
Assert.AreEqual(jd.JobType, typeof(StatefulMethodInvokingJob), "factory did not create stateful method invoking job");
}
#if !QUARTZ_2_0
/// <summary>
/// Tests JobDetail retrieval and it's set properties.
/// </summary>
@@ -82,6 +89,7 @@ namespace Spring.Scheduling.Quartz
JobDetail jd = (JobDetail)factory.GetObject();
CollectionAssert.AreEquivalent(LISTENER_NAMES, jd.JobListenerNames);
}
#endif
}
}

View File

@@ -27,6 +27,12 @@ using Rhino.Mocks;
using Spring.Objects.Support;
#if QUARTZ_2_0
using JobExecutionContext = Quartz.Impl.JobExecutionContextImpl;
using JobDetail = Quartz.Impl.JobDetailImpl;
using SimpleTrigger = Quartz.Impl.Triggers.SimpleTriggerImpl;
#endif
namespace Spring.Scheduling.Quartz
{
/// <summary>

View File

@@ -30,6 +30,14 @@ using Spring.Context.Support;
using Spring.Objects;
using Spring.Objects.Factory.Support;
#if QUARTZ_2_0
using CronTrigger = Quartz.Impl.Triggers.CronTriggerImpl;
using JobExecutionContext = Quartz.IJobExecutionContext;
using JobDetail = Quartz.Impl.JobDetailImpl;
using SimpleTrigger = Quartz.Impl.Triggers.SimpleTriggerImpl;
using Trigger = Quartz.ITrigger;
#endif
namespace Spring.Scheduling.Quartz
{
/// <summary>
@@ -41,17 +49,6 @@ namespace Spring.Scheduling.Quartz
[TestFixture]
public class QuartzSupportTests
{
private MockRepository mockery;
/// <summary>
/// Test setup.
/// </summary>
[SetUp]
public void SetUp()
{
mockery = new MockRepository();
}
/// <summary>
/// Executes parametrized test.
/// </summary>
@@ -123,28 +120,10 @@ namespace Spring.Scheduling.Quartz
trigger1.RepeatInterval = TimeSpan.FromMilliseconds(20);
trigger1.AfterPropertiesSet();
IScheduler scheduler = (IScheduler) mockery.CreateMock(typeof (IScheduler));
IScheduler scheduler = MockRepository.GenerateMock<IScheduler>();
Expect.Call(scheduler.Context).Return(new SchedulerContext());
Expect.Call(scheduler.GetJobDetail("myJob0", SchedulerConstants.DefaultGroup)).Return(null);
Expect.Call(scheduler.GetJobDetail("myJob1", SchedulerConstants.DefaultGroup)).Return(null);
Expect.Call(scheduler.GetTrigger("myTrigger0", SchedulerConstants.DefaultGroup)).Return(null);
Expect.Call(scheduler.GetTrigger("myTrigger1", SchedulerConstants.DefaultGroup)).Return(null);
scheduler.Stub(x => x.Context).Return(new SchedulerContext());
scheduler.AddJob(jobDetail0, true);
LastCall.IgnoreArguments();
Expect.Call(scheduler.ScheduleJob(trigger0)).Return(DateTime.UtcNow);
scheduler.AddJob(jobDetail1, true);
LastCall.IgnoreArguments();
Expect.Call(scheduler.ScheduleJob(trigger1)).Return(DateTime.UtcNow);
scheduler.Start();
LastCall.IgnoreArguments();
scheduler.Shutdown(false);
LastCall.IgnoreArguments();
mockery.ReplayAll();
SchedulerFactoryObject schedulerFactoryObject = new TestSchedulerFactoryObject(scheduler);
schedulerFactoryObject.JobFactory = (null);
IDictionary schedulerContext = new Hashtable();
@@ -165,7 +144,14 @@ namespace Spring.Scheduling.Quartz
schedulerFactoryObject.Dispose();
}
mockery.VerifyAll();
scheduler.AssertWasCalled(x => x.ScheduleJob(trigger0));
scheduler.AssertWasCalled(x => x.ScheduleJob(trigger1));
scheduler.AssertWasCalled(x => x.AddJob(jobDetail0, true));
scheduler.AssertWasCalled(x => x.AddJob(jobDetail1, true));
scheduler.AssertWasCalled(x => x.Start());
scheduler.AssertWasCalled(x => x.Shutdown(false));
}
/// <summary>
@@ -219,28 +205,21 @@ namespace Spring.Scheduling.Quartz
trigger1.RepeatInterval = TimeSpan.FromMilliseconds(20);
trigger1.AfterPropertiesSet();
IScheduler scheduler = (IScheduler) mockery.CreateMock(typeof (IScheduler));
Expect.Call(scheduler.Context).Return(new SchedulerContext());
Expect.Call(scheduler.GetTrigger("myTrigger0", SchedulerConstants.DefaultGroup)).Return(null);
Expect.Call(scheduler.GetTrigger("myTrigger1", SchedulerConstants.DefaultGroup)).Return(new SimpleTrigger());
IScheduler scheduler = MockRepository.GenerateMock<IScheduler>();
scheduler.Stub(x => x.Context).Return(new SchedulerContext());
#if QUARTZ_2_0
scheduler.Stub(x => x.GetTrigger(new TriggerKey("myTrigger1", SchedulerConstants.DefaultGroup))).Return(new SimpleTrigger());
#else
scheduler.Stub(x => x.GetTrigger("myTrigger1", SchedulerConstants.DefaultGroup)).Return(new SimpleTrigger());
#endif
if (overwrite)
{
scheduler.AddJob(jobDetail1, true);
LastCall.IgnoreArguments();
Expect.Call(scheduler.RescheduleJob("myTrigger1", SchedulerConstants.DefaultGroup, trigger1)).Return(
DateTime.UtcNow);
#if QUARTZ_2_0
scheduler.Stub(x => x.RescheduleJob(new TriggerKey("myTrigger1", SchedulerConstants.DefaultGroup), trigger1)).Return(DateTime.UtcNow);
#else
scheduler.Stub(x => x.RescheduleJob("myTrigger1", SchedulerConstants.DefaultGroup, trigger1)).Return(DateTime.UtcNow);
#endif
}
else
{
Expect.Call(scheduler.GetJobDetail("myJob0", SchedulerConstants.DefaultGroup)).Return(null);
}
scheduler.AddJob(jobDetail0, true);
LastCall.IgnoreArguments();
Expect.Call(scheduler.ScheduleJob(trigger0)).Return(DateTime.UtcNow);
scheduler.Start();
scheduler.Shutdown(false);
mockery.ReplayAll();
SchedulerFactoryObject schedulerFactoryObject = new TestSchedulerFactoryObject(scheduler);
schedulerFactoryObject.JobFactory = (null);
@@ -262,7 +241,10 @@ namespace Spring.Scheduling.Quartz
schedulerFactoryObject.Dispose();
}
mockery.VerifyAll();
scheduler.AssertWasCalled(x => x.AddJob(jobDetail0, true));
scheduler.AssertWasCalled(x => x.ScheduleJob(trigger0));
scheduler.AssertWasCalled(x => x.Start());
scheduler.AssertWasCalled(x => x.Shutdown(false));
}
/// <summary>
@@ -316,37 +298,37 @@ namespace Spring.Scheduling.Quartz
trigger1.RepeatInterval = TimeSpan.FromMilliseconds(20);
trigger1.AfterPropertiesSet();
IScheduler scheduler = (IScheduler) mockery.CreateMock(typeof (IScheduler));
Expect.Call(scheduler.Context).Return(new SchedulerContext());
Expect.Call(scheduler.GetTrigger("myTrigger0", SchedulerConstants.DefaultGroup)).Return(null);
Expect.Call(scheduler.GetTrigger("myTrigger1", SchedulerConstants.DefaultGroup)).Return(new SimpleTrigger());
IScheduler scheduler = MockRepository.GenerateMock<IScheduler>();
scheduler.Stub(x => x.Context).Return(new SchedulerContext());
#if QUARTZ_2_0
scheduler.Stub(x => x.GetTrigger(new TriggerKey("myTrigger1", SchedulerConstants.DefaultGroup))).Return(new SimpleTrigger());
#else
scheduler.Stub(x => x.GetTrigger("myTrigger1", SchedulerConstants.DefaultGroup)).Return(new SimpleTrigger());
#endif
if (overwrite)
{
scheduler.AddJob(jobDetail1, true);
LastCall.IgnoreArguments();
Expect.Call(scheduler.RescheduleJob("myTrigger1", SchedulerConstants.DefaultGroup, trigger1)).Return(
DateTime.UtcNow);
}
else
{
Expect.Call(scheduler.GetJobDetail("myJob0", SchedulerConstants.DefaultGroup)).Return(null);
#if QUARTZ_2_0
scheduler.Stub(x => x.RescheduleJob(new TriggerKey("myTrigger1", SchedulerConstants.DefaultGroup), trigger1)).Return(DateTime.UtcNow);
#else
scheduler.Stub(x => x.RescheduleJob("myTrigger1", SchedulerConstants.DefaultGroup, trigger1)).Return(DateTime.UtcNow);
#endif
}
scheduler.AddJob(jobDetail0, true);
LastCall.IgnoreArguments();
scheduler.Stub(x => x.ScheduleJob(trigger0)).Throw(new ObjectAlreadyExistsException(""));
Expect.Call(scheduler.ScheduleJob(trigger0)).Throw(new ObjectAlreadyExistsException(""));
if (overwrite)
{
Expect.Call(scheduler.RescheduleJob("myTrigger0", SchedulerConstants.DefaultGroup, trigger0)).Return(
DateTime.UtcNow);
#if QUARTZ_2_0
scheduler.Stub(x => x.RescheduleJob(new TriggerKey("myTrigger0", SchedulerConstants.DefaultGroup), trigger0)).Return(DateTime.UtcNow);
#else
scheduler.Stub(x => x.RescheduleJob("myTrigger0", SchedulerConstants.DefaultGroup, trigger0)).Return(DateTime.UtcNow);
#endif
}
scheduler.Start();
scheduler.Shutdown(false);
mockery.ReplayAll();
SchedulerFactoryObject schedulerFactoryObject = new TestSchedulerFactoryObject(scheduler);
schedulerFactoryObject.JobFactory = (null);
@@ -368,9 +350,11 @@ namespace Spring.Scheduling.Quartz
schedulerFactoryObject.Dispose();
}
mockery.VerifyAll();
scheduler.AssertWasCalled(x => x.AddJob(jobDetail0, true));
}
#if !QUARTZ_2_0
/// <summary>
/// </summary>
[Test]
@@ -378,7 +362,7 @@ namespace Spring.Scheduling.Quartz
{
IJobFactory jobFactory = new AdaptableJobFactory();
IScheduler scheduler = (IScheduler) mockery.CreateMock(typeof (IScheduler));
IScheduler scheduler = MockRepository.GenerateMock<IScheduler>();
ISchedulerListener schedulerListener = new TestSchedulerListener();
IJobListener globalJobListener = new TestJobListener();
@@ -395,8 +379,6 @@ namespace Spring.Scheduling.Quartz
scheduler.Start();
scheduler.Shutdown(false);
mockery.ReplayAll();
SchedulerFactoryObject schedulerFactoryObject = new TestSchedulerFactoryObject(scheduler);
schedulerFactoryObject.JobFactory = (jobFactory);
@@ -414,10 +396,9 @@ namespace Spring.Scheduling.Quartz
{
schedulerFactoryObject.Dispose();
}
mockery.VerifyAll();
}
#endif
/*public void TestMethodInvocationWithConcurrency() {
methodInvokingConcurrency(true);
}*/
@@ -549,23 +530,8 @@ namespace Spring.Scheduling.Quartz
trigger1.RepeatCount = (SimpleTrigger.RepeatIndefinitely);
trigger1.RepeatInterval = TimeSpan.FromMilliseconds(20);
IScheduler scheduler = (IScheduler) mockery.CreateMock(typeof (IScheduler));
Expect.Call(scheduler.JobFactory = (jobFactory));
Expect.Call(scheduler.GetJobDetail("myJob0", SchedulerConstants.DefaultGroup)).Return(null);
Expect.Call(scheduler.GetJobDetail("myJob1", SchedulerConstants.DefaultGroup)).Return(null);
Expect.Call(scheduler.GetTrigger("myTrigger0", SchedulerConstants.DefaultGroup)).Return(null);
Expect.Call(scheduler.GetTrigger("myTrigger1", SchedulerConstants.DefaultGroup)).Return(null);
scheduler.AddJob(jobDetail0, true);
LastCall.IgnoreArguments();
scheduler.AddJob(jobDetail1, true);
LastCall.IgnoreArguments();
Expect.Call(scheduler.ScheduleJob(trigger0)).Return(DateTime.UtcNow);
Expect.Call(scheduler.ScheduleJob(trigger1)).Return(DateTime.UtcNow);
scheduler.Start();
scheduler.Shutdown(false);
mockery.ReplayAll();
IScheduler scheduler = MockRepository.GenerateMock<IScheduler>();
SchedulerFactoryObject schedulerFactoryObject = new TestSchedulerFactoryObject(scheduler);
schedulerFactoryObject.JobFactory = (jobFactory);
@@ -581,7 +547,20 @@ namespace Spring.Scheduling.Quartz
schedulerFactoryObject.Dispose();
}
mockery.VerifyAll();
scheduler.AssertWasCalled(x => x.JobFactory = jobFactory);
scheduler.AssertWasCalled(x => x.AddJob(jobDetail0, true));
scheduler.AssertWasCalled(x => x.AddJob(jobDetail1, true));
#if QUARTZ_2_0
scheduler.AssertWasCalled(x => x.GetJobDetail(new JobKey("myJob0", SchedulerConstants.DefaultGroup)));
scheduler.AssertWasCalled(x => x.GetJobDetail(new JobKey("myJob1", SchedulerConstants.DefaultGroup)));
scheduler.AssertWasCalled(x => x.GetTrigger(new TriggerKey("myTrigger0", SchedulerConstants.DefaultGroup)));
scheduler.AssertWasCalled(x => x.GetTrigger(new TriggerKey("myTrigger1", SchedulerConstants.DefaultGroup)));
#else
scheduler.AssertWasCalled(x => x.GetJobDetail("myJob0", SchedulerConstants.DefaultGroup));
scheduler.AssertWasCalled(x => x.GetJobDetail("myJob1", SchedulerConstants.DefaultGroup));
scheduler.AssertWasCalled(x => x.GetTrigger("myTrigger0", SchedulerConstants.DefaultGroup));
scheduler.AssertWasCalled(x => x.GetTrigger("myTrigger1", SchedulerConstants.DefaultGroup));
#endif
}
/// <summary>
@@ -592,13 +571,9 @@ namespace Spring.Scheduling.Quartz
TestObject tb = new TestObject("tb", 99);
StaticApplicationContext ac = new StaticApplicationContext();
IScheduler scheduler = (IScheduler) mockery.CreateMock(typeof (IScheduler));
IScheduler scheduler = MockRepository.GenerateMock<IScheduler>();
SchedulerContext schedulerContext = new SchedulerContext();
Expect.Call(scheduler.Context).Return(schedulerContext).Repeat.Times(4);
scheduler.Start();
scheduler.Shutdown(false);
mockery.ReplayAll();
scheduler.Stub(x => x.Context).Return(schedulerContext).Repeat.Times(4);
SchedulerFactoryObject schedulerFactoryObject = new TestSchedulerFactoryObject(scheduler);
schedulerFactoryObject.JobFactory = (null);
@@ -619,8 +594,6 @@ namespace Spring.Scheduling.Quartz
{
schedulerFactoryObject.Dispose();
}
mockery.VerifyAll();
}
/// <summary>
@@ -645,6 +618,7 @@ namespace Spring.Scheduling.Quartz
Assert.AreEqual(ac, jobDetail.JobDataMap.Get("appCtx"));
}
#if !QUARTZ_2_0
/// <summary>
/// </summary>
[Test]
@@ -699,7 +673,7 @@ namespace Spring.Scheduling.Quartz
ArrayList result = new ArrayList(trigger.TriggerListenerNames);
Assert.AreEqual(names, result);
}
#endif
/// <summary>
/// </summary>
[Test]
@@ -744,23 +718,23 @@ namespace Spring.Scheduling.Quartz
JobDetail jobDetail = new JobDetailObject();
jobDetail.JobType = typeof (DummyRunnable);
jobDetail.Name = ("myJob");
jobDetail.Name = "myJob";
SimpleTriggerObject trigger = new SimpleTriggerObject();
trigger.Name = ("myTrigger");
trigger.JobDetail = (jobDetail);
trigger.Name = "myTrigger";
trigger.JobDetail = jobDetail;
trigger.StartDelay = TimeSpan.FromMilliseconds(1);
trigger.RepeatInterval = TimeSpan.FromMilliseconds(500);
trigger.RepeatCount = (1);
trigger.RepeatCount = 1;
trigger.AfterPropertiesSet();
SchedulerFactoryObject factoryObject = new SchedulerFactoryObject();
factoryObject.Triggers = (new Trigger[] {trigger});
factoryObject.JobDetails = (new JobDetail[] {jobDetail});
factoryObject.Triggers = new Trigger[] {trigger};
factoryObject.JobDetails = new JobDetail[] {jobDetail};
factoryObject.AfterPropertiesSet();
factoryObject.Start();
Thread.Sleep(500);
DummyRunnable.runEvent.WaitOne(500);
Assert.IsTrue(DummyRunnable.count > 0);
factoryObject.Dispose();
@@ -901,7 +875,7 @@ namespace Spring.Scheduling.Quartz
factoryObject.AfterPropertiesSet();
factoryObject.Start();
Thread.Sleep(500);
DummyRunnable.runEvent.WaitOne(500);
Assert.AreEqual(10, DummyRunnable.param);
Assert.IsTrue(DummyRunnable.count > 0);
@@ -953,8 +927,8 @@ namespace Spring.Scheduling.Quartz
DummyJob.count = 0;
SchedulerFactoryObject factoryObject = new SchedulerFactoryObject();
factoryObject.JobFactory = (new SpringObjectJobFactory());
factoryObject.JobSchedulingDataLocation = ("job-scheduling-data.xml");
factoryObject.JobFactory = new SpringObjectJobFactory();
factoryObject.JobSchedulingDataLocation = "job-scheduling-data.xml";
// TODO bean.ResourceLoader = (new FileSystemResourceLoader());
factoryObject.AfterPropertiesSet();
factoryObject.Start();
@@ -1091,6 +1065,87 @@ namespace Spring.Scheduling.Quartz
}
#if QUARTZ_2_0
private class TestSchedulerListener : ISchedulerListener
{
public void JobScheduled(ITrigger trigger)
{
}
public void JobUnscheduled(TriggerKey triggerKey)
{
}
public void TriggerFinalized(ITrigger trigger)
{
}
public void TriggerPaused(TriggerKey triggerKey)
{
}
public void TriggersPaused(string triggerGroup)
{
}
public void TriggerResumed(TriggerKey triggerKey)
{
}
public void TriggersResumed(string triggerGroup)
{
}
public void JobAdded(IJobDetail jobDetail)
{
}
public void JobDeleted(JobKey jobKey)
{
}
public void JobPaused(JobKey jobKey)
{
}
public void JobsPaused(string jobGroup)
{
}
public void JobResumed(JobKey jobKey)
{
}
public void JobsResumed(string jobGroup)
{
}
public void SchedulerError(string msg, SchedulerException cause)
{
}
public void SchedulerInStandbyMode()
{
}
public void SchedulerStarted()
{
}
public void SchedulerShutdown()
{
}
public void SchedulerShuttingdown()
{
}
public void SchedulingDataCleared()
{
}
}
#else
private class TestSchedulerListener : ISchedulerListener
{
public void JobScheduled(Trigger trigger)
@@ -1129,7 +1184,7 @@ namespace Spring.Scheduling.Quartz
{
}
}
#endif
private class TestJobListener : IJobListener
{
@@ -1236,19 +1291,7 @@ namespace Spring.Scheduling.Quartz
{
internal static int param;
internal static int count;
/// <summary>
/// Sets param value.
/// </summary>
/// <param name="value"></param>
public void SetParam(int value)
{
if (param > 0)
{
throw new NotSupportedException("Param already set");
}
param = value;
}
internal static readonly ManualResetEvent runEvent = new ManualResetEvent(false);
/// <summary>
/// Runs thread runnable.
@@ -1256,6 +1299,7 @@ namespace Spring.Scheduling.Quartz
public void Run()
{
count++;
runEvent.Set();
}
}
}

View File

@@ -16,21 +16,27 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Reflection;
using System.Text;
using System.Threading;
using NUnit.Framework;
using Quartz;
using Quartz.Impl;
using Quartz.Spi;
using Rhino.Mocks;
using Spring.Core.IO;
#if QUARTZ_2_0
using Trigger = Quartz.ITrigger;
using JobExecutionContext = Quartz.IJobExecutionContext;
using JobDetail = Quartz.IJobDetail;
using SimpleTrigger = Quartz.Impl.Triggers.SimpleTriggerImpl;
#endif
namespace Spring.Scheduling.Quartz
{
/// <summary>
@@ -42,7 +48,6 @@ namespace Spring.Scheduling.Quartz
{
private static readonly MethodInfo m_InitSchedulerFactory = typeof(SchedulerFactoryObject).GetMethod("InitSchedulerFactory",
BindingFlags.Instance | BindingFlags.NonPublic);
private MockRepository mockery;
private SchedulerFactoryObject factory;
/// <summary>
@@ -52,12 +57,9 @@ namespace Spring.Scheduling.Quartz
public void SetUp()
{
factory = new SchedulerFactoryObject();
TestSchedulerFactory.Mockery.BackToRecordAll();
Expect
.Call(TestSchedulerFactory.MockScheduler.SchedulerName)
.Return("scheduler")
.Repeat.Any();
TestSchedulerFactory.Initialize();
TestSchedulerFactory.MockScheduler.Stub(x => x.SchedulerName).Return("scheduler").Repeat.Any();
}
/// <summary>
@@ -67,7 +69,6 @@ namespace Spring.Scheduling.Quartz
public void TestAfterPropertiesSet_Defaults()
{
factory.AfterPropertiesSet();
TestSchedulerFactory.Mockery.ReplayAll();
}
/// <summary>
@@ -78,7 +79,6 @@ namespace Spring.Scheduling.Quartz
{
factory.JobFactory = null;
factory.AfterPropertiesSet();
TestSchedulerFactory.Mockery.ReplayAll();
}
/// <summary>
@@ -89,67 +89,63 @@ namespace Spring.Scheduling.Quartz
{
// set expectations
TestSchedulerFactory.MockScheduler.JobFactory = null;
LastCall.IgnoreArguments();
TestSchedulerFactory.Mockery.ReplayAll();
factory.SchedulerFactoryType = typeof(TestSchedulerFactory);
factory.AutoStartup = false;
factory.AfterPropertiesSet();
TestSchedulerFactory.MockScheduler.AssertWasCalled(x => x.JobFactory = null);
}
#if !QUARTZ_2_0
/// <summary>
/// Tests AfterPropertiesSet behavior.
/// </summary>
[Test]
public void TestAfterPropertiesSet_AddListeners()
{
mockery = new MockRepository();
InitForAfterPropertiesSetTest();
factory.SchedulerListeners = new ISchedulerListener[] { (ISchedulerListener)mockery.CreateMock(typeof(ISchedulerListener)) };
factory.SchedulerListeners = new ISchedulerListener[] { MockRepository.GenerateMock<ISchedulerListener>() };
TestSchedulerFactory.MockScheduler.AddSchedulerListener(null);
LastCall.IgnoreArguments();
factory.GlobalJobListeners = new IJobListener[] { (IJobListener)mockery.CreateMock(typeof(IJobListener)) };
factory.GlobalJobListeners = new IJobListener[] { MockRepository.GenerateMock<IJobListener>() };
TestSchedulerFactory.MockScheduler.AddGlobalJobListener(null);
LastCall.IgnoreArguments();
factory.JobListeners = new IJobListener[] { (IJobListener)mockery.CreateMock(typeof(IJobListener)) };
factory.JobListeners = new IJobListener[] { MockRepository.GenerateMock<IJobListener>() };
TestSchedulerFactory.MockScheduler.AddJobListener(null);
LastCall.IgnoreArguments();
factory.GlobalTriggerListeners = new ITriggerListener[] { (ITriggerListener)mockery.CreateMock(typeof(ITriggerListener)) };
factory.GlobalTriggerListeners = new ITriggerListener[] { MockRepository.GenerateMock<ITriggerListener>() };
TestSchedulerFactory.MockScheduler.AddGlobalTriggerListener(null);
LastCall.IgnoreArguments();
factory.TriggerListeners = new ITriggerListener[] { (ITriggerListener)mockery.CreateMock(typeof(ITriggerListener)) };
factory.TriggerListeners = new ITriggerListener[] { MockRepository.GenerateMock<ITriggerListener>() };
TestSchedulerFactory.MockScheduler.AddTriggerListener(null);
LastCall.IgnoreArguments();
TestSchedulerFactory.Mockery.ReplayAll();
mockery.ReplayAll();
factory.AfterPropertiesSet();
}
#endif
/// <summary>
/// Tests AfterPropertiesSet behavior.
/// </summary>
[Test]
public void TestAfterPropertiesSet_Calendars()
{
mockery = new MockRepository();
InitForAfterPropertiesSetTest();
const string calendarName = "calendar";
ICalendar cal = (ICalendar) mockery.CreateMock(typeof (ICalendar));
ICalendar cal = MockRepository.GenerateMock<ICalendar>();
Hashtable calTable = new Hashtable();
calTable[calendarName] = cal;
factory.Calendars = calTable;
TestSchedulerFactory.MockScheduler.AddCalendar(calendarName, cal, true, true);
TestSchedulerFactory.Mockery.ReplayAll();
mockery.ReplayAll();
factory.AfterPropertiesSet();
TestSchedulerFactory.MockScheduler.AssertWasCalled(x => x.AddCalendar(calendarName, cal, true, true));
}
/// <summary>
@@ -158,7 +154,6 @@ namespace Spring.Scheduling.Quartz
[Test]
public void TestAfterPropertiesSet_Trigger_TriggerExists()
{
mockery = new MockRepository();
InitForAfterPropertiesSetTest();
const string TRIGGER_NAME = "trigName";
@@ -166,10 +161,12 @@ namespace Spring.Scheduling.Quartz
SimpleTrigger trigger = new SimpleTrigger(TRIGGER_NAME, TRIGGER_GROUP);
factory.Triggers = new Trigger[] { trigger };
Expect.Call(TestSchedulerFactory.MockScheduler.GetTrigger(TRIGGER_NAME, TRIGGER_GROUP)).Return(trigger);
#if QUARTZ_2_0
TestSchedulerFactory.MockScheduler.Stub(x => x.GetTrigger(new TriggerKey(TRIGGER_NAME, TRIGGER_GROUP))).Return(trigger);
#else
TestSchedulerFactory.MockScheduler.Stub(x => x.GetTrigger(TRIGGER_NAME, TRIGGER_GROUP)).Return(trigger);
#endif
TestSchedulerFactory.Mockery.ReplayAll();
mockery.ReplayAll();
factory.AfterPropertiesSet();
}
@@ -179,7 +176,6 @@ namespace Spring.Scheduling.Quartz
[Test]
public void TestAfterPropertiesSet_Trigger_TriggerDoesntExist()
{
mockery = new MockRepository();
InitForAfterPropertiesSetTest();
const string TRIGGER_NAME = "trigName";
@@ -187,15 +183,9 @@ namespace Spring.Scheduling.Quartz
SimpleTrigger trigger = new SimpleTrigger(TRIGGER_NAME, TRIGGER_GROUP);
factory.Triggers = new Trigger[] { trigger };
Expect.Call(TestSchedulerFactory.MockScheduler.GetTrigger(TRIGGER_NAME, TRIGGER_GROUP)).Return(null);
TestSchedulerFactory.MockScheduler.ScheduleJob(trigger);
LastCall.IgnoreArguments().Return(DateTime.UtcNow);
TestSchedulerFactory.Mockery.ReplayAll();
mockery.ReplayAll();
factory.AfterPropertiesSet();
TestSchedulerFactory.MockScheduler.AssertWasCalled(x => x.ScheduleJob(trigger));
}
@@ -205,7 +195,6 @@ namespace Spring.Scheduling.Quartz
// set expectations
factory.SchedulerFactoryType = typeof(TestSchedulerFactory);
TestSchedulerFactory.MockScheduler.JobFactory = null;
LastCall.IgnoreArguments();
}
/// <summary>
@@ -214,16 +203,13 @@ namespace Spring.Scheduling.Quartz
[Test]
public void TestStart()
{
// set expectations
TestSchedulerFactory.MockScheduler.JobFactory = null;
LastCall.IgnoreArguments();
TestSchedulerFactory.MockScheduler.Start();
TestSchedulerFactory.Mockery.ReplayAll();
factory.SchedulerFactoryType = typeof(TestSchedulerFactory);
factory.AutoStartup = false;
factory.AfterPropertiesSet();
factory.Start();
TestSchedulerFactory.MockScheduler.AssertWasCalled(x => x.JobFactory = Arg<IJobFactory>.Is.NotNull);
TestSchedulerFactory.MockScheduler.AssertWasCalled(x => x.Start());
}
/// <summary>
@@ -232,16 +218,13 @@ namespace Spring.Scheduling.Quartz
[Test]
public void TestStop()
{
// set expectations
TestSchedulerFactory.MockScheduler.JobFactory = null;
LastCall.IgnoreArguments();
TestSchedulerFactory.MockScheduler.Standby();
TestSchedulerFactory.Mockery.ReplayAll();
factory.SchedulerFactoryType = typeof(TestSchedulerFactory);
factory.AutoStartup = false;
factory.AfterPropertiesSet();
factory.Stop();
TestSchedulerFactory.MockScheduler.AssertWasCalled(x => x.JobFactory = Arg<IJobFactory>.Is.NotNull);
TestSchedulerFactory.MockScheduler.AssertWasCalled(x => x.Standby());
}
/// <summary>
@@ -251,7 +234,6 @@ namespace Spring.Scheduling.Quartz
public void TestGetObject()
{
factory.AfterPropertiesSet();
TestSchedulerFactory.Mockery.ReplayAll();
IScheduler sched = (IScheduler)factory.GetObject();
Assert.IsNotNull(sched, "scheduler was null");
}
@@ -263,7 +245,6 @@ namespace Spring.Scheduling.Quartz
[ExpectedException(typeof(ArgumentException))]
public void TestSchedulerFactoryType_InvalidType()
{
TestSchedulerFactory.Mockery.ReplayAll();
factory.SchedulerFactoryType = typeof(SchedulerFactoryObjectTest);
}
@@ -273,7 +254,6 @@ namespace Spring.Scheduling.Quartz
[Test]
public void TestSchedulerFactoryType_ValidType()
{
TestSchedulerFactory.Mockery.ReplayAll();
factory.SchedulerFactoryType = typeof(StdSchedulerFactory);
}
@@ -283,8 +263,6 @@ namespace Spring.Scheduling.Quartz
[Test]
public void TestInitSchedulerFactory_MinimalDefaults()
{
TestSchedulerFactory.Mockery.ReplayAll();
factory.SchedulerName = "testFactoryObject";
StdSchedulerFactory factoryToPass = new StdSchedulerFactory();
m_InitSchedulerFactory.Invoke(factory, new object[] { factoryToPass });
@@ -315,8 +293,6 @@ ConnectionStringKey+ " = " + ConnectionStringValue + Environment.NewLine +
// intercept call
InterceptingStdSChedulerFactory factoryToPass = new InterceptingStdSChedulerFactory();
TestSchedulerFactory.Mockery.ReplayAll();
factory.ConfigLocation = new TestConfigLocation(ms, "description");
m_InitSchedulerFactory.Invoke(factory, new object[] { factoryToPass });
@@ -324,21 +300,6 @@ ConnectionStringKey+ " = " + ConnectionStringValue + Environment.NewLine +
Assert.AreEqual(ConnectionStringValue, factoryToPass.Properties[ConnectionStringKey]);
}
/// <summary>
/// Cleans this test instance.
/// </summary>
[TearDown]
public void TearDown()
{
TestSchedulerFactory.Mockery.VerifyAll();
if (mockery != null)
{
mockery.VerifyAll();
}
}
}
internal class TestConfigLocation : InputStreamResource
@@ -353,21 +314,7 @@ ConnectionStringKey+ " = " + ConnectionStringValue + Environment.NewLine +
/// </summary>
public class TestSchedulerFactory : ISchedulerFactory
{
private static readonly MockRepository mockery = new MockRepository();
private static readonly IScheduler mockScheduler;
static TestSchedulerFactory()
{
mockScheduler = (IScheduler) mockery.CreateMock(typeof (IScheduler));
}
/// <summary>
/// MockRepository intance.
/// </summary>
public static MockRepository Mockery
{
get { return mockery; }
}
private static IScheduler mockScheduler;
/// <summary>
/// The mocked scheduler.
@@ -394,12 +341,26 @@ ConnectionStringKey+ " = " + ConnectionStringValue + Environment.NewLine +
return mockScheduler;
}
#if QUARTZ_2_0
///<summary>
///</summary>
public ICollection<IScheduler> AllSchedulers
{
get { return new List<IScheduler>(); }
}
#else
///<summary>
///</summary>
public ICollection AllSchedulers
{
get { return new ArrayList(); }
}
#endif
public static void Initialize()
{
mockScheduler = MockRepository.GenerateMock<IScheduler>();
}
}
///<summary>

View File

@@ -16,12 +16,17 @@
using System;
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using Quartz;
using Quartz.Job;
#if QUARTZ_2_0
using JobDetail = Quartz.Impl.JobDetailImpl;
#endif
namespace Spring.Scheduling.Quartz
{
/// <summary>
@@ -113,7 +118,7 @@ namespace Spring.Scheduling.Quartz
[Test]
public void TestJobDataAsMap()
{
Hashtable data = new Hashtable();
IDictionary data = new Dictionary<string, object>();
data["foo"] = "bar";
data["number"] = 123;
simpleTrigger.JobDataAsMap = data;

View File

@@ -15,13 +15,20 @@
*/
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using Quartz;
using Quartz.Job;
using Quartz.Spi;
#if QUARTZ_2_0
using Trigger = Quartz.Spi.IOperableTrigger;
using JobExecutionContext = Quartz.IJobExecutionContext;
using JobDetail = Quartz.IJobDetail;
using SimpleTrigger = Quartz.Impl.Triggers.SimpleTriggerImpl;
#endif
namespace Spring.Scheduling.Quartz
{
/// <summary>
@@ -51,7 +58,11 @@ namespace Spring.Scheduling.Quartz
Trigger trigger = new SimpleTrigger();
TriggerFiredBundle bundle = TestUtil.CreateMinimalFiredBundleWithTypedJobDetail(typeof (NoOpJob), trigger);
#if QUARTZ_2_0
IJob job = factory.NewJob(bundle, null);
#else
IJob job = factory.NewJob(bundle);
#endif
Assert.IsNotNull(job, "Created job was null");
}
@@ -61,14 +72,23 @@ namespace Spring.Scheduling.Quartz
[Test]
public void TestCreateJobInstance_SchedulerContextGiven()
{
Trigger trigger = new SimpleTrigger();
TriggerFiredBundle bundle = TestUtil.CreateMinimalFiredBundleWithTypedJobDetail(typeof(InjectableJob), trigger);
#if QUARTZ_2_0
IDictionary<string, object> items = new Dictionary<string, object>();
items["foo"] = "bar";
items["number"] = 123;
factory.SchedulerContext = new SchedulerContext(items);
InjectableJob job = (InjectableJob)factory.NewJob(bundle, null);
#else
IDictionary items = new Hashtable();
items["foo"] = "bar";
items["number"] = 123;
factory.SchedulerContext = new SchedulerContext(items);
Trigger trigger = new SimpleTrigger();
TriggerFiredBundle bundle = TestUtil.CreateMinimalFiredBundleWithTypedJobDetail(typeof(InjectableJob), trigger);
InjectableJob job = (InjectableJob) factory.NewJob(bundle);
#endif
Assert.IsNotNull(job, "Created job was null");
Assert.AreEqual("bar", job.Foo, "string injection failed");
Assert.AreEqual(123, job.Number, "integer injection failed");
@@ -86,7 +106,11 @@ namespace Spring.Scheduling.Quartz
trigger.JobDataMap["number"] = 123;
TriggerFiredBundle bundle = TestUtil.CreateMinimalFiredBundleWithTypedJobDetail(typeof(InjectableJob), trigger);
#if QUARTZ_2_0
InjectableJob job = (InjectableJob)factory.NewJob(bundle, null);
#else
InjectableJob job = (InjectableJob)factory.NewJob(bundle);
#endif
Assert.IsNotNull(job, "Created job was null");
Assert.AreEqual(123, job.Number, "integer injection failed");
Assert.IsNull(job.Foo, "foo was injected when it was not supposed to ");

View File

@@ -19,6 +19,11 @@ using System;
using Quartz;
using Quartz.Spi;
#if QUARTZ_2_0
using JobDetail = Quartz.Impl.JobDetailImpl;
using Trigger = Quartz.Spi.IOperableTrigger;
#endif
namespace Spring.Scheduling.Quartz
{
/// <summary>

View File

@@ -22,6 +22,10 @@ using Quartz;
using Spring.Objects.Factory;
#if QUARTZ_2_0
using Trigger = Quartz.Spi.IOperableTrigger;
#endif
namespace Spring.Scheduling.Quartz
{
/// <summary>
@@ -31,6 +35,7 @@ namespace Spring.Scheduling.Quartz
public abstract class TriggerObjectTest
{
private Trigger trigger;
/// <summary>
/// Constant name for tested triggers.
/// </summary>
@@ -52,11 +57,17 @@ namespace Spring.Scheduling.Quartz
{
((IInitializingObject) trigger).AfterPropertiesSet();
#if QUARTZ_2_0
Assert.AreEqual(TRIGGER_NAME, trigger.Key.Name, "trigger name mismatch");
Assert.AreEqual(SchedulerConstants.DefaultGroup, trigger.Key.Group, "trigger group name mismatch");
Assert.IsNull(trigger.JobKey, "trigger job name not null");
#else
Assert.AreEqual(TRIGGER_NAME, trigger.Name, "trigger name mismatch");
Assert.AreEqual(SchedulerConstants.DefaultGroup, trigger.Group, "trigger group name mismatch");
AssertDateTimesEqualityWithAllowedDelta(DateTime.UtcNow, trigger.StartTimeUtc, 1000);
Assert.IsNull(trigger.JobName, "trigger job name not null");
Assert.AreEqual(SchedulerConstants.DefaultGroup, trigger.JobGroup, "trigger job group was not default");
#endif
AssertDateTimesEqualityWithAllowedDelta(DateTime.UtcNow, trigger.StartTimeUtc, 1000);
}
/// <summary>
@@ -69,12 +80,18 @@ namespace Spring.Scheduling.Quartz
const string NAME = "newName";
const string GROUP = "newGroup";
DateTime START_TIME = new DateTime(10000000);
DateTime START_TIME = new DateTime(1982, 6, 28, 13, 10, 0);
trigger.StartTimeUtc = START_TIME;
#if QUARTZ_2_0
trigger.Key = new TriggerKey(NAME, GROUP);
Assert.AreEqual(NAME, trigger.Key.Name, "trigger name mismatch");
Assert.AreEqual(GROUP, trigger.Key.Group, "trigger group name mismatch");
#else
trigger.Name = NAME;
trigger.Group = GROUP;
trigger.StartTimeUtc = START_TIME;
Assert.AreEqual(NAME, trigger.Name, "trigger name mismatch");
Assert.AreEqual(GROUP, trigger.Group, "trigger group name mismatch");
#endif
AssertDateTimesEqualityWithAllowedDelta(START_TIME, trigger.StartTimeUtc, 1000);
}
@@ -88,10 +105,42 @@ namespace Spring.Scheduling.Quartz
const string jobName = "jobName";
const string jobGroup = "jobGroup";
#if QUARTZ_2_0
Assert.AreEqual(jobName, trigger.JobKey.Name, "trigger job name was not from job detail");
Assert.AreEqual(jobGroup, trigger.JobKey.Group, "trigger job group was not from job detail");
#else
Assert.AreEqual(jobName, trigger.JobName, "trigger job name was not from job detail");
Assert.AreEqual(jobGroup, trigger.JobGroup, "trigger job group was not from job detail");
#endif
}
#if QUARTZ_2_0
/// <summary>
/// Tests whether two datetimes are close enough.
/// </summary>
/// <param name="d1"></param>
/// <param name="d2"></param>
/// <param name="allowedDeltaInMilliseconds"></param>
protected static void AssertDateTimesEqualityWithAllowedDelta(DateTimeOffset d1, DateTimeOffset d2, int allowedDeltaInMilliseconds)
{
int diffInMillis = (int) Math.Abs((d1 - d2).TotalMilliseconds);
Assert.LessOrEqual(diffInMillis, allowedDeltaInMilliseconds, "too much difference in times");
}
#else
/// <summary>
/// Tests whether two datetimes are close enough.
/// </summary>
/// <param name="d1"></param>
/// <param name="d2"></param>
/// <param name="allowedDeltaInMilliseconds"></param>
protected static void AssertDateTimesEqualityWithAllowedDelta(DateTime d1, DateTime d2, int allowedDeltaInMilliseconds)
{
int diffInMillis = (int)Math.Abs((d1 - d2).TotalMilliseconds);
Assert.LessOrEqual(diffInMillis, allowedDeltaInMilliseconds, "too much difference in times");
}
/// <summary>
/// Tests that TriggerObject defaults values as expected in AfterPropertiesSet.
/// </summary>
@@ -104,18 +153,7 @@ namespace Spring.Scheduling.Quartz
trigger.TriggerListenerNames = LISTENER_NAMES;
CollectionAssert.AreEqual(LISTENER_NAMES, trigger.TriggerListenerNames, "Trigger listeners were not equal");
}
/// <summary>
/// Tests whether two datetimes are close enough.
/// </summary>
/// <param name="d1"></param>
/// <param name="d2"></param>
/// <param name="allowedDeltaInMilliseconds"></param>
protected static void AssertDateTimesEqualityWithAllowedDelta(DateTime d1, DateTime d2, int allowedDeltaInMilliseconds)
{
int diffInMillis = (int) Math.Abs((d1 - d2).TotalMilliseconds);
Assert.LessOrEqual(diffInMillis, allowedDeltaInMilliseconds, "too much difference in times");
}
#endif
}
}

View File

@@ -36,15 +36,19 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\net\2.0\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Quartz, Version=0.7.0.15571, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Quartz, Version=1.0.3.2, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\net\2.0\Quartz.dll</HintPath>
<HintPath>..\..\..\lib\Quartz10\net\2.0\Quartz.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks, Version=2.9.6.40380, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Net\2.0\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
<HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll</HintPath>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>

View File

@@ -42,8 +42,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\net\2.0\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Quartz">
<HintPath>..\..\..\lib\Net\3.5\Quartz.dll</HintPath>
<Reference Include="Quartz, Version=1.0.3.3, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Quartz10\net\3.5\Quartz.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks, Version=2.9.6.40380, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>

View File

@@ -0,0 +1,51 @@
#region License
/*
* Copyright <20> 2002-2007 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#endregion
#region Imports
using System.Threading;
using NUnit.Framework;
using Spring.Context;
using Spring.Context.Support;
#endregion
namespace Spring.Scheduling.Quartz.Integration.Tests
{
[TestFixture]
public class LocalDataSourceJobStoreTest
{
private IApplicationContext ctx;
[SetUp]
public void SetUp()
{
ctx = new XmlApplicationContext("assembly://Spring.Scheduling.Quartz20.Integration.Tests/Spring.Scheduling.Quartz/LocalDataSourceJobStoreTest.xml");
}
[Test]
public void TestLocalDataSourceJobStore()
{
// sleep 20 seconds
Thread.Sleep(20000);
}
}
}

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net"
xmlns:aop="http://www.springframework.net/aop"
xmlns:db="http://www.springframework.net/database"
xmlns:tx="http://www.springframework.net/tx">
<!-- Property placeholder configurer for database settings -->
<object type="Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer, Spring.Core">
<property name="ConfigSections" value="appSettings"/>
</object>
<!-- DB -->
<db:provider id="dbProvider" provider="SqlServer-2.0" connectionString="${ConnectionString}"/>
<object id="transactionManager" type="Spring.Data.Core.TxScopeTransactionManager, Spring.Data">
</object>
<!-- And actual Quartz -->
<object id="quartzSchedulerFactory" type="Spring.Scheduling.Quartz.SchedulerFactoryObject, Spring.Scheduling.Quartz20">
<property name="AutoStartup" value="true" />
<property name="StartupDelay" value="5s" />
<property name="QuartzProperties">
<dictionary>
<entry key="quartz.threadPool.threadCount" value="10"/>
<entry key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz"/>
<entry key="quartz.threadPool.threadPriority" value="Normal"/>
<entry key="quartz.jobStore.misfireThreshold" value="60000"/>
<entry key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz"/>
<entry key="quartz.jobStore.useProperties" value="false"/>
<entry key="quartz.jobStore.tablePrefix" value="QRTZ_"/>
<entry key="quartz.jobStore.lockHandler.type" value="Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz"/>
</dictionary>
</property>
<property name="triggers">
<list>
<ref object="simpleTrigger" />
</list>
</property>
<property name="DbProvider" ref="dbProvider" />
<property name="TransactionManager" ref="transactionManager" />
</object>
<object id="testJob" type="Spring.Scheduling.Quartz.JobDetailObject, Spring.Scheduling.Quartz20">
<property name="JobType" value="Spring.Scheduling.Quartz.Integration.Tests.TestJob, Spring.Scheduling.Quartz20.Integration.Tests" />
</object>
<object id="simpleTrigger" type="Spring.Scheduling.Quartz.SimpleTriggerObject, Spring.Scheduling.Quartz20">
<!-- see the example of method invoking job above -->
<property name="jobDetail" ref="testJob" />
<!-- 2 seconds -->
<property name="startDelay" value="2s" />
<!-- repeat every 3 seconds -->
<property name="repeatInterval" value="3s" />
</object>
</objects>

View File

@@ -0,0 +1,20 @@
using System;
using Quartz;
namespace Spring.Scheduling.Quartz.Integration.Tests
{
public class TestJob : IJob
{
public void Execute(IJobExecutionContext context)
{
Console.WriteLine("Executing Execute!");
}
public void DoIt()
{
Console.WriteLine("Executing DoIt!");
}
}
}

View File

@@ -0,0 +1,81 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8CF0F34A-CC93-4D87-AE14-A2DEEF072F26}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring</RootNamespace>
<AssemblyName>Spring.Scheduling.Quartz20.Integration.Tests</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\build\VS.NET.2008\Spring.Scheduling.Quartz20.Integration.Tests\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_2_0;NET_3_5</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\build\VS.NET.2008\Spring.Scheduling.Quartz20.Integration.Tests\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0;NET_3_5</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="C5, Version=1.1.0.0, Culture=neutral, PublicKeyToken=06a1b38866503b69, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Quartz20\net\3.5\C5.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=2.2.7.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\net\2.0\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Quartz, Version=2.0.0.100, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Quartz20\net\3.5\Quartz.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks, Version=2.9.6.40380, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Net\2.0\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<None Include="Spring.Scheduling.Quartz20.Integration.Tests.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Compile Include="Scheduling\Quartz\LocalDataSourceJobStoreTest.cs" />
<Compile Include="Scheduling\Quartz\TestJob.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Scheduling\Quartz\LocalDataSourceJobStoreTest.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.2008.csproj">
<Project>{710961A3-0DF4-49E4-A26E-F5B9C044AC84}</Project>
<Name>Spring.Core.2008</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\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>

View File

@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8CF0F34A-CC93-4D87-AE14-A2DEEF072F26}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring</RootNamespace>
<AssemblyName>Spring.Scheduling.Quartz20.Integration.Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\build\VS.NET.2008\Spring.Scheduling.Quartz20.Integration.Tests\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_2_0;NET_3_5,QUARTZ_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\build\VS.NET.2008\Spring.Scheduling.Quartz20.Integration.Tests\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0;NET_3_5</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="C5, Version=1.1.0.0, Culture=neutral, PublicKeyToken=06a1b38866503b69, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Quartz20\net\3.5\C5.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=2.2.7.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\net\2.0\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Quartz, Version=2.0.0.100, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Quartz20\net\3.5\Quartz.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks, Version=2.9.6.40380, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Net\2.0\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<None Include="Spring.Scheduling.Quartz20.Integration.Tests.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Compile Include="Scheduling\Quartz\LocalDataSourceJobStoreTest.cs" />
<Compile Include="Scheduling\Quartz\TestJob.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Scheduling\Quartz\LocalDataSourceJobStoreTest.xml" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.2010.csproj">
<Project>{710961A3-0DF4-49E4-A26E-F5B9C044AC84}</Project>
<Name>Spring.Core.2010</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\src\Spring\Spring.Data\Spring.Data.2010.csproj">
<Project>{AE00E5AB-C39A-436F-86D2-33BFE33E2E40}</Project>
<Name>Spring.Data.2010</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\src\Spring\Spring.Scheduling.Quartz20\Spring.Scheduling.Quartz20.2010.csproj">
<Project>{E823D54C-CE82-4868-929F-5F95A999F123}</Project>
<Name>Spring.Scheduling.Quartz20.2010</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\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>

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" ?>
<project name="Spring.Scheduling.Quartz20.Integration.Tests" default="build" xmlns="http://nant.sf.net/schemas/nant.xsd">
<include buildfile="${spring.basedir}/common-project.include" />
<!--
Required properties:
* current.bin.dir - (path) root level to build to
* build.debug - (true|false) debug build?
* current.build.defines.csc - framework-specific build defines
-->
<target name="build">
<csc target="library" define="${current.build.defines.csc}"
warnaserror="true"
optimize="${build.optimize}"
debug="${current.build.debug}"
output="${current.bin.dir}/${project::get-name()}.dll"
doc="${current.bin.dir}/${project::get-name()}.xml">
<nowarn>
<warning number="${nowarn.numbers.test}" />
</nowarn>
<sources failonempty="true">
<include name="**/*.cs" />
<include name="../CommonAssemblyInfo.cs" />
</sources>
<references basedir="${current.bin.dir}">
<include name="*.dll" />
<exclude name="${project::get-name()}.dll" />
</references>
</csc>
<copy todir="${current.bin.dir}">
<fileset basedir="${project::get-name()}/Data">
<include name="**/*.xml" />
<include name="**/*.test" />
</fileset>
</copy>
<copy todir="${current.bin.dir}">
<fileset basedir="${project::get-name()}">
<include name="**/*.config" />
</fileset>
</copy>
</target>
<target name="test" depends="build">
<!-- property name="test.assemblyname" value="${project::get-name()}" / -->
<call target="common.run-tests" />
</target>
<!--
<target name="test" depends="build">
<nunit2>
<formatter type="Plain" />
<formatter type="Xml" usefile="true" extension=".xml"
outputdir="${current.bin.dir}/results" />
<test assemblyname="${current.bin.dir}/${project::get-name()}.dll"
appconfig="${current.bin.dir}/${project::get-name()}.dll.config" />
</nunit2>
</target>
-->
<!--
<target name="test-mono-1.0" >
<nunit2>
<formatter type="Plain" />
<formatter type="Xml" usefile="true" extension=".xml"
outputdir="${current.bin.dir}/results" />
<test assemblyname="${bin.dir}/net/1.1/${current.build.config}/${project::get-name()}.dll"
appconfig="${bin.dir}/net/1.1/${current.build.config}/${project::get-name()}.dll.config" />
</nunit2>
</target>
-->
</project>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
<sectionGroup name="spring">
<section name="typeAliases" type="Spring.Context.Support.TypeAliasesSectionHandler, Spring.Core"/>
<section name="parsers" type="Spring.Context.Support.NamespaceParsersSectionHandler, Spring.Core"/>
<section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web"/>
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>
</sectionGroup>
</configSections>
<common>
<logging>
<factoryAdapter type="Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter, Common.Logging">
<arg key="level" value="DEBUG" />
</factoryAdapter>
</logging>
</common>
<spring>
<parsers>
<parser type="Spring.Data.Config.DatabaseNamespaceParser, Spring.Data"/>
<parser type="Spring.Transaction.Config.TxNamespaceParser, Spring.Data"/>
<parser type="Spring.Aop.Config.AopNamespaceParser, Spring.Aop"/>
</parsers>
</spring>
<appSettings>
<add key="ConnectionString" value="Server=(local);initial catalog=quartz;Integrated Security=true"/>
</appSettings>
</configuration>

View File

@@ -0,0 +1,142 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{47E7DF97-2515-4F2F-BBFD-0A4C205800DE}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring</RootNamespace>
<AssemblyName>Spring.Scheduling.Quartz20.Tests</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\build\VS.NET.2008\Spring.Scheduling.Quartz20.Tests\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>
</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\build\VS.NET.2008\Spring.Scheduling.Quartz20.Tests\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="C5, Version=1.1.0.0, Culture=neutral, PublicKeyToken=06a1b38866503b69, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Quartz20\net\3.5\C5.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=2.2.7.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\net\2.0\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Quartz, Version=2.0.0.100, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Quartz20\net\3.5\Quartz.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks, Version=2.9.6.40380, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Net\2.0\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\QuartzCompilerOptionsTests.cs">
<Link>QuartzCompilerOptionsTests.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\AdaptableJobFactoryTest.cs">
<Link>Scheduling\Quartz\AdaptableJobFactoryTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\CronTriggerObjectTest.cs">
<Link>Scheduling\Quartz\CronTriggerObjectTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\JobDetailObjectTest.cs">
<Link>Scheduling\Quartz\JobDetailObjectTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\MethodInvokingJobDetailFactoryObjectTest.cs">
<Link>Scheduling\Quartz\MethodInvokingJobDetailFactoryObjectTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\MethodInvokingJobTest.cs">
<Link>Scheduling\Quartz\MethodInvokingJobTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\QuartzSupportTests.cs">
<Link>Scheduling\Quartz\QuartzSupportTests.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\QuartzTestObject.cs">
<Link>Scheduling\Quartz\QuartzTestObject.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\SchedulerFactoryObjectTest.cs">
<Link>Scheduling\Quartz\SchedulerFactoryObjectTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\SimpleTriggerObjectTest.cs">
<Link>Scheduling\Quartz\SimpleTriggerObjectTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\SpringObjectJobFactoryTest.cs">
<Link>Scheduling\Quartz\SpringObjectJobFactoryTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\TestMethodInvokingTask.cs">
<Link>Scheduling\Quartz\TestMethodInvokingTask.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\TestUtil.cs">
<Link>Scheduling\Quartz\TestUtil.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\TriggerObjectTest.cs">
<Link>Scheduling\Quartz\TriggerObjectTest.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="job-scheduling-data.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="multipleAnonymousMethodInvokingJobDetailFB.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="multipleSchedulers.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="schedulerAccessorObject.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="schedulerRepositoryExposure.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.2008.csproj">
<Project>{710961A3-0DF4-49E4-A26E-F5B9C044AC84}</Project>
<Name>Spring.Core.2008</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\src\Spring\Spring.Scheduling.Quartz20\Spring.Scheduling.Quartz20.2008.csproj">
<Project>{E823D54C-CE82-4868-929F-5F95A999F61E}</Project>
<Name>Spring.Scheduling.Quartz20.2008</Name>
</ProjectReference>
<ProjectReference Include="..\Spring.Core.Tests\Spring.Core.Tests.2008.csproj">
<Project>{44B16BAA-6DF8-447C-9D7F-3AD3D854D904}</Project>
<Name>Spring.Core.Tests.2008</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Spring.Scheduling.Quartz20.Tests.build" />
<None Include="Spring.Scheduling.Quartz20.Tests.dll.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\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>

View File

@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{247787CF-ECE1-4675-8B42-7DF4329A4891}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring</RootNamespace>
<AssemblyName>Spring.Scheduling.Quartz20.Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\build\VS.NET.2010\Spring.Scheduling.Quartz20.Tests\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_2_0,QUARTZ_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>
</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\build\VS.NET.2010\Spring.Scheduling.Quartz20.Tests\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="C5, Version=1.1.0.0, Culture=neutral, PublicKeyToken=06a1b38866503b69, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Quartz20\net\3.5\C5.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=2.2.7.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\net\2.0\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Quartz">
<HintPath>..\..\..\lib\Quartz20\net\3.5\Quartz.dll</HintPath>
</Reference>
<Reference Include="Rhino.Mocks, Version=2.9.6.40380, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Net\2.0\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.2010.csproj">
<Project>{710961A3-0DF4-49E4-A26E-F5B9C044AC84}</Project>
<Name>Spring.Core.2010</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\src\Spring\Spring.Scheduling.Quartz20\Spring.Scheduling.Quartz20.2010.csproj">
<Project>{E823D54C-CE82-4868-929F-5F95A999F123}</Project>
<Name>Spring.Scheduling.Quartz20.2010</Name>
</ProjectReference>
<ProjectReference Include="..\Spring.Core.Tests\Spring.Core.Tests.2010.csproj">
<Project>{44B16BAA-6DF8-447C-9D7F-3AD3D854D904}</Project>
<Name>Spring.Core.Tests.2010</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\QuartzCompilerOptionsTests.cs">
<Link>QuartzCompilerOptionsTests.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\AdaptableJobFactoryTest.cs">
<Link>Scheduling\Quartz\AdaptableJobFactoryTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\CronTriggerObjectTest.cs">
<Link>Scheduling\Quartz\CronTriggerObjectTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\JobDetailObjectTest.cs">
<Link>Scheduling\Quartz\JobDetailObjectTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\MethodInvokingJobDetailFactoryObjectTest.cs">
<Link>Scheduling\Quartz\MethodInvokingJobDetailFactoryObjectTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\MethodInvokingJobTest.cs">
<Link>Scheduling\Quartz\MethodInvokingJobTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\QuartzSupportTests.cs">
<Link>Scheduling\Quartz\QuartzSupportTests.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\QuartzTestObject.cs">
<Link>Scheduling\Quartz\QuartzTestObject.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\SchedulerFactoryObjectTest.cs">
<Link>Scheduling\Quartz\SchedulerFactoryObjectTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\SimpleTriggerObjectTest.cs">
<Link>Scheduling\Quartz\SimpleTriggerObjectTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\SpringObjectJobFactoryTest.cs">
<Link>Scheduling\Quartz\SpringObjectJobFactoryTest.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\TestMethodInvokingTask.cs">
<Link>Scheduling\Quartz\TestMethodInvokingTask.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\TestUtil.cs">
<Link>Scheduling\Quartz\TestUtil.cs</Link>
</Compile>
<Compile Include="..\Spring.Scheduling.Quartz.Tests\Scheduling\Quartz\TriggerObjectTest.cs">
<Link>Scheduling\Quartz\TriggerObjectTest.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="job-scheduling-data.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="multipleAnonymousMethodInvokingJobDetailFB.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="multipleSchedulers.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="schedulerAccessorObject.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="schedulerRepositoryExposure.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="Spring.Scheduling.Quartz20.Tests.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\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>

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" ?>
<project name="Spring.Scheduling.Quartz.Tests" default="build" xmlns="http://nant.sf.net/schemas/nant.xsd">
<include buildfile="${spring.basedir}/common-project.include" />
<!--
Required properties:
* current.bin.dir - (path) root level to build to
* build.debug - (true|false) debug build?
* current.build.defines.csc - framework-specific build defines
-->
<target name="build">
<echo message="${quartz20.lib.dir}" />
<copy todir="${current.bin.dir}" overwrite="true">
<fileset basedir="${quartz20.lib.dir}">
<include name="**/*.dll" />
</fileset>
</copy>
<csc target="library" define="${current.build.defines.csc}"
warnaserror="true"
optimize="${build.optimize}"
debug="${current.build.debug}"
output="${current.bin.dir}/${project::get-name()}.dll"
doc="${current.bin.dir}/${project::get-name()}.xml">
<nowarn>
<warning number="${nowarn.numbers.test}" />
</nowarn>
<sources failonempty="true">
<include name="**/*.cs" />
<include name="../CommonAssemblyInfo.cs" />
</sources>
<references basedir="${current.bin.dir}">
<include name="*.dll" />
<exclude name="${project::get-name()}.dll" />
</references>
</csc>
<copy todir="${current.bin.dir}">
<fileset basedir="${project::get-name()}/Data">
<include name="**/*.xml" />
<include name="**/*.test" />
</fileset>
</copy>
<copy todir="${current.bin.dir}">
<fileset basedir="${project::get-name()}">
<include name="**/*.config" />
</fileset>
</copy>
</target>
<target name="test" depends="build">
<!-- property name="test.assemblyname" value="${project::get-name()}" / -->
<call target="common.run-tests" />
</target>
<!--
<target name="test" depends="build">
<nunit2>
<formatter type="Plain" />
<formatter type="Xml" usefile="true" extension=".xml"
outputdir="${current.bin.dir}/results" />
<test assemblyname="${current.bin.dir}/${project::get-name()}.dll"
appconfig="${current.bin.dir}/${project::get-name()}.dll.config" />
</nunit2>
</target>
-->
<!--
<target name="test-mono-1.0" >
<nunit2>
<formatter type="Plain" />
<formatter type="Xml" usefile="true" extension=".xml"
outputdir="${current.bin.dir}/results" />
<test assemblyname="${bin.dir}/net/1.1/${current.build.config}/${project::get-name()}.dll"
appconfig="${bin.dir}/net/1.1/${current.build.config}/${project::get-name()}.dll.config" />
</nunit2>
</target>
-->
</project>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
</configuration>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<job-scheduling-data xmlns="http://quartznet.sourceforge.net/JobSchedulingData"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.0">
<processing-directives>
<overwrite-existing-data>true</overwrite-existing-data>
</processing-directives>
<schedule>
<job>
<name>myJob</name>
<group>myGroup</group>
<job-type>Spring.Scheduling.Quartz.DummyJob, Spring.Scheduling.Quartz20.Tests</job-type>
<durable>true</durable>
<recover>false</recover>
<job-data-map>
<entry>
<key>param</key>
<value>10</value>
</entry>
</job-data-map>
</job>
<trigger>
<simple>
<name>myTrigger</name>
<group>myGroup</group>
<job-name>myJob</job-name>
<job-group>myGroup</job-group>
<repeat-count>1</repeat-count>
<repeat-interval>500</repeat-interval>
</simple>
</trigger>
</schedule>
</job-scheduling-data>

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects xmlns="http://www.springframework.net"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/xsd/spring-objects.xsd">
<object id="scheduler" type="Spring.Scheduling.Quartz.SchedulerFactoryObject, Spring.Scheduling.Quartz20">
<property name="Triggers">
<list>
<ref local="exportTrigger"/>
<ref local="importTrigger"/>
</list>
</property>
</object>
<object id="exportTrigger" type="Spring.Scheduling.Quartz.SimpleTriggerObject, Spring.Scheduling.Quartz20">
<property name="JobDetail">
<object type="Spring.Scheduling.Quartz.MethodInvokingJobDetailFactoryObject, Spring.Scheduling.Quartz20">
<property name="TargetObject" ref="exportService"/>
<property name="TargetMethod" value="DoExport"/>
</object>
</property>
<property name="RepeatInterval" value="1s"/>
<property name="RepeatCount" value="1"/>
</object>
<object id="importTrigger" type="Spring.Scheduling.Quartz.SimpleTriggerObject, Spring.Scheduling.Quartz20">
<property name="JobDetail">
<object type="Spring.Scheduling.Quartz.MethodInvokingJobDetailFactoryObject, Spring.Scheduling.Quartz20">
<property name="TargetObject" ref="importService"/>
<property name="TargetMethod" value="DoImport"/>
</object>
</property>
<property name="RepeatInterval" value="1s"/>
<property name="RepeatCount" value="1"/>
</object>
<object id="exportService" type="Spring.Scheduling.Quartz.QuartzTestObject, Spring.Scheduling.Quartz20.Tests"/>
<object id="importService" type="Spring.Scheduling.Quartz.QuartzTestObject, Spring.Scheduling.Quartz20.Tests"/>
</objects>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects xmlns="http://www.springframework.net"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/xsd/spring-objects.xsd">
<object id="scheduler1" type="Spring.Scheduling.Quartz.SchedulerFactoryObject, Spring.Scheduling.Quartz20">
<property name="SchedulerName" value="quartz1"/>
</object>
<object id="scheduler2" type="Spring.Scheduling.Quartz.SchedulerFactoryObject, Spring.Scheduling.Quartz20">
<property name="SchedulerName" value="quartz2"/>
</object>
</objects>

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects xmlns="http://www.springframework.net"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/xsd/spring-objects.xsd">
<object id="scheduler" type="Spring.Scheduling.Quartz.SchedulerFactoryObject, Spring.Scheduling.Quartz20"/>
<object type="Spring.Scheduling.Quartz.SchedulerAccessorObject, Spring.Scheduling.Quartz20">
<property name="Scheduler" ref="scheduler"/>
<property name="Triggers">
<list>
<ref local="exportTrigger"/>
<ref local="importTrigger"/>
</list>
</property>
</object>
<object id="exportTrigger" type="Spring.Scheduling.Quartz.SimpleTriggerObject, Spring.Scheduling.Quartz20">
<property name="JobDetail">
<object type="Spring.Scheduling.Quartz.MethodInvokingJobDetailFactoryObject, Spring.Scheduling.Quartz20">
<property name="TargetObject" ref="exportService"/>
<property name="TargetMethod" value="DoExport"/>
</object>
</property>
<property name="RepeatInterval" value="1s"/>
<property name="RepeatCount" value="1"/>
</object>
<object id="importTrigger" type="Spring.Scheduling.Quartz.SimpleTriggerObject, Spring.Scheduling.Quartz20">
<property name="jobDetail">
<object type="Spring.Scheduling.Quartz.MethodInvokingJobDetailFactoryObject, Spring.Scheduling.Quartz20">
<property name="TargetObject" ref="importService"/>
<property name="TargetMethod" value="DoImport"/>
</object>
</property>
<property name="RepeatInterval" value="1s"/>
<property name="RepeatCount" value="1"/>
</object>
<object id="exportService" type="Spring.Scheduling.Quartz.QuartzTestObject, Spring.Scheduling.Quartz20.Tests"/>
<object id="importService" type="Spring.Scheduling.Quartz.QuartzTestObject, Spring.Scheduling.Quartz20.Tests"/>
</objects>

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects xmlns="http://www.springframework.net"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/xsd/spring-objects.xsd">
<object id="scheduler" type="Spring.Scheduling.Quartz.SchedulerFactoryObject, Spring.Scheduling.Quartz20">
<property name="schedulerName" value="myScheduler"/>
<property name="exposeSchedulerInRepository" value="true"/>
</object>
<object type="Spring.Scheduling.Quartz.SchedulerAccessorObject, Spring.Scheduling.Quartz20">
<property name="schedulerName" value="myScheduler"/>
<property name="triggers">
<list>
<ref local="exportTrigger"/>
<ref local="importTrigger"/>
</list>
</property>
</object>
<object id="exportTrigger" type="Spring.Scheduling.Quartz.SimpleTriggerObject, Spring.Scheduling.Quartz20">
<property name="JobDetail">
<object type="Spring.Scheduling.Quartz.MethodInvokingJobDetailFactoryObject, Spring.Scheduling.Quartz20">
<property name="TargetObject" ref="exportService"/>
<property name="TargetMethod" value="DoExport"/>
</object>
</property>
<property name="RepeatInterval" value="1s"/>
<property name="RepeatCount" value="1"/>
</object>
<object id="importTrigger" type="Spring.Scheduling.Quartz.SimpleTriggerObject, Spring.Scheduling.Quartz20">
<property name="jobDetail">
<object type="Spring.Scheduling.Quartz.MethodInvokingJobDetailFactoryObject, Spring.Scheduling.Quartz20">
<property name="TargetObject" ref="importService"/>
<property name="TargetMethod" value="DoImport"/>
</object>
</property>
<property name="RepeatInterval" value="1s"/>
<property name="RepeatCount" value="1"/>
</object>
<object id="exportService" type="Spring.Scheduling.Quartz.QuartzTestObject, Spring.Scheduling.Quartz20.Tests"/>
<object id="importService" type="Spring.Scheduling.Quartz.QuartzTestObject, Spring.Scheduling.Quartz20.Tests"/>
</objects>