AdoTemplate based implementation of ITestObjectDao data access layer.
Inheritance: Spring.Data.Core.AdoDaoSupport, ITestObjectDao
Beispiel #1
0
        public void DaoOperations()
        {
            IApplicationContext ctx =
                new XmlApplicationContext("assembly://Spring.Data.Integration.Tests/Spring.Data/templateTests.xml");

            Assert.IsNotNull(ctx);
            TestObjectDao dao = (TestObjectDao)ctx["testObjectDao"];

            dao.Create("George", 33);
            TestObject to = dao.FindByName("George");

            Assert.IsNotNull(to);
            Assert.AreEqual("George", to.Name);
            Assert.AreEqual(33, to.Age);

            to.Age = 34;
            dao.Update(to);

            TestObject to2 = dao.FindByName("George");

            Assert.AreEqual(34, to2.Age);

            dao.Delete("George");

            TestObject to3 = dao.FindByName("George");

            Assert.IsNull(to3);
        }
Beispiel #2
0
        public void DeclarativeWithAttributes()
        {
            ITestObjectManager mgr = ctx["testObjectManager"] as ITestObjectManager;
            TestObjectDao      dao = (TestObjectDao)ctx["testObjectDao"];

            TransactionTemplateTests.PerformOperations(mgr, dao);
        }
Beispiel #3
0
        public void DeclarativeViaAutoProxyCreator()
        {
            ITestObjectManager mgr = ctx["testObjectManager"] as ITestObjectManager;
            TestObjectDao      dao = (TestObjectDao)ctx["testObjectDao"];

            PerformOperations(mgr, dao);
        }
Beispiel #4
0
        public void DeclarativeViaProxyFactoryObject()
        {
            ITestObjectManager mgr = ctx["testObjectManagerPF"] as ITestObjectManager;
            TestObjectDao      dao = (TestObjectDao)ctx["testObjectDao"];

            PerformOperations(mgr, dao);
        }
        public void CoordinatorDeclarativeWithAttributes()
        {
            ITestCoordinator coord = ctx["testCoordinator"] as ITestCoordinator;
            TestObjectDao    dao   = (TestObjectDao)ctx["testObjectDao"];

            TransactionTemplateTests.PerformOperations(coord, dao);
        }
Beispiel #6
0
        public void SimpleDao2()
        {
            IApplicationContext ctx =
                new XmlApplicationContext("assembly://Spring.Data.Integration.Tests/Spring.Data/templateTests.xml");

            Assert.IsNotNull(ctx);
            TestObjectDao dao = (TestObjectDao)ctx["testObjectDao"];

            Assert.IsNotNull(dao);
            Assert.AreEqual(1, dao.GetCountByDelegate());
        }
Beispiel #7
0
        public void SimpleDao()
        {
            IApplicationContext ctx =
                new XmlApplicationContext("assembly://Spring.Data.Integration.Tests/Spring.Data/templateTests.xml");

            Assert.IsNotNull(ctx);
            TestObjectDao dao = (TestObjectDao)ctx["testObjectDao"];

            Assert.IsNotNull(dao);
            Assert.AreEqual(10, dao.GetCount());

            Assert.AreEqual(3, dao.GetCount(33));
            Assert.AreEqual(3, dao.GetCountByAltMethod(33));
            Assert.AreEqual(3, dao.GetCountByCommandSetter(33));
            Assert.AreEqual(2, dao.GetCount(33, "George"));
        }
Beispiel #8
0
 protected override void OnSetUp()
 {
     TestObjectDao.Cleanup();
     base.OnSetUp();
 }