예제 #1
0
        public virtual void TestCriteriaQueryQueryWithValueInList()
		{
			string baseName = GetBaseName();
            SetUp(baseName);
			NeoDatis.Odb.ODB odb = Open(baseName);
			Profile p0 = new Profile("profile0"
				);
			p0.AddFunction(null);
			p0.AddFunction(new Function("f1"));
			p0.AddFunction(new Function("f2"));
			Profile p1 = new Profile("profile1"
				);
			p1.AddFunction(null);
			p1.AddFunction(new Function("f12"));
			p1.AddFunction(new Function("f22"));
			User user = new User("The user"
				, "themail", p0);
			User user2 = new User("The user2"
				, "themail2", p1);
			odb.Store(user);
			odb.Store(user2);
			odb.Close();
			odb = Open(baseName);
			Function f2bis = (Function)
				odb.GetObjects<Function> (new CriteriaQuery(Where.Equal("name", "f2"))).GetFirst();
			CriteriaQuery query = odb.CriteriaQuery(typeof(
				User), Where.Contain
				("profile.functions", f2bis));
			NeoDatis.Odb.Objects<User> l = odb.GetObjects<User>(query);
			AssertEquals(1, l.Count);
			user = (User)l.GetFirst();
			AssertEquals("The user", user.GetName());
			odb.Close();
		}
예제 #2
0
        public virtual void TestDeleteListElements()
		{
			string baseName = GetBaseName();
			NeoDatis.Odb.ODB odb = Open(baseName);
			NeoDatis.Odb.Test.VO.Login.Profile p = new NeoDatis.Odb.Test.VO.Login.Profile("name"
				);
			p.AddFunction(new NeoDatis.Odb.Test.VO.Login.Function("f1"));
			p.AddFunction(new NeoDatis.Odb.Test.VO.Login.Function("f2"));
			p.AddFunction(new NeoDatis.Odb.Test.VO.Login.Function("3"));
			odb.Store(p);
			odb.Close();
			odb = Open(baseName);
			NeoDatis.Odb.Objects<Profile> objects = odb.GetObjects<Profile>();
			while (objects.HasNext())
			{
				NeoDatis.Odb.Test.VO.Login.Profile profile = objects.Next();
                System.Collections.Generic.IList<Function> functions = profile.GetFunctions();
				for (int j = 0; j < functions.Count; j++)
				{
					odb.Delete(functions[j]);
				}
				odb.Delete(profile);
			}
			odb.Close();
		}
예제 #3
0
        public virtual void TestDeleteListElements()
        {
            string baseName = GetBaseName();

            NeoDatis.Odb.ODB odb = Open(baseName);
            NeoDatis.Odb.Test.VO.Login.Profile p = new NeoDatis.Odb.Test.VO.Login.Profile("name"
                                                                                          );
            p.AddFunction(new NeoDatis.Odb.Test.VO.Login.Function("f1"));
            p.AddFunction(new NeoDatis.Odb.Test.VO.Login.Function("f2"));
            p.AddFunction(new NeoDatis.Odb.Test.VO.Login.Function("3"));
            odb.Store(p);
            odb.Close();
            odb = Open(baseName);
            NeoDatis.Odb.Objects <Profile> objects = odb.GetObjects <Profile>();
            while (objects.HasNext())
            {
                NeoDatis.Odb.Test.VO.Login.Profile          profile   = objects.Next();
                System.Collections.Generic.IList <Function> functions = profile.GetFunctions();
                for (int j = 0; j < functions.Count; j++)
                {
                    odb.Delete(functions[j]);
                }
                odb.Delete(profile);
            }
            odb.Close();
        }
예제 #4
0
		/// <exception cref="System.Exception"></exception>
		public virtual void TestCriteriaQueryQueryWithObject()
		{
			string baseName = GetBaseName();
			NeoDatis.Odb.ODB odb = Open(baseName);
			Profile p0 = new Profile("profile0"
				);
			p0.AddFunction(null);
			p0.AddFunction(new Function("f1"));
			p0.AddFunction(new Function("f2"));
			Profile p1 = new Profile("profile1"
				);
			p1.AddFunction(null);
			p1.AddFunction(new Function("f12"));
			p1.AddFunction(new Function("f22"));
			User user = new User("The user"
				, "themail", p0);
			User user2 = new User("The user2"
				, "themail2", p1);
			odb.Store(user);
			odb.Store(user2);
			odb.Close();
			odb = Open(baseName);
			Profile pp = (Profile)odb.GetObjects<Profile>
				(new CriteriaQuery(Where.Equal("name", "profile0"))).GetFirst();
			CriteriaQuery query = new CriteriaQuery(Where.Equal("profile", pp));
			NeoDatis.Odb.Objects<User> l = odb.GetObjects<User>(query);
			AssertEquals(1, l.Count);
			user = (User)l.GetFirst();
			AssertEquals("The user", user.GetName());
			odb.Close();
		}
