Remove obsolete files.

pull/41/head
Lau 6 years ago
parent 1be52eecf8
commit 0c2fbad73c

@ -18,10 +18,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Jet", "src\EFCore.Je
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{A56C261D-351C-449B-8130-75F6FA76842C}"
ProjectSection(SolutionItems) = preProject
tools\CleanMSSQLLocalDB.cmd = tools\CleanMSSQLLocalDB.cmd
tools\DropAllDatabases.sql = tools\DropAllDatabases.sql
tools\Resources.tt = tools\Resources.tt
tools\ShrinkLocalDBModel.cmd = tools\ShrinkLocalDBModel.cmd
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Jet.Integration.Test", "test\EFCore.Jet.Integration.Test\EFCore.Jet.Integration.Test.csproj", "{50CA2970-B995-4D28-9F6C-F7CA4940F23A}"
@ -38,8 +35,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Jet.Tests", "test\EF
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Jet.Design.FunctionalTests", "test\EFCore.Jet.Design.FunctionalTest\EFCore.Jet.Design.FunctionalTests.csproj", "{543477FB-CF81-446D-AB02-1E41382DED5B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Data.Jet.PerformanceTest", "test\System.Data.Jet.PerformanceTest\System.Data.Jet.PerformanceTest.csproj", "{8A3F688D-AA42-4070-9813-293D19E7F023}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build help", "build help", "{20B764C9-8664-4609-A743-8CF32BA6CA69}"
ProjectSection(SolutionItems) = preProject
NuGet.Config = NuGet.Config
@ -148,18 +143,6 @@ Global
{543477FB-CF81-446D-AB02-1E41382DED5B}.Release|x64.Build.0 = Release|x64
{543477FB-CF81-446D-AB02-1E41382DED5B}.Release|x86.ActiveCfg = Release|Any CPU
{543477FB-CF81-446D-AB02-1E41382DED5B}.Release|x86.Build.0 = Release|Any CPU
{8A3F688D-AA42-4070-9813-293D19E7F023}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8A3F688D-AA42-4070-9813-293D19E7F023}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A3F688D-AA42-4070-9813-293D19E7F023}.Debug|x64.ActiveCfg = Debug|x64
{8A3F688D-AA42-4070-9813-293D19E7F023}.Debug|x64.Build.0 = Debug|x64
{8A3F688D-AA42-4070-9813-293D19E7F023}.Debug|x86.ActiveCfg = Debug|x86
{8A3F688D-AA42-4070-9813-293D19E7F023}.Debug|x86.Build.0 = Debug|x86
{8A3F688D-AA42-4070-9813-293D19E7F023}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A3F688D-AA42-4070-9813-293D19E7F023}.Release|Any CPU.Build.0 = Release|Any CPU
{8A3F688D-AA42-4070-9813-293D19E7F023}.Release|x64.ActiveCfg = Release|x64
{8A3F688D-AA42-4070-9813-293D19E7F023}.Release|x64.Build.0 = Release|x64
{8A3F688D-AA42-4070-9813-293D19E7F023}.Release|x86.ActiveCfg = Release|Any CPU
{8A3F688D-AA42-4070-9813-293D19E7F023}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -172,7 +155,6 @@ Global
{3C88D49A-7EF2-42BA-A8D7-9DF7D358FD24} = {6A8DE399-1804-4113-A408-F23B7F5C9CAC}
{C38B58D7-F346-40A2-9849-D12CB9EC5C69} = {6A8DE399-1804-4113-A408-F23B7F5C9CAC}
{543477FB-CF81-446D-AB02-1E41382DED5B} = {6A8DE399-1804-4113-A408-F23B7F5C9CAC}
{8A3F688D-AA42-4070-9813-293D19E7F023} = {6A8DE399-1804-4113-A408-F23B7F5C9CAC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9359773D-6399-447E-9814-6CB41C2FB664}

