public void DeclarativeWithAttributes() { ITestObjectManager mgr = ctx["testObjectManager"] as ITestObjectManager; TestObjectDao dao = (TestObjectDao)ctx["testObjectDao"]; TransactionTemplateTests.PerformOperations(mgr, dao); }
public static void PerformOperations(ITestObjectManager mgr, ITestObjectDao dao) { Assert.IsNotNull(mgr); TestObject to1 = new TestObject(); to1.Name = "Jack"; to1.Age = 7; TestObject to2 = new TestObject(); to2.Name = "Jill"; to2.Age = 8; mgr.SaveTwoTestObjects(to1, to2); TestObject to = dao.FindByName("Jack"); Assert.IsNotNull(to); to = dao.FindByName("Jill"); Assert.IsNotNull(to); Assert.AreEqual("Jill", to.Name); mgr.DeleteTwoTestObjects("Jack", "Jill"); to = dao.FindByName("Jack"); Assert.IsNull(to); to = dao.FindByName("Jill"); Assert.IsNull(to); }
public void DeclarativeViaAutoProxyCreator() { ITestObjectManager mgr = ctx["testObjectManager"] as ITestObjectManager; TestObjectDao dao = (TestObjectDao)ctx["testObjectDao"]; PerformOperations(mgr, dao); }
public void DeclarativeViaTransactionProxyFactoryObject() { ITestObjectManager mgr = ctx["testObjectManagerTP"] as ITestObjectManager; ITestObjectDao dao = (ITestObjectDao)ctx["testObjectDao"]; PerformOperations(mgr, dao); }
public void DeclarativeViaProxyFactoryObject() { ITestObjectManager mgr = ctx["testObjectManagerPF"] as ITestObjectManager; TestObjectDao dao = (TestObjectDao)ctx["testObjectDao"]; PerformOperations(mgr, dao); }
public void TearDown() { ITestObjectManager testObjectManager = ctx["testObjectManager"] as ITestObjectManager; testObjectManager.DeleteTwoTestObjects("Jack", "Jill"); testObjectManager.DeleteAllTestObjects(); }
public void RollbackTestSetup() { // WELLKNOWN // NamespaceParserRegistry.RegisterParser(typeof (DatabaseNamespaceParser)); // NamespaceParserRegistry.RegisterParser(typeof (TxNamespaceParser)); // NamespaceParserRegistry.RegisterParser(typeof (AopNamespaceParser)); IApplicationContext ctx = new XmlApplicationContext( "assembly://Spring.Data.Integration.Tests/Spring.Data/TestTxIsolationLevel.xml"); Assert.IsNotNull(ctx); testObjectManager = ctx["testObjectManager"] as ITestObjectManager; Assert.IsNotNull(testObjectManager); }
public void SetUp() { ctx = new XmlApplicationContext("assembly://Spring.Data.Integration.Tests/Spring.Data/templateTests.xml"); dbProvider = ctx["DbProvider"] as IDbProvider; transactionManager = ctx["transactionManager"] as IPlatformTransactionManager; adoOperations = ctx["adoTemplate"] as IAdoOperations; ITestObjectManager testObjectManager = ctx["testObjectManager"] as ITestObjectManager; testObjectManager.DeleteAllTestObjects(); testObjectManager.SaveTwoTestObjects(new TestObject("Jack", 10), new TestObject("Jill", 20)); }
private void DeleteTestData() { ITestObjectManager testObjectManager = ctx["testObjectManager"] as ITestObjectManager; testObjectManager.DeleteAllTestObjects(); }
private void PopulateTestData() { ITestObjectManager testObjectManager = ctx["testObjectManager"] as ITestObjectManager; testObjectManager.SaveTwoTestObjects(new TestObject("Jack", 10), new TestObject("Jill", 20)); }