예제 #5
0
 private object GetInstance(string @string)
 {
     if (simpleObject)
     {
         return(new NeoDatis.Odb.Test.VO.Login.Function(@string));
     }
     NeoDatis.Odb.Test.VO.Login.Profile p = new NeoDatis.Odb.Test.VO.Login.Profile(@string
                                                                                   );
     p.AddFunction(new NeoDatis.Odb.Test.VO.Login.Function("function " + @string + "1"
                                                           ));
     p.AddFunction(new NeoDatis.Odb.Test.VO.Login.Function("function " + @string + "2"
                                                           ));
     NeoDatis.Odb.Test.VO.Login.User user = new NeoDatis.Odb.Test.VO.Login.User(@string
                                                                                , "email" + @string, p);
     return(user);
 }
예제 #6
0
        public virtual void Test1WithCommit3()
        {
            if (!runAll)
            {
                return;
            }
            NeoDatis.Tool.StopWatch stopWatch = new NeoDatis.Tool.StopWatch();
            stopWatch.Start();
            DeleteBase(FileName);
            NeoDatis.Odb.ODB odb = Open(FileName);
            Function         f1  = new Function(
                "function 1");

            Println(odb.Count(new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery(typeof(
                                                                                          User))));
            NeoDatis.Odb.Test.VO.Login.Profile p = new NeoDatis.Odb.Test.VO.Login.Profile("profile number 0"
                                                                                          , f1);
            p.AddFunction(new Function("f1"));
            User user = new User("user name 0"
                                 , "user email 0", p);

            odb.Store(user);
            NeoDatis.Odb.Test.VO.Login.Profile p2 = new NeoDatis.Odb.Test.VO.Login.Profile("profile number 0"
                                                                                           , f1);
            p2.AddFunction(new Function("f2"));
            User user2 = new User("user name 0"
                                  , "user email 0", p2);

            odb.Store(user2);
            odb.Close();
            odb = Open(FileName);
            NeoDatis.Odb.Objects <User> objects = null;
            for (int k = 0; k < 2; k++)
            {
                System.Console.Out.WriteLine(":" + k);
                objects = odb.GetObjects <User>();
                while (objects.HasNext())
                {
                    user = (User)objects.Next();
                    user.GetProfile().SetName(user.GetProfile().GetName() + "-updated");
                    Println(user.GetProfile().GetName());
                    odb.Store(user);
                }
            }
            odb.Close();
            odb     = Open(FileName);
            objects = odb.GetObjects <User>();
            AssertEquals(2, objects.Count);
            odb.Close();
        }
예제 #7
0
		/// <exception cref="System.Exception"></exception>
		public virtual void Test1WithCommit3()
		{
			if (!runAll)
			{
				return;
			}
			NeoDatis.Tool.StopWatch stopWatch = new NeoDatis.Tool.StopWatch();
			stopWatch.Start();
			DeleteBase(FileName);
			NeoDatis.Odb.ODB odb = Open(FileName);
			Function f1 = new Function(
				"function 1");
			Println(odb.Count(new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery(typeof(
				User))));
			NeoDatis.Odb.Test.VO.Login.Profile p = new NeoDatis.Odb.Test.VO.Login.Profile("profile number 0"
				, f1);
			p.AddFunction(new Function("f1"));
			User user = new User("user name 0"
				, "user email 0", p);
			odb.Store(user);
			NeoDatis.Odb.Test.VO.Login.Profile p2 = new NeoDatis.Odb.Test.VO.Login.Profile("profile number 0"
				, f1);
			p2.AddFunction(new Function("f2"));
			User user2 = new User("user name 0"
				, "user email 0", p2);
			odb.Store(user2);
			odb.Close();
			odb = Open(FileName);
			NeoDatis.Odb.Objects<User> objects = null;
			for (int k = 0; k < 2; k++)
			{
				System.Console.Out.WriteLine(":" + k);
				objects = odb.GetObjects<User>();
				while (objects.HasNext())
				{
					user = (User)objects.Next();
					user.GetProfile().SetName(user.GetProfile().GetName() + "-updated");
					Println(user.GetProfile().GetName());
					odb.Store(user);
				}
			}
			odb.Close();
			odb = Open(FileName);
			objects = odb.GetObjects<User>();
			AssertEquals(2, objects.Count);
			odb.Close();
		}
