Incremental work towards cache/volatile system

--HG--
branch : dev
This commit is contained in:
Louis DeJardin
2010-05-14 22:30:16 -07:00
parent fba838f366
commit c138cc996d
40 changed files with 396 additions and 217 deletions

View File

@@ -18,7 +18,18 @@ namespace Orchard.Profile.Tests {
[Given(@"I am logged in")]
public void GivenIAmLoggedIn() {
DoRequest("/Users/Account/LogOn", "userNameOrEmail=admin&password=profiling-secret&rememberMe=false");
DoRequest("/Users/Account/LogOn");
const string requestVerificationTokenName = "__RequestVerificationToken";
const string valueMarker = "value=\"";
var tokenIndex = _text.IndexOf(requestVerificationTokenName);
var valueIndex = _text.IndexOf(valueMarker, tokenIndex);
var valueStart = valueIndex + valueMarker.Length;
var valueEnd = _text.IndexOf("\"", valueStart);
var requestVerificationTokenValue = _text.Substring(valueStart, valueEnd - valueStart);
DoRequest("/Users/Account/LogOn", "userNameOrEmail=admin&password=profiling-secret&rememberMe=false&" + requestVerificationTokenName + "=" + requestVerificationTokenValue);
}
[When(@"I go to ""(.*)""")]

View File

@@ -3,6 +3,12 @@
As a developer
I want to generate a fixed number of repeatable requests
Scenario: Warmup
Given I am logged in
When I go to "/admin"
When I go to "/blog0"
When I go to "/"
Scenario: Dashboard
Given I am logged in
When I go to "/admin" 40 times

View File

@@ -2,7 +2,7 @@
// <auto-generated>
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.2.0.0
// Runtime Version:2.0.50727.3603
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -51,15 +51,34 @@ namespace Orchard.Profile.Tests
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("Dashboard")]
public virtual void Dashboard()
[NUnit.Framework.DescriptionAttribute("Warmup")]
public virtual void Warmup()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Dashboard", ((string[])(null)));
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Warmup", ((string[])(null)));
#line 6
this.ScenarioSetup(scenarioInfo);
#line 7
testRunner.Given("I am logged in");
#line 8
testRunner.When("I go to \"/admin\"");
#line 9
testRunner.When("I go to \"/blog0\"");
#line 10
testRunner.When("I go to \"/\"");
#line hidden
testRunner.CollectScenarioErrors();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("Dashboard")]
public virtual void Dashboard()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Dashboard", ((string[])(null)));
#line 12
this.ScenarioSetup(scenarioInfo);
#line 13
testRunner.Given("I am logged in");
#line 14
testRunner.When("I go to \"/admin\" 40 times");
#line hidden
testRunner.CollectScenarioErrors();
@@ -70,19 +89,19 @@ this.ScenarioSetup(scenarioInfo);
public virtual void HittingBlogs()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Hitting blogs", ((string[])(null)));
#line 10
this.ScenarioSetup(scenarioInfo);
#line 11
testRunner.Given("I am logged in");
#line 12
testRunner.When("I go to \"/blog0\" 10 times");
#line 13
testRunner.When("I go to \"/blog1\" 10 times");
#line 14
testRunner.When("I go to \"/blog2\" 10 times");
#line 15
testRunner.When("I go to \"/blog3\" 10 times");
#line 16
this.ScenarioSetup(scenarioInfo);
#line 17
testRunner.Given("I am logged in");
#line 18
testRunner.When("I go to \"/blog0\" 10 times");
#line 19
testRunner.When("I go to \"/blog1\" 10 times");
#line 20
testRunner.When("I go to \"/blog2\" 10 times");
#line 21
testRunner.When("I go to \"/blog3\" 10 times");
#line 22
testRunner.When("I go to \"/blog4\" 10 times");
#line hidden
testRunner.CollectScenarioErrors();
@@ -93,11 +112,11 @@ this.ScenarioSetup(scenarioInfo);
public virtual void HittingHomePage()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Hitting home page", ((string[])(null)));
#line 18
#line 24
this.ScenarioSetup(scenarioInfo);
#line 19
#line 25
testRunner.Given("I am logged in");
#line 20
#line 26
testRunner.When("I go to \"/\" 40 times");
#line hidden
testRunner.CollectScenarioErrors();

View File

@@ -1,6 +1,3 @@
help commands
setup /SiteName:Profiling /AdminUsername:admin /AdminPassword:profiling-secret /DatabaseProvider:SQLite /EnabledFeatures:Orchard.Framework,Common,Dashboard,Feeds,HomePage,Navigation,Scheduling,Settings,XmlRpc,Orchard.Users,Orchard.Roles,TinyMce,Orchard.Modules,Orchard.Themes,Orchard.MultiTenancy,Orchard.Pages,Orchard.Blogs,Orchard.Comments,Futures.Widgets,Orchard.Media,Orchard.Tags,Orchard.DevTools
help commands
tenant list
feature list
setup /SiteName:Profiling /AdminUsername:admin /AdminPassword:profiling-secret /DatabaseProvider:SQLite /EnabledFeatures:Orchard.Framework,Common,Dashboard,Feeds,HomePage,Navigation,Scheduling,Settings,XmlRpc,Orchard.Users,Orchard.Roles,TinyMce,Orchard.Modules,Orchard.Themes,Orchard.MultiTenancy,Orchard.Pages,Orchard.Blogs,Orchard.Comments,Futures.Widgets,Orchard.Media,Orchard.Tags,Orchard.DevTools
add profiling data
feature disable Orchard.DevTools