@ -1,150 +0,0 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace System.Data.Jet.PerformanceTest
{
//[TestClass]
public class CheckTableExistenceTest
{
[TestInitialize]
public void Initialize()
{
using (JetConnection connection = JetDatabaseFixture.GetConnection())
{
connection.Open();
for (int i = 0; i < 300; i++)
{
string sql = $@"
CREATE TABLE [Employees_{i}] (
[EmployeeID] int IDENTITY (1, 1) NOT NULL ,
[LastName] varchar (20) NOT NULL ,
[FirstName] varchar (10) NOT NULL ,
[Title] varchar (30) NULL ,
[TitleOfCourtesy] varchar (25) NULL ,
[BirthDate] datetime NULL ,
[HireDate] datetime NULL ,
[Address] varchar (60) NULL ,
[City] varchar (15) NULL ,
[Region] varchar (15) NULL ,
[PostalCode] varchar (10) NULL ,
[Country] varchar (15) NULL ,
[HomePhone] varchar (24) NULL ,
[Extension] varchar (4) NULL ,
[Photo] image NULL ,
[Notes] text NULL ,
[ReportsTo] int NULL ,
[PhotoPath] varchar (255) NULL ,
CONSTRAINT [PK_Employees] PRIMARY KEY
(
[EmployeeID]
)
);
CREATE INDEX [LastName] ON [Employees_{i}]([LastName]);
CREATE INDEX [PostalCode] ON [Employees_{i}]([PostalCode]);
";
connection.CreateCommand(sql).ExecuteNonQuery();
}
}
}
[TestCleanup]
public void Cleanup()
{
using (JetConnection connection = JetDatabaseFixture.GetConnection())
{
connection.Open();
for (int i = 0; i < 300; i++)
{
string sql = $@"DROP TABLE [Employees_{i}]";
connection.CreateCommand(sql).ExecuteNonQuery();
}
}
}
[TestMethod]
public void TryCatch()
{
int exists = 0;
int notExists = 0;
using(new Timer("TryCatch"))
using (JetConnection connection = JetDatabaseFixture.GetConnection())
{
connection.Open();
for (int i = 0; i < 1000; i++)
{
if (TableExistsTryCatch(connection, $"Employees_{i % 500}"))
exists++;
else
notExists++;
}
}
Assert.AreEqual(600, exists);
Assert.AreEqual(400, notExists);
}
[TestMethod]
public void ShowWhere()
{
int exists = 0;
int notExists = 0;
using (new Timer("ShowWhere"))
using (JetConnection connection = JetDatabaseFixture.GetConnection())
{
connection.Open();
for (int i = 0; i < 1000; i++)
{
if (TableExistsShowWhere(connection, $"Employees_{i % 500}"))
exists++;
else
notExists++;
}
}
Assert.AreEqual(600, exists);
Assert.AreEqual(400, notExists);
}
public bool TableExistsTryCatch(JetConnection connection, string tableName)
{
bool tableExists;
try
{
string sqlFormat = "select Top 1 * from [{0}]";
connection.CreateCommand(String.Format(sqlFormat, tableName)).ExecuteNonQuery();
tableExists = true;
}
catch
{
tableExists = false;
}
return tableExists;
}
public bool TableExistsShowWhere(JetConnection connection, string tableName)
{
string sqlFormat = "show tables where name = '{0}'";
return connection.CreateCommand(String.Format(sqlFormat, tableName.Replace("'", "''"))).ExecuteScalar() != DBNull.Value;
}
}
}

File diff suppressed because one or more lines are too long

@ -1,20 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("System.Data.Jet.PerformanceTest")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("System.Data.Jet.PerformanceTest")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("8a3f688d-aa42-4070-9813-293d19e7f023")]
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -1,28 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp3.1</TargetFrameworks>
<IsPackable>false</IsPackable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Platforms>AnyCPU;x86;x64</Platforms>
</PropertyGroup>
<ItemGroup>
<None Remove="System.Data.Jet.PerformanceTest.csproj.DotSettings" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.0" />
<PackageReference Include="coverlet.collector" Version="1.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\System.Data.Jet\System.Data.Jet.csproj" />
</ItemGroup>
</Project>

@ -1,2 +0,0 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeEditing/Localization/Localizable/@EntryValue">No</s:String></wpf:ResourceDictionary>