예제 #8
0
		/// <exception cref="System.Exception"></exception>
		public virtual void Test1WithCommit2()
		{
			if (!runAll)
			{
				return;
			}
			NeoDatis.Tool.StopWatch stopWatch = new NeoDatis.Tool.StopWatch();
			stopWatch.Start();
			int size = 2;
			int size2 = 1;
			int nbFunctions = 1;
			DeleteBase(FileName);
			NeoDatis.Odb.ODB odb = Open(FileName);
			Function f1 = new Function(
				"function 1");
			Println(odb.Count(new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery(typeof(
				User))));
			// Create Objects
			for (int i = 0; i < size; i++)
			{
				NeoDatis.Odb.Test.VO.Login.Profile p = new NeoDatis.Odb.Test.VO.Login.Profile("profile number "
					 + i, f1);
				for (int j = 0; j < nbFunctions; j++)
				{
					p.AddFunction(new Function(" inner function of profile : number "
						 + i + " - " + j));
				}
				User user = new User("user name "
					 + i, "user email " + i, p);
				odb.Store(user);
				if (i % 100 == 0)
				{
					Println("insert " + i);
				}
			}
			odb.Close();
			Println("created");
			// Updates 10 times the objects
			odb = Open(FileName);
			NeoDatis.Odb.Objects<User> objects = odb.GetObjects<User>();
			Println("got the object " + objects.Count);
			for (int k = 0; k < 3; k++)
			{
				objects.Reset();
				long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
				for (int i = 0; i < size; i++)
				{
					User user = (User)objects.Next
						();
					user.GetProfile().SetName(user.GetProfile().GetName() + "-updated");
					odb.Store(user);
					if (i % 100 == 0)
					{
						Println("update " + i + " - " + k);
					}
				}
				Println("Update " + k + " - " + (NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs
					() - start) + " ms");
			}
			Println("updated");
			Println("deleted");
			odb.Close();
			// Check object count
			odb = Open(FileName);
			objects = odb.GetObjects<User>();
			AssertEquals(objects.Count, size);
			// Check data of the objects
			int a = 0;
			while (objects.HasNext())
			{
				User user = (User)objects.Next
					();
				AssertEquals("user name " + a, user.GetName());
				AssertEquals("user email " + a, user.GetEmail());
				AssertEquals("profile number " + a + "-updated-updated-updated", user.GetProfile(
					).GetName());
				a++;
			}
			Println("checked");
			for (int k = 0; k < 10; k++)
			{
				objects.Reset();
				for (int i = 0; i < size2; i++)
				{
					User user = (User)objects.Next
						();
					user.GetProfile().SetName(user.GetProfile().GetName() + "-updated" + "-");
					odb.Store(user);
				}
			}
			Println("re-updated");
			odb.Close();
			// delete objects
			odb = Open(FileName);
			objects = odb.GetObjects<User>();
			a = 0;
			while (objects.HasNext())
			{
				odb.Delete(objects.Next());
				a++;
			}
			AssertEquals(size, a);
			odb.Close();
			odb = Open(FileName);
			AssertEquals(0, odb.GetObjects<User>().Count);
			AssertEquals(0, odb.Count(new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
				(typeof(User))));
			Println("deleted");
			odb.Close();
			stopWatch.End();
			Println("Total time 1 = " + stopWatch.GetDurationInMiliseconds());
			if (stopWatch.GetDurationInMiliseconds() > 90700)
			{
				Fail("time is > than " + 90700 + " = " + stopWatch.GetDurationInMiliseconds());
			}
		}
