springnet-commits Mailing List for Spring Framework .NET (Page 15)
Brought to you by:
aseovic,
markpollack
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(33) |
Aug
(163) |
Sep
(491) |
Oct
(289) |
Nov
(336) |
Dec
(84) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(227) |
Feb
(413) |
Mar
(128) |
Apr
(232) |
May
(92) |
Jun
(299) |
Jul
(386) |
Aug
(228) |
Sep
(237) |
Oct
(426) |
Nov
(325) |
Dec
(405) |
2006 |
Jan
(315) |
Feb
(311) |
Mar
(152) |
Apr
(177) |
May
(443) |
Jun
(92) |
Jul
(88) |
Aug
(80) |
Sep
(288) |
Oct
(515) |
Nov
(1049) |
Dec
(440) |
2007 |
Jan
(179) |
Feb
(406) |
Mar
(294) |
Apr
(80) |
May
(432) |
Jun
(242) |
Jul
(452) |
Aug
(710) |
Sep
(206) |
Oct
(240) |
Nov
(65) |
Dec
(227) |
2008 |
Jan
(80) |
Feb
(90) |
Mar
(98) |
Apr
(136) |
May
(101) |
Jun
(12) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Mark P. <mar...@us...> - 2008-02-26 21:21:48
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI/Controls In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26070 Modified Files: ValidationError.cs ValidationSummary.cs Log Message: SPRNET-558 - Enable Data Validation and Model Managment for UserControl Index: ValidationSummary.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI/Controls/ValidationSummary.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ValidationSummary.cs 2 Aug 2007 19:19:42 -0000 1.8 --- ValidationSummary.cs 26 Feb 2008 21:21:26 -0000 1.9 *************** *** 30,33 **** --- 30,34 ---- /// </summary> /// <author>Aleksandar Seovic</author> + /// <author>Jonathan Allenby</author> /// <version>$Id$</version> public class ValidationSummary : Control *************** *** 96,100 **** if (Visible) { ! IList errorMessages = this.Page.ValidationErrors.GetResolvedErrors(this.Provider, this.Page.MessageSource); Renderer.RenderErrors(Page, writer, errorMessages); } --- 97,116 ---- if (Visible) { ! IList errorMessages; ! ! System.Type t = typeof(Spring.Web.UI.Page); ! ! if (this.TemplateControl != null) t = this.TemplateControl.GetType(); ! ! if (t.IsSubclassOf(typeof(Spring.Web.UI.UserControl))) ! { ! Spring.Web.UI.UserControl container = (Spring.Web.UI.UserControl)this.TemplateControl as Spring.Web.UI.UserControl; ! errorMessages = container.ValidationErrors.GetResolvedErrors(this.Provider, container.MessageSource); ! } ! else ! { ! errorMessages = this.Page.ValidationErrors.GetResolvedErrors(this.Provider, this.Page.MessageSource); ! } ! Renderer.RenderErrors(Page, writer, errorMessages); } Index: ValidationError.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI/Controls/ValidationError.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ValidationError.cs 2 Aug 2007 19:19:42 -0000 1.8 --- ValidationError.cs 26 Feb 2008 21:21:26 -0000 1.9 *************** *** 29,32 **** --- 29,33 ---- /// </summary> /// <author>Aleksandar Seovic</author> + /// <author>Jonathan Allenby</author> /// <version>$Id$</version> public class ValidationError : Control *************** *** 95,99 **** if (Visible) { ! IList errorMessages = this.Page.ValidationErrors.GetResolvedErrors(this.Provider, this.Page.MessageSource); Renderer.RenderErrors(Page, writer, errorMessages); } --- 96,115 ---- if (Visible) { ! IList errorMessages; ! ! System.Type t = typeof(Spring.Web.UI.Page); ! ! if (this.TemplateControl != null) t = this.TemplateControl.GetType(); ! ! if (t.IsSubclassOf(typeof(Spring.Web.UI.UserControl))) ! { ! Spring.Web.UI.UserControl container = (Spring.Web.UI.UserControl)this.TemplateControl as Spring.Web.UI.UserControl; ! errorMessages = container.ValidationErrors.GetResolvedErrors(this.Provider, container.MessageSource); ! } ! else ! { ! errorMessages = this.Page.ValidationErrors.GetResolvedErrors(this.Provider, this.Page.MessageSource); ! } ! Renderer.RenderErrors(Page, writer, errorMessages); } |
From: Mark P. <mar...@us...> - 2008-02-26 19:06:15
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv31974 Modified Files: UserControl.cs Log Message: SPRNET-558 - Enable Data Validation for UserControl (Partial fix) Index: UserControl.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI/UserControl.cs,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** UserControl.cs 2 Feb 2008 09:12:44 -0000 1.50 --- UserControl.cs 26 Feb 2008 19:06:11 -0000 1.51 *************** *** 39,44 **** using Spring.DataBinding; using Spring.Globalization; ! using Spring.Util; using Spring.Web.Support; #endregion --- 39,45 ---- using Spring.DataBinding; using Spring.Globalization; ! using Spring.Validation; using Spring.Web.Support; + using IValidator = Spring.Validation.IValidator; #endregion *************** *** 69,72 **** --- 70,74 ---- private IDictionary sharedState; private IBindingContainer bindingManager; + private IValidationErrors validationErrors = new ValidationErrors(); private IDictionary results; private IApplicationContext applicationContext; *************** *** 117,120 **** --- 119,131 ---- InitializeBindingManager(); + if (!IsPostBack) + { + InitializeModel(); + } + else + { + LoadModel(LoadModelFromPersistenceMedium()); + } + base.OnInit(e); *************** *** 236,239 **** --- 247,256 ---- base.OnPreRender(e); + + object modelToSave = SaveModel(); + if (modelToSave != null) + { + SaveModelToPersistenceMedium(modelToSave); + } } *************** *** 291,294 **** --- 308,376 ---- #endregion + #region Model Management Support + + /// <summary> + /// Initializes data model when the page is first loaded. + /// </summary> + /// <remarks> + /// This method should be overriden by the developer + /// in order to initialize data model for the page. + /// </remarks> + protected virtual void InitializeModel() + { + } + + /// <summary> + /// Retrieves data model from a persistence store. + /// </summary> + /// <remarks> + /// The default implementation uses <see cref="System.Web.UI.Page.Session"/> to store and retrieve + /// the model for the current <see cref="System.Web.HttpRequest.CurrentExecutionFilePath" /> + /// </remarks> + protected virtual object LoadModelFromPersistenceMedium() + { + return Session[Request.CurrentExecutionFilePath + this.UniqueID + ".Model"]; + } + + /// <summary> + /// Saves data model to a persistence store. + /// </summary> + /// <remarks> + /// The default implementation uses <see cref="System.Web.UI.Page.Session"/> to store and retrieve + /// the model for the current <see cref="System.Web.HttpRequest.CurrentExecutionFilePath" /> + /// </remarks> + protected virtual void SaveModelToPersistenceMedium(object modelToSave) + { + Session[Request.CurrentExecutionFilePath + this.UniqueID + ".Model"] = modelToSave; + } + + /// <summary> + /// Loads the saved data model on postback. + /// </summary> + /// <remarks> + /// This method should be overriden by the developer + /// in order to load data model for the page. + /// </remarks> + protected virtual void LoadModel(object savedModel) + { + } + + /// <summary> + /// Returns a model object that should be saved. + /// </summary> + /// <remarks> + /// This method should be overriden by the developer + /// in order to save data model for the page. + /// </remarks> + /// <returns> + /// A model object that should be saved. + /// </returns> + protected virtual object SaveModel() + { + return null; + } + + #endregion< + #region Controller Support *************** *** 466,469 **** --- 548,626 ---- #endregion + #region Validation support + + /// <summary> + /// Evaluates specified validators and returns <c>True</c> if all of them are valid. + /// </summary> + /// <remarks> + /// <p> + /// Each validator can itself represent a collection of other validators if it is + /// an instance of <see cref="ValidatorGroup"/> or one of its derived types. + /// </p> + /// <p> + /// Please see the Validation Framework section in the documentation for more info. + /// </p> + /// </remarks> + /// <param name="validationContext">Object to validate.</param> + /// <param name="validators">Validators to evaluate.</param> + /// <returns> + /// <c>True</c> if all of the specified validators are valid, <c>False</c> otherwise. + /// </returns> + public bool Validate(object validationContext, params IValidator[] validators) + { + IDictionary contextParams = CreateValidatorParameters(); + bool result = true; + foreach (IValidator validator in validators) + { + if (validator == null) + { + throw new ArgumentException("Validator is not defined."); + } + result = validator.Validate(validationContext, contextParams, this.validationErrors) && result; + } + + return result; + } + + /// <summary> + /// Gets the validation errors container. + /// </summary> + /// <value>The validation errors container.</value> + public IValidationErrors ValidationErrors + { + get { return validationErrors; } + } + + /// <summary> + /// Creates the validator parameters. + /// </summary> + /// <remarks> + /// <para> + /// This method can be overriden if you want to pass additional parameters + /// to the validation framework, but you should make sure that you call + /// this base implementation in order to add page, session, application, + /// request, response and context to the variables collection. + /// </para> + /// </remarks> + /// <returns> + /// Dictionary containing parameters that should be passed to + /// the data validation framework. + /// </returns> + protected virtual IDictionary CreateValidatorParameters() + { + IDictionary parameters = new ListDictionary(); + parameters["page"] = this.Page; + parameters["usercontrol"] = this; + parameters["session"] = this.Session; + parameters["application"] = this.Application; + parameters["request"] = this.Request; + parameters["response"] = this.Response; + parameters["context"] = this.Context; + + return parameters; + } + + #endregion + #region Data binding support |
From: Mark P. <mar...@us...> - 2008-02-26 02:04:38
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv12269 Modified Files: index.xml objects.xml orm.xml web.xml Log Message: misc updates. Index: index.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/index.xml,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** index.xml 16 Jan 2008 19:41:38 -0000 1.80 --- index.xml 26 Feb 2008 02:04:32 -0000 1.81 *************** *** 55,59 **** <subtitle>Reference Documentation</subtitle> <releaseinfo>Version 1.1</releaseinfo> ! <pubdate>Last Updated January 16, 2007</pubdate> <authorgroup> <author> --- 55,59 ---- <subtitle>Reference Documentation</subtitle> <releaseinfo>Version 1.1</releaseinfo> ! <pubdate>Last Updated February 25, 2008</pubdate> <authorgroup> <author> Index: orm.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/orm.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** orm.xml 16 Jan 2008 17:21:44 -0000 1.15 --- orm.xml 26 Feb 2008 02:04:32 -0000 1.16 *************** *** 1,3 **** ! <?xml version="1.0" encoding="UTF-8"?> <chapter id="orm"> <title>Object Relational Mapping (ORM) data access</title> --- 1,3 ---- ! <?xml version="1.0" encoding="UTF-8"?> <chapter id="orm"> <title>Object Relational Mapping (ORM) data access</title> *************** *** 300,304 **** </objects></programlisting> ! <para>The location of NHibernate mapping information can also be specified using Spring's <link linkend="resources">IResource abstraction</link> via the property <literal>MappingResources</literal>. --- 300,310 ---- </objects></programlisting> ! <para>Many of the properties on ! <literal>LocalSessionFactoryObject</literal> are those you will commonly ! configure, for example the property <literal>MappingAssemblies</literal> ! specifies a list of assemblies to seach for hibernate mapping files. The ! property <literal>HibernateProperies</literal> are the familiar ! NHibernate properties used to set typical options such as dialect and ! driver class. The location of NHibernate mapping information can also be specified using Spring's <link linkend="resources">IResource abstraction</link> via the property <literal>MappingResources</literal>. *************** *** 307,311 **** leverage the extensibility of IResource and thereby allow NHibernate to obtain its configuration information from locations such as a database ! or LDAP.</para> </section> --- 313,380 ---- leverage the extensibility of IResource and thereby allow NHibernate to obtain its configuration information from locations such as a database ! or LDAP.For other properties you can configure them as you normal using ! the file <literal>hibernate.cfg.xml</literal> and refer to it via the ! property <literal>ConfigFileNames</literal>. This property is a string ! array so multiple configuration files are supported.</para> ! ! <para>There are other properties in ! <classname>LocalSessionFactoryObject</classname> that relate to the ! integration of Spring with NHibernate. The property ! <literal>ExposeTransactionAwareSessionFactory</literal> is discussed ! below and allows you to use Spring's declarative transaction demarcation ! functionality with the standard NHibernate API (as compared to using ! HibernateTemplate). </para> ! ! <para>The property <literal>DbProvider</literal> is used to infer two ! NHibernate configurations options. </para> ! ! <itemizedlist> ! <listitem> ! <para>Infer the connection string, typically done via the hibernate ! property "hibernate.connection.connection_string". </para> ! </listitem> ! ! <listitem> ! <para>Delegate to the <classname>DbProvider</classname> itself as ! the NHibernate connection provider instead of listing it via ! property hibernate.connection.provider via ! <literal>HibernateProperties</literal>. </para> ! </listitem> ! </itemizedlist> ! ! <para>If you specify both the property hibernate.connection.provider and ! DbProvider (as shown above) the configuration of the property ! hibernate.connection.provider is used and a warning level message is ! logged. If you use Spring's <classname>DbProvider</classname> as the ! NHibernate connection provider then you can take advantage of ! <classname>IDbProvider</classname> implementations that will let you ! change the connection string at runtime such as <link lang="" ! linkend="dbprovider-usercredentials">UserCredentialsDbProvider</link> ! and <link ! linkend="dbprovider-multidelegating">MultiDelegatingDbProvider</link>. ! </para> ! ! <note> ! <para><link lang="" ! linkend="dbprovider-usercredentials">UserCredentialsDbProvider</link> ! and <link ! linkend="dbprovider-multidelegating">MultiDelegatingDbProvider</link> ! only change the connection string at runtime based on values in thread ! local storage and do not clear out the Hibernate cache that is unique ! to each <classname>ISessionFactory</classname> instance. As such, they ! are only useful for selecting at runtime a single database instance. ! Cleaning up an existing session factory when switching to a new ! database is left to user code. Creating a new session factory per ! connection string (assuming the same mapping files can be used across ! all databases connections) is not currently supported. To support this ! functionality, you can subclass ! <classname>LocalSessionFactoryObject</classname> and override the ! method <literal>ISessionFactory NewSessionFactory(Configuration ! config)</literal> so that it returns an implementation of ! <classname>ISessionFactory</classname> that selects among multiple ! instances based on values in thread local storage, much like the ! implementation of ! <classname>MultiDelegatingDbProvider</classname>.</para> ! </note> </section> Index: web.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/web.xml,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** web.xml 17 Feb 2008 13:19:51 -0000 1.36 --- web.xml 26 Feb 2008 02:04:32 -0000 1.37 *************** *** 2162,2166 **** if none is specified. TransferNoPreserve issues a server-side transfer with 'preserveForm=false', so that QueryString and Form data are not ! preserved. </para> <para>If one's target page requires parameters, one can define them using --- 2162,2166 ---- if none is specified. TransferNoPreserve issues a server-side transfer with 'preserveForm=false', so that QueryString and Form data are not ! preserved.</para> <para>If one's target page requires parameters, one can define them using *************** *** 2180,2186 **** described in the section <link linkend="objects-factory-placeholderconfigurer">PropertyPlaceholderConfigurer</link>. ! The prefix that should be used in the <literal>Parameters</literal> ! dictionary to avoid this conflict is the percent sign, i.e. ! <literal>%{UserInfo.FullName}</literal>.</para> </note></para> --- 2180,2190 ---- described in the section <link linkend="objects-factory-placeholderconfigurer">PropertyPlaceholderConfigurer</link>. ! As a workaround you can change the prefix and suffix used in ! PropertyPlaceholderConfigurer to be different, for example prefix = ! $${ and suffix = }. In Spring 1.1.1 a new prefix character, the ! percent sign (i.e.<literal>%{UserInfo.FullName}</literal>.) can be ! used in the <literal>Parameters</literal> dictionary to avoid this ! conflict so you can keep the familiar NAnt style ! PropertyPlaceholderConfigurer defaults.</para> </note></para> Index: objects.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/objects.xml,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** objects.xml 24 Jan 2008 17:38:31 -0000 1.118 --- objects.xml 26 Feb 2008 02:04:32 -0000 1.119 *************** *** 2028,2044 **** <title>Using <literal>depends-on</literal></title> ! <para>Spring.NET uses the <literal><ref/></literal> element to ! express references to other dependant objects. Unless you have some ! special initialization requirements, you don't have to use the ! <literal><depends-on/></literal> element. However, when you are ! using statics that need initialization or some object needs to be ! initialized because of something else needing preparation, you can use ! the <literal><depends-on/></literal> element. This will ensure all ! objects you've listed as dependencies will get initialized before ! they're actually set on the object. For example... <programlisting><object id="objectOne" type="Examples.ExampleObject, ExamplesLibrary" depends-on="manager"> <property name="manager" ref="manager"/> </object> ! <object id="manager" type="ManagerObject"/></programlisting></para> </sect2> --- 2028,2068 ---- <title>Using <literal>depends-on</literal></title> ! <para>For most situations, the fact that an object is a dependency of ! another is expressed by the fact that one object is set as a property of ! another. This is typically accomploished with the ! <literal><ref/></literal> element in XML-based configuration ! metadata. For the relatively infrequent situations where dependencies ! between objects are less direct (for example, when a static initializer ! in a class needs to be triggered) the '<literal>depends-on</literal>' ! attribute may be used to explicitly force one or more objects to be ! initialized before the object using this element is initialized. Find ! below an example of using the '<literal>depends-on</literal>' attribute ! to express a dependency on a single object.. <programlisting><object id="objectOne" type="Examples.ExampleObject, ExamplesLibrary" depends-on="manager"> <property name="manager" ref="manager"/> </object> ! <object id="manager" type="Examples.ManagerObject, ExamplesLibrary"/></programlisting></para> ! ! <para>If you need to express a dependency on multiple objects, you can ! supply a list of object names as the value of the ! '<literal>depends-on</literal>' attribute, with commas, whitespace and ! semicolons all valid delimiters, like so:</para> ! ! <programlisting><object id="objectOne" type="Examples.ExampleObject, ExamplesLibrary" depends-on="manager,accountDao"> ! <property name="manager" ref="manager" /> ! </object> ! ! <object id="manager" type="Examples.ManagerObject, ExamplesLibrary" /> ! <object id="accountDao" type="Examples.AdoAccountDao, ExamplesLibrary" /></programlisting> ! ! <para><note> ! <para>The '<literal>depends-on</literal>' attribute and property is ! used not only to specify an initialization time dependency, but also ! to specify the corresponding destroy time dependency (in the case of ! singleton objects only). Dependent objects that are defined in the ! 'depends-on' attribute will be destroyed after the relevant object ! itself is destroyed. This thus allows you to control shutdown order ! too</para> ! </note></para> </sect2> *************** *** 2103,2116 **** <title>Autowiring collaborators</title> ! <para>Spring.NET has autowire capabilities, meaning that it is possible ! to automatically let Spring.NET resolve collaborators (other objects) ! for your object by inspecting the object definitions in the container. ! Autowiring is specified <emphasis>per</emphasis> object and can thus be ! enabled for some objects, while other objects won't be autowired. Using ! autowiring, it is possible to reduce or even wholly eliminate the need ! to specify properties or constructor arguments. <footnote> ! <para>See <xref linkend="objects-factory-collaborators" /></para> ! </footnote> The autowiring functionality has five modes... <table ! frame="all"> <title>Autowiring modes</title> --- 2127,2144 ---- <title>Autowiring collaborators</title> ! <para>The Spring container is able to autowire relationships between ! collaborating objects. This means that it is possible to automatically ! let Spring resolve collaborators (other objects) for your object by ! inspecting the contents of the IoC container.. The autowiring ! functionality has five modes. Autowiring is specified per object and can ! thus be enabled for some object, while other objects will not be ! autowired. Using autowiring, it is possible to reduce or eliminate the ! need to specify properties or constructor arguments, thus saving a ! significant amount of typing. When using XML-based configuration ! metadata, the autowire mode for an object definition is specified by ! using the autowire attribute of the <object/> element. The ! following values are allowed:</para> ! ! <para><table frame="all"> <title>Autowiring modes</title> *************** *** 2190,2196 **** </table></para> ! <note> ! Explicit dependencies always override autowiring. Autowire behavior can be combined with dependency checking, which will be performed after all autowiring has been completed. ! </note> </sect2> --- 2218,2289 ---- </table></para> ! <para>Note that explicit dependencies in property and constructor-arg ! settings always override autowiring. Please also note that it is not ! currently possible to autowire so-called simple properties such as ! primitives, Strings, and Types (and arrays of such simple properties). ! (This is by-design and should be considered a feature.) When using ! either the byType or constructor autowiring mode, it is possible to wire ! arrays and typed-collections. In such cases all autowire candidates ! within the container that match the expected type will be provided to ! satisfy the dependency. Strongly-typed IDictionaries can even be ! autowired if the expected key type is string. An autowired IDictionary ! values will consist of all object instances that match the expected ! type, and the IDictionary's keys will contain the corresponding object ! names.</para> ! ! <para>Autowire behavior can be combined with dependency checking, which ! will be performed after all autowiring has been completed. It is ! important to understand the various advantages and disadvantages of ! autowiring. Some advantages of autowiring include:</para> ! ! <itemizedlist> ! <listitem> ! <para>Autowiring can significantly reduce the volume of ! configuration required. However, mechanisms such as the use of a ! object template (discussed elsewhere in this chapter) are also ! valuable in this regard.</para> ! </listitem> ! ! <listitem> ! <para>Autowiring can cause configuration to keep itself up to date ! as your objects evolve. For example, if you need to add an ! additional dependency to a class, that dependency can be satisfied ! automatically without the need to modify configuration. Thus there ! may be a strong case for autowiring during development, without ! ruling out the option of switching to explicit wiring when the code ! base becomes more stable.</para> ! </listitem> ! </itemizedlist> ! ! <para>Some disadvantages of autowiring:</para> ! ! <itemizedlist> ! <listitem> ! <para>Autowiring is more magical than explicit wiring. Although, as ! noted in the above table, Spring is careful to avoid guessing in ! case of ambiguity which might have unexpected results, the ! relationships between your Spring-managed objects are no longer ! documented explicitly.</para> ! </listitem> ! ! <listitem> ! <para>Wiring information may not be available to tools that may ! generate documentation from a Spring container.</para> ! </listitem> ! </itemizedlist> ! ! <para>Another issue to consider when autowiring by type is that multiple ! object definitions within the container may match the type specified by ! the setter method or constructor argument to be autowired. For arrays, ! collections, or IDictionary, this is not necessarily a problem. However ! for dependencies that expect a single value, this ambiguity will not be ! arbitrarily resolved. Instead, if no unique object definition is ! available, an Exception will be thrown.</para> ! ! <para>When deciding whether to use autowiring, there is no wrong or ! right answer in all cases. A degree of consistency across a project is ! best though; for example, if autowiring is not used in general, it might ! be confusing to developers to use it just to wire one or two object ! definitions.</para> </sect2> |
From: Mark P. <mar...@us...> - 2008-02-26 00:03:47
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aspects/Exception In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv28981 Modified Files: ExceptionHandlerAspectIntegrationTests.cs Log Message: SPRNET-880 - Logging exception handler should continue processing of exception handler chain. Index: ExceptionHandlerAspectIntegrationTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aspects/Exception/ExceptionHandlerAspectIntegrationTests.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ExceptionHandlerAspectIntegrationTests.cs 8 Oct 2007 22:05:26 -0000 1.5 --- ExceptionHandlerAspectIntegrationTests.cs 26 Feb 2008 00:03:43 -0000 1.6 *************** *** 292,296 **** --- 292,325 ---- } + [Test] + public void ChainLogAndWrap() + { + string logHandlerText = "on exception name ArithmeticException log 'My Message, Method Name ' + #method.Name"; + string translationHandlerText = "on exception name ArithmeticException wrap System.InvalidOperationException 'My Message'"; + exceptionHandlerAdvice.ExceptionHandlers.Add(logHandlerText); + exceptionHandlerAdvice.ExceptionHandlers.Add(translationHandlerText); + exceptionHandlerAdvice.AfterPropertiesSet(); + ProxyFactory pf = new ProxyFactory(new TestObject()); + pf.AddAdvice(exceptionHandlerAdvice); + ITestObject to = (ITestObject)pf.GetProxy(); + try + { + to.Exceptional(new ArithmeticException("Bad Math")); + Assert.Fail("Should have thrown exception"); + } + catch (InvalidOperationException e) + { + Assert.IsNotNull(e.InnerException); + Exception innerEx = e.InnerException; + Assert.AreEqual("My Message", e.Message); + Assert.AreEqual("Bad Math", innerEx.Message); + } + catch (Exception e) + { + Assert.IsInstanceOfType(typeof(InvalidOperationException), e); + } + + } private ITestObject CreateTestObjectProxy(string logHandlerText) |
From: Mark P. <mar...@us...> - 2008-02-26 00:03:28
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Exceptions In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv28963 Modified Files: LogExceptionHandler.cs Log Message: SPRNET-880 - Logging exception handler should continue processing of exception handler chain. Index: LogExceptionHandler.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Exceptions/LogExceptionHandler.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LogExceptionHandler.cs 10 Oct 2007 18:07:46 -0000 1.5 --- LogExceptionHandler.cs 26 Feb 2008 00:03:24 -0000 1.6 *************** *** 41,44 **** --- 41,45 ---- public LogExceptionHandler() { + ContinueProcessing = true; } *************** *** 49,52 **** --- 50,54 ---- public LogExceptionHandler(string[] exceptionNames) : base(exceptionNames) { + ContinueProcessing = true; } *************** *** 63,66 **** --- 65,69 ---- } + /// <summary> /// Handles the exception. |
From: Mark P. <mar...@us...> - 2008-02-25 20:39:26
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate12/Data/NHibernate In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9032 Modified Files: LocalSessionFactoryObject.cs Log Message: SPRNET-879 - LocalSessionFactoryObject can configure ISessionFactory to use Spring's IDbProvider as a NHibernate ConnectionProvider Index: LocalSessionFactoryObject.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate12/Data/NHibernate/LocalSessionFactoryObject.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** LocalSessionFactoryObject.cs 29 Jan 2008 19:48:40 -0000 1.9 --- LocalSessionFactoryObject.cs 25 Feb 2008 20:39:12 -0000 1.10 *************** *** 22,28 **** --- 22,30 ---- using System.Collections; + using System.Data; using Common.Logging; using NHibernate; using NHibernate.Cfg; + using NHibernate.Connection; using Spring.Core.IO; using Spring.Data.Common; *************** *** 248,251 **** --- 250,255 ---- config.SetProperty(Environment.ConnectionString, dbProvider.ConnectionString); + config.SetProperty(Environment.ConnectionProvider, typeof(DbProviderWrapper).AssemblyQualifiedName); + } *************** *** 261,264 **** --- 265,280 ---- if (this.hibernateProperties != null) { + if (config.GetProperty(Environment.ConnectionProvider) !=null && + hibernateProperties.Contains(Environment.ConnectionProvider)) + { + #region Logging + if (log.IsWarnEnabled) + { + log.Warn("Overriding use of Spring's Hibernate Connection Provider with [" + + hibernateProperties[Environment.ConnectionProvider] + "]"); + } + #endregion + config.Properties.Remove(Environment.ConnectionProvider); + } config.AddProperties(hibernateProperties); } *************** *** 360,366 **** protected virtual ISessionFactory NewSessionFactory(Configuration config) { ! return config.BuildSessionFactory(); } } } --- 376,419 ---- protected virtual ISessionFactory NewSessionFactory(Configuration config) { ! ISessionFactory sf = config.BuildSessionFactory(); ! DbProviderWrapper dbProviderWrapper = sf.ConnectionProvider as DbProviderWrapper; ! if (dbProviderWrapper != null) ! { ! dbProviderWrapper.DbProvider = dbProvider; ! } ! return sf; } + #region DbProviderWrapper Helper class + + internal class DbProviderWrapper : ConnectionProvider + { + private IDbProvider _dbProvider; + + public DbProviderWrapper() + { + } + + public IDbProvider DbProvider + { + get { return _dbProvider; } + set { _dbProvider = value; } + } + + public override void CloseConnection(IDbConnection conn) + { + base.CloseConnection(conn); + conn.Dispose(); + } + + public override IDbConnection GetConnection() + { + IDbConnection dbCon = _dbProvider.CreateConnection(); + dbCon.Open(); + return dbCon; + } + } + + #endregion // DbProviderWrapper Helper class } } |
From: Mark P. <mar...@us...> - 2008-02-25 20:39:26
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate/Data/NHibernate In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9048 Modified Files: LocalSessionFactoryObject.cs Log Message: SPRNET-879 - LocalSessionFactoryObject can configure ISessionFactory to use Spring's IDbProvider as a NHibernate ConnectionProvider Index: LocalSessionFactoryObject.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate/Data/NHibernate/LocalSessionFactoryObject.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LocalSessionFactoryObject.cs 4 Feb 2008 22:42:49 -0000 1.5 --- LocalSessionFactoryObject.cs 25 Feb 2008 20:39:17 -0000 1.6 *************** *** 22,28 **** --- 22,30 ---- using System.Collections; + using System.Data; using Common.Logging; using NHibernate; using NHibernate.Cfg; + using NHibernate.Connection; using Spring.Core.IO; using Spring.Data.Common; *************** *** 231,239 **** { config.SetProperty(Environment.ConnectionString, dbProvider.ConnectionString); ! } if (this.hibernateProperties != null) { config.AddProperties(hibernateProperties); } --- 233,253 ---- { config.SetProperty(Environment.ConnectionString, dbProvider.ConnectionString); ! config.SetProperty(Environment.ConnectionProvider, typeof(DbProviderWrapper).AssemblyQualifiedName); } if (this.hibernateProperties != null) { + if (config.GetProperty(Environment.ConnectionProvider) != null && + hibernateProperties.Contains(Environment.ConnectionProvider)) + { + #region Logging + if (log.IsWarnEnabled) + { + log.Warn("Overriding use of Spring's Hibernate Connection Provider with [" + + hibernateProperties[Environment.ConnectionProvider] + "]"); + } + #endregion + config.Properties.Remove(Environment.ConnectionProvider); + } config.AddProperties(hibernateProperties); } *************** *** 332,338 **** protected virtual ISessionFactory NewSessionFactory(Configuration config) { ! return config.BuildSessionFactory(); } } } --- 346,390 ---- protected virtual ISessionFactory NewSessionFactory(Configuration config) { ! ISessionFactory sf = config.BuildSessionFactory(); ! DbProviderWrapper dbProviderWrapper = sf.ConnectionProvider as DbProviderWrapper; ! if (dbProviderWrapper != null) ! { ! dbProviderWrapper.DbProvider = dbProvider; ! } ! return sf; ! } ! ! #region DbProviderWrapper Helper class ! ! internal class DbProviderWrapper : ConnectionProvider ! { ! private IDbProvider _dbProvider; ! ! public DbProviderWrapper() ! { ! } ! ! public IDbProvider DbProvider ! { ! get { return _dbProvider; } ! set { _dbProvider = value; } ! } ! ! public override void CloseConnection(IDbConnection conn) ! { ! base.CloseConnection(conn); ! conn.Dispose(); ! } ! ! public override IDbConnection GetConnection() ! { ! IDbConnection dbCon = _dbProvider.CreateConnection(); ! dbCon.Open(); ! return dbCon; ! } } + #endregion // DbProviderWrapper Helper class + } } |
From: Mark P. <mar...@us...> - 2008-02-25 20:36:05
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7402 Modified Files: validation.xml Log Message: SPRNET-780 - Valdiation example for ASP.NET refers to wrong namespace. Index: validation.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/validation.xml,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** validation.xml 17 Feb 2008 13:19:51 -0000 1.19 --- validation.xml 25 Feb 2008 20:35:59 -0000 1.20 *************** *** 628,633 **** <programlisting><%@ Page Language="c#" MasterPageFile="~/Web/StandardTemplate.master" Inherits="TripForm" CodeFile="TripForm.aspx.cs" %> ! <%@ Register TagPrefix="spring" Namespace="Spring.Web.Anthem.UI.Controls" Assembly="Spring.Web.Anthem" %> ! <%@ Register TagPrefix="anthem" Namespace="Anthem" Assembly="Anthem" %> <asp:Content ID="head" ContentPlaceHolderID="head" runat="server"> --- 628,632 ---- <programlisting><%@ Page Language="c#" MasterPageFile="~/Web/StandardTemplate.master" Inherits="TripForm" CodeFile="TripForm.aspx.cs" %> ! <%@ Register TagPrefix="spring" Namespace="Spring.Web.UI.Controls" Assembly="Spring.Web" %> <asp:Content ID="head" ContentPlaceHolderID="head" runat="server"> *************** *** 663,667 **** <asp:Label ID="leavingFrom" runat="server" /></td> <td nowrap="nowrap"> ! <anthem:DropDownList ID="leavingFromAirportCode" AutoCallBack="true" runat="server" /> <emphasis role="bold"><spring:ValidationError id="departureAirportErrors" runat="server" /></emphasis> </td> --- 662,666 ---- <asp:Label ID="leavingFrom" runat="server" /></td> <td nowrap="nowrap"> ! <asp:DropDownList ID="leavingFromAirportCode" AutoCallBack="true" runat="server" /> <emphasis role="bold"><spring:ValidationError id="departureAirportErrors" runat="server" /></emphasis> </td> *************** *** 669,673 **** <asp:Label ID="goingTo" runat="server" /></td> <td nowrap="nowrap"> ! <anthem:DropDownList ID="goingToAirportCode" AutoCallBack="true" runat="server" /> <emphasis role="bold"><spring:ValidationError id="destinationAirportErrors" runat="server" /></emphasis> </td> --- 668,672 ---- <asp:Label ID="goingTo" runat="server" /></td> <td nowrap="nowrap"> ! <asp:DropDownList ID="goingToAirportCode" AutoCallBack="true" runat="server" /> <emphasis role="bold"><spring:ValidationError id="destinationAirportErrors" runat="server" /></emphasis> </td> *************** *** 692,696 **** <td class="buttonBar" colspan="4"> <br/> ! <anthem:Button ID="findFlights" runat="server"/></td> </tr> </table> --- 691,695 ---- <td class="buttonBar" colspan="4"> <br/> ! <asp:Button ID="findFlights" runat="server"/></td> </tr> </table> *************** *** 817,821 **** <programlisting><!-- Validation errors renderer configuration --> ! <object id="Spring.Web.Anthem.UI.Controls.ValidationError" abstract="true"> <property name="Renderer"> <object type="Spring.Web.Validation.IconValidationErrorsRenderer, Spring.Web"> --- 816,820 ---- <programlisting><!-- Validation errors renderer configuration --> ! <object id="Spring.Web.UI.Controls.ValidationError" abstract="true"> <property name="Renderer"> <object type="Spring.Web.Validation.IconValidationErrorsRenderer, Spring.Web"> *************** *** 825,829 **** </object> ! <object id="Spring.Web.Anthem.UI.Controls.ValidationSummary" abstract="true"> <property name="Renderer"> <object type="Spring.Web.Validation.DivValidationErrorsRenderer, Spring.Web"> --- 824,828 ---- </object> ! <object id="Spring.Web.UI.Controls.ValidationSummary" abstract="true"> <property name="Renderer"> <object type="Spring.Web.Validation.DivValidationErrorsRenderer, Spring.Web"> |
From: Bruno B. <bb...@us...> - 2008-02-24 19:10:55
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/Services In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25803 Modified Files: WebServiceExporter.cs Log Message: Make WebServiceProxyFactory and WebServiceExporter easily customizable. Index: WebServiceExporter.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/Services/WebServiceExporter.cs,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** WebServiceExporter.cs 22 Feb 2008 16:44:47 -0000 1.30 --- WebServiceExporter.cs 24 Feb 2008 19:10:52 -0000 1.31 *************** *** 22,25 **** --- 22,26 ---- using System; + using System.Globalization; using System.Collections; using System.Reflection; *************** *** 62,66 **** #region Fields ! private Type webServiceBaseType = typeof(WebService); private string _targetName; private string _description; --- 63,67 ---- #region Fields ! private Type _webServiceBaseType = typeof(WebService); private string _targetName; private string _description; *************** *** 71,78 **** private IDictionary _memberAttributes = new Hashtable(); ! private string objectName; ! private IObjectFactory objectFactory; ! private Type proxyType; ! private ConstructorInfo proxyConstructor; #endregion --- 72,89 ---- private IDictionary _memberAttributes = new Hashtable(); ! /// <summary> ! /// The name of the object in the factory. ! /// </summary> ! protected string objectName; ! ! /// <summary> ! /// The owning factory. ! /// </summary> ! protected IObjectFactory objectFactory; ! ! /// <summary> ! /// The generated web service wrapper type. ! /// </summary> ! protected Type proxyType; #endregion *************** *** 99,104 **** public Type WebServiceBaseType { ! get { return webServiceBaseType; } ! set { webServiceBaseType = value; } } --- 110,115 ---- public Type WebServiceBaseType { ! get { return _webServiceBaseType; } ! set { _webServiceBaseType = value; } } *************** *** 247,256 **** // no sense to call this method, because the web service type // will be instantiated by the .NET infrastructure. (ObjectType is used instead) ! if (proxyConstructor == null) ! { ! proxyConstructor = proxyType.GetConstructor(Type.EmptyTypes); ! } ! ! return proxyConstructor.Invoke(ObjectUtils.EmptyObjects); } --- 258,264 ---- // no sense to call this method, because the web service type // will be instantiated by the .NET infrastructure. (ObjectType is used instead) ! // Users should use GetObject("TargetName") instead. ! return new InvalidOperationException( ! "The web service instance is created and managed by the .NET infrastructure."); } *************** *** 317,321 **** #region Protected Methods ! protected void ValidateConfiguration() { if (TargetName == null) --- 325,332 ---- #region Protected Methods ! /// <summary> ! /// Validates the configuration. ! /// </summary> ! protected virtual void ValidateConfiguration() { if (TargetName == null) *************** *** 325,333 **** } ! protected void GenerateProxy() { IProxyTypeBuilder builder = new WebServiceProxyTypeBuilder(TargetName, Description, Name, Namespace); ! builder.Name = this.objectName; ! builder.BaseType = webServiceBaseType; builder.TargetType = objectFactory.GetType(TargetName); if (Interfaces != null && Interfaces.Length > 0) --- 336,347 ---- } ! /// <summary> ! /// Generates the web service wrapper type. ! /// </summary> ! protected virtual void GenerateProxy() { IProxyTypeBuilder builder = new WebServiceProxyTypeBuilder(TargetName, Description, Name, Namespace); ! builder.Name = objectName; ! builder.BaseType = WebServiceBaseType; builder.TargetType = objectFactory.GetType(TargetName); if (Interfaces != null && Interfaces.Length > 0) |
From: Bruno B. <bb...@us...> - 2008-02-24 19:10:45
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Services/Web/Services In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25743 Modified Files: WebServiceProxyFactory.cs Log Message: Make WebServiceProxyFactory and WebServiceExporter easily customizable. Index: WebServiceProxyFactory.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Services/Web/Services/WebServiceProxyFactory.cs,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** WebServiceProxyFactory.cs 22 Feb 2008 16:44:38 -0000 1.32 --- WebServiceProxyFactory.cs 24 Feb 2008 19:10:12 -0000 1.33 *************** *** 74,90 **** #region Fields ! private IObjectDefinition productTemplate; ! private Type webServiceProxyBaseType = typeof(SoapHttpClientProtocol); ! private IResource serviceUri; ! private Type proxyType; ! private Type serviceInterface; ! private NetworkCredential credential; ! private string proxyUrl; ! private NetworkCredential proxyCredential; ! private string bindingName; private IList _typeAttributes = new ArrayList(); private IDictionary _memberAttributes = new Hashtable(); ! private ConstructorInfo proxyConstructor; #endregion --- 74,93 ---- #region Fields ! private IObjectDefinition _productTemplate; ! private Type _webServiceProxyBaseType = typeof(SoapHttpClientProtocol); ! private IResource _serviceUri; ! private Type _proxyType; ! private Type _serviceInterface; ! private NetworkCredential _credential; ! private string _proxyUrl; ! private NetworkCredential _proxyCredential; ! private string _bindingName; private IList _typeAttributes = new ArrayList(); private IDictionary _memberAttributes = new Hashtable(); ! /// <summary> ! /// The web service proxy default constructor. ! /// </summary> ! protected ConstructorInfo proxyConstructor; #endregion *************** *** 113,118 **** public Type ClientProtocolType { ! get { return webServiceProxyBaseType; } ! set { webServiceProxyBaseType = value; } } --- 116,121 ---- public Type ClientProtocolType { ! get { return _webServiceProxyBaseType; } ! set { _webServiceProxyBaseType = value; } } *************** *** 125,130 **** public Type WebServiceProxyBaseType { ! get { return webServiceProxyBaseType; } ! set { webServiceProxyBaseType = value; } } --- 128,133 ---- public Type WebServiceProxyBaseType { ! get { return _webServiceProxyBaseType; } ! set { _webServiceProxyBaseType = value; } } *************** *** 135,140 **** public IResource ServiceUri { ! get { return serviceUri; } ! set { serviceUri = value; } } --- 138,143 ---- public IResource ServiceUri { ! get { return _serviceUri; } ! set { _serviceUri = value; } } *************** *** 144,149 **** public Type ProxyType { ! get { return proxyType; } ! set { proxyType = value; } } --- 147,152 ---- public Type ProxyType { ! get { return _proxyType; } ! set { _proxyType = value; } } *************** *** 153,158 **** public Type ServiceInterface { ! get { return serviceInterface; } ! set { serviceInterface = value; } } --- 156,161 ---- public Type ServiceInterface { ! get { return _serviceInterface; } ! set { _serviceInterface = value; } } *************** *** 163,168 **** public NetworkCredential Credential { ! get { return credential; } ! set { credential = value; } } --- 166,171 ---- public NetworkCredential Credential { ! get { return _credential; } ! set { _credential = value; } } *************** *** 180,185 **** public string ProxyUrl { ! get { return proxyUrl; } ! set { proxyUrl = value; } } --- 183,188 ---- public string ProxyUrl { ! get { return _proxyUrl; } ! set { _proxyUrl = value; } } *************** *** 195,200 **** public NetworkCredential ProxyCredential { ! get { return proxyCredential; } ! set { proxyCredential = value; } } --- 198,203 ---- public NetworkCredential ProxyCredential { ! get { return _proxyCredential; } ! set { _proxyCredential = value; } } *************** *** 204,209 **** public string BindingName { ! get { return bindingName; } ! set { bindingName = value; } } --- 207,212 ---- public string BindingName { ! get { return _bindingName; } ! set { _bindingName = value; } } *************** *** 273,278 **** public virtual IObjectDefinition ProductTemplate { ! get { return productTemplate; } ! set { productTemplate = value; } } --- 276,281 ---- public virtual IObjectDefinition ProductTemplate { ! get { return _productTemplate; } ! set { _productTemplate = value; } } *************** *** 293,297 **** #region Protected Methods ! protected void GenerateProxy() { IProxyTypeBuilder builder; --- 296,326 ---- #region Protected Methods ! /// <summary> ! /// Validates the configuration. ! /// </summary> ! protected virtual void ValidateConfiguration() ! { ! if (ServiceUri == null && ProxyType == null) ! { ! throw new ArgumentException("ServiceUri or ProxyType property is required."); ! } ! if (ServiceInterface == null) ! { ! throw new ArgumentException("The ServiceInterface property is required."); ! } ! if (!ServiceInterface.IsInterface) ! { ! throw new ArgumentException("ServiceInterface must be an interface"); ! } ! if (WebServiceProxyBaseType.IsSealed) ! { ! throw new ArgumentException("Web service client proxy cannot be created for a sealed class [" + WebServiceProxyBaseType.FullName + "]"); ! } ! } ! ! /// <summary> ! /// Generates the web service proxy type. ! /// </summary> ! protected virtual void GenerateProxy() { IProxyTypeBuilder builder; *************** *** 300,304 **** // Wrap .NET generated proxy class or another builder = new WebServiceProxyProxyTypeBuilder(); ! builder.TargetType = proxyType; } else --- 329,333 ---- // Wrap .NET generated proxy class or another builder = new WebServiceProxyProxyTypeBuilder(); ! builder.TargetType = ProxyType; } else *************** *** 306,314 **** // Dynamically generates proxy class from WSDL builder = new SoapHttpClientProxyTypeBuilder( ! serviceUri, GetWsDocuments(serviceUri), bindingName); ! builder.BaseType = webServiceProxyBaseType; } ! builder.Interfaces = ReflectionUtils.ToInterfaceArray(serviceInterface); builder.TypeAttributes = TypeAttributes; builder.MemberAttributes = MemberAttributes; --- 335,343 ---- // Dynamically generates proxy class from WSDL builder = new SoapHttpClientProxyTypeBuilder( ! ServiceUri, GetWsDocuments(ServiceUri), BindingName); ! builder.BaseType = WebServiceProxyBaseType; } ! builder.Interfaces = ReflectionUtils.ToInterfaceArray(ServiceInterface); builder.TypeAttributes = TypeAttributes; builder.MemberAttributes = MemberAttributes; *************** *** 322,336 **** if (LOG.IsDebugEnabled) { ! if (serviceUri != null) { LOG.Debug( String.Format("Generated client proxy type [{0}] for web service [{1}]", wrapper.FullName, ! serviceUri.Description)); } ! else if (proxyType != null) { LOG.Debug( String.Format("Generated client proxy type [{0}] for web service based on provided proxy type [{1}]", wrapper.FullName, ! proxyType.FullName)); } } --- 351,365 ---- if (LOG.IsDebugEnabled) { ! if (ServiceUri != null) { LOG.Debug( String.Format("Generated client proxy type [{0}] for web service [{1}]", wrapper.FullName, ! ServiceUri.Description)); } ! else if (ProxyType != null) { LOG.Debug( String.Format("Generated client proxy type [{0}] for web service based on provided proxy type [{1}]", wrapper.FullName, ! ProxyType.FullName)); } } *************** *** 339,361 **** } ! protected void ValidateConfiguration() ! { ! if (ServiceUri == null && ProxyType == null) ! { ! throw new ArgumentException("ServiceUri or ProxyType property is required."); ! } ! if (ServiceInterface == null) ! { ! throw new ArgumentException("The ServiceInterface property is required."); ! } ! if (!ServiceInterface.IsInterface) ! { ! throw new ArgumentException("ServiceInterface must be an interface"); ! } ! if (WebServiceProxyBaseType.IsSealed) ! { ! throw new ArgumentException("Web service client proxy cannot be created for a sealed class [" + WebServiceProxyBaseType.FullName + "]"); ! } ! } /// <summary> --- 368,374 ---- } ! #endregion ! ! #region Private Methods /// <summary> *************** *** 366,371 **** try { ! if (serviceUri is UrlResource || ! serviceUri is FileSystemResource) { DiscoveryClientProtocol dcProtocol = new DiscoveryClientProtocol(); --- 379,384 ---- try { ! if (ServiceUri is UrlResource || ! ServiceUri is FileSystemResource) { DiscoveryClientProtocol dcProtocol = new DiscoveryClientProtocol(); *************** *** 394,402 **** { IWebProxy webProxy = null; ! if (proxyUrl != null) { ! webProxy = new WebProxy(proxyUrl); } ! if (proxyCredential != null) { if (webProxy == null) --- 407,415 ---- { IWebProxy webProxy = null; ! if (ProxyUrl != null) { ! webProxy = new WebProxy(ProxyUrl); } ! if (ProxyCredential != null) { if (webProxy == null) *************** *** 408,412 **** #endif } ! webProxy.Credentials = proxyCredential; } --- 421,425 ---- #endif } ! webProxy.Credentials = ProxyCredential; } *************** *** 416,428 **** private ICredentials CreateCredentials() { ! if (credential != null) { CredentialCache credentialCache = new CredentialCache(); ! Uri wsUri = new Uri(serviceUri.Uri.AbsoluteUri.Substring(0, serviceUri.Uri.AbsoluteUri.Length - serviceUri.Uri.AbsolutePath.Length)); IEnumerator enumerator = AuthenticationManager.RegisteredModules; while (enumerator.MoveNext()) { ! credentialCache.Add(wsUri, ((IAuthenticationModule)enumerator.Current).AuthenticationType, credential); } --- 429,441 ---- private ICredentials CreateCredentials() { ! if (Credential != null) { CredentialCache credentialCache = new CredentialCache(); ! Uri wsUri = new Uri(ServiceUri.Uri.AbsoluteUri.Substring(0, ServiceUri.Uri.AbsoluteUri.Length - ServiceUri.Uri.AbsolutePath.Length)); IEnumerator enumerator = AuthenticationManager.RegisteredModules; while (enumerator.MoveNext()) { ! credentialCache.Add(wsUri, ((IAuthenticationModule)enumerator.Current).AuthenticationType, Credential); } |
From: Bruno B. <bb...@us...> - 2008-02-22 16:45:30
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Services/Web/Services In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23063 Modified Files: WebServiceProxyFactory.cs Log Message: Make WebServiceProxyFactory and WebServiceExporter easily customizable. Index: WebServiceProxyFactory.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Services/Web/Services/WebServiceProxyFactory.cs,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** WebServiceProxyFactory.cs 7 Dec 2007 20:25:51 -0000 1.31 --- WebServiceProxyFactory.cs 22 Feb 2008 16:44:38 -0000 1.32 *************** *** 284,288 **** /// Initializes factory object. /// </summary> ! public void AfterPropertiesSet() { ValidateConfiguration(); --- 284,288 ---- /// Initializes factory object. /// </summary> ! public virtual void AfterPropertiesSet() { ValidateConfiguration(); *************** *** 291,297 **** #endregion ! #region Private Helper Methods ! private void GenerateProxy() { IProxyTypeBuilder builder; --- 291,297 ---- #endregion ! #region Protected Methods ! protected void GenerateProxy() { IProxyTypeBuilder builder; *************** *** 339,343 **** } ! private void ValidateConfiguration() { if (ServiceUri == null && ProxyType == null) --- 339,343 ---- } ! protected void ValidateConfiguration() { if (ServiceUri == null && ProxyType == null) |
From: Bruno B. <bb...@us...> - 2008-02-22 16:44:52
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/Services In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23075 Modified Files: WebServiceExporter.cs Log Message: Make WebServiceProxyFactory and WebServiceExporter easily customizable. Index: WebServiceExporter.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/Services/WebServiceExporter.cs,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** WebServiceExporter.cs 7 Dec 2007 20:26:12 -0000 1.29 --- WebServiceExporter.cs 22 Feb 2008 16:44:47 -0000 1.30 *************** *** 218,222 **** /// In case of initialization errors. /// </exception> ! public IObjectFactory ObjectFactory { set { this.objectFactory = value; } --- 218,222 ---- /// In case of initialization errors. /// </exception> ! public virtual IObjectFactory ObjectFactory { set { this.objectFactory = value; } *************** *** 307,311 **** /// property) or if initialization fails. /// </exception> ! public void AfterPropertiesSet() { ValidateConfiguration(); --- 307,311 ---- /// property) or if initialization fails. /// </exception> ! public virtual void AfterPropertiesSet() { ValidateConfiguration(); *************** *** 315,321 **** #endregion ! #region Private Methods ! private void ValidateConfiguration() { if (TargetName == null) --- 315,321 ---- #endregion ! #region Protected Methods ! protected void ValidateConfiguration() { if (TargetName == null) *************** *** 325,329 **** } ! private void GenerateProxy() { IProxyTypeBuilder builder = new WebServiceProxyTypeBuilder(TargetName, Description, Name, Namespace); --- 325,329 ---- } ! protected void GenerateProxy() { IProxyTypeBuilder builder = new WebServiceProxyTypeBuilder(TargetName, Description, Name, Namespace); |
From: Bruno B. <bb...@us...> - 2008-02-22 15:28:43
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv24742 Modified Files: AbstractObjectFactory.cs Log Message: IConfigurableFactoryObject instance cannot be proxied with the AOP auto proxy functionality [SPRNET-877] Index: AbstractObjectFactory.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectFactory.cs,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** AbstractObjectFactory.cs 5 Dec 2007 00:28:04 -0000 1.73 --- AbstractObjectFactory.cs 22 Feb 2008 15:28:36 -0000 1.74 *************** *** 759,784 **** RootObjectDefinition rod = (ContainsObjectDefinition(objectName) ? GetMergedObjectDefinition(objectName,true) : null); ! instance = GetObjectFromFactoryObject(factory,objectName, rod); ! ! if (factory is IConfigurableFactoryObject) ! { ! IConfigurableFactoryObject configurableFactory = (IConfigurableFactoryObject)factory; ! ! #region Instrumentation ! ! if (log.IsDebugEnabled) ! { ! log.Debug(string.Format("Factory object with name '{0}' is configurable.", TransformedObjectName(name))); ! } ! ! #endregion ! ! if (configurableFactory.ProductTemplate != null) ! { ! instance = ConfigureObject(instance, ! String.Format("{0}.ProductTemplate", name), ! configurableFactory.ProductTemplate); ! } ! } if (instance == null) --- 759,763 ---- RootObjectDefinition rod = (ContainsObjectDefinition(objectName) ? GetMergedObjectDefinition(objectName,true) : null); ! instance = GetObjectFromFactoryObject(factory, objectName, rod); if (instance == null) *************** *** 838,844 **** } if (instance != null) { ! try { instance = PostProcessObjectFromFactoryObject(instance, objectName); } --- 817,845 ---- } + if (factory is IConfigurableFactoryObject) + { + IConfigurableFactoryObject configurableFactory = (IConfigurableFactoryObject)factory; + + #region Instrumentation + + if (log.IsDebugEnabled) + { + log.Debug(string.Format("Factory object with name '{0}' is configurable.", TransformedObjectName(objectName))); + } + + #endregion + + if (configurableFactory.ProductTemplate != null) + { + instance = ConfigureObject(instance, + String.Format("{0}.ProductTemplate", objectName), + configurableFactory.ProductTemplate); + } + } + if (instance != null) { ! try ! { instance = PostProcessObjectFromFactoryObject(instance, objectName); } |
From: Bruno B. <bb...@us...> - 2008-02-20 14:29:25
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Xml In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7111 Modified Files: NamespaceParserSupport.cs Log Message: Typo error. Index: NamespaceParserSupport.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Xml/NamespaceParserSupport.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NamespaceParserSupport.cs 28 Aug 2007 14:16:40 -0000 1.8 --- NamespaceParserSupport.cs 20 Feb 2008 14:29:22 -0000 1.9 *************** *** 99,103 **** if (parser == null) { ! parserContext.ReaderContext.ReportException(element, "unknown object name", "Cannot locate IObjectDefintionParser for element [" + element.LocalName + "]"); } --- 99,103 ---- if (parser == null) { ! parserContext.ReaderContext.ReportException(element, "unknown object name", "Cannot locate IObjectDefinitionParser for element [" + element.LocalName + "]"); } |
From: Bruno B. <bb...@us...> - 2008-02-20 14:29:19
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aop/Config In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7095 Modified Files: ConfigObjectDefinitionParser.cs Log Message: Typo error. Index: ConfigObjectDefinitionParser.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aop/Config/ConfigObjectDefinitionParser.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConfigObjectDefinitionParser.cs 29 Jun 2007 00:09:32 -0000 1.2 --- ConfigObjectDefinitionParser.cs 20 Feb 2008 14:29:13 -0000 1.3 *************** *** 36,41 **** public class ConfigObjectDefinitionParser : IObjectDefinitionParser { - - /// <summary> /// The '<code>proxy-target-type</code>' attribute --- 36,39 ---- *************** *** 62,66 **** /// </summary> /// <param name="element">The element to be parsed.</param> ! /// <param name="parserContext">TThe object encapsulating the current state of the parsing process. /// Provides access to a IObjectDefinitionRegistry</param> /// <returns>The primary object definition.</returns> --- 60,64 ---- /// </summary> /// <param name="element">The element to be parsed.</param> ! /// <param name="parserContext">The object encapsulating the current state of the parsing process. /// Provides access to a IObjectDefinitionRegistry</param> /// <returns>The primary object definition.</returns> *************** *** 86,90 **** /// <summary> ! /// Parses the supplied advisor. element and registers the resulting <see cref="IAdvisor"/> /// </summary> /// <param name="advisorElement">The advisor element.</param> --- 84,88 ---- /// <summary> ! /// Parses the supplied advisor element and registers the resulting <see cref="IAdvisor"/> /// </summary> /// <param name="advisorElement">The advisor element.</param> *************** *** 106,110 **** parserContext.ReaderContext.RegisterWithGeneratedName(advisorDef); } - } --- 104,107 ---- |
From: Bruno B. <bb...@us...> - 2008-02-18 00:02:50
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Objects/Factory/Config In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv30786 Modified Files: ObjectDefinitionVisitorTests.cs Log Message: Fixed SPRNET-860 - Placeholders not resolved in name-values element. Thanks ralfkret from the forum for the fix ! Index: ObjectDefinitionVisitorTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Objects/Factory/Config/ObjectDefinitionVisitorTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ObjectDefinitionVisitorTests.cs 26 Nov 2007 14:16:29 -0000 1.1 --- ObjectDefinitionVisitorTests.cs 18 Feb 2008 00:02:44 -0000 1.2 *************** *** 128,131 **** --- 128,148 ---- } + [Test] + public void VisitNameValueCollection() + { + IObjectDefinition od = new RootObjectDefinition(); + NameValueCollection nvc = new NameValueCollection(); + nvc["Key"] = "$Property"; + od.PropertyValues.Add("PropertyName", nvc); + + ObjectDefinitionVisitor odv = new ObjectDefinitionVisitor(variableSource); + odv.VisitObjectDefinition(od); + + NameValueCollection visitedNvc = + od.PropertyValues.GetPropertyValue("PropertyName").Value as NameValueCollection; + + Assert.AreEqual("Value", visitedNvc["Key"]); + } + #region Helper class |
From: Bruno B. <bb...@us...> - 2008-02-18 00:02:33
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Config In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv30764 Modified Files: ObjectDefinitionVisitor.cs Log Message: Fixed SPRNET-860 - Placeholders not resolved in name-values element. Thanks ralfkret from the forum for the fix ! Index: ObjectDefinitionVisitor.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Config/ObjectDefinitionVisitor.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ObjectDefinitionVisitor.cs 26 Nov 2007 14:15:53 -0000 1.8 --- ObjectDefinitionVisitor.cs 18 Feb 2008 00:02:27 -0000 1.9 *************** *** 23,26 **** --- 23,27 ---- using System; using System.Collections; + using System.Collections.Specialized; using Spring.Collections; *************** *** 216,222 **** VisitManagedDictionary((ManagedDictionary)value); } else if (value is TypedStringValue) { ! TypedStringValue typedStringValue = (TypedStringValue) value; String stringValue = typedStringValue.Value; if (stringValue != null) --- 217,227 ---- VisitManagedDictionary((ManagedDictionary)value); } + else if (value is NameValueCollection) + { + VisitNameValueCollection((NameValueCollection)value); + } else if (value is TypedStringValue) { ! TypedStringValue typedStringValue = (TypedStringValue)value; String stringValue = typedStringValue.Value; if (stringValue != null) *************** *** 232,238 **** else if (value is ExpressionHolder) { ! ExpressionHolder holder = (ExpressionHolder) value; string newExpressionString = ResolveStringValue(holder.ExpressionString).ToString(); ! return new ExpressionHolder(newExpressionString); } return value; --- 237,243 ---- else if (value is ExpressionHolder) { ! ExpressionHolder holder = (ExpressionHolder)value; string newExpressionString = ResolveStringValue(holder.ExpressionString).ToString(); ! return new ExpressionHolder(newExpressionString); } return value; *************** *** 337,340 **** --- 342,362 ---- /// <summary> + /// Visits the elements of a NameValueCollection and calls + /// <see cref="ResolveValue"/> for value of each element. + /// </summary> + protected virtual void VisitNameValueCollection(NameValueCollection collection) + { + foreach (string key in collection.AllKeys) + { + string oldValue = collection[key]; + string newValue = ResolveValue(oldValue) as string; + if (!ObjectUtils.NullSafeEquals(newValue, oldValue)) + { + collection[key] = newValue; + } + } + } + + /// <summary> /// Looks up the value of the given variable name in the configured <see cref="IVariableSource"/>. /// </summary> |
From: Mark P. <mar...@us...> - 2008-02-17 13:34:57
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Context/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7136 Modified Files: XmlApplicationContextTests.cs Log Message: SPRNET-871 - GenericApplicationContext.ctor(IApplicationContext) always throws NullReferenceException Index: XmlApplicationContextTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Context/Support/XmlApplicationContextTests.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** XmlApplicationContextTests.cs 22 Aug 2007 08:49:57 -0000 1.13 --- XmlApplicationContextTests.cs 17 Feb 2008 13:34:52 -0000 1.14 *************** *** 216,219 **** --- 216,226 ---- } + [Test] + public void GenericApplicationContextConstructorTests() + { + IApplicationContext ctx = new XmlApplicationContext("assembly://Spring.Core.Tests/Spring.Context/contextlifecycle.xml"); + GenericApplicationContext genericCtx = new GenericApplicationContext(ctx); + } + #region Helper classes |
From: Mark P. <mar...@us...> - 2008-02-17 13:34:53
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Context/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7120 Modified Files: GenericApplicationContext.cs Log Message: SPRNET-871 - GenericApplicationContext.ctor(IApplicationContext) always throws NullReferenceException Index: GenericApplicationContext.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Context/Support/GenericApplicationContext.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GenericApplicationContext.cs 8 Aug 2007 17:46:37 -0000 1.4 --- GenericApplicationContext.cs 17 Feb 2008 13:34:44 -0000 1.5 *************** *** 96,99 **** --- 96,100 ---- public GenericApplicationContext(IApplicationContext parent) { + objectFactory = new DefaultListableObjectFactory(); ParentContext = parent; } |
From: Mark P. <mar...@us...> - 2008-02-17 13:19:57
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv1001 Modified Files: testing.xml transaction.xml validation.xml web.xml Log Message: SPRNET-875 - Documentation incorrectly lists Unspecified as default isolation level, should be ReadCommitted. other misc doc changes Index: validation.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/validation.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** validation.xml 16 Jan 2008 17:21:44 -0000 1.18 --- validation.xml 17 Feb 2008 13:19:51 -0000 1.19 *************** *** 69,74 **** <para>Decoupling validation from presentation was the major goal that ! significantly influenced design of the validation framework. Basically, we ! wanted to be able to define a set of validation rules that are completely independent from the presentation so we can reuse them (or at least have the ability to reuse them) in different application layers. This meant --- 69,74 ---- <para>Decoupling validation from presentation was the major goal that ! significantly influenced design of the validation framework. We wanted to ! be able to define a set of validation rules that are completely independent from the presentation so we can reuse them (or at least have the ability to reuse them) in different application layers. This meant *************** *** 648,652 **** <div style="text-align: center"> <h4><asp:Label ID="caption" runat="server"></asp:Label></h4> ! <spring:ValidationSummary ID="validationSummary" runat="server" /> <table> <tr class="formLabel"> --- 648,652 ---- <div style="text-align: center"> <h4><asp:Label ID="caption" runat="server"></asp:Label></h4> ! <emphasis role="bold"><spring:ValidationSummary ID="validationSummary" runat="server" /></emphasis> <table> <tr class="formLabel"> *************** *** 664,668 **** <td nowrap="nowrap"> <anthem:DropDownList ID="leavingFromAirportCode" AutoCallBack="true" runat="server" /> ! <spring:ValidationError id="departureAirportErrors" runat="server" /> </td> <td class="formLabel" align="right"> --- 664,668 ---- <td nowrap="nowrap"> <anthem:DropDownList ID="leavingFromAirportCode" AutoCallBack="true" runat="server" /> ! <emphasis role="bold"><spring:ValidationError id="departureAirportErrors" runat="server" /></emphasis> </td> <td class="formLabel" align="right"> *************** *** 670,674 **** <td nowrap="nowrap"> <anthem:DropDownList ID="goingToAirportCode" AutoCallBack="true" runat="server" /> ! <spring:ValidationError id="destinationAirportErrors" runat="server" /> </td> </tr> --- 670,674 ---- <td nowrap="nowrap"> <anthem:DropDownList ID="goingToAirportCode" AutoCallBack="true" runat="server" /> ! <emphasis role="bold"><spring:ValidationError id="destinationAirportErrors" runat="server" /></emphasis> </td> </tr> *************** *** 678,682 **** <td nowrap="nowrap"> <spring:Calendar ID="leavingFromDate" runat="server" Width="75px" AllowEditing="true" Skin="system" /> ! <spring:ValidationError id="departureDateErrors" runat="server" /> </td> <td class="formLabel" align="right"> --- 678,682 ---- <td nowrap="nowrap"> <spring:Calendar ID="leavingFromDate" runat="server" Width="75px" AllowEditing="true" Skin="system" /> ! <emphasis role="bold"><spring:ValidationError id="departureDateErrors" runat="server" /></emphasis> </td> <td class="formLabel" align="right"> *************** *** 685,689 **** <div id="returningOnCalendar"> <spring:Calendar ID="returningOnDate" runat="server" Width="75px" AllowEditing="true" Skin="system" /> ! <spring:ValidationError id="returnDateErrors" runat="server" /> </div> </td> --- 685,689 ---- <div id="returningOnCalendar"> <spring:Calendar ID="returningOnDate" runat="server" Width="75px" AllowEditing="true" Skin="system" /> ! <emphasis role="bold"><spring:ValidationError id="returnDateErrors" runat="server" /></emphasis> </div> </td> Index: testing.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/testing.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** testing.xml 16 Jan 2008 17:21:44 -0000 1.5 --- testing.xml 17 Feb 2008 13:19:51 -0000 1.6 *************** *** 67,84 **** <note> <para>The Spring.Testing.NUnit.dll library is compiled against NUnit ! 2.4.1. At the time of this writing the latest version of NUnit is 2.4.3. ! ReSharper (which uses 2.2.8 internally) TestDriven.NET will handle these ! differences appropriately and you will be able to use these tools for ! Spring based NUnit testing in the IDE. If you are using the GUI-runner ! that comes with NUnit then you should add the following to your .config ! file, (in the form of MyAssembly.dll.config)</para> ! <programlisting><dependentAssembly> ! <assemblyIdentity name="nunit.framework" ! publicKeyToken="96d09a1eb7f44a77" ! culture="neutral"/> ! <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" ! newVersion="2.4.3.0"/> ! </dependentAssembly></programlisting> </note> --- 67,92 ---- <note> <para>The Spring.Testing.NUnit.dll library is compiled against NUnit ! 2.4.1. At the time of this writing the latest version of NUnit is 2.4.6. ! Note that add-in have their own versions of NUnit they use. For example, ! ReSharper 3.0 uses 2.2.8. If you are using the GUI-runner that comes ! with NUnit then you should add the following to your .config file, (in ! the form of MyAssembly.dll.config)</para> ! <programlisting><runtime> ! ! <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> ! ! <dependentAssembly> ! <assemblyIdentity name="nunit.framework" ! publicKeyToken="96d09a1eb7f44a77" ! culture="neutral"/> ! <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535 ! newVersion="2.4.6.0"/> ! ! </dependentAssembly> ! ! </assemblyBinding> ! ! </runtime></programlisting> </note> Index: web.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/web.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** web.xml 16 Jan 2008 19:44:25 -0000 1.35 --- web.xml 17 Feb 2008 13:19:51 -0000 1.36 *************** *** 87,92 **** <para>Spring.Web also adds support for applying the dependency injection ! principle to one's ASP.NET <classname>Page</classname>s and ! <classname>Control</classname>s as well as http modules and custom provider modules. This means that application developers can easily inject service dependencies into web controllers by leveraging the power of the --- 87,92 ---- <para>Spring.Web also adds support for applying the dependency injection ! principle to one's ASP.NET <classname>Pages</classname> and ! <classname>Controls</classname> as well as http modules and custom provider modules. This means that application developers can easily inject service dependencies into web controllers by leveraging the power of the *************** *** 112,116 **** specific base classes such as <classname>Spring.Web.UI.Page</classname>; however, some very powerful features such as dependency injection for ! ASP.NET <classname>Page</classname>s can be leveraged without having to extend Spring.Web-specific base classes. It is worth stating that by taking advantage of <emphasis>some</emphasis> of the more useful features --- 112,116 ---- specific base classes such as <classname>Spring.Web.UI.Page</classname>; however, some very powerful features such as dependency injection for ! ASP.NET Pages, Controls, and providers can be leveraged without having to extend Spring.Web-specific base classes. It is worth stating that by taking advantage of <emphasis>some</emphasis> of the more useful features *************** *** 370,374 **** configuration file.</para> ! <para>Needless to say, you can (and should) avoid the need to specify <literal><configSections/></literal> element by moving the configuration handler definition for the --- 370,374 ---- configuration file.</para> ! <para>You can (and should) avoid the need to specify <literal><configSections/></literal> element by moving the configuration handler definition for the *************** *** 1081,1095 **** false</literal>), the <literal>InitializeModel</literal> method is called which initializes the trip object by creating a new instance ! and setting its properties to desired values. Right before page is ! rendered, <literal>SaveModel</literal> method will be invoked and ! whatever the value it returns will be stored within HTTP Session. ! Finally, on each postback, <literal>LoadModel</literal> method will ! be called and the value returned by the previous call to <literal>SaveModel</literal> will be passed to it as an argument.</para> ! <para>In this particular case the implementation is very simple: ! because our whole model is just the <literal>trip</literal> object, ! <literal>SaveModel</literal> simply returns the <literal>trip</literal> object and <literal>LoadModel</literal> casts the <literal>savedModel</literal> argument to --- 1081,1095 ---- false</literal>), the <literal>InitializeModel</literal> method is called which initializes the trip object by creating a new instance ! and setting its properties to desired values. Right before the page ! is rendered, <literal>the SaveModel</literal> method will be invoked ! and whatever the value it returns will be stored within the HTTP ! Session. Finally, on each postback, <literal>the LoadModel</literal> ! method will be called and the value returned by the previous call to <literal>SaveModel</literal> will be passed to it as an argument.</para> ! <para>In this particular case the implementation is very simple ! because our whole model is just the <literal>trip</literal> object. ! As such, <literal>SaveModel</literal> simply returns the <literal>trip</literal> object and <literal>LoadModel</literal> casts the <literal>savedModel</literal> argument to *************** *** 1120,1133 **** always the case when you are setting a bi-directional binding, as both binding expressions need to be "settable". What is important to ! remember about <literal>InitializeDataBindings</literal> method ! (other than the fact that you should configure your data binding ! rules there, of course ;-), is that it is executed only once ! <emphasis>per page type</emphasis>. Basically, all of the binding ! expressions are parsed the first time the page is instantiated, and ! are the cached and used by all instances of that same page type that ! are created at a later time. This is done for performance reasons, ! as data binding expression parsing on every postback is unnecessary ! and would add a significant overhead to the overall page processing ! time.</para> </listitem> --- 1120,1131 ---- always the case when you are setting a bi-directional binding, as both binding expressions need to be "settable". What is important to ! remember about <literal>InitializeDataBindings</literal> method is ! that it is executed only once <emphasis>per page type</emphasis>. ! Basically, all of the binding expressions are parsed the first time ! the page is instantiated, and are the cached and used by all ! instances of that same page type that are created at a later time. ! This is done for performance reasons, as data binding expression ! parsing on every postback is unnecessary and would add a significant ! overhead to the overall page processing time.</para> </listitem> *************** *** 1135,1143 **** <para>If you look at the SearchForFlights event handler, you will notice that it has no dependencies on the view elements. It simply ! uses injected bookingAgent service and a trip object UI controls ! were previously bound to in order to obtain a list of suggested ! flights. Furthermore, if you make any modifications to the trip ! object within your event handler, bound controls will be updated ! accordingly just before the page is rendered.</para> <para>This accomplishes one of the major goals we set out to --- 1133,1141 ---- <para>If you look at the SearchForFlights event handler, you will notice that it has no dependencies on the view elements. It simply ! uses the injected bookingAgent service and a trip object that in ! order to obtain a list of suggested flights. Furthermore, if you ! make any modifications to the trip object within your event handler, ! bound controls will be updated accordingly just before the page is ! rendered.</para> <para>This accomplishes one of the major goals we set out to *************** *** 1148,1154 **** </orderedlist></para> ! <para>Now that you have a solid high-level picture and know how Spring.NET ! data binding and model management are typically used in web applications, ! let's take a look at the details and see how data binding is actually implemented under the hood, what the extension points are, and what are some additional features that make data binding framework usable in --- 1146,1152 ---- </orderedlist></para> ! <para>Now that you have a solid high-level picture of how Spring.NET data ! binding and model management are typically used in web applications, let's ! take a look at the details and see how data binding is actually implemented under the hood, what the extension points are, and what are some additional features that make data binding framework usable in *************** *** 1167,1174 **** { void BindSourceToTarget(object source, object target, ValidationErrors validationErrors); ! void BindSourceToTarget(object source, object target, ValidationErrors validationErrors, IDictionary variables); void BindTargetToSource(object source, object target, ValidationErrors validationErrors); ! void BindTargetToSource(object source, object target, ValidationErrors validationErrors, IDictionary variables); void SetErrorMessage(string messageId, params string[] errorProviders); --- 1165,1176 ---- { void BindSourceToTarget(object source, object target, ValidationErrors validationErrors); ! ! void BindSourceToTarget(object source, object target, ValidationErrors validationErrors, ! IDictionary variables); void BindTargetToSource(object source, object target, ValidationErrors validationErrors); ! ! void BindTargetToSource(object source, object target, ValidationErrors validationErrors, ! IDictionary variables); void SetErrorMessage(string messageId, params string[] errorProviders); *************** *** 1185,1190 **** explanation. While the data binding framework is not in any way coupled to the data validation framework, they are in some ways related. For ! example, while data validation framework is best suited to validate the ! populated model according to the business rules, the data binding framework is in a better position to validate data types during the binding process. However, regardless of where specific validation is --- 1187,1192 ---- explanation. While the data binding framework is not in any way coupled to the data validation framework, they are in some ways related. For ! example, while the data validation framework is best suited to validate ! the populated model according to the business rules, the data binding framework is in a better position to validate data types during the binding process. However, regardless of where specific validation is *************** *** 1208,1226 **** members:<programlisting>public interface IBindingContainer : IBinding { ! bool HasBindings { get; } ! IBinding AddBinding(IBinding binding); ! IBinding AddBinding(string sourceExpression, string targetExpression); ! IBinding AddBinding(string sourceExpression, string targetExpression, BindingDirection direction); ! IBinding AddBinding(string sourceExpression, string targetExpression, IFormatter formatter); ! IBinding AddBinding(string sourceExpression, string targetExpression, BindingDirection direction, IFormatter formatter); }</programlisting>As you can see, this interface has a number of overloaded <literal>AddBinding</literal> methods. The first one, <literal>AddBinding(IBinding binding)</literal> is the most generic one, as it can be used to add any binding type to the container. The other ! four are really convenience methods that provide a simple way to add the ! most commonly used binding type, ! <literal>SimpleExpressionBinding</literal>. The ! <literal>SimpleExpressionBinding</literal> is what we used in the example at the beginning of this section to bind our web form to a <classname>Trip</classname> instance. It uses Spring.NET Expression --- 1210,1228 ---- members:<programlisting>public interface IBindingContainer : IBinding { ! bool HasBindings { get; } ! IBinding AddBinding(IBinding binding); ! IBinding AddBinding(string sourceExpression, string targetExpression); ! IBinding AddBinding(string sourceExpression, string targetExpression, BindingDirection direction); ! IBinding AddBinding(string sourceExpression, string targetExpression, IFormatter formatter); ! IBinding AddBinding(string sourceExpression, string targetExpression, BindingDirection direction, ! IFormatter formatter); }</programlisting>As you can see, this interface has a number of overloaded <literal>AddBinding</literal> methods. The first one, <literal>AddBinding(IBinding binding)</literal> is the most generic one, as it can be used to add any binding type to the container. The other ! four are convenience methods that provide a simple way to add the most ! commonly used binding type, <literal>SimpleExpressionBinding</literal>. ! The <literal>SimpleExpressionBinding</literal> is what we used in the example at the beginning of this section to bind our web form to a <classname>Trip</classname> instance. It uses Spring.NET Expression *************** *** 1235,1239 **** <para>The direction argument determines whether the binding is bidirectional or unidirectional. By default, all data bindings are ! bidirectional unless direction argument is set to either <literal>BindingDirection.SourceToTarget</literal> or <literal>BindingDirection.TargetToSource</literal>. If one of these --- 1237,1241 ---- <para>The direction argument determines whether the binding is bidirectional or unidirectional. By default, all data bindings are ! bidirectional unless the direction argument is set to either <literal>BindingDirection.SourceToTarget</literal> or <literal>BindingDirection.TargetToSource</literal>. If one of these *************** *** 1450,1455 **** of strings that specify the collection of error providers message where the message should be displayed. In the above case the error ! provider will be rendered in Spring's ValidationError User ! Control.</para> </sect3> --- 1452,1457 ---- of strings that specify the collection of error providers message where the message should be displayed. In the above case the error ! provider will be rendered in Spring's ValidationError User Control. ! See</para> </sect3> *************** *** 2129,2134 **** <dictionary> <entry key="literal" value="My Text"/> ! <entry key="name" value="${UserInfo.FullName}"/> ! <entry key="host" value="${Request.UserHostName}"/> </dictionary> </property> --- 2131,2136 ---- <dictionary> <entry key="literal" value="My Text"/> ! <entry key="name" value="%{UserInfo.FullName}"/> ! <entry key="host" value="%{Request.UserHostName}"/> </dictionary> </property> *************** *** 2156,2170 **** for each and every result is the <literal>TargetPage</literal> property. The value of the <literal>Mode</literal> property can be either ! <literal>Transfer</literal> or <literal>Redirect</literal>, and defaults ! to <literal>Transfer</literal> if none is specified.</para> <para>If one's target page requires parameters, one can define them using the <literal>Parameters</literal> dictionary property. One simply ! specifies either literal values or object navigation expressions for such ! parameter values; if one specifies an expression, this expression will be ! evaluated in the context of the page in which the result is being ! referenced... in the specific case of the above example, this means that ! any page that uses the <literal>homePageResult</literal> needs to expose a ! <classname>UserInfo</classname> property on the page class itself.</para> <para>Parameters will be handled differently depending on the result mode. --- 2158,2187 ---- for each and every result is the <literal>TargetPage</literal> property. The value of the <literal>Mode</literal> property can be either ! <literal>Transfer</literal>, <literal>TransferNoPreserve</literal>, ! <literal>Redirect</literal>, and defaults to <literal>Transfer</literal> ! if none is specified. TransferNoPreserve issues a server-side transfer ! with 'preserveForm=false', so that QueryString and Form data are not ! preserved. </para> <para>If one's target page requires parameters, one can define them using the <literal>Parameters</literal> dictionary property. One simply ! specifies either literal values or <link linkend="navigation">object ! navigation expressions</link> for such parameter values; if one specifies ! an expression, this expression will be evaluated in the context of the ! page in which the result is being referenced... in the specific case of ! the above example, this means that any page that uses the ! <literal>homePageResult</literal> needs to expose a ! <classname>UserInfo</classname> property on the page class itself.<note> ! <para>In Spring 1.1.0 and before the prefix used to indicate an object ! navigation expression in the <literal>Parameters</literal> dictionary ! property was the dollar sign, i.e. ! <literal>${UserInfo.FullName}.</literal>This conflicted with the ! prefix used to perform property replacement, the dollar sign, as ! described in the section <link ! linkend="objects-factory-placeholderconfigurer">PropertyPlaceholderConfigurer</link>. ! The prefix that should be used in the <literal>Parameters</literal> ! dictionary to avoid this conflict is the percent sign, i.e. ! <literal>%{UserInfo.FullName}</literal>.</para> ! </note></para> <para>Parameters will be handled differently depending on the result mode. *************** *** 2188,2200 **** <programlisting> <object type="~/UI/Forms/UserRegistration.aspx" parent="basePage"> ! <property name="UserManager"> ! <ref object="userManager"/> ! </property> ! <property name="Results"> ! <dictionary> ! <entry key="userSaved" value="redirect:UserRegistered.aspx?status=Registration Successful,user=${UserInfo}"/> ! <entry key="cancel" value-ref="homePageResult"/> ! </dictionary> ! </property> </object> </programlisting> --- 2205,2218 ---- <programlisting> <object type="~/UI/Forms/UserRegistration.aspx" parent="basePage"> ! <property name="UserManager"> ! <ref object="userManager"/> ! </property> ! ! <property name="Results"> ! <dictionary> ! <entry key="userSaved" value="redirect:UserRegistered.aspx?status=Registration Successful,user=${UserInfo}"/> ! <entry key="cancel" value-ref="homePageResult"/> ! </dictionary> ! </property> </object> </programlisting> *************** *** 2358,2360 **** --- 2376,2385 ---- </sect2> </sect1> + + <sect1> + <title>Spring User Controls</title> + + <para>Spring provides several custom user controls such as those used to + render errors that occur during databinding.</para> + </sect1> </chapter> \ No newline at end of file Index: transaction.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/transaction.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** transaction.xml 25 Jan 2008 17:34:11 -0000 1.26 --- transaction.xml 17 Feb 2008 13:19:51 -0000 1.27 *************** *** 1096,1100 **** <listitem> ! <para>The isolation level is IsolationLevel.Unspecified</para> </listitem> --- 1096,1100 ---- <listitem> ! <para>The isolation level is IsolationLevel.ReadCommitted</para> </listitem> *************** *** 1175,1179 **** <entry>No</entry> ! <entry>Unspecified</entry> <entry>The transaction isolation level</entry> --- 1175,1179 ---- <entry>No</entry> ! <entry>ReadCommitted</entry> <entry>The transaction isolation level</entry> *************** *** 1254,1258 **** <listitem> ! <para>The isolation level is IsolationLevel.Unspecified</para> </listitem> --- 1254,1258 ---- <listitem> ! <para>The isolation level is IsolationLevel.ReadCommitted</para> </listitem> |
From: Mark P. <mar...@us...> - 2008-02-17 13:17:20
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32606 Modified Files: TransactionSynchronizationManager.cs Log Message: SPRNET-874 - Null reference accessing TransactionSynchronizationManager.CurrentTransactionIsolationLevel when no Spring managed transaction is active Index: TransactionSynchronizationManager.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Support/TransactionSynchronizationManager.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TransactionSynchronizationManager.cs 7 Sep 2007 02:47:00 -0000 1.18 --- TransactionSynchronizationManager.cs 17 Feb 2008 13:17:13 -0000 1.19 *************** *** 462,474 **** /// <summary> ! /// Gets or sets the current transaction isolation level. /// </summary> /// <remarks>Called by the transaction manager on transaction begin and on cleanup.</remarks> ! /// <value>The current transaction isolation level.</value> public static IsolationLevel CurrentTransactionIsolationLevel { get { ! return (IsolationLevel) LogicalThreadContext.GetData(currentTxIsolationLevelDataSlotName); } set --- 462,484 ---- /// <summary> ! /// Gets or sets the current transaction isolation level, if any. /// </summary> /// <remarks>Called by the transaction manager on transaction begin and on cleanup.</remarks> ! /// <value>The current transaction isolation level. If no current transaction is ! /// active, retrun IsolationLevel.Unspecified</value> public static IsolationLevel CurrentTransactionIsolationLevel { get { ! object data = ! LogicalThreadContext.GetData(currentTxIsolationLevelDataSlotName); ! if (data != null) ! { ! return (IsolationLevel) data; ! } ! else ! { ! return IsolationLevel.Unspecified; ! } } set |
From: Mark P. <mar...@us...> - 2008-02-17 13:16:41
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Config In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32219 Modified Files: spring-tx-1.1.xsd Log Message: SPRNET-873 - ReadCommitted was misspelled in spring-tx-1.1.xsd Index: spring-tx-1.1.xsd =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Config/spring-tx-1.1.xsd,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** spring-tx-1.1.xsd 17 Feb 2008 12:06:27 -0000 1.5 --- spring-tx-1.1.xsd 17 Feb 2008 13:16:36 -0000 1.6 *************** *** 166,170 **** </xsd:simpleType> </xsd:attribute> ! <xsd:attribute name="isolation" default="Unspecified"> <xsd:simpleType> <xsd:annotation> --- 166,170 ---- </xsd:simpleType> </xsd:attribute> ! <xsd:attribute name="isolation" default="ReadCommitted"> <xsd:simpleType> <xsd:annotation> |
From: Mark P. <mar...@us...> - 2008-02-17 12:06:34
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Config In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14846 Modified Files: spring-tx-1.1.xsd Log Message: SPRNET-873 - ReadCommitted was misspelled in spring-tx-1.1.xsd Index: spring-tx-1.1.xsd =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Config/spring-tx-1.1.xsd,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** spring-tx-1.1.xsd 8 Aug 2007 16:50:42 -0000 1.4 --- spring-tx-1.1.xsd 17 Feb 2008 12:06:27 -0000 1.5 *************** *** 176,180 **** <xsd:enumeration value="Unspecified"/> <xsd:enumeration value="ReadUncommitted"/> ! <xsd:enumeration value="ReadCommited"/> <xsd:enumeration value="RepeatableRead"/> <xsd:enumeration value="Serializable"/> --- 176,180 ---- <xsd:enumeration value="Unspecified"/> <xsd:enumeration value="ReadUncommitted"/> ! <xsd:enumeration value="ReadCommitted"/> <xsd:enumeration value="RepeatableRead"/> <xsd:enumeration value="Serializable"/> |
From: Bruno B. <bb...@us...> - 2008-02-06 18:29:09
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aop/Framework In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv16423/Aop/Framework Modified Files: AbstractMethodInvocationTests.cs DynamicMethodInvocationTests.cs ReflectiveMethodInvocationTests.cs Log Message: Added Inheritance-based aop proxy. Index: DynamicMethodInvocationTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicMethodInvocationTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DynamicMethodInvocationTests.cs 2 Aug 2007 16:28:46 -0000 1.1 --- DynamicMethodInvocationTests.cs 6 Feb 2008 18:29:05 -0000 1.2 *************** *** 39,45 **** public class DynamicMethodInvocationTests : AbstractMethodInvocationTests { ! protected override AbstractMethodInvocation CreateMethodInvocation(object proxy, object target, MethodInfo method, object[] arguments, Type targetType, IList interceptors) { ! return new DynamicMethodInvocation(proxy, target, method, arguments, targetType, interceptors); } } --- 39,45 ---- public class DynamicMethodInvocationTests : AbstractMethodInvocationTests { ! protected override AbstractMethodInvocation CreateMethodInvocation(object proxy, object target, MethodInfo method, MethodInfo onProxyMethod, object[] arguments, Type targetType, IList interceptors) { ! return new DynamicMethodInvocation(proxy, target, method, onProxyMethod, arguments, targetType, interceptors); } } Index: AbstractMethodInvocationTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aop/Framework/AbstractMethodInvocationTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractMethodInvocationTests.cs 2 Aug 2007 16:28:46 -0000 1.1 --- AbstractMethodInvocationTests.cs 6 Feb 2008 18:29:05 -0000 1.2 *************** *** 44,48 **** { protected abstract AbstractMethodInvocation CreateMethodInvocation( ! object proxy, object target, MethodInfo method, object[] arguments, Type targetType, IList interceptors); --- 44,48 ---- { protected abstract AbstractMethodInvocation CreateMethodInvocation( ! object proxy, object target, MethodInfo method, MethodInfo onProxyMethod, object[] arguments, Type targetType, IList interceptors); *************** *** 51,55 **** public void InstantiationWithNullMethod() { ! CreateMethodInvocation(null, this, null, null, GetType(), null); } --- 51,55 ---- public void InstantiationWithNullMethod() { ! CreateMethodInvocation(null, this, null, null, null, GetType(), null); } *************** *** 58,62 **** public void InstantiationWithNullTarget() { ! CreateMethodInvocation(null, null, null, null, GetType(), null); } --- 58,62 ---- public void InstantiationWithNullTarget() { ! CreateMethodInvocation(null, null, null, null, null, GetType(), null); } *************** *** 66,70 **** Target target = new Target(); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethodNoArgs(), null, target.GetType(), null); string score = (string) join.Proceed(); Assert.AreEqual(Target.DefaultScore + Target.Suffix, score); --- 66,70 ---- Target target = new Target(); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethodNoArgs(), null, null, target.GetType(), null); string score = (string) join.Proceed(); Assert.AreEqual(Target.DefaultScore + Target.Suffix, score); *************** *** 76,80 **** Target target = new Target(); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethodNoArgs(), null, target.GetType(), new ArrayList()); string score = (string) join.Proceed(); Assert.AreEqual(Target.DefaultScore + Target.Suffix, score); --- 76,80 ---- Target target = new Target(); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethodNoArgs(), null, null, target.GetType(), new ArrayList()); string score = (string) join.Proceed(); Assert.AreEqual(Target.DefaultScore + Target.Suffix, score); *************** *** 86,90 **** Target target = new Target(); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethodNoArgs(), null, target.GetType(), new ArrayList()); CheckToStringDoesntThrowAnException(join); } --- 86,90 ---- Target target = new Target(); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethodNoArgs(), null, null, target.GetType(), new ArrayList()); CheckToStringDoesntThrowAnException(join); } *************** *** 95,99 **** Target target = new Target(); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethod(), new string[] { "Five" }, target.GetType(), new ArrayList()); CheckToStringDoesntThrowAnException(join); } --- 95,99 ---- Target target = new Target(); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethod(), null, new string[] { "Five" }, target.GetType(), new ArrayList()); CheckToStringDoesntThrowAnException(join); } *************** *** 104,108 **** Target target = new TargetWithBadToString(); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethodNoArgs(), null, target.GetType(), new ArrayList()); // if it hits the target the test will fail with NotSupportedException... CheckToStringDoesntThrowAnException(join); --- 104,108 ---- Target target = new TargetWithBadToString(); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethodNoArgs(), null, null, target.GetType(), new ArrayList()); // if it hits the target the test will fail with NotSupportedException... CheckToStringDoesntThrowAnException(join); *************** *** 172,176 **** IDynamicMock mock = new DynamicMock(typeof (IMethodInterceptor)); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethodNoArgs(), null, target.GetType(), new object[] { mock.Object }); mock.ExpectAndReturn("Invoke", target.BullseyeMethod().ToLower(CultureInfo.InvariantCulture)); --- 172,176 ---- IDynamicMock mock = new DynamicMock(typeof (IMethodInterceptor)); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethodNoArgs(), null, null, target.GetType(), new object[] { mock.Object }); mock.ExpectAndReturn("Invoke", target.BullseyeMethod().ToLower(CultureInfo.InvariantCulture)); *************** *** 185,189 **** BadCommand target = new BadCommand(); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethod(), null, target.GetType(), new object[] { }); try { --- 185,189 ---- BadCommand target = new BadCommand(); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethod(), null, null, target.GetType(), new object[] { }); try { *************** *** 206,210 **** IDynamicMock mock = new DynamicMock(typeof (IMethodInterceptor)); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethod(), null, target.GetType(), new object[] { mock.Object }); mock.ExpectAndReturn("Invoke", null); try --- 206,210 ---- IDynamicMock mock = new DynamicMock(typeof (IMethodInterceptor)); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethod(), null, null, target.GetType(), new object[] { mock.Object }); mock.ExpectAndReturn("Invoke", null); try *************** *** 229,233 **** IDynamicMock mock = new DynamicMock(typeof (IMethodInterceptor)); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethod(), null, target.GetType(), new object[] { mock.Object }); mock.ExpectAndThrow("Invoke", new NotImplementedException()); try --- 229,233 ---- IDynamicMock mock = new DynamicMock(typeof (IMethodInterceptor)); AbstractMethodInvocation join = CreateMethodInvocation( ! null, target, target.GetTargetMethod(), null, null, target.GetType(), new object[] { mock.Object }); mock.ExpectAndThrow("Invoke", new NotImplementedException()); try Index: ReflectiveMethodInvocationTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aop/Framework/ReflectiveMethodInvocationTests.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ReflectiveMethodInvocationTests.cs 2 Aug 2007 16:28:46 -0000 1.7 --- ReflectiveMethodInvocationTests.cs 6 Feb 2008 18:29:05 -0000 1.8 *************** *** 40,46 **** public class ReflectiveMethodInvocationTests : AbstractMethodInvocationTests { ! protected override AbstractMethodInvocation CreateMethodInvocation(object proxy, object target, MethodInfo method, object[] arguments, Type targetType, IList interceptors) { ! return new ReflectiveMethodInvocation(proxy, target, method, arguments, targetType, interceptors); } } --- 40,46 ---- public class ReflectiveMethodInvocationTests : AbstractMethodInvocationTests { ! protected override AbstractMethodInvocation CreateMethodInvocation(object proxy, object target, MethodInfo method, MethodInfo onProxyMethod, object[] arguments, Type targetType, IList interceptors) { ! return new ReflectiveMethodInvocation(proxy, target, method, onProxyMethod, arguments, targetType, interceptors); } } |
From: Bruno B. <bb...@us...> - 2008-02-06 18:29:08
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv16423 Modified Files: Spring.Aop.Tests.2005.csproj Log Message: Added Inheritance-based aop proxy. Index: Spring.Aop.Tests.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.2005.csproj,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Spring.Aop.Tests.2005.csproj 5 Feb 2008 21:38:49 -0000 1.33 --- Spring.Aop.Tests.2005.csproj 6 Feb 2008 18:29:05 -0000 1.34 *************** *** 142,145 **** --- 142,146 ---- <Compile Include="Aop\Framework\DynamicProxy\CachedAopProxyFactoryTests.cs" /> <Compile Include="Aop\Framework\DynamicProxy\CompositionAopProxyTests.cs" /> + <Compile Include="Aop\Framework\DynamicProxy\InheritanceAopProxyTests.cs" /> <Compile Include="Aop\Framework\DynamicProxy\DecoratorAopProxyTests.cs" /> <Compile Include="Aop\Framework\DynamicProxy\DefaultAopProxyFactoryTests.cs" /> |