@ -1,18 +0,0 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace System.Data.Jet.PerformanceTest
{
//[TestClass]
class TestInitialization
{
[AssemblyInitialize]
static public void AssemblyInitialize(TestContext testContext)
{
JetDatabaseFixture.CreateAndSeedIfNotExists();
// Enabling show sql statements can change performances
//JetConfiguration.ShowSqlStatements = true;
}
}
}

@ -1,31 +0,0 @@
using System;
namespace System.Data.Jet.PerformanceTest
{
class Timer : IDisposable
{
private readonly string _actionName;
private DateTime _startTime;
public Timer(string actionName, bool showStartTime = false)
{
if (actionName == null) throw new ArgumentNullException(nameof(actionName));
_actionName = actionName;
_startTime = DateTime.Now;
if (showStartTime)
Console.WriteLine($"{_actionName} starting at {_startTime}");
}
public void Dispose()
{
if (_startTime == DateTime.MinValue)
throw new InvalidOperationException($"Timer for action '{_actionName}' already disposed");
DateTime endTime = DateTime.Now;
Console.WriteLine($"{_actionName} started at {_startTime} is finishing at {endTime} after {(endTime-_startTime).TotalSeconds}");
_startTime = DateTime.MinValue;
}
}
}

@ -1,149 +0,0 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace System.Data.Jet.PerformanceTest
{
//[TestClass]
public class Where_False
{
[TestMethod]
public void Where_False_Test()
{
const int cycles = 5000;
using (new Timer($"Select {cycles} Where 1=2 get data reader"))
{
using (var connection = JetDatabaseFixture.GetConnection())
{
connection.Open();
for (int i = 0; i < cycles; i++)
{
var reader = connection.CreateCommand("Select * from employees where 1=2").ExecuteReader();
reader.Dispose();
}
}
}
using (new Timer($"Select {cycles} Where 1=2 get table structure"))
{
using (var connection = JetDatabaseFixture.GetConnection())
{
connection.Open();
for (int i = 0; i < cycles; i++)
{
var reader = connection.CreateCommand("Select * from employees where 1=2").ExecuteReader(CommandBehavior.KeyInfo);
var schemaTable = reader.GetSchemaTable();
reader.Dispose();
// ReSharper disable once PossibleNullReferenceException
schemaTable.Dispose();
}
}
}
using (new Timer($"Select {cycles} Top 1 get data reader"))
{
using (var connection = JetDatabaseFixture.GetConnection())
{
connection.Open();
for (int i = 0; i < cycles; i++)
{
var reader = connection.CreateCommand("Select top 1 * from employees").ExecuteReader();
reader.Dispose();
}
}
}
using (new Timer($"Select {cycles} Top 1 get table structure"))
{
using (var connection = JetDatabaseFixture.GetConnection())
{
connection.Open();
for (int i = 0; i < cycles; i++)
{
var reader = connection.CreateCommand("Select top 1 * from employees").ExecuteReader(CommandBehavior.KeyInfo);
var schemaTable = reader.GetSchemaTable();
reader.Dispose();
// ReSharper disable once PossibleNullReferenceException
schemaTable.Dispose();
}
}
}
using (new Timer($"Select {cycles} Top 1 Where 1=2 get data reader"))
{
using (var connection = JetDatabaseFixture.GetConnection())
{
connection.Open();
for (int i = 0; i < cycles; i++)
{
var reader = connection.CreateCommand("Select top 1 * from employees where 1=2").ExecuteReader();
reader.Dispose();
}
}
}
using (new Timer($"Select {cycles} Top 1 Where 1=2 get table structure"))
{
using (var connection = JetDatabaseFixture.GetConnection())
{
connection.Open();
for (int i = 0; i < cycles; i++)
{
var reader = connection.CreateCommand("Select top 1 * from employees where 1=2").ExecuteReader(CommandBehavior.KeyInfo);
var schemaTable = reader.GetSchemaTable();
reader.Dispose();
// ReSharper disable once PossibleNullReferenceException
schemaTable.Dispose();
}
}
}
}
[TestMethod]
public void Where_False_Test_DisposeConnection()
{
const int cycles = 60;
using (new Timer($"Select {cycles} Where 1=2 get table structure (Dispose connection)"))
{
for (int i = 0; i < cycles; i++)
{
using (var connection = JetDatabaseFixture.GetConnection())
{
connection.Open();
var reader = connection.CreateCommand("Select * from employees where 1=2").ExecuteReader(CommandBehavior.KeyInfo);
var schemaTable = reader.GetSchemaTable();
reader.Dispose();
// ReSharper disable once PossibleNullReferenceException
schemaTable.Dispose();
}
}
}
using (new Timer($"Select {cycles} Top 1 get table structure (Dispose connection)"))
{
for (int i = 0; i < cycles; i++)
{
using (var connection = JetDatabaseFixture.GetConnection())
{
connection.Open();
var reader = connection.CreateCommand("Select top 1 * from employees").ExecuteReader(CommandBehavior.KeyInfo);
var schemaTable = reader.GetSchemaTable();
reader.Dispose();
// ReSharper disable once PossibleNullReferenceException
schemaTable.Dispose();
}
}
}
}
}
}

