DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Private Member Functions | List of all members
Deveel.Data.ContextBasedTest Class Reference
Inheritance diagram for Deveel.Data.ContextBasedTest:
Deveel.Data.Client.DbConnectionTests Deveel.Data.Diagnostics.EventsTests Deveel.Data.Diagnostics.LoggerTests Deveel.Data.Linq.ContextQueryTests Deveel.Data.Linq.TableQueryTests Deveel.Data.Routines.FunctionBuildTests Deveel.Data.Routines.SystemFunctionTests Deveel.Data.Security.UserManagementTests Deveel.Data.SequenceManagerTests Deveel.Data.Spatial.SpatialFunctionsTest Deveel.Data.Sql.CreateTableTests Deveel.Data.Sql.CursorTests Deveel.Data.Sql.DropTableTests Deveel.Data.Sql.Expressions.SqlQueryExpressionTests Deveel.Data.Sql.InsertTests Deveel.Data.Sql.JoinTableTests Deveel.Data.Sql.MutableTableTests Deveel.Data.Sql.Statements.AlterTableStatementTests Deveel.Data.Sql.Statements.CreateTableStatementTests Deveel.Data.Sql.Statements.CreateUserStatementTests Deveel.Data.Sql.Statements.CreateViewStatementTests Deveel.Data.Sql.Statements.DeclareCursorStatementTests Deveel.Data.Sql.Statements.DropTableStatementTests Deveel.Data.Sql.Statements.GrantTests Deveel.Data.Sql.Statements.InsertIntoStatementTests Deveel.Data.Sql.Statements.OpenStatementTests Deveel.Data.Sql.Statements.SelectStatementTests Deveel.Data.Sql.Statements.UpdateStatementTests Deveel.Data.Sql.Triggers.TriggerListenTests Deveel.Data.Sql.Triggers.TriggerTests Deveel.Data.Sql.VariableTests Deveel.Data.Types.DataTypeParseTests Deveel.Data.Types.DataTypeParseTests Deveel.Data.Xml.XmlFunctionsTest

Classes

class  TestSystemBuilder
 

Public Member Functions

void TestSetUp ()
 
void TestFixtureSetUp ()
 
void TestTearDown ()
 
void TestFixtureTearDown ()
 

Protected Member Functions

virtual void RegisterServices (ServiceContainer container)
 
virtual ISystem CreateSystem ()
 
virtual IDatabase CreateDatabase (ISystem system, IConfiguration configuration)
 
virtual ISession CreateAdminSession (IDatabase database)
 
virtual IQuery CreateQuery (ISession session)
 
ISession CreateUserSession (string userName, string password)
 
virtual void OnSetUp (string testName)
 
virtual void OnTearDown ()
 

Protected Attributes

const string AdminUserName = "SA"
 
const string AdminPassword = "1234567890"
 
const string DatabaseName = "testdb"
 

Properties

virtual bool SingleContext [get]
 
IQuery Query [get, private set]
 
ISystem System [get, private set]
 
IDatabase Database [get, private set]
 
ISession Session [get, private set]
 

Private Member Functions

void CreateContext ()
 
void DisposeContext ()
 

Detailed Description

Definition at line 25 of file ContextBasedTest.cs.

Member Function Documentation

virtual ISession Deveel.Data.ContextBasedTest.CreateAdminSession ( IDatabase  database)
inlineprotectedvirtual
void Deveel.Data.ContextBasedTest.CreateContext ( )
inlineprivate

Definition at line 91 of file ContextBasedTest.cs.

91  {
92  System = CreateSystem();
93 
94  var dbConfig = new Configuration.Configuration();
95  dbConfig.SetValue("database.name", DatabaseName);
96 
97  Database = CreateDatabase(System, dbConfig);
100  }
virtual IQuery CreateQuery(ISession session)
virtual ISystem CreateSystem()
virtual ISession CreateAdminSession(IDatabase database)
virtual IDatabase CreateDatabase(ISystem system, IConfiguration configuration)
Configuration(bool isRoot)
Constructs the Configuration.
virtual IDatabase Deveel.Data.ContextBasedTest.CreateDatabase ( ISystem  system,
IConfiguration  configuration 
)
inlineprotectedvirtual

