diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/AssemblyInfo.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/AssemblyInfo.cs new file mode 100644 index 00000000..9d95a597 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/AssemblyInfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("Spring.ConversationWA.NH32 Integration Tests")] +[assembly: AssemblyDescription("Integration tests for Spring.ConversationWA.NH32.Tests assembly")] diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Bsn/ConversationEvidenceBsnImpl.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Bsn/ConversationEvidenceBsnImpl.cs new file mode 100644 index 00000000..f76d04d1 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Bsn/ConversationEvidenceBsnImpl.cs @@ -0,0 +1,35 @@ +using System; +using System.Data; +using System.Configuration; + +namespace Spring.Bsn +{ + /// + /// + /// + public class ConversationEvidenceBsnImpl: IConversationEvidenceBsn + { + private String uniqueId = ""; + + /// + /// Create instance with unique id. + /// + public ConversationEvidenceBsnImpl() + { + uniqueId = Guid.NewGuid().ToString(); + } + + #region IConversationEvidenceBsn Members + + /// + /// + /// + /// + public String UniqueId() + { + return this.uniqueId; + } + + #endregion + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Bsn/IConversationEvidenceBsn.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Bsn/IConversationEvidenceBsn.cs new file mode 100644 index 00000000..2420e957 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Bsn/IConversationEvidenceBsn.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Spring.Bsn +{ + /// + /// Simulates a business infrastructure in order to demonstrate the end of + /// the conversation. + /// + public interface IConversationEvidenceBsn + { + /// + /// Return a unique id per instance. + /// + /// + String UniqueId(); + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Bsn/INoDeferedErrorBsn.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Bsn/INoDeferedErrorBsn.cs new file mode 100644 index 00000000..75a1b13d --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Bsn/INoDeferedErrorBsn.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Spring.Bsn +{ + /// + /// TODO: + /// + public interface IConnectionReleaseModeIssueBsn + { + /// + /// TODO + /// + void Test(); + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Bsn/NoDeferedErrorBsnImpl.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Bsn/NoDeferedErrorBsnImpl.cs new file mode 100644 index 00000000..130b83c5 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Bsn/NoDeferedErrorBsnImpl.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Text; +using NHibernate; +using Spring.Entities; +using NUnit.Framework; +using Spring.Spring.Data.Common; + +namespace Spring.Bsn +{ + /// + /// Outside the "transaction boundaries", each statement + /// execution (lazy loads) was being made a call to + /// "IDbProvider.CreateConnection()". This would + /// cause a large over-reading because most of the "lazy loads" tend to + /// occur outside the "transaction boundaries". + /// The solution to this is to use "connection.release_mode" with "on_close" + /// in "HibernateProperties." + /// This test was created to show how the connection openings + /// occur in the following scenarios: + /// *Test with conversation and "connection.release_mode" + /// "auto"(ConnectionReleaseMode.AfterTransaction). + /// *Test with NO conversation and "connection.release_mode" + /// "auto"(ConnectionReleaseMode.AfterTransaction) + /// on block within the scope of "transaction boundary". + /// *Test with NO conversation and "connection.release_mode" + /// "auto"(ConnectionReleaseMode.AfterTransaction). + /// *Test with conversation and "connection.release_mode" + /// "on_close"(ConnectionReleaseMode.OnClose). + /// + public class ConnectionReleaseModeIssueBsnImpl : IConnectionReleaseModeIssueBsn + { + private ISessionFactory sessionFactory; + /// + /// SessionFactory. + /// + public ISessionFactory SessionFactory + { + get { return sessionFactory; } + set { sessionFactory = value; } + } + + #region IConnectionReleaseModeIssueBsn Members + + /// + /// Test. + /// + [Transaction.Interceptor.Transaction(ReadOnly=true)] + public void Test() + { + ISession sessionNoConv = this.SessionFactory.GetCurrentSession(); + SPCMasterEnt masterEnt2 = sessionNoConv.Get(2); + Assert.AreEqual(1, masterEnt2.SPCDetailEntList.Count, "masterEnt2.SPCDetailEntList.Count"); + + SPCMasterEnt masterEnt3 = sessionNoConv.Get(3); + Assert.AreEqual(1, masterEnt3.SPCDetailEntList.Count, "masterEnt3.SPCDetailEntList.Count"); + + Assert.AreEqual(1, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count"); + } + + #endregion + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/ConversationWA/PatialEndConvBeginBasePage.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/ConversationWA/PatialEndConvBeginBasePage.cs new file mode 100644 index 00000000..a9f7d305 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/ConversationWA/PatialEndConvBeginBasePage.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Spring.Web.UI; +using Spring.ConversationWA; + +namespace Spring.ConversationWA +{ + /// + /// Base class for test pages for test + /// . + /// + public class PatialEndConvBeginBasePage: Page + { + private IConversationState conversation; + /// + /// + /// + public IConversationState Conversation + { + get { return conversation; } + set { conversation = value; } + } + + /// + /// Common Begin. + /// + /// + /// + protected virtual void Page_Load(object sender, EventArgs e) + { + this.Conversation.StartResumeConversation(); + + Session["ConversationStr"] = this.Conversation.ToString(); + } + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/ConversationWA/PatialEndConvEndBasePage.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/ConversationWA/PatialEndConvEndBasePage.cs new file mode 100644 index 00000000..c283e494 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/ConversationWA/PatialEndConvEndBasePage.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Spring.Web.UI; +using Spring.ConversationWA; + +namespace Spring.ConversationWA +{ + /// + /// Base class for test pages for test + /// . + /// + public abstract class PatialEndConvEndBasePage: Page + { + private IConversationState conversation; + /// + /// + /// + public IConversationState Conversation + { + get { return conversation; } + set { conversation = value; } + } + + /// + /// Common End. + /// + /// + /// + public virtual void Page_Load(object sender, EventArgs e) + { + this.Conversation.EndConversation(); + } + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/ConversationWA/SimpleTest.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/ConversationWA/SimpleTest.cs new file mode 100644 index 00000000..73f57f00 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/ConversationWA/SimpleTest.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; + +namespace Spring.ConversationWA +{ + [TestFixture] + public class SimpleTest + { + [Test] + public void Test() + { + Assert.AreEqual(2, 1 + 1, "2 == 1 + 1"); + } + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/ConversationWA/WebConversationStateTest.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/ConversationWA/WebConversationStateTest.cs new file mode 100644 index 00000000..5e46f89a Binary files /dev/null and b/test/Spring/Spring.ConversationWA.NH32.Tests/ConversationWA/WebConversationStateTest.cs differ diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/CircularDependenceTest.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/CircularDependenceTest.aspx new file mode 100644 index 00000000..47f665a1 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/CircularDependenceTest.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CircularDependenceTest.aspx.cs" Inherits="CircularDependenceTest" %><% +Response.Write("OK"); +%> \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/CircularDependenceTest.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/CircularDependenceTest.aspx.cs new file mode 100644 index 00000000..f137571c --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/CircularDependenceTest.aspx.cs @@ -0,0 +1,56 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; +using NUnit.Framework; +using Spring.Context.Support; +using System.Text; +using Common.Logging; +using Spring.Context; + +public partial class CircularDependenceTest : System.Web.UI.Page, IApplicationContextAware +{ + private static readonly ILog LOG = LogManager.GetLogger(typeof(CircularDependenceTest)); + + protected void Page_Load(object sender, EventArgs e) + { + IConversationState convCircularDependenceTest_A = (IConversationState)this.applicationContext.GetObject("convCircularDependenceTest_A"); + IConversationState convCircularDependenceTest_A_A_A = (IConversationState)this.applicationContext.GetObject("convCircularDependenceTest_A_A_A"); + StringBuilder sbErrors = new StringBuilder(); + try + { + convCircularDependenceTest_A_A_A.InnerConversations.Add(convCircularDependenceTest_A); + sbErrors.AppendLine("Circular was not detected. "); + } + catch (InvalidOperationException ioe) + { + LOG.Debug("SERVER SIDE ERROR", ioe); + if (!ioe.Message.Contains("convCircularDependenceTest_A_A_A->convCircularDependenceTest_A->convCircularDependenceTest_A_A->convCircularDependenceTest_A_A_A")) + { + sbErrors.AppendLine(String.Format("Wrong CircularDependence message= '{0}'", ioe.Message)); + } + } + catch (Exception ex) + { + LOG.Error("SERVER SIDE ERROR", ex); + sbErrors.AppendLine(String.Format("Unexpected Error: '{0}' \n {1}", ex.Message, ex.StackTrace)); + } + + Session["CircularDependenceTest"] = sbErrors.ToString(); + } + + #region IApplicationContextAware Members + private IApplicationContext applicationContext; + public IApplicationContext ApplicationContext + { + set { this.applicationContext = value; } + } + #endregion +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/ConnectionReleaseModeIssue.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/ConnectionReleaseModeIssue.aspx new file mode 100644 index 00000000..0ec08d1d --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/ConnectionReleaseModeIssue.aspx @@ -0,0 +1,16 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ConnectionReleaseModeIssue.aspx.cs" Inherits="ConnectionReleaseModeIssue" %> + + + + + + Untitled Page + + +
+
+ +
+
+ + diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/ConnectionReleaseModeIssue.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/ConnectionReleaseModeIssue.aspx.cs new file mode 100644 index 00000000..1cdc86c9 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/ConnectionReleaseModeIssue.aspx.cs @@ -0,0 +1,265 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; +using Spring.Data.NHibernate.Support; +using NHibernate; +using Spring.Entities; +using Spring.Spring.Data.Common; +using NUnit.Framework; +using Spring.Bsn; +using NHibernate.Impl; +using System.Reflection; +using NHibernate.Cfg; +using Spring.Context; + +/// +/// Page for . +/// +public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicationContextAware +{ + private IConversationState conversation; + /// + /// + /// + public IConversationState Conversation + { + get { return conversation; } + set { conversation = value; } + } + + private ISessionFactory sessionFactory; + public ISessionFactory SessionFactory + { + get { return sessionFactory; } + set { sessionFactory = value; } + } + + + private IConnectionReleaseModeIssueBsn connectionReleaseModeIssueBsn; + public IConnectionReleaseModeIssueBsn ConnectionReleaseModeIssueBsn + { + get { return connectionReleaseModeIssueBsn; } + set { connectionReleaseModeIssueBsn = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + try + { + /// Test with conversation and "connection.release_mode" + /// "auto"(). + this.connection_release_mode_auto(); + + /// Test with NO conversation and "connection.release_mode" + /// "auto"() + /// on block within the scope of "transaction boundary". + this.connection_release_mode_auto_transaction_boundary(); + + /// Test with NO conversation and "connection.release_mode" + /// "auto"(). + this.connection_release_mode_auto_no_conversation(); + + /// Test with conversation and "connection.release_mode" + /// "on_close"(). + this.connection_release_mode_on_close(); + + Session["result"] = "OK"; + } + catch (Exception ex) + { + Session["result"] = ex.Message + " " + ex.StackTrace; + //throw; + } + } + + /// + /// Test with conversation and "connection.release_mode" + /// "auto"(). + /// + /// + /// Here we can see that every statement causes a closing of the IDbConnection. + /// + private void connection_release_mode_auto() + { + //with conversation and "connection.release_mode" "auto"(AfterTransaction) + //forcing "auto" by reflection. + Settings settings = ((SessionFactoryImpl)this.SessionFactory).Settings; + ConnectionReleaseMode connReleaseModeOriginal = settings.ConnectionReleaseMode; + this.setConnectionReleaseModeByReflection(settings, ConnectionReleaseMode.AfterTransaction); + + //((SessionFactoryImpl)this.sessionFactory).Settings.ConnectionReleaseMode = ConnectionReleaseMode.AfterTransaction; + CountGetConnDbProvider.Count = 0; + this.Conversation.StartResumeConversation(); + ISession sessionA = this.SessionFactory.GetCurrentSession(); + SPCDetailEnt detailEnt = sessionA.Get(1); + Assert.AreEqual(1, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count"); + + SessionScopeSettings sessionScopeSettings = new SessionScopeSettings(this.sessionFactory); + sessionScopeSettings.SingleSession = true; + SPCMasterEnt masterEnt; + using (new SessionScope(sessionScopeSettings, false)) + { + ISession sessionB = this.SessionFactory.GetCurrentSession(); + + masterEnt = sessionB.Get(1); + Assert.AreEqual(2, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count"); + + Assert.AreSame(sessionA, sessionB, "sessionA, sessionB"); + } + + SPCMasterEnt masterEnt2 = sessionA.Get(2); + Assert.AreEqual(3, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count"); + Assert.AreEqual(1, masterEnt2.SPCDetailEntList.Count, "masterEnt2.SPCDetailEntList.Count"); + Assert.AreEqual(4, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count"); + + SPCMasterEnt masterEnt3 = sessionA.Get(3); + Assert.AreEqual(5, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count"); + Assert.AreEqual(1, masterEnt3.SPCDetailEntList.Count, "masterEnt3.SPCDetailEntList.Count"); + Assert.AreEqual(6, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count"); + + + //Renew the conversation. + this.Conversation.EndConversation(); + this.Conversation.ConversationManager.FreeEnded(); + this.Conversation = (IConversationState)this.applicationContext.GetObject("convConnectionReleaseModeIssue"); + + this.setConnectionReleaseModeByReflection(settings, connReleaseModeOriginal); + } + + /// + /// Test with NO conversation and "connection.release_mode" + /// "auto"() + /// on block within the scope of "transaction boundary". + /// + /// + /// Here we can see that only a IDbConnection is open, even + /// with the execution of various statements. This is because + /// the statements are made within a "transaction boundary". + /// + private void connection_release_mode_auto_transaction_boundary() + { + //with conversation and "connection.release_mode" "auto"(AfterTransaction) + //forcing "auto" by reflection. + Settings settings = ((SessionFactoryImpl)this.SessionFactory).Settings; + ConnectionReleaseMode connReleaseModeOriginal = settings.ConnectionReleaseMode; + this.setConnectionReleaseModeByReflection(settings, ConnectionReleaseMode.AfterTransaction); + + CountGetConnDbProvider.Count = 0; + this.ConnectionReleaseModeIssueBsn.Test(); + + this.setConnectionReleaseModeByReflection(settings, connReleaseModeOriginal); + } + + /// + /// Test with NO conversation and "connection.release_mode" + /// "auto"(). + /// + private void connection_release_mode_auto_no_conversation() + { + //with NO conversation and "connection.release_mode" "auto"(AfterTransaction) + //forcing "auto" by reflection. + Settings settings = ((SessionFactoryImpl)this.SessionFactory).Settings; + ConnectionReleaseMode connReleaseModeOriginal = settings.ConnectionReleaseMode; + this.setConnectionReleaseModeByReflection(settings, ConnectionReleaseMode.AfterTransaction); + + //with no conversation + SessionScopeSettings sessionScopeSettings = new SessionScopeSettings(this.sessionFactory); + CountGetConnDbProvider.Count = 0; + using (new SessionScope(sessionScopeSettings, true)) + { + ISession sessionNoConv = this.SessionFactory.GetCurrentSession(); + SPCMasterEnt masterEnt2 = sessionNoConv.Get(2); + Assert.AreEqual(1, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count"); + Assert.AreEqual(1, masterEnt2.SPCDetailEntList.Count, "masterEnt2.SPCDetailEntList.Count"); + Assert.AreEqual(2, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count"); + + SPCMasterEnt masterEnt3 = sessionNoConv.Get(3); + Assert.AreEqual(3, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count"); + Assert.AreEqual(1, masterEnt3.SPCDetailEntList.Count, "masterEnt3.SPCDetailEntList.Count"); + Assert.AreEqual(4, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count"); + } + + this.setConnectionReleaseModeByReflection(settings, connReleaseModeOriginal); + } + + /// + /// Test with conversation and "connection.release_mode" + /// "on_close"(). + /// + /// + /// Here we can see that only a IDbConnection is open, even + /// with the execution of various statements. + /// + private void connection_release_mode_on_close() + { + //forcing "on_close" by reflection. + Settings settings = ((SessionFactoryImpl)this.SessionFactory).Settings; + ConnectionReleaseMode connReleaseModeOriginal = settings.ConnectionReleaseMode; + this.setConnectionReleaseModeByReflection(settings, ConnectionReleaseMode.OnClose); + + //with conversation and "connection.release_mode" "on_close"(AfterTransaction) + CountGetConnDbProvider.Count = 0; + this.Conversation.StartResumeConversation(); + ISession sessionA = this.SessionFactory.GetCurrentSession(); + SPCDetailEnt detailEnt = sessionA.Get(1); + Assert.AreEqual(1, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count"); + + SessionScopeSettings sessionScopeSettings = new SessionScopeSettings(this.sessionFactory); + sessionScopeSettings.SingleSession = true; + SPCMasterEnt masterEnt; + using (new SessionScope(sessionScopeSettings, false)) + { + ISession sessionB = this.SessionFactory.GetCurrentSession(); + + masterEnt = sessionB.Get(1); + + Assert.AreSame(sessionA, sessionB, "sessionA, sessionB"); + } + + Assert.AreEqual(3, masterEnt.SPCDetailEntList.Count, "masterEnt.SPCDetailEntList.Count"); + + Assert.AreEqual(1, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count"); + + //Renew the conversation. + this.Conversation.EndConversation(); + this.Conversation.ConversationManager.FreeEnded(); + this.Conversation = (IConversationState)this.applicationContext.GetObject("convConnectionReleaseModeIssue"); + + this.setConnectionReleaseModeByReflection(settings, connReleaseModeOriginal); + } + + /// + /// Sets the by reflection. + /// + /// The settings. + /// The mode. + private void setConnectionReleaseModeByReflection(Settings settings, ConnectionReleaseMode mode) + { + PropertyInfo pInfoConnectionReleaseMode = + settings.GetType().GetProperty( + "ConnectionReleaseMode", + BindingFlags.Public | + BindingFlags.NonPublic | + BindingFlags.SetProperty | + BindingFlags.Instance); + + pInfoConnectionReleaseMode.SetValue(settings, mode, null); + } + + #region IApplicationContextAware Members + private IApplicationContext applicationContext; + public IApplicationContext ApplicationContext + { + set { this.applicationContext = value; } + } + + #endregion +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndConversationTestBegin.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndConversationTestBegin.aspx new file mode 100644 index 00000000..28e2e284 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndConversationTestBegin.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EndConversationTestBegin.aspx.cs" Inherits="EndConversationTestBegin" %><% +Response.Write("OK"); +%> \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndConversationTestBegin.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndConversationTestBegin.aspx.cs new file mode 100644 index 00000000..7d937e5e --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndConversationTestBegin.aspx.cs @@ -0,0 +1,37 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; +using Spring.Bsn; + +public partial class EndConversationTestBegin : System.Web.UI.Page +{ + private IConversationEvidenceBsn conversationEvidenceBsn; + public IConversationEvidenceBsn ConversationEvidenceBsn + { + get { return conversationEvidenceBsn; } + set { conversationEvidenceBsn = value; } + } + + + private IConversationState conversation; + public IConversationState Conversation + { + get { return conversation; } + set { conversation = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + this.Conversation.StartResumeConversation(); + + Session["ConversationEvidenceBsn_UniqId"] = this.ConversationEvidenceBsn.UniqueId(); + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndConversationTestEnd.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndConversationTestEnd.aspx new file mode 100644 index 00000000..13a43a2c --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndConversationTestEnd.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EndConversationTestEnd.aspx.cs" Inherits="EndConversationTestEnd" %><% +Response.Write("OK"); +%> \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndConversationTestEnd.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndConversationTestEnd.aspx.cs new file mode 100644 index 00000000..63768540 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndConversationTestEnd.aspx.cs @@ -0,0 +1,35 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.Bsn; +using Spring.ConversationWA; + +public partial class EndConversationTestEnd : System.Web.UI.Page +{ + private IConversationEvidenceBsn conversationEvidenceBsn; + public IConversationEvidenceBsn ConversationEvidenceBsn + { + get { return conversationEvidenceBsn; } + set { conversationEvidenceBsn = value; } + } + + + private IConversationState conversation; + public IConversationState Conversation + { + get { return conversation; } + set { conversation = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + this.Conversation.EndConversation(); + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedSessionIsClosedA.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedSessionIsClosedA.aspx new file mode 100644 index 00000000..af200f39 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedSessionIsClosedA.aspx @@ -0,0 +1,16 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EndPausedSessionIsClosedA.aspx.cs"Inherits="EndPausedSessionIsClosedA" %> + + + + + + Untitled Page + + +
+
+ +
+
+ + diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedSessionIsClosedA.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedSessionIsClosedA.aspx.cs new file mode 100644 index 00000000..3671ab3b --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedSessionIsClosedA.aspx.cs @@ -0,0 +1,40 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; +using Spring.Entities; +using NHibernate; + +public partial class EndPausedSessionIsClosedA : System.Web.UI.Page +{ + + private IConversationState conversation; + /// + /// + /// + public IConversationState Conversation + { + get { return conversation; } + set { conversation = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + this.Session["result"] = "NOT OK"; + + this.Conversation.StartResumeConversation(); + + //database access + ISession session = this.Conversation.SessionFactory.GetCurrentSession(); + SPCMasterEnt sPCMasterEnt = session.Get(1); + + this.Session["result"] = "OK"; + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedSessionIsClosedB.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedSessionIsClosedB.aspx new file mode 100644 index 00000000..21987f26 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedSessionIsClosedB.aspx @@ -0,0 +1,16 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EndPausedSessionIsClosedB.aspx.cs"Inherits="EndPausedSessionIsClosedB" %> + + + + + + Untitled Page + + +
+
+ +
+
+ + diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedSessionIsClosedB.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedSessionIsClosedB.aspx.cs new file mode 100644 index 00000000..1c13094d --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedSessionIsClosedB.aspx.cs @@ -0,0 +1,46 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; +using NHibernate; +using Spring.Entities; + +public partial class EndPausedSessionIsClosedB : System.Web.UI.Page +{ + private IConversationState conversation; + /// + /// + /// + public IConversationState Conversation + { + get { return conversation; } + set { conversation = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + this.Session["result"] = "NOT OK"; + + try + { + this.Conversation.StartResumeConversation(); + + //database access + ISession session = this.Conversation.SessionFactory.GetCurrentSession(); + SPCMasterEnt sPCMasterEnt = session.Get(1); + + this.Session["result"] = "OK"; + } + catch (Exception ex) + { + this.Session["result"] = ex.Message; + } + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedTest.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedTest.aspx new file mode 100644 index 00000000..a55709b1 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedTest.aspx @@ -0,0 +1,16 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EndPausedTest.aspx.cs" Inherits="EndPausedTest" %> + + + + + + Untitled Page + + +
+
+ +
+
+ + diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedTest.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedTest.aspx.cs new file mode 100644 index 00000000..3814e5d5 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/EndPausedTest.aspx.cs @@ -0,0 +1,48 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; + +public partial class EndPausedTest : System.Web.UI.Page +{ + private IConversationState convA; + + public IConversationState ConvA + { + get { return convA; } + set { convA = value; } + } + private IConversationState convB; + + public IConversationState ConvB + { + get { return convB; } + set { convB = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (this.Request["testPhase"] == "begin") + { + if (!this.convA.Ended && !this.convB.Ended) + this.Session["result"] = "OK"; + else + this.Session["result"] = "(!this.convA.Ended && !this.convB.Ended) is false"; + } + else if (this.Request["testPhase"] == "startConvA") + { + this.convA.StartResumeConversation(); + if (!this.convA.Ended && this.convB.Ended) + this.Session["result"] = "OK"; + else + this.Session["result"] = "(!this.convA.Ended && this.convB.Ended) is false"; + } + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/GetParentObjetFromChild.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/GetParentObjetFromChild.aspx new file mode 100644 index 00000000..b5e2cdc3 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/GetParentObjetFromChild.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GetParentObjetFromChild.aspx.cs" Inherits="GetParentObjetFromChild" %><% +Response.Write("OK"); +%> \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/GetParentObjetFromChild.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/GetParentObjetFromChild.aspx.cs new file mode 100644 index 00000000..3a323427 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/GetParentObjetFromChild.aspx.cs @@ -0,0 +1,30 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; + +public partial class GetParentObjetFromChild : System.Web.UI.Page +{ + private IConversationState conversation; + public IConversationState Conversation + { + get { return conversation; } + set { conversation = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + this.Conversation.StartResumeConversation(); + + Session["parentKey"] = this.Conversation["parentKey"]; + Session["childKey"] = this.Conversation["childKey"]; + Session["overwrittenKey"] = this.Conversation["overwrittenKey"]; + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/IoeTests.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/IoeTests.aspx new file mode 100644 index 00000000..044b21f4 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/IoeTests.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="IoeTests.aspx.cs" Inherits="IoeTests" %><% +Response.Write("OK"); +%> \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/IoeTests.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/IoeTests.aspx.cs new file mode 100644 index 00000000..82221b7a --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/IoeTests.aspx.cs @@ -0,0 +1,466 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; +using Spring.ConversationWA.Imple; +using System.Text.RegularExpressions; +using NHibernate; +using Spring.Data.NHibernate.Support; +using Common.Logging; +using Spring.Objects.Factory; + +public partial class IoeTests : System.Web.UI.Page +{ + private static readonly ILog LOG = LogManager.GetLogger(typeof(IoeTests)); + + private IConversationState conversationA; + public IConversationState ConversationA + { + get { return conversationA; } + set { conversationA = value; } + } + private IConversationState conversationAA; + public IConversationState ConversationAA + { + get { return conversationAA; } + set { conversationAA = value; } + } + + private IConversationManager conversationManager; + public IConversationManager ConversationManager + { + get { return conversationManager; } + set { conversationManager = value; } + } + + private ISessionFactory sessionFactory; + public ISessionFactory SessionFactory + { + get { return sessionFactory; } + set { sessionFactory = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + try + { + if ("reset".Equals(this.Request.Params["test"])) + { + this.ConversationA.EndConversation(); + this.Session["testResult"] = "OK"; + } + else if ("alreadyHasAnotherManagerNotRaise".Equals(this.Request.Params["test"])) + { + this.alreadyHasAnotherManagerNotRaise(); + } + else if ("alreadyHasAnotherManagerRaise".Equals(this.Request.Params["test"])) + { + this.alreadyHasAnotherManagerRaise(); + } + else if ("conversationAlreadyDifferentParent".Equals(this.Request.Params["test"])) + { + this.conversationAlreadyDifferentParent(); + } + else if ("setParentConversationIsNotNew".Equals(this.Request.Params["test"])) + { + this.setParentConversationIsNotNew(); + } + else if ("startResumeConversationIsEnded".Equals(this.Request.Params["test"])) + { + this.startResumeConversationIsEnded(); + } + else if ("participatingHibernateNotAlowed".Equals(this.Request.Params["test"])) + { + this.participatingHibernateNotAlowed(); + } + else if ("idIsDifferentFromSpringName".Equals(this.Request.Params["test"])) + { + this.idIsDifferentFromSpringName(); + } + else + { + throw new Exception("'test' request parameter was not recognized"); + } + } + catch (Exception ex) + { + this.Session["testResult"] = "FAIL: " + ex.ToString(); + } + } + + private void alreadyHasAnotherManagerNotRaise() + { + IConversationManager otherConversationManager = new WebConversationManager(); + + //Not raise error + IConversationState otherConversationState = null; + try + { + otherConversationState = new WebConversationSpringState(); + otherConversationState.Id = "otherConversationState"; + otherConversationManager.AddConversation(otherConversationState); + this.Session["testResult"] = "OK"; + } + catch (InvalidOperationException ioe) + { + this.Session["testResult"] = "NOT OK " + ioe.ToString(); + } + finally + { + otherConversationState.EndConversation(); + } + } + + private void alreadyHasAnotherManagerRaise() + { + Regex msgErrorRx = new Regex(".*already.*has.*another.*manager.*"); + IConversationManager otherConversationManager = null; + + //Raise error + try + { + otherConversationManager = new WebConversationManager(); + otherConversationManager.AddConversation(this.ConversationA); + this.Session["testResult"] = "NOT OK"; + } + catch (InvalidOperationException ioe) + { + if (msgErrorRx.IsMatch(ioe.Message)) + { + this.Session["testResult"] = "OK"; + } + else + { + this.Session["testResult"] = "NOT OK " + ioe.Message; + } + } + } + + private void conversationAlreadyDifferentParent() + { + Regex msgErrorRx = new Regex(".*conversation.*already.*different.*parent.*"); + //BEGIN: Raise error + IConversationState otherConversationState = null; + try + { + otherConversationState = new WebConversationSpringState(); + otherConversationState.Id = "otherConversationState"; + //try first by 'InnerConversations.Add' + otherConversationState.InnerConversations.Add(this.ConversationAA); + throw new Exception("NOT OK: No raise for 'InnerConversations.Add(this.ConversationAA)'"); + } + catch (InvalidOperationException ioe) + { + if (msgErrorRx.IsMatch(ioe.Message)) + { + this.Session["testResult"] = "OK"; + } + else + { + throw new Exception("NOT OK " + ioe.Message); + } + } + finally + { + otherConversationState.EndConversation(); + } + + try + { + otherConversationState = new WebConversationSpringState(); + otherConversationState.Id = "otherConversationState"; + //try second by 'ParenteConversation = ' + this.ConversationAA.ParenteConversation = otherConversationState; + throw new Exception("NOT OK: No raise for 'this.ConversationAA.ParenteConversation = otherConversationState'"); + } + catch (InvalidOperationException ioe) + { + if (msgErrorRx.IsMatch(ioe.Message)) + { + this.Session["testResult"] = "OK"; + } + else + { + throw new Exception("NOT OK, 'ex.Message' not match :" + ioe.Message); + } + } + finally + { + otherConversationState.EndConversation(); + } + //END: Raise error + + //BEGIN: NO Raise error + otherConversationState = null; + try + { + otherConversationState = new WebConversationSpringState(); + otherConversationState.Id = "otherConversationState"; + //try first by 'InnerConversations.Add' + this.ConversationAA.InnerConversations.Add(otherConversationState); + this.Session["testResult"] = "OK"; + } + finally + { + otherConversationState.EndConversation(); + } + + try + { + otherConversationState = new WebConversationSpringState(); + otherConversationState.Id = "otherConversationState"; + //try second by 'ParenteConversation = ' + otherConversationState.ParenteConversation = this.ConversationA; + this.Session["testResult"] = "OK"; + } + finally + { + otherConversationState.EndConversation(); + } + //END: NO Raise error + } + + private void setParentConversationIsNotNew() + { + Regex msgErrorRx = new Regex(".*Conversation.*not.*new.*Conversation.Id.*Parent.*Tried.*"); + IConversationState otherConversationState = null; + //BEGIN: Raise error + try + { + otherConversationState = new WebConversationSpringState(); + otherConversationState.Id = "otherConversationState"; + // make not new + otherConversationState.StartResumeConversation(); + //try first by 'InnerConversations.Add' + this.ConversationA.InnerConversations.Add(otherConversationState); + throw new Exception("NOT OK: No raise for 'this.ConversationA.InnerConversations.Add(otherConversationState)'"); + } + catch (InvalidOperationException ioe) + { + if (msgErrorRx.IsMatch(ioe.Message)) + { + this.Session["testResult"] = "OK"; + } + else + { + throw new Exception("NOT OK " + ioe.Message); + } + } + finally + { + otherConversationState.EndConversation(); + } + + try + { + otherConversationState = new WebConversationSpringState(); + otherConversationState.Id = "otherConversationState"; + // make not new + otherConversationState.StartResumeConversation(); + //try second by 'ParenteConversation = ' + otherConversationState.ParenteConversation = this.ConversationA; + throw new Exception("NOT OK: No raise for 'this.ConversationAA.ParenteConversation = otherConversationState'"); + } + catch (InvalidOperationException ioe) + { + if (msgErrorRx.IsMatch(ioe.Message)) + { + this.Session["testResult"] = "OK"; + } + else + { + throw new Exception("NOT OK, 'ex.Message' not match :" + ioe.Message); + } + } + finally + { + otherConversationState.EndConversation(); + } + //END: Raise error + + //BEGIN: NO Raise error + try + { + otherConversationState = new WebConversationSpringState(); + otherConversationState.Id = "otherConversationState"; + // leave new + //try first by 'InnerConversations.Add' + this.ConversationA.InnerConversations.Add(otherConversationState); + this.Session["testResult"] = "OK"; + } + finally + { + otherConversationState.EndConversation(); + } + + try + { + otherConversationState = new WebConversationSpringState(); + otherConversationState.Id = "otherConversationState"; + // leave new + //try second by 'ParenteConversation = ' + otherConversationState.ParenteConversation = this.ConversationA; + this.Session["testResult"] = "OK"; + } + finally + { + otherConversationState.EndConversation(); + } + //END: NO Raise error + } + + private void startResumeConversationIsEnded() + { + Regex msgErrorRx = new Regex(".*StartResumeConversation.*conversation.*is.*ended.*"); + IConversationState otherConversationState = null; + //BEGIN: Raise error + try + { + otherConversationState = new WebConversationSpringState(); + otherConversationState.Id = "otherConversationState"; + // make not new + otherConversationState.EndConversation(); + otherConversationState.StartResumeConversation(); + throw new Exception("NOT OK: No raise for 'otherConversationState.StartResumeConversation()'"); + } + catch (InvalidOperationException ioe) + { + if (msgErrorRx.IsMatch(ioe.Message)) + { + this.Session["testResult"] = "OK"; + } + else + { + throw new Exception("NOT OK " + ioe.Message); + } + } + finally + { + otherConversationState.EndConversation(); + } + //END: Raise error + + //BEGIN: NO Raise error + try + { + otherConversationState = new WebConversationSpringState(); + otherConversationState.Id = "otherConversationState"; + // make not new + otherConversationState.StartResumeConversation(); + otherConversationState.EndConversation(); + this.Session["testResult"] = "OK"; + } + finally + { + otherConversationState.EndConversation(); + } + //END: NO Raise error + } + + private void participatingHibernateNotAlowed() + { + Regex msgErrorRx = new Regex(".*Participating.*Hibernate.*NOT.*ALOWED.*"); + try + { + //No raise + this.ConversationA.StartResumeConversation(); + ISession session = this.SessionFactory.GetCurrentSession(); + this.ConversationManager.FreeEnded(); + this.ConversationManager.PauseConversations(); + this.Session["testResult"] = "OK"; + } + finally + { + this.ConversationManager.FreeEnded(); + this.ConversationManager.PauseConversations(); + } + + try + { + //Raise + this.ConversationA.StartResumeConversation(); + this.ConversationManager.FreeEnded(); + this.ConversationManager.PauseConversations(); + + SessionScopeSettings sessionScopeSettings = new SessionScopeSettings(this.sessionFactory); + sessionScopeSettings.SingleSession = true; + using (new SessionScope(sessionScopeSettings, true)) + { + ISession session = this.SessionFactory.GetCurrentSession(); + this.ConversationA.StartResumeConversation(); + } + throw new Exception("NOT OK: No raise for 'this.ConversationA.StartResumeConversation()'"); + } + catch (InvalidOperationException ioe) + { + if (msgErrorRx.IsMatch(ioe.Message)) + { + this.Session["testResult"] = "OK"; + } + else + { + throw new Exception("NOT OK " + ioe.Message); + } + } + finally + { + this.ConversationManager.FreeEnded(); + this.ConversationManager.PauseConversations(); + } + + } + + private void idIsDifferentFromSpringName() + { + Regex msgErrorRx = new Regex(".*Id.*is.*different.*from.*spring.*name.*"); + IConversationState otherConversationState = null; + //BEGIN: Raise error + try + { + otherConversationState = new WebConversationSpringState(); + otherConversationState.Id = "otherConversationState"; + // different name + ((IObjectNameAware)otherConversationState).ObjectName = "different_name"; + throw new Exception("NOT OK: No raise for '((IObjectNameAware)otherConversationState).ObjectName ='"); + } + catch (InvalidOperationException ioe) + { + if (msgErrorRx.IsMatch(ioe.Message)) + { + this.Session["testResult"] = "OK"; + } + else + { + throw new Exception("NOT OK " + ioe.Message); + } + } + finally + { + otherConversationState.EndConversation(); + } + //END: Raise error + + //BEGIN: NO Raise error + try + { + otherConversationState = new WebConversationSpringState(); + otherConversationState.Id = "otherConversationState"; + // make not new + // different name + ((IObjectNameAware)otherConversationState).ObjectName = "otherConversationState"; + this.Session["testResult"] = "OK"; + } + finally + { + otherConversationState.EndConversation(); + } + //END: NO Raise error + } +} \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_B_Begin.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_B_Begin.aspx new file mode 100644 index 00000000..e695ce08 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_B_Begin.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PatialEndConv_A_B_Begin.aspx.cs" Inherits="PatialEndConv_A_B_Begin" %><% +Response.Write("OK"); +%> \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_B_Begin.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_B_Begin.aspx.cs new file mode 100644 index 00000000..b25c2542 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_B_Begin.aspx.cs @@ -0,0 +1,15 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; + +public partial class PatialEndConv_A_B_Begin : PatialEndConvBeginBasePage +{ +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_B_End.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_B_End.aspx new file mode 100644 index 00000000..f9caee04 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_B_End.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PatialEndConv_A_B_End.aspx.cs" Inherits="PatialEndConv_A_B_End" %><% +Response.Write("OK"); +%> \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_B_End.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_B_End.aspx.cs new file mode 100644 index 00000000..b205b401 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_B_End.aspx.cs @@ -0,0 +1,15 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; + +public partial class PatialEndConv_A_B_End : PatialEndConvEndBasePage +{ +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_Begin.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_Begin.aspx new file mode 100644 index 00000000..83bc8c8a --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_Begin.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PatialEndConv_A_Begin.aspx.cs" Inherits="PatialEndConv_A_Begin" %><% +Response.Write("OK"); +%> \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_Begin.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_Begin.aspx.cs new file mode 100644 index 00000000..7a4a6699 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_Begin.aspx.cs @@ -0,0 +1,15 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; + +public partial class PatialEndConv_A_Begin : PatialEndConvBeginBasePage +{ +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_End.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_End.aspx new file mode 100644 index 00000000..dded3de4 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_End.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PatialEndConv_A_End.aspx.cs" Inherits="PatialEndConv_A_End" %><% +Response.Write("OK"); +%> \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_End.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_End.aspx.cs new file mode 100644 index 00000000..ab646490 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/PatialEndConv_A_End.aspx.cs @@ -0,0 +1,15 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; + +public partial class PatialEndConv_A_End : PatialEndConvEndBasePage +{ +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/RedirectErrorNoPauseConversation.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/RedirectErrorNoPauseConversation.aspx new file mode 100644 index 00000000..523cf938 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/RedirectErrorNoPauseConversation.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RedirectErrorNoPauseConversation.aspx.cs" Inherits="RedirectErrorNoPauseConversation" %><% +Response.Write("OK"); +%> \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/RedirectErrorNoPauseConversation.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/RedirectErrorNoPauseConversation.aspx.cs new file mode 100644 index 00000000..6c1269bd --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/RedirectErrorNoPauseConversation.aspx.cs @@ -0,0 +1,58 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; +using Spring.Entities; +using System.Threading; +using NHibernate; + +public partial class RedirectErrorNoPauseConversation : System.Web.UI.Page +{ + private IConversationState conversation; + public IConversationState Conversation + { + get { return conversation; } + set { conversation = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (this.Request.Params["step"].Equals("obtain_session_cookie")) + { + //nothing, only for obtain session cookie + } + if (this.Request.Params["step"].Equals("step_01")) + { + this.Conversation.StartResumeConversation(); + //Open Session for the first time + ISession ss = this.Conversation.SessionFactory.GetCurrentSession(); + this.Response.Redirect("RedirectErrorNoPauseConversation.aspx?step=step_02"); + } + else if (this.Request.Params["step"].Equals("step_02")) + { + this.Conversation.StartResumeConversation(); + } + else if (this.Request.Params["step"].Equals("Some_Exception")) + { + this.Conversation.StartResumeConversation(); + //Open Session for the first time + ISession ss = this.Conversation.SessionFactory.GetCurrentSession(); + throw new Exception("Some_Exception"); + } + else if (this.Request.Params["step"].Equals("Post_Some_Exception")) + { + this.Conversation.StartResumeConversation(); + } + else if (this.Request.Params["step"].Equals("end_conversation")) + { + this.Conversation.EndConversation(); + } + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCLazyLoadTest_A_Begin.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCLazyLoadTest_A_Begin.aspx new file mode 100644 index 00000000..ebbcf51f --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCLazyLoadTest_A_Begin.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SPCLazyLoadTest_A_Begin.aspx.cs" Inherits="SPCLazyLoadTest_A_Begin" %><% +Response.Write("OK"); +%> \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCLazyLoadTest_A_Begin.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCLazyLoadTest_A_Begin.aspx.cs new file mode 100644 index 00000000..9a327f53 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCLazyLoadTest_A_Begin.aspx.cs @@ -0,0 +1,45 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; +using NHibernate; +using Spring.Entities; + +public partial class SPCLazyLoadTest_A_Begin : System.Web.UI.Page +{ + private IConversationState conversation; + public IConversationState Conversation + { + get { return conversation; } + set { conversation = value; } + } + private ISessionFactory sessionFactory; + public ISessionFactory SessionFactory + { + get { return sessionFactory; } + set { sessionFactory = value; } + } + protected void Page_Load(object sender, EventArgs e) + { + if (this.Request["endConversation"] != null && bool.Parse(this.Request["endConversation"])) + { + this.Conversation.EndConversation(); + } + else + { + this.Conversation.StartResumeConversation(); + + ISession session = this.SessionFactory.GetCurrentSession(); + + SPCMasterEnt sPCMasterEnt = session.Get(1); + this.Session["sPCMasterEnt"] = sPCMasterEnt; + } + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCLazyLoadTest_A_Status.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCLazyLoadTest_A_Status.aspx new file mode 100644 index 00000000..867ef918 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCLazyLoadTest_A_Status.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SPCLazyLoadTest_A_Status.aspx.cs" Inherits="SPCLazyLoadTest_A_Status" %><% +Response.Write("OK"); +%> \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCLazyLoadTest_A_Status.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCLazyLoadTest_A_Status.aspx.cs new file mode 100644 index 00000000..46809c42 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCLazyLoadTest_A_Status.aspx.cs @@ -0,0 +1,48 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; +using Spring.Entities; +using Common.Logging; +using NHibernate; + +public partial class SPCLazyLoadTest_A_Status : System.Web.UI.Page +{ + private static readonly ILog LOG = LogManager.GetLogger(typeof(SPCLazyLoadTest_A_Status)); + + private IConversationState conversation; + public IConversationState Conversation + { + get { return conversation; } + set { conversation = value; } + } + protected void Page_Load(object sender, EventArgs e) + { + try + { + this.Conversation.StartResumeConversation(); + + SPCMasterEnt sPCMasterEnt = (SPCMasterEnt)this.Session["sPCMasterEnt"]; + foreach (SPCDetailEnt sPCDetailEntItem in sPCMasterEnt.SPCDetailEntList) + { + LOG.Debug(String.Format("Page_Load: sPCDetailEntItem.Description={0}", sPCDetailEntItem.Description)); + } + this.Session["messageTest"] = "no lazy error"; + } + catch (LazyInitializationException lex) + { + this.Session["messageTest"] = lex.GetType().FullName + ": " + lex.Message + "\n" + lex.StackTrace; + } + catch (Exception ex) + { + this.Session["messageTest"] = ex.GetType().FullName + ": " + ex.Message + "\n" + ex.StackTrace; + } + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCSwitchConversationSameRequest.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCSwitchConversationSameRequest.aspx new file mode 100644 index 00000000..324bf809 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCSwitchConversationSameRequest.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SPCSwitchConversationSameRequest.aspx.cs" Inherits="SPCSwitchConversationSameRequest" %><% +Response.Write("OK"); +%> \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCSwitchConversationSameRequest.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCSwitchConversationSameRequest.aspx.cs new file mode 100644 index 00000000..70b6434d --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SPCSwitchConversationSameRequest.aspx.cs @@ -0,0 +1,112 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; +using Spring.Entities; +using NHibernate; +using Common.Logging; + +public partial class SPCSwitchConversationSameRequest : System.Web.UI.Page +{ + private static readonly ILog LOG = LogManager.GetLogger(typeof(SPCSwitchConversationSameRequest)); + + private IConversationState conversationA; + public IConversationState ConversationA + { + get { return conversationA; } + set { conversationA = value; } + } + private IConversationState conversationB; + public IConversationState ConversationB + { + get { return conversationB; } + set { conversationB = value; } + } + + private ISessionFactory sessionFactory; + public ISessionFactory SessionFactory + { + get { return sessionFactory; } + set { sessionFactory = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + this.ConversationA.StartResumeConversation(); + SPCMasterEnt sPCMasterEntA = this.SessionFactory.GetCurrentSession().Get(1); + + this.ConversationB.StartResumeConversation(); + SPCMasterEnt sPCMasterEntB = this.SessionFactory.GetCurrentSession().Get(1); + + //testeRaizeLazy_A + try + { + this.LoopSPCMasterEnt(sPCMasterEntA, "sPCMasterEntA"); + } + catch (LazyInitializationException) + { + this.Session["testeRaizeLazy_A"] = "OK"; + } + catch (Exception ex) + { + this.Session["testeRaizeLazy_A"] = ex.ToString(); + } + + //testeRaizeLazy_B + this.ConversationA.StartResumeConversation(); + try + { + this.LoopSPCMasterEnt(sPCMasterEntB, "sPCMasterEntB"); + } + catch (LazyInitializationException) + { + this.Session["testeRaizeLazy_B"] = "OK"; + } + catch (Exception ex) + { + this.Session["testeRaizeLazy_B"] = ex.ToString(); + } + + //testeNoRaizeLazy_A + this.ConversationA.StartResumeConversation(); + try + { + this.LoopSPCMasterEnt(sPCMasterEntA, "sPCMasterEntA"); + this.Session["testeNoRaizeLazy_A"] = "OK"; + } + catch (Exception ex) + { + this.Session["testeNoRaizeLazy_A"] = ex.ToString(); + } + + //testeNoRaizeLazy_B + this.ConversationB.StartResumeConversation(); + try + { + this.LoopSPCMasterEnt(sPCMasterEntB, "sPCMasterEntB"); + this.Session["testeNoRaizeLazy_B"] = "OK"; + } + catch (Exception ex) + { + this.Session["testeNoRaizeLazy_B"] = ex.ToString(); + } + + this.ConversationA.EndConversation(); + this.ConversationB.EndConversation(); + } + + private void LoopSPCMasterEnt(SPCMasterEnt sPCMasterEnt, String desc) + { + foreach (SPCDetailEnt sPCDetailEntItem in sPCMasterEnt.SPCDetailEntList) + { + LOG.Debug(String.Format("Page_Load({1}): sPCDetailEntItem.Description={0}", sPCDetailEntItem.Description, desc)); + } + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SessionIsClosedA.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SessionIsClosedA.aspx new file mode 100644 index 00000000..fc10bf12 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SessionIsClosedA.aspx @@ -0,0 +1,16 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SessionIsClosedA.aspx.cs" Inherits="SessionIsClosedA" %> + + + + + + Untitled Page + + +
+
+ +
+
+ + diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SessionIsClosedA.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SessionIsClosedA.aspx.cs new file mode 100644 index 00000000..c0ea808d --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SessionIsClosedA.aspx.cs @@ -0,0 +1,46 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; +using Spring.Entities; +using NHibernate; + +public partial class SessionIsClosedA : System.Web.UI.Page +{ + private IConversationState conversation; + /// + /// + /// + public IConversationState Conversation + { + get { return conversation; } + set { conversation = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + this.Session["result"] = "NOT OK"; + + try + { + this.Conversation.StartResumeConversation(); + + //database access + ISession session = this.Conversation.SessionFactory.GetCurrentSession(); + SPCMasterEnt sPCMasterEnt = session.Get(1); + + this.Session["result"] = "OK"; + } + catch (Exception ex) + { + this.Session["result"] = ex.Message; + } + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SessionIsClosedB.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SessionIsClosedB.aspx new file mode 100644 index 00000000..0571bfd2 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SessionIsClosedB.aspx @@ -0,0 +1,16 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SessionIsClosedB.aspx.cs" Inherits="SessionIsClosedB" %> + + + + + + Untitled Page + + +
+
+ +
+
+ + diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SessionIsClosedB.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SessionIsClosedB.aspx.cs new file mode 100644 index 00000000..920b98a7 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/SessionIsClosedB.aspx.cs @@ -0,0 +1,71 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; +using Spring.Entities; +using NHibernate; + +public partial class SessionIsClosedB : System.Web.UI.Page +{ + private IConversationState conversation; + /// + /// + /// + public IConversationState Conversation + { + get { return conversation; } + set { conversation = value; } + } + + private IConversationState conversationA; + /// + /// "convASessionIsClosed" + /// + public IConversationState ConversationA + { + get { return conversationA; } + set { conversationA = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + this.Session["result"] = "NOT OK"; + + try + { + if ("endA_FreeEnded".Equals(this.Request["command"])) + { + this.Conversation.StartResumeConversation(); + + /* + * Producing the error "HibernateException: Session is closed..." This is because in + * "SessionPerConversationScope.LazySessionPerConversationHolder.CloseConversation(IConversationState)" + * we are closing the "SessionPerConversationScope.LazySessionPerConversationHolder.activeConversation" + * instead of parameter "conversation" (BUG). + */ + this.ConversationA.EndConversation(); + this.ConversationA.ConversationManager.FreeEnded(); + this.Conversation.ConversationManager.PauseConversations(); + } + + this.Conversation.StartResumeConversation(); + + //database access + ISession session = this.Conversation.SessionFactory.GetCurrentSession(); + SPCMasterEnt sPCMasterEnt = session.Get(1); + + this.Session["result"] = "OK"; + } + catch (Exception ex) + { + this.Session["result"] = ex.Message; + } + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/TimeOut_NoTimeOut.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/TimeOut_NoTimeOut.aspx new file mode 100644 index 00000000..1a3eda9a --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/TimeOut_NoTimeOut.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TimeOut_NoTimeOut.aspx.cs" Inherits="TimeOut_NoTimeOut" %><% +Response.Write("OK"); +%> \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/TimeOut_NoTimeOut.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/TimeOut_NoTimeOut.aspx.cs new file mode 100644 index 00000000..c258f3ee --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/TimeOut_NoTimeOut.aspx.cs @@ -0,0 +1,32 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; + +public partial class TimeOut_NoTimeOut : System.Web.UI.Page +{ + private IConversationState conversation; + public IConversationState Conversation + { + get { return conversation; } + set { conversation = value; } + } + protected void Page_Load(object sender, EventArgs e) + { + this.Conversation.StartResumeConversation(); + + this.Session["keyTimeOut_Old"] = Conversation["keyTimeOut"]; + Conversation["keyTimeOut"] = "this is the new value"; + this.Session["keyTimeOut_New"] = Conversation["keyTimeOut"]; + + //This should not cause the end of the conversation by timeout + this.Conversation.LastAccess = DateTime.Now.AddMilliseconds(-(this.Conversation.TimeOut / 2)); + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/TimeOut_WithTimeOut.aspx b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/TimeOut_WithTimeOut.aspx new file mode 100644 index 00000000..2ca44957 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/TimeOut_WithTimeOut.aspx @@ -0,0 +1,3 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TimeOut_WithTimeOut.aspx.cs" Inherits="TimeOut_WithTimeOut" %><% +Response.Write("OK"); +%> \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/TimeOut_WithTimeOut.aspx.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/TimeOut_WithTimeOut.aspx.cs new file mode 100644 index 00000000..2ea5175a --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/TimeOut_WithTimeOut.aspx.cs @@ -0,0 +1,27 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Spring.ConversationWA; + +public partial class TimeOut_WithTimeOut : System.Web.UI.Page +{ + private IConversationState conversation; + public IConversationState Conversation + { + get { return conversation; } + set { conversation = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + //This should cause the end of the conversation by timeout + this.Conversation.LastAccess = DateTime.Now.AddMilliseconds(-(this.Conversation.TimeOut * 2)); + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/Web.Config b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/Web.Config new file mode 100644 index 00000000..d8db7f1e --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/Web.Config @@ -0,0 +1,97 @@ + + + + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/log4net.config b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/log4net.config new file mode 100644 index 00000000..5a27fc7b --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/log4net.config @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/services.xml.config b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/services.xml.config new file mode 100644 index 00000000..61ae00aa --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/services.xml.config @@ -0,0 +1,340 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + conversationManager + conversationManagerEndPaused + convMngEndPausedSessionIsClosed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Spring.ConversationWA.NH32.Tests + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/sqlite/conversationTests.db b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/sqlite/conversationTests.db new file mode 100644 index 00000000..1a2004ab Binary files /dev/null and b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/sqlite/conversationTests.db differ diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/web.config.net-2.0 b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/web.config.net-2.0 new file mode 100644 index 00000000..47c16f16 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Data/Spring/ConversationWA/WebConversationStateTest/web.config.net-2.0 @@ -0,0 +1,97 @@ + + + + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Entities/SPCDetailEnt.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Entities/SPCDetailEnt.cs new file mode 100644 index 00000000..28666448 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Entities/SPCDetailEnt.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Spring.ConversationWA; + +namespace Spring.Entities +{ + /// + /// Detail Entity for 'session-per-conversation' tests: + /// , + /// + /// + /// Hailton de Castro + public class SPCDetailEnt + { + private Int32? id; + /// + /// Entity key + /// + public virtual Int32? Id + { + get { return id; } + set { id = value; } + } + + private String description; + /// + /// Description + /// + public virtual String Description + { + get { return description; } + set { description = value; } + } + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Entities/SPCDetailEnt.hbm.xml b/test/Spring/Spring.ConversationWA.NH32.Tests/Entities/SPCDetailEnt.hbm.xml new file mode 100644 index 00000000..fd065967 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Entities/SPCDetailEnt.hbm.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Entities/SPCMasterEnt.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Entities/SPCMasterEnt.cs new file mode 100644 index 00000000..7e50db53 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Entities/SPCMasterEnt.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Spring.ConversationWA; + +namespace Spring.Entities +{ + /// + /// Master Entity for 'session-per-conversation' tests: + /// , + /// + /// + /// Hailton de Castro + public class SPCMasterEnt + { + private Int32? id; + /// + /// Entity key + /// + public virtual Int32? Id + { + get { return id; } + set { id = value; } + } + + private String description; + /// + /// Description + /// + public virtual String Description + { + get { return description; } + set { description = value; } + } + + private IList sPCDetailEntList; + /// + /// one-to-many relationship. + /// + public virtual IList SPCDetailEntList + { + get { return sPCDetailEntList; } + set { sPCDetailEntList = value; } + } + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Entities/SPCMasterEnt.hbm.xml b/test/Spring/Spring.ConversationWA.NH32.Tests/Entities/SPCMasterEnt.hbm.xml new file mode 100644 index 00000000..80418909 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Entities/SPCMasterEnt.hbm.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Spring.ConversationWA.NH32.Tests.2008.csproj b/test/Spring/Spring.ConversationWA.NH32.Tests/Spring.ConversationWA.NH32.Tests.2008.csproj new file mode 100644 index 00000000..81beef06 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Spring.ConversationWA.NH32.Tests.2008.csproj @@ -0,0 +1,148 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {2FB16852-22AD-4A5B-885A-97136265CC46} + Library + Properties + Spring + Spring.ConversationWA.NH32.Tests + + + 2.0 + v3.5 + + + + + + + true + full + false + ..\..\..\build\VS.Net.2008\Spring.ConversationWA.NH32.Tests\Debug\ + DEBUG;TRACE + prompt + 4 + ..\..\..\build\VS.Net.2008\Spring.ConversationWA.NH32.Tests\Debug\Spring.ConversationWA.NH32.Tests.XML + Program + $(MSBuildProjectDirectory)\..\..\dependencies\tools\NUnit-2.6.0.12051\bin\nunit-x86.exe + "$(MSBuildProjectDirectory)\$(OutputPath)\$(AssemblyName).dll" + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\lib\Net\2.0\Common.Logging.dll + + + False + ..\..\..\lib\NHibernate32\net\3.5\NHibernate.dll + + + False + ..\..\..\lib\Net\2.0\nunit.framework.dll + + + False + ..\..\..\lib\Net\2.0\NUnitAspEx.dll + + + + 3.5 + + + + False + lib\net\2.0\System.Data.SQLite.dll + + + + + + + CommonAssemblyInfo.cs + + + + + + + ASPXCodeBehind + + + ASPXCodeBehind + + + + + + + + + + {3A3A4E65-45A6-4B20-B460-0BEDC302C02C} + Spring.Aop.2008 + + + {64400FF8-2E9F-4809-B5F4-0C7EB8ABFF87} + Spring.ConversationWA.NH32.2008 + + + {710961A3-0DF4-49E4-A26E-F5B9C044AC84} + Spring.Core.2008 + + + {1C8E0481-A70D-445E-AB4D-4A963CF7DC83} + Spring.Data.NHibernate32.2008 + + + {AE00E5AB-C39A-436F-86D2-33BFE33E2E40} + Spring.Data.2008 + + + {BA4789EB-281A-48EA-8763-28B9F0596A18} + Spring.Web.2008 + + + + + + + + + + + + + + + + + + + + + + echo "Copying TestWebs to output directory" +rd /S /Q "$(TargetDir)Data" +xcopy "$(ProjectDir)Data" "$(TargetDir)Data\" /y /s +rd /S /Q "$(TargetDir)Data\Spring\ConversationWA\WebConversationStateTest\Bin" + + + \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Spring.ConversationWA.NH32.Tests.2010.csproj b/test/Spring/Spring.ConversationWA.NH32.Tests/Spring.ConversationWA.NH32.Tests.2010.csproj new file mode 100644 index 00000000..ec361913 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Spring.ConversationWA.NH32.Tests.2010.csproj @@ -0,0 +1,184 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {2FB16852-22AD-4A5B-885A-97136265CC46} + Library + Properties + Spring + Spring.ConversationWA.NH32.Tests + + + 3.5 + v4.0 + + + http://localhost/Spring.ConversationWA.NH32.Tests/ + true + Web + true + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + true + false + true + + + true + full + false + ..\..\..\build\VS.Net.2010\Spring.ConversationWA.NH32.Tests\Debug\ + DEBUG;TRACE + prompt + 4 + ..\..\..\build\VS.Net.2010\Spring.ConversationWA.NH32.Tests\Debug\Spring.ConversationWA.NH32.Tests.XML + Program + $(MSBuildProjectDirectory)\..\..\dependencies\tools\NUnit-2.6.0.12051\bin\nunit-x86.exe + "$(MSBuildProjectDirectory)\$(OutputPath)\$(AssemblyName).dll" + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\lib\Net\2.0\Common.Logging.dll + + + False + ..\..\..\lib\NHibernate32\net\3.5\NHibernate.dll + + + False + ..\..\..\lib\Net\2.0\nunit.framework.dll + + + False + ..\..\..\lib\Net\2.0\NUnitAspEx.dll + + + + 3.5 + + + + False + lib\net\2.0\System.Data.SQLite.dll + + + + + + + CommonAssemblyInfo.cs + + + + + + + ASPXCodeBehind + + + ASPXCodeBehind + + + + + + + + + + {3A3A4E65-45A6-4B20-B460-0BEDC302C02C} + Spring.Aop.2010 + + + {64400FF8-2E9F-4809-B5F4-0C7EB8ABFF87} + Spring.ConversationWA.NH32.2010 + + + {710961A3-0DF4-49E4-A26E-F5B9C044AC84} + Spring.Core.2010 + + + {9F0F739C-876E-4C4B-AA55-9AC9242C25C8} + Spring.Data.NHibernate32.2010 + + + {AE00E5AB-C39A-436F-86D2-33BFE33E2E40} + Spring.Data.2010 + + + {BA4789EB-281A-48EA-8763-28B9F0596A18} + Spring.Web.2010 + + + + + + + + + + + + + + + + + + + + + False + Microsoft .NET Framework 4 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + + echo "Copying TestWebs to output directory" +rd /S /Q "$(TargetDir)Data" +xcopy "$(ProjectDir)Data" "$(TargetDir)Data\" /y /s +rd /S /Q "$(TargetDir)Data\Spring\ConversationWA\WebConversationStateTest\Bin" + + + \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Spring.ConversationWA.NH32.Tests.build b/test/Spring/Spring.ConversationWA.NH32.Tests/Spring.ConversationWA.NH32.Tests.build new file mode 100644 index 00000000..b0a4fd3c --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Spring.ConversationWA.NH32.Tests.build @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/Spring/Data/Common/CountGetConnDbProvider.cs b/test/Spring/Spring.ConversationWA.NH32.Tests/Spring/Data/Common/CountGetConnDbProvider.cs new file mode 100644 index 00000000..66f4a0bc --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/Spring/Data/Common/CountGetConnDbProvider.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Spring.Data.Common; +using System.Data; + +namespace Spring.Spring.Data.Common +{ + /// + /// Count the number of calls to "CreateConnection()". + /// + public class CountGetConnDbProvider : DelegatingDbProvider + { + /// + /// Count of calls to + /// + public static Int32 Count = 0; + + /// + /// Count. + /// + /// + public override IDbConnection CreateConnection() + { + Count++; + return this.TargetDbProvider.CreateConnection(); + } + } +} diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/app.config b/test/Spring/Spring.ConversationWA.NH32.Tests/app.config new file mode 100644 index 00000000..15184ef6 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH32.Tests/app.config @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/lib/Mono/2.0/System.Data.SQLite.dll b/test/Spring/Spring.ConversationWA.NH32.Tests/lib/Mono/2.0/System.Data.SQLite.dll new file mode 100644 index 00000000..698d501d Binary files /dev/null and b/test/Spring/Spring.ConversationWA.NH32.Tests/lib/Mono/2.0/System.Data.SQLite.dll differ diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/lib/net/2.0/System.Data.SQLite.dll b/test/Spring/Spring.ConversationWA.NH32.Tests/lib/net/2.0/System.Data.SQLite.dll new file mode 100644 index 00000000..698d501d Binary files /dev/null and b/test/Spring/Spring.ConversationWA.NH32.Tests/lib/net/2.0/System.Data.SQLite.dll differ diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/lib/net/3.5/System.Data.SQLite.dll b/test/Spring/Spring.ConversationWA.NH32.Tests/lib/net/3.5/System.Data.SQLite.dll new file mode 100644 index 00000000..698d501d Binary files /dev/null and b/test/Spring/Spring.ConversationWA.NH32.Tests/lib/net/3.5/System.Data.SQLite.dll differ diff --git a/test/Spring/Spring.ConversationWA.NH32.Tests/lib/net/4.0/System.Data.SQLite.dll b/test/Spring/Spring.ConversationWA.NH32.Tests/lib/net/4.0/System.Data.SQLite.dll new file mode 100644 index 00000000..698d501d Binary files /dev/null and b/test/Spring/Spring.ConversationWA.NH32.Tests/lib/net/4.0/System.Data.SQLite.dll differ diff --git a/test/Spring/Spring.ConversationWA.NH33.Tests/Data/Spring/ConversationWA/WebConversationStateTest/Web.Config b/test/Spring/Spring.ConversationWA.NH33.Tests/Data/Spring/ConversationWA/WebConversationStateTest/Web.Config new file mode 100644 index 00000000..b84471fd --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH33.Tests/Data/Spring/ConversationWA/WebConversationStateTest/Web.Config @@ -0,0 +1,97 @@ + + + + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH33.Tests/Data/Spring/ConversationWA/WebConversationStateTest/services.xml.config b/test/Spring/Spring.ConversationWA.NH33.Tests/Data/Spring/ConversationWA/WebConversationStateTest/services.xml.config new file mode 100644 index 00000000..d7172cf3 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH33.Tests/Data/Spring/ConversationWA/WebConversationStateTest/services.xml.config @@ -0,0 +1,340 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + conversationManager + conversationManagerEndPaused + convMngEndPausedSessionIsClosed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Spring.ConversationWA.NH33.Tests + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH33.Tests/Data/Spring/ConversationWA/WebConversationStateTest/web.config.net-2.0 b/test/Spring/Spring.ConversationWA.NH33.Tests/Data/Spring/ConversationWA/WebConversationStateTest/web.config.net-2.0 new file mode 100644 index 00000000..b84471fd --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH33.Tests/Data/Spring/ConversationWA/WebConversationStateTest/web.config.net-2.0 @@ -0,0 +1,97 @@ + + + + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH33.Tests/Entities/SPCDetailEnt.hbm.xml b/test/Spring/Spring.ConversationWA.NH33.Tests/Entities/SPCDetailEnt.hbm.xml new file mode 100644 index 00000000..570c2be2 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH33.Tests/Entities/SPCDetailEnt.hbm.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/test/Spring/Spring.ConversationWA.NH33.Tests/Entities/SPCMasterEnt.hbm.xml b/test/Spring/Spring.ConversationWA.NH33.Tests/Entities/SPCMasterEnt.hbm.xml new file mode 100644 index 00000000..c9552a1a --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH33.Tests/Entities/SPCMasterEnt.hbm.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/test/Spring/Spring.ConversationWA.NH33.Tests/Spring.ConversationWA.NH33.Tests.2008.csproj b/test/Spring/Spring.ConversationWA.NH33.Tests/Spring.ConversationWA.NH33.Tests.2008.csproj new file mode 100644 index 00000000..3c2a9d1f --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH33.Tests/Spring.ConversationWA.NH33.Tests.2008.csproj @@ -0,0 +1,174 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {C57B05EA-FD1A-40EC-BB60-D2E45AB1A86A} + Library + Properties + Spring + Spring.ConversationWA.NH33.Tests + + + 2.0 + v3.5 + + + + + + + true + full + false + ..\..\..\build\VS.Net.2008\Spring.ConversationWA.NH33.Tests\Debug\ + DEBUG;TRACE + prompt + 4 + + + Program + $(MSBuildProjectDirectory)\..\..\dependencies\tools\NUnit-2.6.0.12051\bin\nunit-x86.exe + "$(MSBuildProjectDirectory)\$(OutputPath)\$(AssemblyName).dll" + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\lib\Net\2.0\Common.Logging.dll + + + False + ..\..\..\lib\Net\2.0\log4net.dll + + + False + ..\..\..\lib\NHibernate33\net\3.5\NHibernate.dll + + + False + ..\..\..\lib\Net\2.0\nunit.framework.dll + + + False + ..\..\..\lib\Net\2.0\NUnitAspEx.dll + + + + 3.5 + + + + False + ..\Spring.ConversationWA.NH32.Tests\lib\net\2.0\System.Data.SQLite.dll + + + + + + + CommonAssemblyInfo.cs + + + Bsn\ConversationEvidenceBsnImpl.cs + + + Bsn\IConversationEvidenceBsn.cs + + + Bsn\INoDeferedErrorBsn.cs + + + Bsn\NoDeferedErrorBsnImpl.cs + + + ConversationWA\PatialEndConvBeginBasePage.cs + ASPXCodeBehind + + + ConversationWA\PatialEndConvEndBasePage.cs + ASPXCodeBehind + + + ConversationWA\WebConversationStateTest.cs + + + Entities\SPCDetailEnt.cs + + + Entities\SPCMasterEnt.cs + + + Spring\Data\Common\CountGetConnDbProvider.cs + + + + + {3A3A4E65-45A6-4B20-B460-0BEDC302C02C} + Spring.Aop.2008 + + + {64400FF8-2E9F-4809-B5F4-0C7EB8ABFF87} + Spring.ConversationWA.NH33.2008 + + + {710961A3-0DF4-49E4-A26E-F5B9C044AC84} + Spring.Core.2008 + + + {67EA5988-C54E-4348-BFFB-E4A61F26143C} + Spring.Data.NHibernate33.2008 + + + {AE00E5AB-C39A-436F-86D2-33BFE33E2E40} + Spring.Data.2008 + + + {BA4789EB-281A-48EA-8763-28B9F0596A18} + Spring.Web.2008 + + + + + + + + + + + + + + Data\Spring\ConversationWA\WebConversationStateTest\log4net.config + + + + + + + + + + + echo "Copying TestWebs to output directory" +rd /S /Q "$(TargetDir)Data" +xcopy "$(ProjectDir)..\Spring.ConversationWA.NH32.Tests\Data" "$(TargetDir)Data\" /y /s +xcopy "$(ProjectDir)Data" "$(TargetDir)Data\" /y /s +rd /S /Q "$(TargetDir)Data\Spring\ConversationWA\WebConversationStateTest\Bin" + + + \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH33.Tests/Spring.ConversationWA.NH33.Tests.2010.csproj b/test/Spring/Spring.ConversationWA.NH33.Tests/Spring.ConversationWA.NH33.Tests.2010.csproj new file mode 100644 index 00000000..ed2bb98c --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH33.Tests/Spring.ConversationWA.NH33.Tests.2010.csproj @@ -0,0 +1,206 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {C57B05EA-FD1A-40EC-BB60-D2E45AB1A86A} + Library + Properties + Spring + Spring.ConversationWA.NH33.Tests + + + 3.5 + v4.0 + + + http://localhost/Spring.ConversationWA.NH33.Tests/ + true + Web + true + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + true + false + true + + + true + full + false + ..\..\..\build\VS.Net.2010\Spring.ConversationWA.NH33.Tests\Debug\ + DEBUG;TRACE + prompt + 4 + + + Program + $(MSBuildProjectDirectory)\..\..\dependencies\tools\NUnit-2.6.0.12051\bin\nunit-x86.exe + "$(MSBuildProjectDirectory)\$(OutputPath)\$(AssemblyName).dll" + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\lib\Net\2.0\Common.Logging.dll + + + False + ..\..\..\lib\NHibernate33\net\3.5\NHibernate.dll + + + False + ..\..\..\lib\Net\2.0\nunit.framework.dll + + + False + ..\..\..\lib\Net\2.0\NUnitAspEx.dll + + + + 3.5 + + + + False + ..\Spring.ConversationWA.NH32.Tests\lib\net\2.0\System.Data.SQLite.dll + + + + + + + CommonAssemblyInfo.cs + + + Bsn\ConversationEvidenceBsnImpl.cs + + + Bsn\IConversationEvidenceBsn.cs + + + Bsn\INoDeferedErrorBsn.cs + + + Bsn\NoDeferedErrorBsnImpl.cs + + + ConversationWA\PatialEndConvBeginBasePage.cs + ASPXCodeBehind + + + ConversationWA\PatialEndConvEndBasePage.cs + ASPXCodeBehind + + + ConversationWA\WebConversationStateTest.cs + + + Entities\SPCDetailEnt.cs + + + Entities\SPCMasterEnt.cs + + + Spring\Data\Common\CountGetConnDbProvider.cs + + + + + {3A3A4E65-45A6-4B20-B460-0BEDC302C02C} + Spring.Aop.2010 + + + {CF375928-B6D5-485C-B04D-2BC41D9DBF1E} + Spring.ConversationWA.NH33.2010 + + + {710961A3-0DF4-49E4-A26E-F5B9C044AC84} + Spring.Core.2010 + + + {D546EFB7-9F6C-4C11-B2F8-B85FAD135399} + Spring.Data.NHibernate33.2010 + + + {AE00E5AB-C39A-436F-86D2-33BFE33E2E40} + Spring.Data.2010 + + + {BA4789EB-281A-48EA-8763-28B9F0596A18} + Spring.Web.2010 + + + + + + + + + + + + + + Data\Spring\ConversationWA\WebConversationStateTest\log4net.config + + + + + + + + + + False + Microsoft .NET Framework 4 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + + echo "Copying TestWebs to output directory" +rd /S /Q "$(TargetDir)Data" +xcopy "$(ProjectDir)..\Spring.ConversationWA.NH32.Tests\Data" "$(TargetDir)Data\" /y /s +xcopy "$(ProjectDir)Data" "$(TargetDir)Data\" /y /s +rd /S /Q "$(TargetDir)Data\Spring\ConversationWA\WebConversationStateTest\Bin" + + + \ No newline at end of file diff --git a/test/Spring/Spring.ConversationWA.NH33.Tests/Spring.ConversationWA.NH33.Tests.build b/test/Spring/Spring.ConversationWA.NH33.Tests/Spring.ConversationWA.NH33.Tests.build new file mode 100644 index 00000000..8d71ee46 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH33.Tests/Spring.ConversationWA.NH33.Tests.build @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/Spring/Spring.ConversationWA.NH33.Tests/app.config b/test/Spring/Spring.ConversationWA.NH33.Tests/app.config new file mode 100644 index 00000000..15184ef6 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH33.Tests/app.config @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/test/Spring/Spring.ConversationWA.NH33.Tests/nhibernate-mapping.xsd b/test/Spring/Spring.ConversationWA.NH33.Tests/nhibernate-mapping.xsd new file mode 100644 index 00000000..5c81a4b8 --- /dev/null +++ b/test/Spring/Spring.ConversationWA.NH33.Tests/nhibernate-mapping.xsd @@ -0,0 +1,1695 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A composite key may be modelled by a .NET class with a property for each key column. The class must be Serializable and override equals() and hashCode() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Namespace used to find not-Fully Qualified Type Names + + + + + Assembly used to find not-Fully Qualified Type Names + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + undefined|any|none|null|0|-1|... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The concrete collection should use a generic version or an object-based version. + + + + + + + + + + + + + + Types of polymorphism + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file