SetAsText() public method

Parses the input properties System.String into a valid Spring.Transaction.Interceptor.ITransactionAttributeSource instance
public SetAsText ( string attributeSource ) : void
attributeSource string The properties string to be parsed.
return void
コード例 #1
0
 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);
        }
コード例 #3
0
        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);
        }
コード例 #5
0
        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"));
        }
コード例 #7
0
 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"));
        }
コード例 #10
0
        public void Invalid()
        {
            TransactionAttributeSourceEditor pe = new TransactionAttributeSourceEditor();

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