public void MakeLinkMultiple() { var list = new SharesList(); list.AddOrReplace(UnixShare("share1", "/home/user/share1")); list.AddOrReplace(UnixShare("share2", "/home/user/share2")); { var localPath = UnixPath("/home/user/share1/test.txt"); Assert.AreEqual("/home/user/share1/test.txt", LinkMaker.MakeLink(LinkFormat.LocalPath, "host", list, localPath, '/')); Assert.AreEqual("file:///home/user/share1/test.txt", LinkMaker.MakeLink(LinkFormat.LocalFile, "host", list, localPath, '/')); Assert.AreEqual("file://host/share1/test.txt", LinkMaker.MakeLink(LinkFormat.File, "host", list, localPath, '/')); Assert.AreEqual(@"\\host\share1\test.txt", LinkMaker.MakeLink(LinkFormat.Unc, "host", list, localPath, '/')); Assert.AreEqual(@"\\host\share1\test.txt", LinkMaker.MakeLink(LinkFormat.UncEscaped, "host", list, localPath, '/')); Assert.AreEqual("smb://host/share1/test.txt", LinkMaker.MakeLink(LinkFormat.Smb, "host", list, localPath, '/')); } { var localPath = UnixPath("/home/user/share2/test.txt"); Assert.AreEqual("/home/user/share2/test.txt", LinkMaker.MakeLink(LinkFormat.LocalPath, "host", list, localPath, '/')); Assert.AreEqual("file:///home/user/share2/test.txt", LinkMaker.MakeLink(LinkFormat.LocalFile, "host", list, localPath, '/')); Assert.AreEqual("file://host/share2/test.txt", LinkMaker.MakeLink(LinkFormat.File, "host", list, localPath, '/')); Assert.AreEqual(@"\\host\share2\test.txt", LinkMaker.MakeLink(LinkFormat.Unc, "host", list, localPath, '/')); Assert.AreEqual(@"\\host\share2\test.txt", LinkMaker.MakeLink(LinkFormat.UncEscaped, "host", list, localPath, '/')); Assert.AreEqual("smb://host/share2/test.txt", LinkMaker.MakeLink(LinkFormat.Smb, "host", list, localPath, '/')); } }
public FlexWikiWebApplication(string configPath, LinkMaker linkMaker, OutputFormat outputFormat) { _configPath = configPath; _linkMaker = linkMaker; _outputFormat = outputFormat; }
public MockWikiApplication(LinkMaker linkMaker, OutputFormat outputFormat) { _linkMaker = linkMaker; _ouputFormat = outputFormat; LoadConfiguration(); }
public void MakeLinkCaseInsensitive() { var list = new SharesList(false); list.AddOrReplace(WindowsShare("share", "c:\\downloads")); Assert.AreEqual(@"\\host\share\test.txt", LinkMaker.MakeLink(LinkFormat.Unc, "host", list, WindowsPath(@"c:\Downloads\test.txt"), '\\')); Assert.AreEqual(@"\\host\share\test.txt", LinkMaker.MakeLink(LinkFormat.Unc, "host", list, WindowsPath(@"c:\downloads\test.txt"), '\\')); }
public MockWikiApplication(FederationConfiguration configuration, LinkMaker linkMaker, OutputFormat outputFormat, ITimeProvider timeProvider) { _configuration = configuration; _linkMaker = linkMaker; _ouputFormat = outputFormat; _timeProvider = timeProvider; }
public void ComposeLinkShareItSelf() { var share = UnixShare("share", "/home/user/share"); var relPath = Path(); Assert.AreEqual("/home/user/share", LinkMaker.ComposeLink(LinkFormat.LocalPath, "host", share, relPath, '/')); Assert.AreEqual("file:///home/user/share", LinkMaker.ComposeLink(LinkFormat.LocalFile, "host", share, relPath, '/')); Assert.AreEqual("file://host/share", LinkMaker.ComposeLink(LinkFormat.File, "host", share, relPath, '/')); Assert.AreEqual(@"\\host\share", LinkMaker.ComposeLink(LinkFormat.Unc, "host", share, relPath, '/')); Assert.AreEqual(@"\\host\share", LinkMaker.ComposeLink(LinkFormat.UncEscaped, "host", share, relPath, '/')); Assert.AreEqual("smb://host/share", LinkMaker.ComposeLink(LinkFormat.Smb, "host", share, relPath, '/')); }
public void ComposeLinkSpaces() { var share = UnixShare("my share", "/home/user/my share"); var relPath = Path("a", "b c.txt"); Assert.AreEqual("/home/user/my share/a/b c.txt", LinkMaker.ComposeLink(LinkFormat.LocalPath, "host", share, relPath, '/')); Assert.AreEqual("file:///home/user/my%20share/a/b%20c.txt", LinkMaker.ComposeLink(LinkFormat.LocalFile, "host", share, relPath, '/')); Assert.AreEqual("file://host/my%20share/a/b%20c.txt", LinkMaker.ComposeLink(LinkFormat.File, "host", share, relPath, '/')); Assert.AreEqual(@"\\host\my share\a\b c.txt", LinkMaker.ComposeLink(LinkFormat.Unc, "host", share, relPath, '/')); Assert.AreEqual(@"\\host\my%20share\a\b%20c.txt", LinkMaker.ComposeLink(LinkFormat.UncEscaped, "host", share, relPath, '/')); Assert.AreEqual("smb://host/my%20share/a/b%20c.txt", LinkMaker.ComposeLink(LinkFormat.Smb, "host", share, relPath, '/')); }
public void SetUp() { _linkMaker = new LinkMaker(_baseUri); MockWikiApplication application = new MockWikiApplication(null, _linkMaker, OutputFormat.HTML, new MockTimeProvider(TimeSpan.FromSeconds(1))); Federation = new Federation(application); Federation.WikiTalkVersion = 1; _provider.Initialize(Federation); }
public void SetUp() { string author = "tester-joebob"; _lm = new LinkMaker(_bh); MockWikiApplication application = new MockWikiApplication(null, _lm, OutputFormat.HTML, new MockTimeProvider(TimeSpan.FromSeconds(1))); Federation = new Federation(application); _base = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki.Base"); _other1 = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki.Other1"); _other2 = WikiTestUtilities.CreateMockStore(Federation, "Other2"); _other3 = WikiTestUtilities.CreateMockStore(Federation, "Other3"); _namespaceManager5 = WikiTestUtilities.CreateMockStore(Federation, "Space5"); WikiTestUtilities.WriteTestTopicAndNewVersion(_base, _base.DefinitionTopicName.LocalName, @"Import: FlexWiki.Other1, Other2", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicOne", @"OtherOneHello", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicTwo", @"FlexWiki.Other1.OtherOneGoodbye", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicThree", @"No.Such.Namespace.FooBar", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicFour", @".TopicOne", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicFive", @"FooBar Role:Designer", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicSix", @".GooBar Role:Developer", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, _other1.DefinitionTopicName.LocalName, @"Import: Other3,Other2", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneHello", @"hello Role:Developer", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneGoodbye", @"goodbye", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneRefThree", @"OtherThreeTest", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicOne", @"OtherTwoHello", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicTwo", @"Other2.OtherTwoGoodbye", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicThree", @"No.Such.Namespace.FooBar", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicFour", @".OtherOneTopicOne", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicFive", @"FooBar", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicSix", @".GooBar", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other2, "OtherTwoHello", @"hello", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other2, "OtherTwoGoodbye", @"goodbye", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other3, "OtherThreeTest", @"yo", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager5, "AbsRef", @"Other2.OtherTwoHello", author); }
[SetUp] public void Init() { string author = "tester-joebob"; _lm = new LinkMaker(_bh); TheFederation = new Federation(OutputFormat.HTML, _lm); _base = CreateStore("FlexWiki.Base"); _other1 = CreateStore("FlexWiki.Other1"); _other2 = CreateStore("Other2"); _other3 = CreateStore("Other3"); _cb5 = CreateStore("Space5"); WriteTestTopicAndNewVersion(_base, _base.DefinitionTopicName.Name, @"Import: FlexWiki.Other1, Other2", author); WriteTestTopicAndNewVersion(_base, "TopicOne", @"OtherOneHello", author); WriteTestTopicAndNewVersion(_base, "TopicTwo", @"FlexWiki.Other1.OtherOneGoodbye", author); WriteTestTopicAndNewVersion(_base, "TopicThree", @"No.Such.Namespace.FooBar", author); WriteTestTopicAndNewVersion(_base, "TopicFour", @".TopicOne", author); WriteTestTopicAndNewVersion(_base, "TopicFive", @"FooBar Role:Designer", author); WriteTestTopicAndNewVersion(_base, "TopicSix", @".GooBar Role:Developer", author); WriteTestTopicAndNewVersion(_other1, _other1.DefinitionTopicName.Name, @"Import: Other3,Other2", author); WriteTestTopicAndNewVersion(_other1, "OtherOneHello", @"hello Role:Developer", author); WriteTestTopicAndNewVersion(_other1, "OtherOneGoodbye", @"goodbye", author); WriteTestTopicAndNewVersion(_other1, "OtherOneRefThree", @"OtherThreeTest", author); WriteTestTopicAndNewVersion(_other1, "OtherOneTopicOne", @"OtherTwoHello", author); WriteTestTopicAndNewVersion(_other1, "OtherOneTopicTwo", @"Other2.OtherTwoGoodbye", author); WriteTestTopicAndNewVersion(_other1, "OtherOneTopicThree", @"No.Such.Namespace.FooBar", author); WriteTestTopicAndNewVersion(_other1, "OtherOneTopicFour", @".OtherOneTopicOne", author); WriteTestTopicAndNewVersion(_other1, "OtherOneTopicFive", @"FooBar", author); WriteTestTopicAndNewVersion(_other1, "OtherOneTopicSix", @".GooBar", author); WriteTestTopicAndNewVersion(_other2, "OtherTwoHello", @"hello", author); WriteTestTopicAndNewVersion(_other2, "OtherTwoGoodbye", @"goodbye", author); WriteTestTopicAndNewVersion(_other3, "OtherThreeTest", @"yo", author); WriteTestTopicAndNewVersion(_cb5, "AbsRef", @"Other2.OtherTwoHello", author); }
[SetUp] public void Init() { _lm = new LinkMaker(_base); TheFederation = new Federation(OutputFormat.HTML, _lm); TheFederation.WikiTalkVersion = 1; string ns = "FlexWiki"; string ns2 = "FlexWiki2"; _cb = CreateStore(ns); _cb2 = CreateStore(ns2); WriteTestTopicAndNewVersion(_cb, _cb.DefinitionTopicName.Name, "Import: FlexWiki2", user); WriteTestTopicAndNewVersion(_cb, "HomePage", "This is a simple topic RefOne plus PluralWords reference to wiki://PresentIncluder wiki://TestLibrary/foo.gif", user); WriteTestTopicAndNewVersion(_cb2, "AbsentIncluder", "{{NoSuchTopic}}", user); WriteTestTopicAndNewVersion(_cb2, "PresentIncluder", "{{IncludePresent}}", user); WriteTestTopicAndNewVersion(_cb2, "IncludePresent", "hey! this is ReferencedFromIncludePresent", user); WriteTestTopicAndNewVersion(_cb2, "TestLibrary", "URI: whatever", user); }
public void SetUp() { _lm = new LinkMaker(_base); Federation = new Federation(OutputFormat.HTML, _lm); Federation.WikiTalkVersion = 1; string ns = "FlexWiki"; string ns2 = "FlexWiki2"; _contentStoreManager = WikiTestUtilities.CreateMockStore(Federation, ns); _contentStoreManager2 = WikiTestUtilities.CreateMockStore(Federation, ns2); WikiTestUtilities.WriteTestTopicAndNewVersion(_contentStoreManager, _contentStoreManager.DefinitionTopicName.Name, "Import: FlexWiki2", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_contentStoreManager, "HomePage", "This is a simple topic RefOne plus PluralWords reference to wiki://PresentIncluder wiki://TestLibrary/foo.gif", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_contentStoreManager2, "AbsentIncluder", "{{NoSuchTopic}}", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_contentStoreManager2, "PresentIncluder", "{{IncludePresent}}", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_contentStoreManager2, "IncludePresent", "hey! this is ReferencedFromIncludePresent", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_contentStoreManager2, "TestLibrary", "URI: whatever", _user); }
public FlexWikiWebApplication(string configPath, LinkMaker linkMaker, OutputFormat outputFormat) { _configPath = configPath; _linkMaker = linkMaker; _outputFormat = outputFormat; LoadConfiguration(); // We no longer watch the config file for changes because it was causing too // many problems. Now there's just a "reload configuration" button in // the admin app (not yet implemented). //WatchConfiguration(); string log4NetConfigPath = "log4net.config"; if (_applicationConfiguration.Log4NetConfigPath != null) { log4NetConfigPath = _applicationConfiguration.Log4NetConfigPath; } XmlConfigurator.ConfigureAndWatch(new FileInfo(ResolveRelativePath(log4NetConfigPath))); }
internal static Federation SetupFederation(string siteUrl, TestContentSet content, MockSetupOptions options, FederationConfiguration federationConfiguration) { LinkMaker linkMaker = new LinkMaker(siteUrl); MockWikiApplication application = new MockWikiApplication( federationConfiguration, linkMaker, OutputFormat.HTML, new MockTimeProvider(TimeSpan.FromSeconds(1))); Federation federation = new Federation(application); foreach (TestNamespace ns in content.Namespaces) { NamespaceManager storeManager = CreateMockStore(federation, ns.Name, options, ns.Parameters); foreach (TestTopic topic in ns.Topics) { WriteTestTopicAndNewVersion(storeManager, topic.Name, topic.Content, topic.Author); } } return federation; }
void Command(LinkMaker lm, string command, string helptext, string url) { Response.Write("<table cellspacing='0' cellpadding='1' class='CommandTable' border='0'><tr><td valign='middle'>"); Response.Write("<img src='" + lm.LinkToImage("images/go-dark.gif") + "'>"); Response.Write("</td>"); Response.Write("<td valign='middle'>"); Response.Write("<a title='" + helptext + "' href=\"" + url + "\">" + command + "</a>"); Response.Write("</td>"); Response.Write("</tr></table>"); }
public virtual void Setup() { // Back up the wiki configuration OldWikiState = TestUtilities.BackupWikiState(); // Recreate the wiki each time so we start from a known state string path = System.Guid.NewGuid().ToString(); TheFederation = TestUtilities.CreateFederation(path, FederationContent); // Establish a link maker TheLinkMaker = new LinkMaker(TestUtilities.BaseUrl); // And a browser TheBrowser = new Browser(); }
private void ReallyDoWork() { DaemonBasedDeliveryBoy boy = new DaemonBasedDeliveryBoy(_sendAsAttachments, Federation.Application); LinkMaker lm = new LinkMaker(_rootUrl); NewsletterManager manager = new NewsletterManager(Federation, lm, boy, _newslettersFrom, _headInsert); LogEvent ev = Federation.LogEventFactory.CreateAndStartEvent(null, null, null, LogEventType.NewsletterGeneration); try { manager.Notify(); } finally { ev.Record(); } }
[SetUp] public void Init() { _lm = new LinkMaker(_base); TheFederation = new Federation(OutputFormat.HTML, _lm); TheFederation.WikiTalkVersion = 1; string ns = "FlexWiki"; string ns2 = "FlexWiki2"; _cb = CreateStore(ns); _cb2 = CreateStore(ns2); WriteTestTopicAndNewVersion(_cb, "HomePage", "", user); WriteTestTopicAndNewVersion(_cb, _cb.DefinitionTopicName.Name, @"Import: FlexWiki2", user); WriteTestTopicAndNewVersion(_cb, "QualifiedLocalPropertyRef", @" Color: green color=@@topics.QualifiedLocalPropertyRef.Color@@", user); WriteTestTopicAndNewVersion(_cb, "UnqualifiedLocalPropertyRef", @" Color: green color=@@Color@@", user); WriteTestTopicAndNewVersion(_cb, "QualifiedLocalMethodRef", @" len=@@topics.QualifiedLocalMethodRef.DirectStringLength(""hello"")@@ DirectStringLength: { str | str.Length } ", user); WriteTestTopicAndNewVersion(_cb, "UnqualifiedLocalMethodRef", @" len=@@DirectStringLength(""hello"")@@ DirectStringLength: { str | str.Length } ", user); WriteTestTopicAndNewVersion(_cb, "LocalMethodIndirection", @" len=@@StringLength(""hello"")@@ StringLength: { str | Len(str) } Len: { str | str.Length } ", user); WriteTestTopicAndNewVersion(_cb, "LocalMethodIndirection2", @" len=@@StringLength(""hello"")@@ StringLength: { str | Len(str) } Len: { s | s.Length } ", user); WriteTestTopicAndNewVersion(_cb, "CallerBlockLocalsShouldBeInvisible", @" len=@@StringLength(""hello"")@@ StringLength: { str | Len(str) } Len: { s | str.Length } ", user); WriteTestTopicAndNewVersion(_cb2, "Profile", @"Color: puce", user); WriteTestTopicAndNewVersion(_cb, "ReferAcrossNamespaces", @"@@topics.Profile.Color@@", user); WriteTestTopicAndNewVersion(_cb, "TestChecker", @" Test: { FearFactor } Color: green", user); WriteTestTopicAndNewVersion(_cb, "CallTestChecker", @" FearFactor: nighttime test=@@topics.TestChecker.Test@@ ", user); WriteTestTopicAndNewVersion(_cb, "Topic1", @" Function: { arg1 | topics.Topic2.FunctionTwo( { arg1 } ) } ", user); WriteTestTopicAndNewVersion(_cb, "Topic2", @" FunctionTwo: { someArg | someArg.Value } ", user); WriteTestTopicAndNewVersion(_cb, "Topic3", @"@@topics.Topic1.Function(100)@@", user); WriteTestTopicAndNewVersion(_cb, "BlockCanSeeLexicalScopeCaller", @" result=@@ topics.BlockCanSeeLexicalScopeCallee.BlockValue( { Color } ) @@ Color: green", user); WriteTestTopicAndNewVersion(_cb, "BlockCanSeeLexicalScopeCallee", @" BlockValue: {aBlock | aBlock.Value }", user); WriteTestTopicAndNewVersion(_cb, "ThisTests", @" topic=@@topic.Name@@ namespace=@@namespace.Name@@ nscount=@@federation.Namespaces.Count@@ color=@@this.Color@@ Color: red ", user); }
// Constructors public FlexWikiWebApplication(LinkMaker linkMaker) : this(GetFlexWikiConfigurationPath(), linkMaker) { }
public RenderDriverApplication(FederationConfiguration federationConfiguration, LinkMaker linkMaker) { _federationConfiguration = federationConfiguration; _linkMaker = linkMaker; }
public void SetUp() { string author = "tester-joebob"; _lm = new LinkMaker(_bh); // Allow everyone all permissions FederationConfiguration configuration = new FederationConfiguration(); configuration.AuthorizationRules.Add(new WikiAuthorizationRule( new AuthorizationRule(new AuthorizationRuleWho(AuthorizationRuleWhoType.GenericAll, null), AuthorizationRulePolarity.Allow, AuthorizationRuleScope.Wiki, SecurableAction.ManageNamespace, 0))); MockWikiApplication application = new MockWikiApplication( configuration, _lm, OutputFormat.HTML, new MockTimeProvider(TimeSpan.FromSeconds(1))); Federation = new Federation(application); _base = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki.Base"); _other1 = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki.Other1"); _other2 = WikiTestUtilities.CreateMockStore(Federation, "Other2"); _other3 = WikiTestUtilities.CreateMockStore(Federation, "Other3"); _namespaceManager5 = WikiTestUtilities.CreateMockStore(Federation, "Space5"); WikiTestUtilities.WriteTestTopicAndNewVersion(_base, _base.DefinitionTopicName.LocalName, @"Import: FlexWiki.Other1, Other2", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicOne", @"OtherOneHello", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicTwo", @"FlexWiki.Other1.OtherOneGoodbye", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicThree", @"No.Such.Namespace.FooBar", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicFour", @".TopicOne", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicFive", @"FooBar Role:Designer", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_base, "TopicSix", @".GooBar Role:Developer", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, _other1.DefinitionTopicName.LocalName, @"Import: Other3,Other2", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneHello", @"hello Role:Developer", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneGoodbye", @"goodbye", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneRefThree", @"OtherThreeTest", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicOne", @"OtherTwoHello", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicTwo", @"Other2.OtherTwoGoodbye", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicThree", @"No.Such.Namespace.FooBar", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicFour", @".OtherOneTopicOne", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicFive", @"FooBar", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other1, "OtherOneTopicSix", @".GooBar", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other2, "OtherTwoHello", @"hello", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other2, "OtherTwoGoodbye", @"goodbye", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_other3, "OtherThreeTest", @"yo", author); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager5, "AbsRef", @"Other2.OtherTwoHello", author); }
void ShowFederationInfo(Federation aFederation) { LinkMaker lm = new LinkMaker(RootUrl(Request)); UIResponse.WritePara(UIResponse.Bold("General Federation Information")); UIResponse.WriteStartKVTable(); UIResponse.WriteKVRow("Created", HTMLWriter.Escape(aFederation.Created.ToString())); UIResponse.WriteKVRow("Default Namespace", HTMLWriter.Escape(aFederation.DefaultNamespace.ToString())); UIResponse.WriteEndKVTable(); UIResponse.WriteDivider(); UIResponse.WritePara(UIResponse.Bold("Namespace Information")); UITable namespacesTable = new UITable(); namespacesTable.AddColumn(new UIColumn("Namespace")); namespacesTable.AddColumn(new UIColumn("Title")); namespacesTable.AddColumn(new UIColumn("Imports")); UIResponse.WriteStartTable(namespacesTable); foreach (ContentBase each in aFederation.ContentBases) { UIResponse.WriteStartRow(); string ns = each.Namespace; UIResponse.WriteCell( UIResponse.Bold( UIResponse.Link(lm.LinkToTopic(new AbsoluteTopicName(each.HomePage, each.Namespace), false), UIResponse.Escape(each.Namespace)))); UIResponse.WriteCell(HTMLWriter.Escape(each.Title)); string imports = ""; foreach (string e in each.ImportedNamespaces) { if (imports != "") imports += ", "; imports += e; } UIResponse.WriteCell(HTMLWriter.Escape(imports)); UIResponse.WriteEndRow(); } UIResponse.WriteEndTable(); }
public void Init() { string author = "tester-joebob"; _lm = new LinkMaker("/contentbasetests/"); TheFederation = new Federation(OutputFormat.HTML, _lm); _base = CreateStore("FlexWiki.Base"); WriteTestTopicAndNewVersion(_base, "TopicOne", @"Hello there", author); System.Threading.Thread.Sleep(100); // need the newer one to be newer enough! WriteTestTopicAndNewVersion(_base, "TopicOne", @"Hello a", author); System.Threading.Thread.Sleep(100); // need the newer one to be newer enough! WriteTestTopicAndNewVersion(_base, "TopicOne", @"Hello b", author); System.Threading.Thread.Sleep(100); // need the newer one to be newer enough! WriteTestTopicAndNewVersion(_base, "TopicOne", @"Hello c", author); WriteTestTopicAndNewVersion(_base, "Versioned", "v1", "tester-bob"); WriteTestTopicAndNewVersion(_base, "Versioned", "v2", "tester-sally"); WriteTestTopicAndNewVersion(_base, "TopicTwo", @"Something about TopicOne and more!", author); WriteTestTopicAndNewVersion(_base, "Props", @"First: one Second: two Third:[ lots and lots ] more stuff ", author); WriteTestTopicAndNewVersion(_base, "TopicOlder", @"write first", author); WriteTestTopicAndNewVersion(_base, "ExternalWikis", @"@wiki1=dozo$$$ @wiki2=fat$$$", author); System.Threading.Thread.Sleep(100); // need the newer one to be newer enough! // THIS ONE (TopicNewer) MUST BE WRITTEN LAST!!!! WriteTestTopicAndNewVersion(_base, "TopicNewer", @"write last", author); }
// This one is only used by the BuildVerificationTests and should go away // at some point. Don't use it. public FlexWikiWebApplication(string configPath, LinkMaker linkMaker) : this(configPath, linkMaker, OutputFormat.HTML) { }
public void SetUp() { _lm = new LinkMaker(c_siteUrl); FederationConfiguration configuration = new FederationConfiguration(); AuthorizationRule rule = new AuthorizationRule(new AuthorizationRuleWho(AuthorizationRuleWhoType.GenericAll, null), AuthorizationRulePolarity.Allow, AuthorizationRuleScope.Wiki, SecurableAction.ManageNamespace, 0); configuration.AuthorizationRules.Add(new WikiAuthorizationRule(rule)); MockWikiApplication application = new MockWikiApplication( configuration, _lm, OutputFormat.HTML, new MockTimeProvider(TimeSpan.FromSeconds(1))); Federation = new Federation(application); Federation.WikiTalkVersion = 1; _namespaceManager = WikiTestUtilities.CreateMockStore(Federation, "FlexWiki"); //_namespaceManager.Title = "Friendly Title"; WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "_ContentBaseDefinition", "Title: Friendly Title", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "HomePage", "Home is where the heart is", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "BigPolicy", "This is ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "BigDog", "This is ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "BigAddress", "This is ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "BigBox", "This is ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeOne", "inc1", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeTwo", "!inc2", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeThree", "!!inc3", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeFour", "!inc4", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeNest", @" {{IncludeNest1}} {{IncludeNest2}}", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TopicWithColor", "Color: Yellow", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeNest1", "!hey there", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeNest2", "!black dog", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "IncludeNestURI", @"wiki://IncludeNest1 wiki://IncludeNest2 ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "ResourceReference", @"URI: http://www.google.com/$$$", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "FlexWiki", "flex ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "InlineTestTopic", @"aaa @@""foo""@@ zzz", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "OneMinuteWiki", "one ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TestIncludesBehaviors", "@@ProductName@@ somthing @@Now@@ then @@Now@@", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "_Underscore", "Underscore", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TopicWithBehaviorProperties", @" Face: {""hello"".Length} one FaceWithArg: {arg | arg.Length } FaceSpanningLines:{ arg | arg.Length } ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TestTopicWithBehaviorProperties", @" len=@@topics.TopicWithBehaviorProperties.Face@@ lenWith=@@topics.TopicWithBehaviorProperties.FaceWithArg(""superb"")@@ lenSpanning=@@topics.TopicWithBehaviorProperties.FaceSpanningLines(""parsing is wonderful"")@@ ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TestTopicWithBehaviorProperty", @"lenSpanning=@@topics.TopicWithBehaviorProperties.FaceSpanningLines(""parsing is wonderful"")@@", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TopicWithInclude", "{{TopicOneNoRead}}", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TopicOneNoRead", @"DenyRead: all PropertyOne: ValueOne PropertyTwo: Value Two PropertyOne: List, of, values", _user); _externals = new ExternalReferencesMap(); }
public void Init() { _lm = new LinkMaker(_base); FederationConfiguration configuration = new FederationConfiguration(); AuthorizationRule rule = new AuthorizationRule(new AuthorizationRuleWho(AuthorizationRuleWhoType.GenericAll, null), AuthorizationRulePolarity.Allow, AuthorizationRuleScope.Wiki, SecurableAction.ManageNamespace, 0); configuration.AuthorizationRules.Add(new WikiAuthorizationRule(rule)); MockWikiApplication application = new MockWikiApplication( configuration, _lm, OutputFormat.HTML, new MockTimeProvider(TimeSpan.FromSeconds(1))); Federation = new Federation(application); Federation.WikiTalkVersion = 1; string ns = "FlexWiki"; string ns2 = "FlexWiki2"; _namespaceManager = WikiTestUtilities.CreateMockStore(Federation, ns); _namespaceManager2 = WikiTestUtilities.CreateMockStore(Federation, ns2); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "HomePage", "", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, _namespaceManager.DefinitionTopicName.LocalName, @"Import: FlexWiki2", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "QualifiedLocalPropertyRef", @" Color: green color=@@topics.QualifiedLocalPropertyRef.Color@@", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "UnqualifiedLocalPropertyRef", @" Color: green color=@@Color@@", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "QualifiedLocalMethodRef", @" len=@@topics.QualifiedLocalMethodRef.DirectStringLength(""hello"")@@ DirectStringLength: { str | str.Length } ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "UnqualifiedLocalMethodRef", @" len=@@DirectStringLength(""hello"")@@ DirectStringLength: { str | str.Length } ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "LocalMethodIndirection", @" len=@@StringLength(""hello"")@@ StringLength: { str | Len(str) } Len: { str | str.Length } ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "LocalMethodIndirection2", @" len=@@StringLength(""hello"")@@ StringLength: { str | Len(str) } Len: { s | s.Length } ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "CallerBlockLocalsShouldBeInvisible", @" len=@@StringLength(""hello"")@@ StringLength: { str | Len(str) } Len: { s | str.Length } ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager2, "Profile", @"Color: puce", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "ReferAcrossNamespaces", @"@@topics.Profile.Color@@", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "TestChecker", @" Test: { FearFactor } Color: green", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "CallTestChecker", @" FearFactor: nighttime test=@@topics.TestChecker.Test@@ ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "Topic1", @" Function: { arg1 | topics.Topic2.FunctionTwo( { arg1 } ) } ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "Topic2", @" FunctionTwo: { someArg | someArg.Value } ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "Topic3", @"@@topics.Topic1.Function(100)@@", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "BlockCanSeeLexicalScopeCaller", @" result=@@ topics.BlockCanSeeLexicalScopeCallee.BlockValue( { Color } ) @@ Color: green", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "BlockCanSeeLexicalScopeCallee", @" BlockValue: {aBlock | aBlock.Value }", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "ThisTests", @" topicName=@@topicName.Name@@ namespace=@@namespace.Name@@ nscount=@@federation.Namespaces.Count@@ color=@@this.Color@@ Color: red ", _user); WikiTestUtilities.WriteTestTopicAndNewVersion(_namespaceManager, "WikiTalkHomeObject", @" @@topics@@ namespace=@@namespace@@ federation=@@federation@@ color=@@this.Color@@ Color: red true = @@true@@ empty = @@empty@@(this is empty) false = @@false@@ null = @@null@@ ", _user); }