예제 #9
0
		/// <summary>
		/// 1) insert 10000 objects 2) update 5000 * 10 times 3) delete other 5000
		/// 4) check count : must be 5000 5) re-update 5000 * 10 times 6) delete the
		/// other 5000 7) check count - must be zero
		/// </summary>
		/// <exception cref="System.Exception">System.Exception</exception>
		public virtual void Test1WithoutCommit()
		{
			if (!runAll)
			{
				return;
			}
			NeoDatis.Tool.StopWatch stopWatch = new NeoDatis.Tool.StopWatch();
			stopWatch.Start();
			int size = 10000;
			int size2 = 5000;
			int nbFunctions = 10;
			DeleteBase(FileName);
			NeoDatis.Odb.ODB odb = Open(FileName);
			Function f1 = new Function(
				"function 1");
			// Create Objects
			for (int i = 0; i < size; i++)
			{
				NeoDatis.Odb.Test.VO.Login.Profile p = new NeoDatis.Odb.Test.VO.Login.Profile("profile number "
					 + i, f1);
				for (int j = 0; j < nbFunctions; j++)
				{
					p.AddFunction(new Function(" inner function of profile : number "
						 + i + " - " + j));
				}
				User user = new User("user name "
					 + i, "user email " + i, p);
				odb.Store(user);
			}
			Println("created");
			// Updates 10 times the objects
			NeoDatis.Odb.Objects<User> objects = odb.GetObjects<User>();
			for (int k = 0; k < 10; k++)
			{
				objects.Reset();
				for (int i = 0; i < size2; i++)
				{
					User user = (User)objects.Next
						();
					user.GetProfile().SetName(user.GetProfile().GetName() + "-updated");
					odb.Store(user);
				}
			}
			Println("updated");
			// Delete the rest of the objects
			for (int i = size2; i < size; i++)
			{
				odb.Delete(objects.Next());
			}
			Println("deleted");
			// Check object count
			objects = odb.GetObjects<User>();
			AssertEquals(size2, objects.Count);
			// Check data of the objects
			int a = 0;
			while (objects.HasNext())
			{
				User user = (User)objects.Next
					();
				AssertEquals("user name " + a, user.GetName());
				AssertEquals("user email " + a, user.GetEmail());
				AssertEquals("profile number " + a + "-updated-updated-updated-updated-updated-updated-updated-updated-updated-updated"
					, user.GetProfile().GetName());
				a++;
			}
			Println("checked");
			for (int k = 0; k < 10; k++)
			{
				objects.Reset();
				for (int i = 0; i < size2; i++)
				{
					User user = (User)objects.Next
						();
					user.GetProfile().SetName(user.GetProfile().GetName() + "-updated" + "-");
					odb.Store(user);
				}
			}
			Println("re-updated");
			objects = odb.GetObjects<User>();
			NeoDatis.Odb.Core.Layers.Layer3.IStorageEngine engine = NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.Dummy
				.GetEngine(odb);
			NeoDatis.Odb.Core.Layers.Layer2.Meta.CIZoneInfo uncommited = engine.GetSession(true
				).GetMetaModel().GetClassInfo(typeof(User).FullName, 
				true).GetUncommittedZoneInfo();
			NeoDatis.Odb.Core.Layers.Layer2.Meta.CIZoneInfo commited = engine.GetSession(true
				).GetMetaModel().GetClassInfo(typeof(User).FullName, 
				true).GetCommitedZoneInfo();
			Println("Before commit : uncommited=" + uncommited);
			Println("Before commit : commited=" + commited);
			a = 0;
			while (objects.HasNext())
			{
				// println("a="+a);
				odb.Delete(objects.Next());
				a++;
			}
			AssertEquals(size2, a);
			AssertEquals(0, odb.GetObjects<User>().Count);
			AssertEquals(0, odb.Count(new CriteriaQuery(typeof(User))));
			Println("deleted");
			odb.Close();
			stopWatch.End();
			Println("Total time 2 = " + stopWatch.GetDurationInMiliseconds());
			if (stopWatch.GetDurationInMiliseconds() > 108438)
			{
				Fail("time is > than " + 108438 + " = " + stopWatch.GetDurationInMiliseconds());
			}
		}
예제 #10
0
        public virtual void TestCriteriaQueryQueryWithValueInList2_with_null_object()
		{
			string baseName = GetBaseName();
            SetUp(baseName);
			NeoDatis.Odb.ODB odb = Open(baseName);
			Profile p0 = new Profile("profile0"
				);
			p0.AddFunction(new Function("f1"));
			p0.AddFunction(new Function("f2"));
			Profile p1 = new Profile("profile1"
				);
			p0.AddFunction(new Function("f12"));
			p0.AddFunction(new Function("f22"));
			User user = new User("The user"
				, "themail", p0);
			User user2 = new User("The user2"
				, "themail2", p1);
			odb.Store(user);
			odb.Store(user2);
			odb.Close();
			odb = Open(baseName);
			Function f2bis = new Function
				("f2");
			CriteriaQuery query = new CriteriaQuery
				(typeof(Profile), Where
				.Contain("functions", null));
			NeoDatis.Odb.Objects<Profile> l = odb.GetObjects<Profile>(query
				);
			AssertEquals(1, l.Count);
			p1 = l.GetFirst();
			AssertEquals("profile1", p1.GetName());
			odb.Close();
		}
