Henrik,

Both patches are applied in r5615. I've added the testcase with a little
change: it uses the already existing ResourceImpl class.

-- Roelof

On Mon, Apr 6, 2009 at 8:22 AM, Henrik Feldt <[email protected]> wrote:

>  [Test]
>
> public void TransactionResources_AreDisposed()
>
> {
>
>            var txM = _Container.Resolve<ITransactionManager>();
>
>            var t = txM.CreateTransaction(TransactionMode.Requires,
> IsolationMode.Unspecified);
>
>            var resource = new TestResource();
>
>            t.Enlist(resource);
>
>            t.Begin();
>
>            // lalala
>
>            t.Rollback();
>
>            txM.Dispose(t);
>
>
>
>            Assert.That(resource.wasDisposed);
>
> }
>
>
>
> private class TestResource : IResource, IDisposable
>
> {
>
>            public bool wasDisposed;
>
>
>
>            public void Start()
>
>            {
>
>            }
>
>
>
>            public void Commit()
>
>            {
>
>            }
>
>
>
>            public void Rollback()
>
>            {
>
>            }
>
>
>
>            public void Dispose()
>
>            {
>
>                       wasDisposed = true;
>
>            }
>
> }
>
>
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Henrik Feldt
> *Sent:* den 6 april 2009 07:20
> *To:* [email protected]
> *Subject:* RE: Patch for MicroKernel when passed null in a component
> registration
>
>
>
> Added disposable resources.
>
>
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Henrik Feldt
> *Sent:* den 6 april 2009 00:30
> *To:* [email protected]
> *Subject:* Patch for MicroKernel when passed null in a component
> registration
>
>
>
> Changes in Registration/Component.cs and
> Tests/ComponentRegistrationTestCase.cs
>
>
>
> Problem: When you use Type.GetType, which I use (because I need a type in a
> facility which I can’t reference directly and it doesn’t make sense to open
> it up to changes in the config file which ships with the application), and
> for some reason the application can’t load that type, the method call
> returns null and so the MicoKernel fails where it shouldn’t fail, assuming
> the implementation isn’t null.
>
>
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to