From: <dar...@us...> - 2009-06-10 05:07:43
|
Revision: 4441 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4441&view=rev Author: darioquintana Date: 2009-06-10 05:07:21 +0000 (Wed, 10 Jun 2009) Log Message: ----------- Test applies to MsSQLServer 2005/2008 Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs 2009-06-10 04:45:36 UTC (rev 4440) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs 2009-06-10 05:07:21 UTC (rev 4441) @@ -11,11 +11,18 @@ [TestFixture] public class HQLFunctionFixture : TestCase { + private bool appliesToThisDialect = true; + protected override string MappingsAssembly { get { return "NHibernate.Test"; } } + protected override bool AppliesTo(Dialect.Dialect dialect) + { + return appliesToThisDialect; + } + protected override IList Mappings { get { return new[] {"HQL.Animal.hbm.xml", "HQL.MaterialResource.hbm.xml"}; } @@ -23,7 +30,10 @@ protected override void Configure(Configuration configuration) { - configuration.SetProperty(Environment.Dialect, typeof (CustomDialect).AssemblyQualifiedName); + if (Dialect is MsSql2005Dialect) + configuration.SetProperty(Environment.Dialect, typeof (CustomDialect).AssemblyQualifiedName); + else + appliesToThisDialect = false; } /// <summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2009-07-01 18:08:48
|
Revision: 4554 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4554&view=rev Author: darioquintana Date: 2009-07-01 18:07:38 +0000 (Wed, 01 Jul 2009) Log Message: ----------- merge r4552. NH-645 reopened: not working with AST-Hql. Tests rewritten Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs 2009-07-01 17:51:16 UTC (rev 4553) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs 2009-07-01 18:07:38 UTC (rev 4554) @@ -1,16 +1,38 @@ using System; using System.Collections; +using Antlr.Runtime.Tree; using NHibernate.Cfg; using NHibernate.Dialect; using NHibernate.Dialect.Function; +using NHibernate.Hql.Ast.ANTLR; +using NHibernate.Hql.Classic; using NUnit.Framework; -using Environment=NHibernate.Cfg.Environment; +using Environment = NHibernate.Cfg.Environment; namespace NHibernate.Test.NHSpecificTest.NH645 { [TestFixture] - public class HQLFunctionFixture : TestCase + public class HqlFunctionWithClassicParser : HQLFunctionFixtureBase { + protected override void Configure(Configuration configuration) + { + base.Configure(configuration); + configuration.SetProperty(Environment.QueryTranslator, typeof(ClassicQueryTranslatorFactory).AssemblyQualifiedName); + } + } + + [TestFixture, Ignore("Not fixed yet in the AST-HQL parser")] + public class HqlFunctionWithAstHqlParser : HQLFunctionFixtureBase + { + protected override void Configure(Configuration configuration) + { + base.Configure(configuration); + configuration.SetProperty(Environment.QueryTranslator, typeof(ASTQueryTranslatorFactory).AssemblyQualifiedName); + } + } + + public class HQLFunctionFixtureBase : TestCase + { private bool appliesToThisDialect = true; protected override string MappingsAssembly @@ -18,28 +40,49 @@ get { return "NHibernate.Test"; } } - protected override bool AppliesTo(Dialect.Dialect dialect) + protected override IList Mappings { - return appliesToThisDialect; + get { return new[] { "HQL.Animal.hbm.xml", "HQL.MaterialResource.hbm.xml" }; } } - protected override IList Mappings + protected override bool AppliesTo(Dialect.Dialect dialect) { - get { return new[] {"HQL.Animal.hbm.xml", "HQL.MaterialResource.hbm.xml"}; } + return appliesToThisDialect; } protected override void Configure(Configuration configuration) { if (Dialect is MsSql2005Dialect) - configuration.SetProperty(Environment.Dialect, typeof (CustomDialect).AssemblyQualifiedName); + configuration.SetProperty(Environment.Dialect, typeof(CustomDialect).AssemblyQualifiedName); else appliesToThisDialect = false; } + public void Run(string hql) + { + using (ISession s = OpenSession()) + try + { + s.CreateQuery(hql).List(); + } + catch (Exception ex) + { + if (IsClassicParser) + { + if (ex is QueryException) + Assert.Fail("The parser think that 'freetext' is a boolean function"); + } + else //Hql-Parser + { + if (ex is RewriteEmptyStreamException || ex is InvalidCastException) + Assert.Fail("The parser think that 'freetext' is a boolean function"); + } + } + } + /// <summary> /// Just test the parser can compile, and SqlException is expected. /// </summary> - [Test] public void SimpleWhere() { @@ -57,21 +100,6 @@ { Run("from Animal a where freetext(a.Description, 'hey apple car') AND a.Description <> 'foo'"); } - - - public void Run(string hql) - { - using(ISession s = OpenSession()) - try - { - s.CreateQuery(hql).List(); - } - catch (Exception ex) - { - if (ex is QueryException) - Assert.Fail("The parser think that 'freetext' is a boolean function"); - } - } } public class CustomDialect : MsSql2005Dialect This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dar...@us...> - 2009-07-01 18:46:04
|
Revision: 4556 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4556&view=rev Author: darioquintana Date: 2009-07-01 18:45:34 +0000 (Wed, 01 Jul 2009) Log Message: ----------- minor: marking as abstract to avoid the CI run this fixture Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs 2009-07-01 18:37:12 UTC (rev 4555) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs 2009-07-01 18:45:34 UTC (rev 4556) @@ -31,7 +31,7 @@ } } - public class HQLFunctionFixtureBase : TestCase + public abstract class HQLFunctionFixtureBase : TestCase { private bool appliesToThisDialect = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Tuna T. <te...@gm...> - 2009-07-01 18:48:06
|
It is a bug with NUnit Console Runner. Tuna Toksöz Eternal sunshine of the open source mind. http://devlicio.us/blogs/tuna_toksoz http://tunatoksoz.com http://twitter.com/tehlike On Wed, Jul 1, 2009 at 9:45 PM, <dar...@us...> wrote: > > minor: marking as abstract to avoid the CI run this fixture |
From: <fab...@us...> - 2009-07-05 04:17:17
|
Revision: 4579 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4579&view=rev Author: fabiomaulo Date: 2009-07-05 04:17:11 +0000 (Sun, 05 Jul 2009) Log Message: ----------- Removed ignore because fixed in r4576 Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs 2009-07-05 04:15:41 UTC (rev 4578) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs 2009-07-05 04:17:11 UTC (rev 4579) @@ -21,7 +21,7 @@ } } - [TestFixture, Ignore("Not fixed yet in the AST-HQL parser")] + [TestFixture] public class HqlFunctionWithAstHqlParser : HQLFunctionFixtureBase { protected override void Configure(Configuration configuration) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2011-04-11 18:15:37
|
Revision: 5669 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5669&view=rev Author: patearl Date: 2011-04-11 18:15:31 +0000 (Mon, 11 Apr 2011) Log Message: ----------- Tests: Fixed minor breakage due to namespace case change. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs 2011-04-11 17:41:57 UTC (rev 5668) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs 2011-04-11 18:15:31 UTC (rev 5669) @@ -41,7 +41,7 @@ protected override IList Mappings { - get { return new[] { "HQL.Animal.hbm.xml", "HQL.MaterialResource.hbm.xml" }; } + get { return new[] { "Hql.Animal.hbm.xml", "Hql.MaterialResource.hbm.xml" }; } } protected override bool AppliesTo(Dialect.Dialect dialect) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |