Editor that can convert System.String values into Spring.Transaction.Interceptor.ITransactionAttributeSource instances.
The transaction attribute string must be parseable by the Spring.Transaction.Interceptor.TransactionAttributeEditor in this package.

Strings must be specified in the following syntax:
FQCN.methodName=<transaction attribute string> (sans <>).

ExampleNamespace.ExampleClass.MyMethod=PROPAGATION_MANDATORY,ISOLATION_DEFAULT The specified class must be the one where the methods are defined; in the case of implementing an interface, the interface class name must be specified.

This will register all overloaded methods for a given name. Does not support explicit registration of certain overloaded methods. Supports wildcard style mappings (in the form "xxx*"), e.g. "Notify*" for "Notify" and "NotifyAll".

 public void Null()
 {
     TransactionAttributeSourceEditor pe = new TransactionAttributeSourceEditor();
     pe.SetAsText(null);
     ITransactionAttributeSource tas = pe.Value;
     MethodInfo m = typeof(object).GetMethod("GetHashCode");
     Assert.IsTrue(tas.ReturnTransactionAttribute(m, null) == null);
 }
        public void Null()
        {
            TransactionAttributeSourceEditor pe = new TransactionAttributeSourceEditor();

            pe.SetAsText(null);
            ITransactionAttributeSource tas = pe.Value;
            MethodInfo m = typeof(object).GetMethod("GetHashCode");

            Assert.IsTrue(tas.ReturnTransactionAttribute(m, null) == null);
        }
        public void MatchesAll()
        {
            TransactionAttributeSourceEditor pe = new TransactionAttributeSourceEditor();
            pe.SetAsText("System.Object.*, Mscorlib=PROPAGATION_REQUIRED");
            ITransactionAttributeSource tas = pe.Value;

            checkTransactionProperties(tas, typeof(object).GetMethod("GetHashCode"), TransactionPropagation.Required);
            checkTransactionProperties(tas, typeof(object).GetMethod("Equals", new Type[] { typeof(object) }),TransactionPropagation.Required);
            checkTransactionProperties(tas, typeof(object).GetMethod("GetType"), TransactionPropagation.Required);
            checkTransactionProperties(tas, typeof(object).GetMethod("ToString"), TransactionPropagation.Required);
        }
        public void MatchesAll()
        {
            TransactionAttributeSourceEditor pe = new TransactionAttributeSourceEditor();

            pe.SetAsText("System.Object.*, Mscorlib=PROPAGATION_REQUIRED");
            ITransactionAttributeSource tas = pe.Value;

            checkTransactionProperties(tas, typeof(object).GetMethod("GetHashCode"), TransactionPropagation.Required);
            checkTransactionProperties(tas, typeof(object).GetMethod("Equals", new Type[] { typeof(object) }), TransactionPropagation.Required);
            checkTransactionProperties(tas, typeof(object).GetMethod("GetType"), TransactionPropagation.Required);
            checkTransactionProperties(tas, typeof(object).GetMethod("ToString"), TransactionPropagation.Required);
        }
        public void MatchesSpecific()
        {
            TransactionAttributeSourceEditor pe = new TransactionAttributeSourceEditor();
            pe.SetAsText("System.Object.GetHashCode, Mscorlib =PROPAGATION_REQUIRED\n" +
                "System.Object.Equals, Mscorlib =PROPAGATION_MANDATORY\n" +
                "System.Object.*pe, Mscorlib=PROPAGATION_SUPPORTS");
            ITransactionAttributeSource tas = pe.Value;

            checkTransactionProperties(tas, typeof(object).GetMethod("GetHashCode"), TransactionPropagation.Required);
            checkTransactionProperties(tas, typeof(object).GetMethod("Equals", new Type[] { typeof(object) }),TransactionPropagation.Mandatory);
            checkTransactionProperties(tas, typeof(object).GetMethod( "GetType" ), TransactionPropagation.Supports);
            checkTransactionProperties(tas, typeof(object).GetMethod("ToString") );
        }
        public void MatchesSpecific()
        {
            TransactionAttributeSourceEditor pe = new TransactionAttributeSourceEditor();

            pe.SetAsText("System.Object.GetHashCode, Mscorlib =PROPAGATION_REQUIRED\n" +
                         "System.Object.Equals, Mscorlib =PROPAGATION_MANDATORY\n" +
                         "System.Object.*pe, Mscorlib=PROPAGATION_SUPPORTS");
            ITransactionAttributeSource tas = pe.Value;

            checkTransactionProperties(tas, typeof(object).GetMethod("GetHashCode"), TransactionPropagation.Required);
            checkTransactionProperties(tas, typeof(object).GetMethod("Equals", new Type[] { typeof(object) }), TransactionPropagation.Mandatory);
            checkTransactionProperties(tas, typeof(object).GetMethod("GetType"), TransactionPropagation.Supports);
            checkTransactionProperties(tas, typeof(object).GetMethod("ToString"));
        }
 public void Invalid()
 {
     TransactionAttributeSourceEditor pe = new TransactionAttributeSourceEditor();
     pe.SetAsText("foo=bar");
 }
 public void Invalid()
 {
     TransactionAttributeSourceEditor pe = new TransactionAttributeSourceEditor();
     Assert.Throws<ArgumentException>(() => pe.SetAsText("foo=bar"));
 }
        public void Invalid()
        {
            TransactionAttributeSourceEditor pe = new TransactionAttributeSourceEditor();

            Assert.Throws <ArgumentException>(() => pe.SetAsText("foo=bar"));
        }
        public void Invalid()
        {
            TransactionAttributeSourceEditor pe = new TransactionAttributeSourceEditor();

            pe.SetAsText("foo=bar");
        }