예제 #11
0
        public virtual void Test1WithCommit2()
        {
            if (!runAll)
            {
                return;
            }
            NeoDatis.Tool.StopWatch stopWatch = new NeoDatis.Tool.StopWatch();
            stopWatch.Start();
            int size        = 2;
            int size2       = 1;
            int nbFunctions = 1;

            DeleteBase(FileName);
            NeoDatis.Odb.ODB odb = Open(FileName);
            Function         f1  = new Function(
                "function 1");

            Println(odb.Count(new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery(typeof(
                                                                                          User))));
            // Create Objects
            for (int i = 0; i < size; i++)
            {
                NeoDatis.Odb.Test.VO.Login.Profile p = new NeoDatis.Odb.Test.VO.Login.Profile("profile number "
                                                                                              + i, f1);
                for (int j = 0; j < nbFunctions; j++)
                {
                    p.AddFunction(new Function(" inner function of profile : number "
                                               + i + " - " + j));
                }
                User user = new User("user name "
                                     + i, "user email " + i, p);
                odb.Store(user);
                if (i % 100 == 0)
                {
                    Println("insert " + i);
                }
            }
            odb.Close();
            Println("created");
            // Updates 10 times the objects
            odb = Open(FileName);
            NeoDatis.Odb.Objects <User> objects = odb.GetObjects <User>();
            Println("got the object " + objects.Count);
            for (int k = 0; k < 3; k++)
            {
                objects.Reset();
                long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
                for (int i = 0; i < size; i++)
                {
                    User user = (User)objects.Next
                                    ();
                    user.GetProfile().SetName(user.GetProfile().GetName() + "-updated");
                    odb.Store(user);
                    if (i % 100 == 0)
                    {
                        Println("update " + i + " - " + k);
                    }
                }
                Println("Update " + k + " - " + (NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs
                                                     () - start) + " ms");
            }
            Println("updated");
            Println("deleted");
            odb.Close();
            // Check object count
            odb     = Open(FileName);
            objects = odb.GetObjects <User>();
            AssertEquals(objects.Count, size);
            // Check data of the objects
            int a = 0;

            while (objects.HasNext())
            {
                User user = (User)objects.Next
                                ();
                AssertEquals("user name " + a, user.GetName());
                AssertEquals("user email " + a, user.GetEmail());
                AssertEquals("profile number " + a + "-updated-updated-updated", user.GetProfile(
                                 ).GetName());
                a++;
            }
            Println("checked");
            for (int k = 0; k < 10; k++)
            {
                objects.Reset();
                for (int i = 0; i < size2; i++)
                {
                    User user = (User)objects.Next
                                    ();
                    user.GetProfile().SetName(user.GetProfile().GetName() + "-updated" + "-");
                    odb.Store(user);
                }
            }
            Println("re-updated");
            odb.Close();
            // delete objects
            odb     = Open(FileName);
            objects = odb.GetObjects <User>();
            a       = 0;
            while (objects.HasNext())
            {
                odb.Delete(objects.Next());
                a++;
            }
            AssertEquals(size, a);
            odb.Close();
            odb = Open(FileName);
            AssertEquals(0, odb.GetObjects <User>().Count);
            AssertEquals(0, odb.Count(new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
                                          (typeof(User))));
            Println("deleted");
            odb.Close();
            stopWatch.End();
            Println("Total time 1 = " + stopWatch.GetDurationInMiliseconds());
            if (stopWatch.GetDurationInMiliseconds() > 90700)
            {
                Fail("time is > than " + 90700 + " = " + stopWatch.GetDurationInMiliseconds());
            }
        }