@ -1,8 +0,0 @@
@echo off
sqlcmd -S "(localdb)\mssqllocaldb" -i "DropAllDatabases.sql" -o "DropAll.sql"
sqlcmd -S "(localdb)\mssqllocaldb" -i "DropAll.sql"
del "DropAll.sql"
sqllocaldb stop mssqllocaldb
sqllocaldb delete mssqllocaldb
ShrinkLocalDBModel.cmd

@ -1,24 +0,0 @@
-- Generates a SQL script that will drop all databases (except system and sample ones) on the current server.
DECLARE @name nvarchar(255)
DECLARE db CURSOR FOR
SELECT Name FROM sysdatabases
WHERE Name NOT IN ('master', 'tempdb', 'model', 'msdb')
OPEN db;
FETCH NEXT FROM db
INTO @name;
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT 'DROP DATABASE [' + REPLACE( @name, ']', ']]' ) + ']'
PRINT 'GO'
FETCH NEXT FROM db
INTO @name
END
CLOSE db;
DEALLOCATE db;

@ -1,14 +0,0 @@
@echo off
echo Shrinking the model database several times
sqlcmd -S "(localdb)\mssqllocaldb" -Q "DBCC SHRINKDATABASE (model) WITH NO_INFOMSGS"
sqlcmd -S "(localdb)\mssqllocaldb" -Q "DBCC SHRINKDATABASE (model) WITH NO_INFOMSGS"
sqlcmd -S "(localdb)\mssqllocaldb" -Q "DBCC SHRINKDATABASE (model) WITH NO_INFOMSGS"
sqlcmd -S "(localdb)\mssqllocaldb" -Q "DBCC SHRINKDATABASE (model) WITH NO_INFOMSGS"
sqlcmd -S "(localdb)\mssqllocaldb" -Q "DBCC SHRINKDATABASE (model) WITH NO_INFOMSGS"
sqlcmd -S "(localdb)\mssqllocaldb" -Q "DBCC SHRINKDATABASE (model) WITH NO_INFOMSGS"
sqlcmd -S "(localdb)\mssqllocaldb" -Q "DBCC SHRINKDATABASE (model) WITH NO_INFOMSGS"
sqlcmd -S "(localdb)\mssqllocaldb" -Q "DBCC SHRINKDATABASE (model) WITH NO_INFOMSGS"
sqlcmd -S "(localdb)\mssqllocaldb" -Q "DBCC SHRINKDATABASE (model) WITH NO_INFOMSGS"
echo Configuring model database to grow with default settings
sqlcmd -S "(localdb)\mssqllocaldb" -Q "ALTER DATABASE model MODIFY FILE (NAME=modeldev,FILEGROWTH=10%%);"
sqlcmd -S "(localdb)\mssqllocaldb" -Q "ALTER DATABASE model MODIFY FILE (NAME=modellog,FILEGROWTH=10%%);"
Loading…
Cancel
Save