diff --git a/build-support/solutions/Spring.Net.Quartz.2005.sln b/build-support/solutions/Spring.Net.Quartz.2005.sln index 2625b8f0..839078d3 100644 --- a/build-support/solutions/Spring.Net.Quartz.2005.sln +++ b/build-support/solutions/Spring.Net.Quartz.2005.sln @@ -27,18 +27,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Data.2005", "..\..\s Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Data.Tests.2005", "..\..\test\Spring\Spring.Data.Tests\Spring.Data.Tests.2005.csproj", "{ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Core.Tests.2005", "..\..\test\Spring\Spring.Core.Tests\Spring.Core.Tests.2005.csproj", "{44B16BAA-6DF8-447C-9D7F-3AD3D854D904}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Scheduling.Quartz.2005", "..\..\src\Spring\Spring.Scheduling.Quartz\Spring.Scheduling.Quartz.2005.csproj", "{E823D54C-CE82-4868-929F-5F95A999F61E}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" @@ -51,6 +39,24 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Scheduling.Quartz.Te Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Scheduling.Quartz.Integration.Tests.2005", "..\..\test\Spring\Spring.Scheduling.Quartz.Integration.Tests\Spring.Scheduling.Quartz.Integration.Tests.2005.csproj", "{E4328F68-C3FC-43E2-9D63-30CEC55215B0}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{438FE108-6F55-4C8A-8BF4-C85D0906D134}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{5ECE7B2B-6975-4800-982E-618794909499}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|.NET = Debug|.NET @@ -97,26 +103,6 @@ Global {AE00E5AB-C39A-436F-86D2-33BFE33E2E40}.Release|Any CPU.Build.0 = Release|Any CPU {AE00E5AB-C39A-436F-86D2-33BFE33E2E40}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {AE00E5AB-C39A-436F-86D2-33BFE33E2E40}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Debug|.NET.ActiveCfg = Debug|Any CPU - {ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Release|.NET.ActiveCfg = Release|Any CPU - {ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Release|Any CPU.Build.0 = Release|Any CPU - {ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {44B16BAA-6DF8-447C-9D7F-3AD3D854D904}.Debug|.NET.ActiveCfg = Debug|Any CPU - {44B16BAA-6DF8-447C-9D7F-3AD3D854D904}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {44B16BAA-6DF8-447C-9D7F-3AD3D854D904}.Debug|Any CPU.Build.0 = Debug|Any CPU - {44B16BAA-6DF8-447C-9D7F-3AD3D854D904}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {44B16BAA-6DF8-447C-9D7F-3AD3D854D904}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {44B16BAA-6DF8-447C-9D7F-3AD3D854D904}.Release|.NET.ActiveCfg = Release|Any CPU - {44B16BAA-6DF8-447C-9D7F-3AD3D854D904}.Release|Any CPU.ActiveCfg = Release|Any CPU - {44B16BAA-6DF8-447C-9D7F-3AD3D854D904}.Release|Any CPU.Build.0 = Release|Any CPU - {44B16BAA-6DF8-447C-9D7F-3AD3D854D904}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {44B16BAA-6DF8-447C-9D7F-3AD3D854D904}.Release|Mixed Platforms.Build.0 = Release|Any CPU {E823D54C-CE82-4868-929F-5F95A999F61E}.Debug|.NET.ActiveCfg = Debug|Any CPU {E823D54C-CE82-4868-929F-5F95A999F61E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E823D54C-CE82-4868-929F-5F95A999F61E}.Debug|Any CPU.Build.0 = Debug|Any CPU @@ -137,10 +123,28 @@ Global {9FE720ED-2BD9-4FB9-89C8-FFFA4A491CB5}.Release|Any CPU.Build.0 = Release|Any CPU {9FE720ED-2BD9-4FB9-89C8-FFFA4A491CB5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {9FE720ED-2BD9-4FB9-89C8-FFFA4A491CB5}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E4328F68-C3FC-43E2-9D63-30CEC55215B0}.Debug|.NET.ActiveCfg = Debug|Any CPU + {E4328F68-C3FC-43E2-9D63-30CEC55215B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E4328F68-C3FC-43E2-9D63-30CEC55215B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E4328F68-C3FC-43E2-9D63-30CEC55215B0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E4328F68-C3FC-43E2-9D63-30CEC55215B0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E4328F68-C3FC-43E2-9D63-30CEC55215B0}.Release|.NET.ActiveCfg = Release|Any CPU + {E4328F68-C3FC-43E2-9D63-30CEC55215B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E4328F68-C3FC-43E2-9D63-30CEC55215B0}.Release|Any CPU.Build.0 = Release|Any CPU + {E4328F68-C3FC-43E2-9D63-30CEC55215B0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E4328F68-C3FC-43E2-9D63-30CEC55215B0}.Release|Mixed Platforms.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {3A3A4E65-45A6-4B20-B460-0BEDC302C02C} = {438FE108-6F55-4C8A-8BF4-C85D0906D134} + {710961A3-0DF4-49E4-A26E-F5B9C044AC84} = {438FE108-6F55-4C8A-8BF4-C85D0906D134} + {AE00E5AB-C39A-436F-86D2-33BFE33E2E40} = {438FE108-6F55-4C8A-8BF4-C85D0906D134} + {E823D54C-CE82-4868-929F-5F95A999F61E} = {438FE108-6F55-4C8A-8BF4-C85D0906D134} + {9FE720ED-2BD9-4FB9-89C8-FFFA4A491CB5} = {5ECE7B2B-6975-4800-982E-618794909499} + {E4328F68-C3FC-43E2-9D63-30CEC55215B0} = {5ECE7B2B-6975-4800-982E-618794909499} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution NAntAddinLastFileName = Spring.build EndGlobalSection diff --git a/lib/Net/2.0/Quartz.dll b/lib/Net/2.0/Quartz.dll index 654181e3..6c7df6fc 100644 Binary files a/lib/Net/2.0/Quartz.dll and b/lib/Net/2.0/Quartz.dll differ diff --git a/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/LocalDataSourceJobStore.cs b/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/LocalDataSourceJobStore.cs index 315931a5..0ac83c44 100644 --- a/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/LocalDataSourceJobStore.cs +++ b/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/LocalDataSourceJobStore.cs @@ -14,6 +14,10 @@ * limitations under the License. */ +using System; +using System.Data; +using System.Data.SqlClient; + using Quartz; using Quartz.Impl.AdoJobStore; using Quartz.Spi; @@ -49,9 +53,8 @@ namespace Spring.Scheduling.Quartz /// /// /// - public class LocalDataSourceJobStore : JobStoreSupport + public class LocalDataSourceJobStore : JobStoreCMT { - /** * Name used for the transactional ConnectionProvider for Quartz. * This provider will delegate to the local Spring-managed DataSource. @@ -62,47 +65,39 @@ namespace Spring.Scheduling.Quartz private Data.Common.IDbProvider dbProvider; - public Data.Common.IDbProvider DbProvider + /// + /// Gets or sets the name of the instance. + /// + /// The name of the instance. + public override string InstanceName { - get { return dbProvider; } - set { dbProvider = value; } - } - - - public override void Initialize(ITypeLoadHelper loadHelper, ISchedulerSignaler signaler) - { - - // Absolutely needs thread-bound DataSource to initialize. - dbProvider = SchedulerFactoryObject.ConfigTimeDbProvider; - if (dbProvider == null) + get { return base.InstanceName; } + set { - throw new SchedulerConfigException( - "No db provider found for configuration - " + - "'DbProvider' property must be set on SchedulerFactoryObject"); + // use to catch property setting + base.InstanceName = value; + DataSource = TX_DATA_SOURCE_PREFIX + InstanceName; + // Register transactional ConnectionProvider for Quartz. + // Absolutely needs thread-bound DataSource to initialize. + dbProvider = SchedulerFactoryObject.ConfigTimeDbProvider; + if (dbProvider == null) + { + throw new SchedulerConfigException( + "No db provider found for configuration - " + + "'DbProvider' property must be set on SchedulerFactoryObject"); + } + DBConnectionManager.Instance.AddConnectionProvider( + TX_DATA_SOURCE_PREFIX + InstanceName, new SpringDbProviderAdapter(dbProvider)); + } - - // Configure transactional connection settings for Quartz. - DataSource = TX_DATA_SOURCE_PREFIX + InstanceName; - DontSetAutoCommitFalse = true; - - // Register transactional ConnectionProvider for Quartz. - DBConnectionManager.Instance.AddConnectionProvider( - TX_DATA_SOURCE_PREFIX + InstanceName, new SpringDbProviderAdapter(dbProvider)); - - base.Initialize(loadHelper, signaler); } protected override ConnectionAndTransactionHolder GetNonManagedTXConnection() { - return GetConnection(); + ConnectionTxPair pair = ConnectionUtils.GetConnectionTxPair(dbProvider); + return new ConnectionAndTransactionHolder(pair.Connection, pair.Transaction); } - protected override object ExecuteInLock(string lockName, ITransactionCallback txCallback) - { - throw new System.NotImplementedException(); - } - - protected override void CloseConnection(ConnectionAndTransactionHolder connectionAndTransactionHolder) { // Will work for transactional and non-transactional connections. @@ -111,4 +106,112 @@ namespace Spring.Scheduling.Quartz } + /// + /// + public class JobStoreCMT : JobStoreSupport { + + /// + /// + /// + /// + public override void Initialize(ITypeLoadHelper loadHelper, ISchedulerSignaler signaler) + { + if (LockHandler == null) { + // If the user hasn't specified an explicit lock handler, + // then we *must* use DB locks with CMT... + UseDBLocks = true; + } + + base.Initialize(loadHelper, signaler); + + Log.Info("JobStoreCMT initialized."); + } + + /// + /// + public override void Shutdown() { + + base.Shutdown(); + + try { + DBConnectionManager.Instance.Shutdown(DataSource); + } catch (SqlException sqle) { + Log.Warn("Database connection shutdown unsuccessful.", sqle); + } + } + + protected override ConnectionAndTransactionHolder GetNonManagedTXConnection() + { + IDbConnection conn; + try { + conn = DBConnectionManager.Instance.GetConnection(DataSource); + } catch (SqlException sqle) { + throw new JobPersistenceException( + "Failed to obtain DB connection from data source '" + + DataSource + "': " + + sqle, sqle); + } catch (Exception e) { + throw new JobPersistenceException( + "Failed to obtain DB connection from data source '" + + DataSource + "': " + + e, e, + SchedulerException.ErrorPersistenceCriticalFailure); + } + + if (conn == null) { + throw new JobPersistenceException( + "Could not get connection from DataSource '" + + DataSource + "'"); + } + + // Set any connection connection attributes we are to override. + return new ConnectionAndTransactionHolder(conn, null); + } + + /** + * Execute the given callback having optionally aquired the given lock. + * Because CMT assumes that the connection is already part of a managed + * transaction, it does not attempt to commit or rollback the + * enclosing transaction. + * + * @param lockName The name of the lock to aquire, for example + * "TRIGGER_ACCESS". If null, then no lock is aquired, but the + * txCallback is still executed in a transaction. + * + * @see JobStoreSupport#executeInNonManagedTXLock(String, TransactionCallback) + * @see JobStoreTX#executeInLock(String, TransactionCallback) + * @see JobStoreSupport#getNonManagedTXConnection() + * @see JobStoreSupport#getConnection() + */ + protected override object ExecuteInLock( + string lockName, + ITransactionCallback txCallback){ + bool transOwner = false; + ConnectionAndTransactionHolder conn = null; + try { + if (lockName != null) { + // If we aren't using db locks, then delay getting DB connection + // until after aquiring the lock since it isn't needed. + if (LockHandler.RequiresConnection) { + conn = GetNonManagedTXConnection(); + } + + transOwner = LockHandler.ObtainLock(DbMetadata, conn, lockName); + } + + if (conn == null) { + conn = GetNonManagedTXConnection(); + } + + return txCallback.Execute(conn); + } finally { + try { + ReleaseLock(conn, LockTriggerAccess, transOwner); + } finally { + CleanupConnection(conn); + } + } + } +} + } diff --git a/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SchedulerFactoryObject.cs b/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SchedulerFactoryObject.cs index 28f3f2e8..d9a06070 100644 --- a/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SchedulerFactoryObject.cs +++ b/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SchedulerFactoryObject.cs @@ -145,7 +145,7 @@ namespace Spring.Scheduling.Quartz private IJobListener[] jobListeners; private string[] jobSchedulingDataLocations; private bool overwriteExistingJobs; - private NameValueCollection quartzProperties; + private IDictionary quartzProperties; private IScheduler scheduler; private IDictionary schedulerContextMap; private Type schedulerFactoryType; @@ -227,7 +227,7 @@ namespace Spring.Scheduling.Quartz /// or to specify all necessary properties locally. /// /// - public virtual NameValueCollection QuartzProperties + public virtual IDictionary QuartzProperties { set { quartzProperties = value; } } @@ -779,7 +779,7 @@ namespace Spring.Scheduling.Quartz if (taskExecutor != null) { mergedProps[StdSchedulerFactory.PropertyThreadPoolType] = - typeof (LocalTaskExecutorThreadPool).FullName; + typeof (LocalTaskExecutorThreadPool).AssemblyQualifiedName; } else { @@ -816,7 +816,7 @@ namespace Spring.Scheduling.Quartz if (dbProvider != null) { - mergedProps.Add(StdSchedulerFactory.PropertyJobStoreType, typeof(LocalDataSourceJobStore).FullName); + mergedProps.Add(StdSchedulerFactory.PropertyJobStoreType, typeof(LocalDataSourceJobStore).AssemblyQualifiedName); } @@ -836,11 +836,11 @@ namespace Spring.Scheduling.Quartz /// /// The properties to merge into given map. /// The map to merge to. - protected virtual void MergePropertiesIntoMap(NameValueCollection properties, NameValueCollection map) + protected virtual void MergePropertiesIntoMap(IDictionary properties, NameValueCollection map) { foreach (string key in properties.Keys) { - map[key] = properties[key]; + map[key] = (string) properties[key]; } } diff --git a/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SimpleTriggerObject.cs b/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SimpleTriggerObject.cs index de5ce1ef..5b62e9df 100644 --- a/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SimpleTriggerObject.cs +++ b/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SimpleTriggerObject.cs @@ -51,7 +51,7 @@ namespace Spring.Scheduling.Quartz /// public class SimpleTriggerObject : SimpleTrigger, IJobDetailAwareTrigger, IObjectNameAware, IInitializingObject { - private long startDelay = 0; + private long startDelay; private JobDetail jobDetail; private string objectName; private readonly Constants constants = new Constants(typeof(MisfireInstruction.SimpleTrigger), typeof(MisfireInstruction)); @@ -90,10 +90,7 @@ namespace Spring.Scheduling.Quartz /// public virtual string MisfireInstructionName { - set - { - MisfireInstruction = constants.AsNumber(value); - } + set { MisfireInstruction = constants.AsNumber(value); } } /// diff --git a/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SpringDbProviderAdapter.cs b/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SpringDbProviderAdapter.cs index 8df05bff..36587c0c 100644 --- a/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SpringDbProviderAdapter.cs +++ b/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SpringDbProviderAdapter.cs @@ -1,4 +1,4 @@ -/* + /* * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,11 +14,15 @@ * limitations under the License. */ +using System; using System.Data; +using System.Reflection; using Quartz.Impl.AdoJobStore; using Quartz.Impl.AdoJobStore.Common; +using IDbMetadata=Spring.Data.Common.IDbMetadata; + namespace Spring.Scheduling.Quartz { /// @@ -28,6 +32,7 @@ namespace Spring.Scheduling.Quartz public class SpringDbProviderAdapter : IDbProvider { private readonly Data.Common.IDbProvider dbProvider; + private DbMetadata metadata; /// /// Initializes a new instance of the class. @@ -36,8 +41,10 @@ namespace Spring.Scheduling.Quartz public SpringDbProviderAdapter(Data.Common.IDbProvider dbProvider) { this.dbProvider = dbProvider; + metadata = new SpringMetadataAdapter(dbProvider.DbMetadata); } + public IDbCommand CreateCommand() { return dbProvider.CreateCommand(); @@ -71,7 +78,101 @@ namespace Spring.Scheduling.Quartz public DbMetadata Metadata { - get { throw new System.NotImplementedException(); } + get { return metadata; } } } + + public class SpringMetadataAdapter : DbMetadata + { + private IDbMetadata metadata; + + public SpringMetadataAdapter(IDbMetadata metadata) + { + this.metadata = metadata; + } + + public override string ProductName + { + get { return metadata.ProductName; } + set { throw new NotImplementedException(); } + } + + public override Type ConnectionType + { + get { return metadata.ConnectionType; } + set { throw new NotImplementedException(); } + } + + public override Type CommandType + { + get { return metadata.CommandType; } + set { throw new NotImplementedException(); } + } + + public override Type ParameterType + { + get { return metadata.ParameterType; } + set { throw new NotImplementedException(); } + } + + public override Type CommandBuilderType + { + get { return metadata.CommandBuilderType; } + set { throw new NotImplementedException(); } + } + + public override MethodInfo CommandBuilderDeriveParametersMethod + { + get { return metadata.CommandBuilderDeriveParametersMethod; } + set { throw new NotImplementedException(); } + } + + public override string ParameterNamePrefix + { + get { return metadata.ParameterNamePrefix; } + set { throw new NotImplementedException(); } + } + + public override Type ExceptionType + { + get { return metadata.ExceptionType; } + set { throw new NotImplementedException(); } + } + + public override bool BindByName + { + get { return metadata.BindByName; } + set { throw new NotImplementedException(); } + } + + public override Type ParameterDbType + { + get { return metadata.ParameterDbType; } + set { throw new NotImplementedException(); } + } + + public override PropertyInfo ParameterDbTypeProperty + { + get { return metadata.ParameterDbTypeProperty; } + set { throw new NotImplementedException(); } + } + + public override PropertyInfo ParameterIsNullableProperty + { + get { return metadata.ParameterIsNullableProperty; } + set { throw new NotImplementedException(); } + } + + public override Enum DbBinaryType + { + get { return DbType.Binary; } + } + + public override bool UseParameterNamePrefixInParameterCollection + { + get { return metadata.UseParameterNamePrefixInParameterCollection; } + set { throw new NotImplementedException(); } + } + } + } \ No newline at end of file diff --git a/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Scheduling/Quartz/LocalDataSourceJobStoreTest.cs b/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Scheduling/Quartz/LocalDataSourceJobStoreTest.cs new file mode 100644 index 00000000..bc631199 --- /dev/null +++ b/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Scheduling/Quartz/LocalDataSourceJobStoreTest.cs @@ -0,0 +1,51 @@ +#region License + +/* + * Copyright © 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.Quartz.Integration.Tests/Spring.Scheduling.Quartz/LocalDataSourceJobStoreTest.xml"); + } + + [Test] + public void TestLocalDataSourceJobStore() + { + // sleep 20 seconds + Thread.Sleep(20000); + } + + } +} \ No newline at end of file diff --git a/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Scheduling/Quartz/LocalDataSourceJobStoreTest.xml b/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Scheduling/Quartz/LocalDataSourceJobStoreTest.xml new file mode 100644 index 00000000..c416a461 --- /dev/null +++ b/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Scheduling/Quartz/LocalDataSourceJobStoreTest.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Scheduling/Quartz/TestJob.cs b/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Scheduling/Quartz/TestJob.cs new file mode 100644 index 00000000..05d72988 --- /dev/null +++ b/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Scheduling/Quartz/TestJob.cs @@ -0,0 +1,20 @@ +using System; + +using Quartz; + +namespace Spring.Scheduling.Quartz.Integration.Tests +{ + public class TestJob : IJob + { + public void Execute(JobExecutionContext context) + { + Console.WriteLine("Executing Execute!"); + } + + public void DoIt() + { + Console.WriteLine("Executing DoIt!"); + } + + } +} \ No newline at end of file diff --git a/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Spring.Scheduling.Quartz.Integration.Tests.2003.csproj b/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Spring.Scheduling.Quartz.Integration.Tests.2003.csproj new file mode 100644 index 00000000..5fcd35a3 --- /dev/null +++ b/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Spring.Scheduling.Quartz.Integration.Tests.2003.csproj @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Spring.Scheduling.Quartz.Integration.Tests.2005.csproj b/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Spring.Scheduling.Quartz.Integration.Tests.2005.csproj new file mode 100644 index 00000000..d295daf0 --- /dev/null +++ b/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Spring.Scheduling.Quartz.Integration.Tests.2005.csproj @@ -0,0 +1,82 @@ + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {E4328F68-C3FC-43E2-9D63-30CEC55215B0} + Library + Properties + Spring + Spring.Scheduling.Quartz.Integration.Tests + + + 2.0 + + + + + true + full + false + ..\..\..\build\VS.NET.2005\Spring.Scheduling.Quartz.Integration.Tests\Debug\ + TRACE;DEBUG;NET_2_0 + prompt + 4 + + + pdbonly + true + ..\..\..\build\VS.NET.2005\Spring.Scheduling.Quartz.Integration.Tests\Release\ + TRACE;NET_2_0 + prompt + 4 + + + + False + ..\..\..\lib\net\2.0\nunit.framework.dll + + + False + ..\..\..\lib\net\2.0\Quartz.dll + + + False + ..\..\..\lib\Net\2.0\Rhino.Mocks.dll + + + + + + + + {710961A3-0DF4-49E4-A26E-F5B9C044AC84} + Spring.Core.2005 + + + {E823D54C-CE82-4868-929F-5F95A999F61E} + Spring.Scheduling.Quartz.2005 + + + + + PreserveNewest + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Spring.Scheduling.Quartz.Integration.Tests.build b/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Spring.Scheduling.Quartz.Integration.Tests.build new file mode 100644 index 00000000..c9d5cf62 --- /dev/null +++ b/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Spring.Scheduling.Quartz.Integration.Tests.build @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Spring.Scheduling.Quartz.Integration.Tests.dll.config b/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Spring.Scheduling.Quartz.Integration.Tests.dll.config new file mode 100644 index 00000000..bad5ea5e --- /dev/null +++ b/test/Spring/Spring.Scheduling.Quartz.Integration.Tests/Spring.Scheduling.Quartz.Integration.Tests.dll.config @@ -0,0 +1,52 @@ + + + + + +
+ + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file