From: <dar...@us...> - 2009-02-06 17:27:07
|
Revision: 4060 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4060&view=rev Author: darioquintana Date: 2009-02-06 17:27:04 +0000 (Fri, 06 Feb 2009) Log Message: ----------- Test passing for dialect supporting SupportsIfExistsBeforeTableName (Postgres) Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1274ExportExclude/NH1274ExportExcludeFixture.cs Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1274ExportExclude/NH1274ExportExcludeFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1274ExportExclude/NH1274ExportExcludeFixture.cs 2009-02-06 16:42:39 UTC (rev 4059) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1274ExportExclude/NH1274ExportExcludeFixture.cs 2009-02-06 17:27:04 UTC (rev 4060) @@ -14,7 +14,6 @@ [TestFixture] public class NH1274ExportExcludeFixture { - [Test] public void SchemaExport_Drop_CreatesDropScript() { @@ -24,8 +23,19 @@ Console.SetOut(tw); export.Drop(true, false); string s = tw.ToString(); - Assert.IsTrue(s.Contains("drop table Home_Drop")); - Assert.IsTrue(s.Contains("drop table Home_All")); + + var dialect = Dialect.Dialect.GetDialect(configuration.Properties); + + if (dialect.SupportsIfExistsBeforeTableName) + { + Assert.IsTrue(s.Contains("drop table if exists Home_Drop")); + Assert.IsTrue(s.Contains("drop table if exists Home_All")); + } + else + { + Assert.IsTrue(s.Contains("drop table Home_Drop")); + Assert.IsTrue(s.Contains("drop table Home_All")); + } } [Test] @@ -37,8 +47,19 @@ Console.SetOut(tw); export.Create(true, false); string s = tw.ToString(); - Assert.IsTrue(s.Contains("drop table Home_Drop")); - Assert.IsTrue(s.Contains("drop table Home_All")); + + var dialect = Dialect.Dialect.GetDialect(configuration.Properties); + if (dialect.SupportsIfExistsBeforeTableName) + { + Assert.IsTrue(s.Contains("drop table if exists Home_Drop")); + Assert.IsTrue(s.Contains("drop table if exists Home_All")); + } + else + { + Assert.IsTrue(s.Contains("drop table Home_Drop")); + Assert.IsTrue(s.Contains("drop table Home_All")); + } + Assert.IsTrue(s.Contains("create table Home_All")); Assert.IsTrue(s.Contains("create table Home_Export")); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |