This project has moved and is read-only. For the latest updates, please go here.

1 - Compile the code

Follow instruction to compile the code.

2 - Set up the test environment

SQL Server Trace

The SQL Server Trace is used to make sure that the right requests are sent to the database at the right moment.

To set up a trace, start the profiler by clicking : Start Menu –> Microsoft SQL Server 2008 –> Performance Tools –> SQL Server Profiler

Start a new trace: File –> New Trace…

image

Fig1. SQL Server connection

Click the “Events Selection” tab. Tick Trace RPC:Completed and SQL:BatchCompleted events and tick “Show all columns”:

image

Fig2. Events Selection in Microsoft SQL Profiler

Click on the “Column Filter” button. Add a filter to trace only the tempdb database by adding a filter

image

Fig3. Add the “DatabaseName” filter

Click OK then Run.

Web browser

Internet Explorer or Firefox can be both used to do the tests.

Fiddler

Fiddler is an HTTP network profiler. We will use Fiddler to make sure that the session cookie is correctly set.

You can run Fiddler from Firefox: Tools –> “Monitor with Fiddler” –> “Launch Fiddler Now”. Make sure that traffic is sent to Fiddler in the bottom right of Firefox window)

You can also run Fiddler form Internet Explorer: Alt + Click on Tools –> “Fiddler”

image

Fig4. Fiddler an HTTP Debugging proxy

MBunit test runner (MbUnit.GUI)

This comes with the installation of MBUnit.

The installation setup is commited in the source code in C:\Dev\SessionService\LibrariesThirdParty\MbUnit\2.4.2.355

3 – Run tests

Unit tests

The .Net assembly has unit tests written with MBunit 2.4. All tests should pass.

In order to run unit test:

  1. Compile Homelidays.Web.SessionService.Tests project of SessionService.sln in Release mode.

  2. Launch the SessionService.mbunit project and click “Run”

image

Fig5. MBunit.GUI passing all Homelidays Session Service tests.

Single threaded test

Actions
(Do not wait more than 1 minute between two actions)
Expected on the Browser Expected on the SQL Trace
(Tags of Requests that should be seen)
Expected on the HTTP protocol (Fiddler)
Restart the SQL Server database in order to destroy the tempdb database      
iisreset      
Clear cookies      
Call /SessionService/Test.asp No error should occur CREATE TABLE [dbo].[Session]
/*20100722-190015-YFA*/
/*20100722-190016-YFA*/  + Insert
/*20100722-190015-YFA*/
/*20100722-190016-YFA*/  + Insert
/*20100722-190015-YFA*/
/*20100722-190016-YFA*/  + Insert
Response : Set-Cookie: Yacht=SessionId=<a guid wihout dashes>; path=/
Restart the SQL Server database in order to destroy the tempdb database      
Call /SessionService/Test.asp An error should happen : error '80040e37' /*20100722-190015-YFA*/
CREATE TABLE [dbo].[Session]
/*20100722-190016-YFA*/  + Insert
Request : Yacht cookie should be there with the session Id as above
Response : nothing about Yacth
Call /SessionService/Test.asp An error should happen : error '80004005' /*20100722-190015-YFA*/
/*20100722-190016-YFA*/  + Insert
Request : Yacht cookie should be there with the session Id as above
Response : nothing about Yacth
Call /SessionService/Test.asp No error should occur /*20100722-190015-YFA*/
/*20100722-190016-YFA*/  + Insert
/*20100722-190015-YFA*/
/*20100722-190016-YFA*/  + Insert
/*20100722-190015-YFA*/
/*20100722-190016-YFA*/  + Insert
 
Clear cookies      
Call /SessionService/Test.asp No error should occur /*20100722-190015-YFA*/
/*20100722-190016-YFA*/ + Insert
/*20100722-190015-YFA*/
/*20100722-190016-YFA*/ + Insert
/*20100722-190015-YFA*/
/*20100722-190016-YFA*/ + Insert
Response : Set-Cookie: Yacht=SessionId=<a guid wihout dashes>; path=/
Call /SessionService/Test.aspx No error should occur
19 lines
CREATE TABLE [dbo].[Session]
/*6123A967-9D20-41a6-BED0-64A82D69D783*/
/*4080907D-4E44-41e6-A036-4B7CB41146D5*/
/*CC70CCEA-9D49-49b9-B207-EFBBA29F093D*/
Request : Yacht cookie should be there with the session Id as above
Response : nothing about Yacth
Call /SessionService/Test.aspx a second time No error should occur
20 lines
A new line should appear with dotnetdecimal
/*6123A967-9D20-41a6-BED0-64A82D69D783*/
/*4080907D-4E44-41e6-A036-4B7CB41146D5*/
/*CC70CCEA-9D49-49b9-B207-EFBBA29F093D*/
Request : Yacht cookie should be there with the session Id as above
Response : nothing about Yacth
Call /SessionService/TestMultiDimTable.asp No error should occur /*20100722-190015-YFA*/
/*20100722-190016-YFA*/ + Insert
Request : Yacht cookie should be there with the session Id as above
Response : nothing about Yacth
Call /SessionService/TestNoSessionAccess.asp No error should occur /*20101123-194816-YFA*/ Request : Yacht cookie should be there with the session Id as above
Response : nothing about Yacth
Call /SessionService/TestNoSessionAccess.aspx No error should occur /*07614B4A-4224-492e-88DE-656DB7F876F3*/ Request : Yacht cookie should be there with the session Id as above
Response : nothing about Yacth
/SessionService/TestReadSess.asp No error should occur
You should see the content of the session
/*20100722-190015-YFA*/
/*20100722-190016-YFA*/ + Insert
Request : Yacht cookie should be there with the session Id as above
Response : nothing about Yacth
Call /SessionService/TestRemoveAll.asp No error should occur
/*20100722-190015-YFA*/
/*20100722-190016-YFA*/ + Insert
/*20100722-190015-YFA*/
/*20100722-190016-YFA*/ + Insert
/*20100722-190015-YFA*/
/*20100722-190016-YFA*/ + Insert
Request : Yacht cookie should be there with the session Id as above
Response : nothing about Yacth
/SessionService/TestReadSess.asp No error should occur
Session should be empty
/*20100722-190015-YFA*/
/*20100722-190016-YFA*/ + Insert
Request : Yacht cookie should be there with the session Id as above
Response : nothing about Yacth
/SessionService/TestScriptingDictionary.asp No error should occur /*20100722-190015-YFA*/
/*20100722-190016-YFA*/ + Insert
Request : Yacht cookie should be there with the session Id as above
Response : nothing about Yacth
/SessionService/TestSessionAbandon.asp No error should occur /*20100722-190015-YFA*/
/*20100722-190014-YFA*/
Request : Yacht cookie should be there with the session Id as above
Response : nothing about Yacth
/SessionService/TestReadSess.asp No error should occur
Session should be empty
/*20100722-190015-YFA*/
/*20100722-190016-YFA*/ + Insert
Request : Yacht cookie should be there with the session Id as above
Response : nothing about Yacth
SessionService/TestScriptingDictionary.asp No error should occur /*20100722-190015-YFA*/
/*20100722-190016-YFA*/ + Insert
Request : Yacht cookie should be there with the session Id as above
Response : nothing about Yacth
/SessionService/TestSessionAbandon.aspx No error should occur /*4080907D-4E44-41e6-A036-4B7CB41146D5*/ Request : Yacht cookie should be there with the session Id as above
Response : nothing about Yacth

Multithreaded test

“On Internet Information Services (IIS) Manager” make sure that your test site has “server side debug” disabled.

image

Fig6. For multithreaded tests server side debugging should be disabled

Classic ASP: TestConsoleApplication

TestConsoleApplication is a C++ testing application console that test the session service layers of the COM component (Classic ASP) in a multithreaded environment. Each layer is tested in one or many test functions.

In TestConsoleApplication.cpp, the _tmain function is the entry point of the application. To enable a test function comment/uncomment the desired test. Each test will run indefinitely so you will have to kill the TestConsoleApplication.exe process to stop it.

For non regression testing, each test should be launched in Release mode during a few minutes (let’s say 5 minutes). No crashes should occurs and the memory (“Working Set” in the Windows Task Manager) should not grow indefinitely.

  1. LoggerTest: Testing of logging function. This test write a dummy log file on the hard drive. (5 minutes of test will generate a 1.5 Gbytes of dummy log in C:\Dev\SessionService\TestConsoleApplication).
  2. SerializerTest: Testing of the serialization.
  3. DeserializerTest: Testing of the deserialization.
  4. DeserializerSerialiserTest: Test that deserialization followed by a serialization produce the same result as what was initially provided to the deserialization layer.
  5. PartitionResolverTest: Testing of the partition resolver layer.
  6. SessionPersistenceTest: Testing of the persistence layer that test the data access layer (ADO).

ASP.NET: LoadTester

LoadTester is a C# testing application that act as a web browser. It will run many threads that will call test pages from http://sessionservice.my.homelidays.com. Each test runs indefinitely so you will have to kill the LoadTester.exe process to stop it.

For non regression testing each test should be ran in Release during a few minutes (5 minutes). No crashes should occurs and the memory of the w3wp.exe that host testing web site of the session service should not grow indefinitely.

To choose the desired test change the test_type variable in the main function in Program.cs:

TestType test_type = TestType.ScriptingDictionary

  1. TestType.ScriptingDictionary: Testing of /SessionService/TestScriptingDictionary.asp in a multithreaded environment.
  2. TestType.ValueType: Testing of the /SessionService/Test.asp and /SessionService/TestNoSessionAccess.asp in a multithreaded environment.

Note: TestType.ValueTypeAndIisSession do not test the Homelidays session service and has been developed for dev purpose at a very early stage of the project. You do not need to run it.

Last edited Jun 10, 2014 at 2:37 AM by yanal, version 6

Comments

No comments yet.