예제 #12
0
        public virtual void Test1WithoutCommit()
        {
            if (!runAll)
            {
                return;
            }
            NeoDatis.Tool.StopWatch stopWatch = new NeoDatis.Tool.StopWatch();
            stopWatch.Start();
            int size        = 10000;
            int size2       = 5000;
            int nbFunctions = 10;

            DeleteBase(FileName);
            NeoDatis.Odb.ODB odb = Open(FileName);
            Function         f1  = new Function(
                "function 1");

            // Create Objects
            for (int i = 0; i < size; i++)
            {
                NeoDatis.Odb.Test.VO.Login.Profile p = new NeoDatis.Odb.Test.VO.Login.Profile("profile number "
                                                                                              + i, f1);
                for (int j = 0; j < nbFunctions; j++)
                {
                    p.AddFunction(new Function(" inner function of profile : number "
                                               + i + " - " + j));
                }
                User user = new User("user name "
                                     + i, "user email " + i, p);
                odb.Store(user);
            }
            Println("created");
            // Updates 10 times the objects
            NeoDatis.Odb.Objects <User> objects = odb.GetObjects <User>();
            for (int k = 0; k < 10; k++)
            {
                objects.Reset();
                for (int i = 0; i < size2; i++)
                {
                    User user = (User)objects.Next
                                    ();
                    user.GetProfile().SetName(user.GetProfile().GetName() + "-updated");
                    odb.Store(user);
                }
            }
            Println("updated");
            // Delete the rest of the objects
            for (int i = size2; i < size; i++)
            {
                odb.Delete(objects.Next());
            }
            Println("deleted");
            // Check object count
            objects = odb.GetObjects <User>();
            AssertEquals(size2, objects.Count);
            // Check data of the objects
            int a = 0;

            while (objects.HasNext())
            {
                User user = (User)objects.Next
                                ();
                AssertEquals("user name " + a, user.GetName());
                AssertEquals("user email " + a, user.GetEmail());
                AssertEquals("profile number " + a + "-updated-updated-updated-updated-updated-updated-updated-updated-updated-updated"
                             , user.GetProfile().GetName());
                a++;
            }
            Println("checked");
            for (int k = 0; k < 10; k++)
            {
                objects.Reset();
                for (int i = 0; i < size2; i++)
                {
                    User user = (User)objects.Next
                                    ();
                    user.GetProfile().SetName(user.GetProfile().GetName() + "-updated" + "-");
                    odb.Store(user);
                }
            }
            Println("re-updated");
            objects = odb.GetObjects <User>();
            NeoDatis.Odb.Core.Layers.Layer3.IStorageEngine engine = NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.Dummy
                                                                    .GetEngine(odb);
            NeoDatis.Odb.Core.Layers.Layer2.Meta.CIZoneInfo uncommited = engine.GetSession(true
                                                                                           ).GetMetaModel().GetClassInfo(typeof(User).FullName,
                                                                                                                         true).GetUncommittedZoneInfo();
            NeoDatis.Odb.Core.Layers.Layer2.Meta.CIZoneInfo commited = engine.GetSession(true
                                                                                         ).GetMetaModel().GetClassInfo(typeof(User).FullName,
                                                                                                                       true).GetCommitedZoneInfo();
            Println("Before commit : uncommited=" + uncommited);
            Println("Before commit : commited=" + commited);
            a = 0;
            while (objects.HasNext())
            {
                // println("a="+a);
                odb.Delete(objects.Next());
                a++;
            }
            AssertEquals(size2, a);
            AssertEquals(0, odb.GetObjects <User>().Count);
            AssertEquals(0, odb.Count(new CriteriaQuery(typeof(User))));
            Println("deleted");
            odb.Close();
            stopWatch.End();
            Println("Total time 2 = " + stopWatch.GetDurationInMiliseconds());
            if (stopWatch.GetDurationInMiliseconds() > 108438)
            {
                Fail("time is > than " + 108438 + " = " + stopWatch.GetDurationInMiliseconds());
            }
        }
예제 #13
0
		private object GetInstance(string @string)
		{
			if (simpleObject)
			{
				return new NeoDatis.Odb.Test.VO.Login.Function(@string);
			}
			NeoDatis.Odb.Test.VO.Login.Profile p = new NeoDatis.Odb.Test.VO.Login.Profile(@string
				);
			p.AddFunction(new NeoDatis.Odb.Test.VO.Login.Function("function " + @string + "1"
				));
			p.AddFunction(new NeoDatis.Odb.Test.VO.Login.Function("function " + @string + "2"
				));
			NeoDatis.Odb.Test.VO.Login.User user = new NeoDatis.Odb.Test.VO.Login.User(@string
				, "email" + @string, p);
			return user;
		}