Definition at line 50 of file ContextBasedTest.cs.

50  {
51  return system.CreateDatabase(configuration, AdminUserName, AdminPassword);
52  }
virtual IQuery Deveel.Data.ContextBasedTest.CreateQuery ( ISession  session)
inlineprotectedvirtual
virtual ISystem Deveel.Data.ContextBasedTest.CreateSystem ( )
inlineprotectedvirtual

Reimplemented in Deveel.Data.Sql.Triggers.TriggerListenTests.

Definition at line 45 of file ContextBasedTest.cs.

45  {
46  var builder = new TestSystemBuilder(this);
47  return builder.BuildSystem();
48  }
ISession Deveel.Data.ContextBasedTest.CreateUserSession ( string  userName,
string  password 
)
inlineprotected

Definition at line 64 of file ContextBasedTest.cs.

64  {
65  return Database.CreateUserSession(userName, password);
66  }
void Deveel.Data.ContextBasedTest.DisposeContext ( )
inlineprivate

Definition at line 102 of file ContextBasedTest.cs.

102  {
103  if (Query != null)
104  Query.Dispose();
105 
106  if (Database != null)
107  Database.Dispose();
108 
109  if (System != null)
110  System.Dispose();
111 
112  Query = null;
113  Database = null;
114  Database = null;
115  System = null;
116  }
virtual void Deveel.Data.ContextBasedTest.OnSetUp ( string  testName)
inlineprotectedvirtual
virtual void Deveel.Data.ContextBasedTest.OnTearDown ( )
inlineprotectedvirtual

Definition at line 72 of file ContextBasedTest.cs.

72  {
73 
74  }
virtual void Deveel.Data.ContextBasedTest.RegisterServices ( ServiceContainer  container)
inlineprotectedvirtual
void Deveel.Data.ContextBasedTest.TestFixtureSetUp ( )
inline

Definition at line 86 of file ContextBasedTest.cs.

86  {
87  if (SingleContext)
88  CreateContext();
89  }
void Deveel.Data.ContextBasedTest.TestFixtureTearDown ( )
inline

Definition at line 127 of file ContextBasedTest.cs.

127  {
128  if (SingleContext)
129  DisposeContext();
130  }
void Deveel.Data.ContextBasedTest.TestSetUp ( )
inline

Definition at line 77 of file ContextBasedTest.cs.

77  {
78  if (!SingleContext)
79  CreateContext();
80 
81  var testName = TestContext.CurrentContext.Test.Name;
82  OnSetUp(testName);
83  }
virtual void OnSetUp(string testName)
void Deveel.Data.ContextBasedTest.TestTearDown ( )
inline

Definition at line 119 of file ContextBasedTest.cs.

119  {
120  OnTearDown();
121 
122  if (!SingleContext)
123  DisposeContext();
124  }

Member Data Documentation

const string Deveel.Data.ContextBasedTest.AdminPassword = "1234567890"
protected

Definition at line 27 of file ContextBasedTest.cs.

const string Deveel.Data.ContextBasedTest.AdminUserName = "SA"
protected

Definition at line 26 of file ContextBasedTest.cs.

const string Deveel.Data.ContextBasedTest.DatabaseName = "testdb"
protected

Definition at line 28 of file ContextBasedTest.cs.

Property Documentation

IDatabase Deveel.Data.ContextBasedTest.Database
getprivate setprotected

Definition at line 38 of file ContextBasedTest.cs.

IQuery Deveel.Data.ContextBasedTest.Query
getprivate setprotected

Definition at line 34 of file ContextBasedTest.cs.

ISession Deveel.Data.ContextBasedTest.Session
getprivate setprotected

Definition at line 40 of file ContextBasedTest.cs.

virtual bool Deveel.Data.ContextBasedTest.SingleContext
getprotected

Definition at line 30 of file ContextBasedTest.cs.

ISystem Deveel.Data.ContextBasedTest.System
getprivate setprotected

Definition at line 36 of file ContextBasedTest.cs.


The documentation for this class was generated from the following file: