You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by aj...@apache.org on 2008/02/13 07:29:31 UTC
svn commit: r627275 -
/incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/
Author: ajaquith
Date: Tue Feb 12 22:29:30 2008
New Revision: 627275
URL: http://svn.apache.org/viewvc?rev=627275&view=rev
Log:
Initial commit.
Added:
incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/TestPlugins.txt
incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/TextFormattingRules.txt
incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/filters.xml
incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/groupdatabase.xml.tmpl
incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/jspwiki.properties.tmpl
incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/jspwiki_rcs.properties.tmpl
incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/jspwiki_vers.properties.tmpl
incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/test.properties
incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/userdatabase.xml.tmpl
incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/web unit tests
incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/webtests.xml
Added: incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/TestPlugins.txt
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/TestPlugins.txt?rev=627275&view=auto
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/TestPlugins.txt (added)
+++ incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/TestPlugins.txt Tue Feb 12 22:29:30 2008
@@ -0,0 +1,166 @@
+Since v1.6.3 you can now define your own plugins. These are just
+simply Java classes that implement the
+''com.ecyrd.jspwiki.plugin.WikiPlugin'' interface and can be found from
+somewhere in your class path. The plugins work so that when you write
+a special code on the Wiki page, the plugins are invoked and their
+output is inserted into the page, verbatim.
+
+The form is:
+
+ [[{INSERT <plugin class> WHERE <param1=value1>,<param2=value2>,...}]
+
+You can also use a shortcut: instead of using {{[[{INSERT com.ecyrd.jspwiki.plugin.RecentChangesPlugin}} you can also use {{[[{INSERT RecentChangesPlugin}]}}. This works only with the plugins that come with JSPWiki, though.
+
+In addition, you can now (since 1.9.30) omit even the "INSERT", so the shortest possible version for plugins becomes:
+
+[[{CurrentTimePlugin}]
+
+If a parameter contains spaces, you can use single quotes (') around the parameter. Like this:
+
+[[{INSERT CurrentTimePlugin format='dd MM yyyy'}]
+
+Here are some sample plugins included in the archive:
+
+----
+
+!!RecentChangesPlugin
+
+Inserts the latest changes in order.
+
+!Parameters:
+* __since__=''n'' : show changes from the last n days.
+* __format__=''(full|compact)'' : if "full", then display a long
+ version with all possible info. If "compact", then be as compact as possible.
+
+!Example:
+{{{
+[{INSERT RecentChangesPlugin since=5, format=compact}]
+}}}
+
+Inserts the changes from the past 5 days in a compact format. You
+might use this to make an automatical list of changes to the [LeftMenu], or [LeftMenuFooter], for example.
+
+----
+
+!!UnusedPagesPlugin
+
+Lists all pages that are not currently referred to by any other page, thus meaning they are inaccessible through any other means.
+
+!Parameters
+
+* __maxwidth__=''n'' : Limits the length of the generated links to at most ''n'' characters. This should used to keep the [LeftMenu] or [LeftMenuFooter] at a manageable width. Default is to not limit the length at all.
+
+
+!Example:
+
+See [UnusedPages].
+
+----
+
+!!UndefinedPagesPlugin
+
+Lists all pages that are referred to, but not yet created.
+
+!Parameters
+
+* __maxwidth__=''n'' : Limits the length of the generated links to at most ''n'' characters. This should used to keep the [LeftMenu] or [LeftMenuFooter] at a manageable width. Default is to not limit the length at all.
+
+!Example:
+
+See [UndefinedPages].
+
+----
+
+
+!!ReferringPagesPlugin
+
+Finds and lists all pages that refer to the current page.
+
+!Parameters
+
+* __max__=''n'' : How many pages to list. Default is 10. Some pages might create very long lists, so it's a good idea to limit the list size.
+* __maxwidth__=''n'' : Limits the length of the generated links to at most ''n'' characters. This should used to keep the [LeftMenu] or [LeftMenuFooter] at a manageable width. Default is to not limit the length at all.
+
+!Example
+
+See [LeftMenuFooter].
+
+----
+
+!!CurrentTimePlugin
+
+Just displays the current server time.
+
+!Parameters
+
+* __format__=''format string'' : How the date and time should be formatted. If you omit this, a default format will be used. The following characters are available to you:
+
+{{{
+ Symbol Meaning Presentation Example
+ ------ ------- ------------ -------
+ G era designator (Text) AD
+ y year (Number) 1996
+ M month in year (Text & Number) July & 07
+ d day in month (Number) 10
+ h hour in am/pm (1~12) (Number) 12
+ H hour in day (0~23) (Number) 0
+ m minute in hour (Number) 30
+ s second in minute (Number) 55
+ S millisecond (Number) 978
+ E day in week (Text) Tuesday
+ D day in year (Number) 189
+ F day of week in month (Number) 2 (2nd Wed in July)
+ w week in year (Number) 27
+ W week in month (Number) 2
+ a am/pm marker (Text) PM
+ k hour in day (1~24) (Number) 24
+ K hour in am/pm (0~11) (Number) 0
+ z time zone (Text) Pacific Standard Time
+ \' escape for text (Delimiter)
+ \'' single quote (Literal) '
+}}}
+
+For example, two 'y':s give you the year using two digits. Four 'y':s give you the year in four digits. Three 'M':s give you the month in letters, whereas two 'M':s give just the month number.
+
+(Yes, these are exactly the Java [SimpleDateFormat|http://java.sun.com/j2se/1.3/docs/api/java/text/SimpleDateFormat.html] arguments. Sorry for copying them in.)
+
+!Example
+
+Using [[{INSERT CurrentTimePlugin format='yyyy.MM.dd G \'at\' hh:mm:ss z'}] would give you:
+
+[{INSERT CurrentTimePlugin format='yyyy.MM.dd G \'at\' hh:mm:ss z'}]
+
+----
+
+!!IndexPlugin
+
+Displays all of the pages in this Wiki in alphabetical order. IndexPlugin has been contributed by AlainRavet.
+
+!Parameters
+* __itemsPerLine__ = ''n''. Break every 'n' items on line.
+
+!Example
+
+See [PageIndex].
+
+----
+
+!!Counter
+
+A simple counter that starts counting at 1 at the top of the page, and each time it is invoked, will increase its value by one. These counters are transient, and relative to the current page view only - i.e. two persons viewing the same page at the same time get their own counters.
+
+The current counter value is accessible also as a [WikiVariable]. The name of the variable is "counter", or "counter-<name>", if you have defined a counter name.
+
+!Parameters
+
+* __name__ = ''counter name''. You may define as many counters per page as you want; you just need to separate them with the ''counter name''
+
+!Example
+
+[[{Counter}], [[{Counter}], [[{Counter}], [[{Counter name='aa'}] produces
+
+[{Counter}], [{Counter}], [{Counter}], [{Counter name='aa'}].
+
+The value of "counter" at the end is [{$counter}] and the value of "counter-aa" is [{$counter-aa}].
+
+
Added: incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/TextFormattingRules.txt
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/TextFormattingRules.txt?rev=627275&view=auto
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/TextFormattingRules.txt (added)
+++ incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/TextFormattingRules.txt Tue Feb 12 22:29:30 2008
@@ -0,0 +1,143 @@
+When you've figured out how the editor works, then you should read [WikiEtiquette] so that you would know how to use your newly acquired skills...
+
+!Quick reference
+
+{{{
+---- = Make a horizontal ruler. Extra '-' is ignored.
+\\ = force a line break
+
+[link] = creates a hyperlink to an internal WikiPage called 'Link'.
+[this is also a link] = creates a hyperlink to an internal WikiPage called
+'ThisIsAlsoALink'.
+[click here|link] = creates a hyperlink to an internal WikiPage called
+'Link', but displays the text 'click here' to the
+user instead of 'Link'.
+[1] = Makes a reference to a footnote numbered 1.
+[#1] = Marks the footnote number 1.
+[[link] = creates text '[link]'.
+
+!heading = small heading with text 'heading'
+!!heading = medium heading with text 'heading'
+!!!heading = large heading with text 'heading'
+
+''text'' = prints 'text' in italic.
+__text__ = prints 'text' in bold.
+{{text}} = prints 'text' in monospaced font.
+
+* text = makes a bulleted list item with 'text'
+# text = makes a numbered list item with 'text'
+}}}
+
+!Writing text
+
+You don't need to know anything about the Wiki text formatting rules to use Wiki. Just write normal text, and then use an empty line to mark a paragraph.
+It's just like writing an email.
+
+You can always Edit this page (look at the left sidebar) to see how the different
+effects on this page are used.
+
+!Hyperlinks
+The link can also be a direct URL starting with http:, ftp:, mailto:, https:, or news:, in which case the link points to an external entity. For example, to point at the java.sun.com home page, use [[http://java.sun.com], which becomes [http://java.sun.com/] or [[Java home page|http://java.sun.com], which becomes [Java home page|http://java.sun.com].
+
+To add a new page you just create a link to it from somewhere else. After all, there isn't much point in having a page if you can't access it! You'll then see a small question mark after the page name when you return to that page. Then click on it and you have created a new page!
+
+It's allowed to use almost any kind of characters inside a [WikiName], as long
+as they are letters or numbers.
+
+!Footnotes
+
+These are a special kind of hyperlink. By using nothing but a number inside
+a hyperlink you create a reference to a footnote, like this [[1], which
+creates a footnote[1]. To make the actual footnote, you just put a [[#1]
+where you want that footnote to point at. Look below to find the footnote.
+
+You can also make a named footnote, just as if you were doing a normal hyperlink. For example, this refers to the same footnote[Footnote number 1|1] as the footnote above, but this refers to another footnote[2].
+
+!InterWiki links
+
+You can also do links between different Wikis without knowing the URL. Just use a link in the form [[Wiki:WikiPage] and JSPWiki will create a link for you. For example, this link points to the [JSPWiki TextFormatting rules|JSPWiki:TextFormattingRules]. Check the [SystemInfo] page for more information on which Wiki links are available.
+
+If an InterWiki link is not supported, you'll get a notification of it on the page when
+you save your page.
+
+!Adding pictures
+
+For security reasons uploading images is not permitted, but you can embed
+any image in the wiki code by putting the image available somewhere on the web in one of the allowed formats, and then just linking to it.
+For example, this is an inlined [PNG] image: [http://www.ecyrd.com/~jalkanen/test.png].
+
+If you specify a link text ([[this one here|http://example.com/example.png]) it becomes
+the ALT text for those who either can't or don't want to view images.
+
+The list of accepted image types depends on the Wiki. See the [SystemInfo]
+page for a list of the different image types.
+
+!Bulleted lists
+Use an asterisk (*) in the first column to make bulleted lists. Use more asterisks for deeper indentation. For example:
+{{{
+* One
+* Two
+* Three
+** Three.One}}}
+
+creates
+* One
+* Two
+* Three
+** Three.One
+
+!Numbered lists
+Just like with bulleted lists, but use a hash (#) instead of the asterisk. Like this:
+{{{
+# One
+# Two
+# Three
+## Three.One
+}}}
+
+creates
+# One
+# Two
+# Three
+## Three.One
+
+If you want to write the list item on multiple lines, just add one or more spaces on the next line and the line will be automatically added to the
+previous item. If this sounds complicated, edit this page for an example, below.
+
+* This is a single-line item.
+* This is actually a multi-line item.
+ We continue the second sentence on a line on a line of its own.
+ We might as well do a third line while we're at it...
+ Notice, however, as all these sentences get put inside a single item!
+* The third line is again a single-line item for your convinience.
+
+!Text effects
+
+You may use __bold__ text or ''italic'' text, by using two underscores (_) and two single quotes ('), respectively. If you're on a Windows computer, make sure that you are using the correct quote sign, as there is one that looks the same, but really isn't.
+
+
+!Preformatted text
+
+If you want to add preformatted text (like code) just use three consecutive braces ({) to open a block, and three consecutive braces (}) to close a block. Edit this page for an example.
+
+!Conflicts
+
+If someone happens to edit the same page as you at the same time, JSPWiki will prevent you from doing changes and show a conflict page instead. Sorry to say, but the first one to make changes wins...
+
+__A word of warning:__ If you use the Back button of your browser to go into the Edit page, you will almost certainly get a conflict. This is because the browser thinks its still editing an earlier copy of the page.
+
+!Deleting pages
+
+This is not possible. You can, of course, remove all the links to that page, which makes it inaccesible. Or you can [email me|mailto:jalkanen+jspwiki@regex.fi], and I'll remove the page.
+
+!Adding new pages
+
+Create a link that points to a new (not existing) page using its [WikiName].
+Click that new link, which should now have a question mark (?) suffix and
+you will get an editor for the new page. -- [Asser]
+
+----
+
+[#1] Here's the footnote I mentioned.
+
+[The other footnote|#2] The other footnote. Note how it's name is different?
\ No newline at end of file
Added: incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/filters.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/filters.xml?rev=627275&view=auto
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/filters.xml (added)
+++ incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/filters.xml Tue Feb 12 22:29:30 2008
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+
+<pagefilters>
+
+ <filter>
+ <class>com.ecyrd.jspwiki.filters.ProfanityFilter</class>
+ </filter>
+
+ <filter>
+ <class>com.ecyrd.jspwiki.filters.TestFilter</class>
+
+ <param>
+ <name>foobar</name>
+ <value>Zippadippadai</value>
+ </param>
+
+ <param>
+ <name>blatblaa</name>
+ <value>5</value>
+ </param>
+ </filter>
+
+</pagefilters>
Added: incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/groupdatabase.xml.tmpl
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/groupdatabase.xml.tmpl?rev=627275&view=auto
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/groupdatabase.xml.tmpl (added)
+++ incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/groupdatabase.xml.tmpl Tue Feb 12 22:29:30 2008
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<groups>
+ <group name="TV" created="2006.06.20 at 14:50:54:000 EDT" modifier="" lastModified="2006.01.21 at 14:50:54:000 EST">
+ <member principal="Archie Bunker" />
+ <member principal="BullwinkleMoose" />
+ <member principal="Fred Friendly" />
+ </group>
+ <group name="Literature" created="2006.06.22 at 14:50:54:000 EDT" modifier="" lastModified="2006.01.23 at 14:50:54:000 EST">
+ <member principal="Charles Dickens" />
+ <member principal="Homer" />
+ </group>
+ <group name="Art" created="2006.06.24 at 14:50:54:000 EDT" modifier="" lastModified="2006.01.25 at 14:50:54:000 EST"/>
+ <group name="Admin" created="2006.06.25 at 14:50:54:000 EDT" modifier="" lastModified="2006.01.26 at 14:50:54:000 EST">
+ <member principal="Administrator" />
+ </group>
+</groups>
\ No newline at end of file
Added: incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/jspwiki.properties.tmpl
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/jspwiki.properties.tmpl?rev=627275&view=auto
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/jspwiki.properties.tmpl (added)
+++ incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/jspwiki.properties.tmpl Tue Feb 12 22:29:30 2008
@@ -0,0 +1,149 @@
+#
+# Property file for tests.
+#
+#
+# Which page provider class to use. Possibilities are:
+#
+# RCSFileProvider for simple RCS-based file storage
+# FileSystemProvider for simple pure file storage with no version information
+#
+jspwiki.pageProvider = com.ecyrd.jspwiki.providers.FileSystemProvider
+
+jspwiki.usePageCache = true
+#
+# Determines where wiki files are kept.
+#
+jspwiki.fileSystemProvider.pageDir = @tests.pagedir@
+jspwiki.workDir = @tests.workdir@
+
+jspwiki.translatorReader.camelCaseLinks = true
+
+jspwiki.breakTitleWithSpaces = true
+
+jspwiki.translatorReader.matchEnglishPlurals = true
+jspwiki.translatorReader.useOutlinkImage = false
+
+jspwiki.attachmentProvider = BasicAttachmentProvider
+jspwiki.basicAttachmentProvider.storageDir = @tests.pagedir@
+
+jspwiki.encoding = ISO-8859-1
+
+jspwiki.authenticator = FileAuthenticator
+jspwiki.fileAuthenticator.fileName = @tests.auth.filename@
+
+jspwiki.filterConfig = @tests.filter@
+
+jspwiki.baseURL = http://localhost/
+jspwiki.referenceStyle = relative
+jspwiki.searchProvider = BasicSearchProvider
+jspwiki.authorizer=com.ecyrd.jspwiki.TestAuthorizer
+
+#
+# Special page references.
+#
+# The URL is relative to Wiki.jsp. However, if you use
+# a full, absolute URL, you can also do that.
+#
+# Example to redirect all requests to a page called 'OriginalWiki'
+# to the original wikiwiki at http://c2.com/cgi/wiki
+#
+# jspwiki.specialPage.OriginalWiki = http://c2.com/cgi/wiki
+#
+jspwiki.specialPage.RecentChanges = RecentChanges.jsp
+jspwiki.specialPage.FindPage = Search.jsp
+
+# InterWiki links The %s is replaced with the page reference (specify
+# multiple times to get multiple references). Page references should
+# appear in format : [wiki:wikipage].
+
+jspwiki.interWikiRef.JSPWiki = http://www.ecyrd.com/JSPWiki/Wiki.jsp?page=%s
+
+jspwiki.rss.generate = false
+
+#
+# Define which image types are inlined.
+# These are your standard glob expressions (just like in your
+# Windows or UNIX shells).
+#
+
+jspwiki.translatorReader.inlinePattern.1 = *.jpg
+jspwiki.translatorReader.inlinePattern.2 = *.png
+jspwiki.translatorReader.inlinePattern.3 = http://images.com/*
+
+#
+# Security: use standard providers for user/group auth, user management
+# and ACLs. Use a test userdatabase for storing users.
+#
+jspwiki.aclManager = com.ecyrd.jspwiki.auth.acl.DefaultAclManager
+#jspwiki.authorizer = com.ecyrd.jspwiki.auth.authorize.WebContainerAuthorizer
+jspwiki.groupdatabase = com.ecyrd.jspwiki.auth.authorize.XMLGroupDatabase
+jspwiki.xmlGroupDatabaseFile = tests/etc/groupdatabase.xml
+jspwiki.userdatabase = com.ecyrd.jspwiki.auth.user.XMLUserDatabase
+jspwiki.xmlUserDatabaseFile = tests/etc/userdatabase.xml
+jspwiki.admin.user = admin
+
+jspwiki.userdatabase.datasource=jdbc/UserDatabase
+jspwiki.userdatabase.table=users
+jspwiki.userdatabase.email=email
+jspwiki.userdatabase.fullName=full_name
+jspwiki.userdatabase.loginName=login_name
+jspwiki.userdatabase.password=password
+jspwiki.userdatabase.wikiName=wiki_name
+jspwiki.userdatabase.created=created
+jspwiki.userdatabase.modified=modified
+jspwiki.userdatabase.roleTable=roles
+jspwiki.userdatabase.role=role
+jspwiki.groupdatabase.datasource=jdbc/GroupDatabase
+jspwiki.groupdatabase.table=groups
+jspwiki.groupdatabase.membertable=group_members
+jspwiki.groupdatabase.created=created
+jspwiki.groupdatabase.creator=creator
+jspwiki.groupdatabase.name=name
+jspwiki.groupdatabase.member=member
+jspwiki.groupdatabase.modified=modified
+jspwiki.groupdatabase.modifier=modifier
+
+#
+# Configure logs.
+#
+# Send mail on alerts
+#
+#
+# Log only interesting stuff on screen.
+#
+#log4j.appender.console = org.apache.log4j.ConsoleAppender
+#log4j.appender.console.Threshold = WARN
+
+#log4j.appender.console.layout = org.apache.log4j.PatternLayout
+#log4j.appender.console.layout.ConversionPattern = %-5p: %m%n
+
+#
+# Log everything into a file.
+#
+log4j.appender.FileLog = org.apache.log4j.RollingFileAppender
+log4j.appender.FileLog.MaxFileSize = 10MB
+log4j.appender.FileLog.MaxBackupIndex = 14
+log4j.appender.FileLog.File = @tests.logfile@
+log4j.appender.FileLog.layout = org.apache.log4j.PatternLayout
+log4j.appender.FileLog.layout.ConversionPattern=%d [%t] %p %c %x - %m%n
+log4j.rootCategory=DEBUG,FileLog
+
+log4j.appender.SecurityAppender = org.apache.log4j.RollingFileAppender
+log4j.appender.SecurityAppender.MaxFileSize = 10MB
+log4j.appender.SecurityAppender.MaxBackupIndex = 14
+log4j.appender.SecurityAppender.File = @securitylog@
+log4j.appender.SecurityAppender.layout = org.apache.log4j.PatternLayout
+log4j.appender.SecurityAppender.layout.ConversionPattern=%d %p - %m%n
+log4j.logger.SecurityLog=INFO, SecurityAppender
+
+# JavaMail properties
+mail.smtp.host = 127.0.0.1
+mail.smtp.port = 25
+mail.from = JSPWiki <JS...@localhost>
+#mail.smtp.account =
+#mail.smtp.password =
+
+# Workflow test properties
+jspwiki.approver.workflow.saveWikiPage=
+jspwiki.approver.workflow.foo=janne
+jspwiki.approver.workflow.bar=Admin
Added: incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/jspwiki_rcs.properties.tmpl
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/jspwiki_rcs.properties.tmpl?rev=627275&view=auto
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/jspwiki_rcs.properties.tmpl (added)
+++ incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/jspwiki_rcs.properties.tmpl Tue Feb 12 22:29:30 2008
@@ -0,0 +1,112 @@
+#
+# Property file for tests.
+#
+#
+# Which page provider class to use. Possibilities are:
+#
+# RCSFileProvider for simple RCS-based file storage
+# FileSystemProvider for simple pure file storage with no version information
+#
+jspwiki.pageProvider = RCSFileProvider
+
+#
+# Determines where wiki files are kept.
+#
+jspwiki.fileSystemProvider.pageDir = @tests.pagedir@
+jspwiki.workDir = @tests.workdir@
+jspwiki.searchProvider = BasicSearchProvider
+
+#
+# Special page references.
+#
+# The URL is relative to Wiki.jsp. However, if you use
+# a full, absolute URL, you can also do that.
+#
+# Example to redirect all requests to a page called 'OriginalWiki'
+# to the original wikiwiki at http://c2.com/cgi/wiki
+#
+# jspwiki.specialPage.OriginalWiki = http://c2.com/cgi/wiki
+#
+jspwiki.specialPage.RecentChanges = RecentChanges.jsp
+jspwiki.specialPage.FindPage = Search.jsp
+
+# InterWiki links The %s is replaced with the page reference (specify
+# multiple times to get multiple references). Page references should
+# appear in format : [wiki:wikipage].
+
+jspwiki.interWikiRef.JSPWiki = http://www.ecyrd.com/JSPWiki/Wiki.jsp?page=%s
+
+#
+# Define which image types are inlined.
+# These are your standard glob expressions (just like in your
+# Windows or UNIX shells).
+#
+
+jspwiki.translatorReader.inlinePattern.1 = *.jpg
+jspwiki.translatorReader.inlinePattern.2 = *.png
+jspwiki.translatorReader.inlinePattern.3 = http://images.com/*
+
+#
+# Security: use standard providers for user/group auth, user management
+# and ACLs. Use a test userdatabase for storing users.
+#
+jspwiki.aclManager = com.ecyrd.jspwiki.auth.acl.DefaultAclManager
+jspwiki.authorizer = com.ecyrd.jspwiki.auth.authorize.WebContainerAuthorizer
+jspwiki.groupManager = com.ecyrd.jspwiki.auth.authorize.DefaultGroupManager
+jspwiki.userdatabase = com.ecyrd.jspwiki.auth.user.XMLUserDatabase
+jspwiki.xmlUserDatabaseFile = tests/etc/userdatabase.xml
+jspwiki.admin.user = admin
+
+jspwiki.userdatabase.datasource=jdbc/UserDatabase
+jspwiki.userdatabase.table=users
+jspwiki.userdatabase.email=email
+jspwiki.userdatabase.fullName=full_name
+jspwiki.userdatabase.loginName=login_name
+jspwiki.userdatabase.password=password
+jspwiki.userdatabase.wikiName=wiki_name
+jspwiki.userdatabase.created=created
+jspwiki.userdatabase.modified=modified
+jspwiki.userdatabase.roleTable=roles
+jspwiki.userdatabase.role=role
+jspwiki.groupdatabase.datasource=jdbc/GroupDatabase
+jspwiki.groupdatabase.table=groups
+jspwiki.groupdatabase.membertable=group_members
+jspwiki.groupdatabase.created=created
+jspwiki.groupdatabase.creator=creator
+jspwiki.groupdatabase.name=name
+jspwiki.groupdatabase.member=member
+jspwiki.groupdatabase.modified=modified
+jspwiki.groupdatabase.modifier=modifier
+
+#
+# Configure logs.
+#
+# Send mail on alerts
+#
+#
+# Log only interesting stuff on screen.
+#
+#log4j.appender.console = org.apache.log4j.ConsoleAppender
+#log4j.appender.console.Threshold = WARN
+
+#log4j.appender.console.layout = org.apache.log4j.PatternLayout
+#log4j.appender.console.layout.ConversionPattern = %-5p: %m%n
+
+#
+# Log everything into a file.
+#
+log4j.appender.FileLog = org.apache.log4j.RollingFileAppender
+log4j.appender.FileLog.MaxFileSize = 10MB
+log4j.appender.FileLog.MaxBackupIndex = 14
+log4j.appender.FileLog.File = @tests.logfile@
+log4j.appender.FileLog.layout = org.apache.log4j.PatternLayout
+log4j.appender.FileLog.layout.ConversionPattern=%d [%t] %p %c %x - %m%n
+log4j.rootCategory=DEBUG,FileLog
+
+log4j.appender.SecurityAppender = org.apache.log4j.RollingFileAppender
+log4j.appender.SecurityAppender.MaxFileSize = 10MB
+log4j.appender.SecurityAppender.MaxBackupIndex = 14
+log4j.appender.SecurityAppender.File = @securitylog@
+log4j.appender.SecurityAppender.layout = org.apache.log4j.PatternLayout
+log4j.appender.SecurityAppender.layout.ConversionPattern=%d %p - %m%n
+log4j.logger.SecurityLog=INFO, SecurityAppender
Added: incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/jspwiki_vers.properties.tmpl
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/jspwiki_vers.properties.tmpl?rev=627275&view=auto
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/jspwiki_vers.properties.tmpl (added)
+++ incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/jspwiki_vers.properties.tmpl Tue Feb 12 22:29:30 2008
@@ -0,0 +1,114 @@
+#
+# Property file for tests.
+#
+#
+# Which page provider class to use. Possibilities are:
+#
+# RCSFileProvider for simple RCS-based file storage
+# FileSystemProvider for simple pure file storage with no version information
+#
+jspwiki.pageProvider = VersioningFileProvider
+
+#
+# Determines where wiki files are kept.
+#
+jspwiki.fileSystemProvider.pageDir = @tests.pagedir@
+jspwiki.workDir = @tests.workdir@
+
+jspwiki.encoding = UTF-8
+jspwiki.searchProvider = BasicSearchProvider
+
+#
+# Special page references.
+#
+# The URL is relative to Wiki.jsp. However, if you use
+# a full, absolute URL, you can also do that.
+#
+# Example to redirect all requests to a page called 'OriginalWiki'
+# to the original wikiwiki at http://c2.com/cgi/wiki
+#
+# jspwiki.specialPage.OriginalWiki = http://c2.com/cgi/wiki
+#
+jspwiki.specialPage.RecentChanges = RecentChanges.jsp
+jspwiki.specialPage.FindPage = Search.jsp
+
+# InterWiki links The %s is replaced with the page reference (specify
+# multiple times to get multiple references). Page references should
+# appear in format : [wiki:wikipage].
+
+jspwiki.interWikiRef.JSPWiki = http://www.ecyrd.com/JSPWiki/Wiki.jsp?page=%s
+
+#
+# Define which image types are inlined.
+# These are your standard glob expressions (just like in your
+# Windows or UNIX shells).
+#
+
+jspwiki.translatorReader.inlinePattern.1 = *.jpg
+jspwiki.translatorReader.inlinePattern.2 = *.png
+jspwiki.translatorReader.inlinePattern.3 = http://images.com/*
+
+#
+# Security: use standard providers for user/group auth, user management
+# and ACLs. Use a test userdatabase for storing users.
+#
+jspwiki.aclManager = com.ecyrd.jspwiki.auth.acl.DefaultAclManager
+jspwiki.authorizer = com.ecyrd.jspwiki.auth.authorize.WebContainerAuthorizer
+jspwiki.groupManager = com.ecyrd.jspwiki.auth.authorize.DefaultGroupManager
+jspwiki.userdatabase = com.ecyrd.jspwiki.auth.user.XMLUserDatabase
+jspwiki.xmlUserDatabaseFile = tests/etc/userdatabase.xml
+jspwiki.admin.user = admin
+
+jspwiki.userdatabase.datasource=jdbc/UserDatabase
+jspwiki.userdatabase.table=users
+jspwiki.userdatabase.email=email
+jspwiki.userdatabase.fullName=full_name
+jspwiki.userdatabase.loginName=login_name
+jspwiki.userdatabase.password=password
+jspwiki.userdatabase.wikiName=wiki_name
+jspwiki.userdatabase.created=created
+jspwiki.userdatabase.modified=modified
+jspwiki.userdatabase.roleTable=roles
+jspwiki.userdatabase.role=role
+jspwiki.groupdatabase.datasource=jdbc/GroupDatabase
+jspwiki.groupdatabase.table=groups
+jspwiki.groupdatabase.membertable=group_members
+jspwiki.groupdatabase.created=created
+jspwiki.groupdatabase.creator=creator
+jspwiki.groupdatabase.name=name
+jspwiki.groupdatabase.member=member
+jspwiki.groupdatabase.modified=modified
+jspwiki.groupdatabase.modifier=modifier
+
+#
+# Configure logs.
+#
+# Send mail on alerts
+#
+#
+# Log only interesting stuff on screen.
+#
+#log4j.appender.console = org.apache.log4j.ConsoleAppender
+#log4j.appender.console.Threshold = WARN
+
+#log4j.appender.console.layout = org.apache.log4j.PatternLayout
+#log4j.appender.console.layout.ConversionPattern = %-5p: %m%n
+
+#
+# Log everything into a file.
+#
+log4j.appender.FileLog = org.apache.log4j.RollingFileAppender
+log4j.appender.FileLog.MaxFileSize = 10MB
+log4j.appender.FileLog.MaxBackupIndex = 14
+log4j.appender.FileLog.File = @tests.logfile@
+log4j.appender.FileLog.layout = org.apache.log4j.PatternLayout
+log4j.appender.FileLog.layout.ConversionPattern=%d [%t] %p %c %x - %m%n
+log4j.rootCategory=DEBUG,FileLog
+
+log4j.appender.SecurityAppender = org.apache.log4j.RollingFileAppender
+log4j.appender.SecurityAppender.MaxFileSize = 10MB
+log4j.appender.SecurityAppender.MaxBackupIndex = 14
+log4j.appender.SecurityAppender.File = @securitylog@
+log4j.appender.SecurityAppender.layout = org.apache.log4j.PatternLayout
+log4j.appender.SecurityAppender.layout.ConversionPattern=%d %p - %m%n
+log4j.logger.SecurityLog=INFO, SecurityAppender
Added: incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/test.properties
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/test.properties?rev=627275&view=auto
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/test.properties (added)
+++ incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/test.properties Tue Feb 12 22:29:30 2008
@@ -0,0 +1,12 @@
+# This is a sample properties file with comments
+testProp1=Foo
+
+# This is a comment
+testProp2 =Bar
+
+# This is a property with no value
+testProp3=
+# Two final properties
+testProp4=FooAgain
+testProp5=BarAgain
+
Added: incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/userdatabase.xml.tmpl
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/userdatabase.xml.tmpl?rev=627275&view=auto
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/userdatabase.xml.tmpl (added)
+++ incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/userdatabase.xml.tmpl Tue Feb 12 22:29:30 2008
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?><users>
+ <user email="janne@ecyrd.com" fullName="Janne Jalkanen" loginName="janne" password="{SHA}457b08e825da547c3b77fbc1ff906a1d00a7daee" wikiName="JanneJalkanen" created="2006.06.25 at 14:50:54:000 EDT" lastModified="2006.01.26 at 14:50:54:000 EST"/>
+ <user email="user@example.com" loginName="user" password="{SHA}5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" created="2006.06.25 at 14:50:54:000 EDT" lastModified="2006.01.26 at 14:50:54:000 EST"/>
+ <user loginName="admin" wikiName="Administrator" fullName="Administrator" email="admin@locahost" password="{SHA}457b08e825da547c3b77fbc1ff906a1d00a7daee" created="2006.06.25 at 14:50:54:000 EDT" lastModified="2006.01.26 at 14:50:54:000 EST"/>
+ <user loginName="Alice" wikiName="Alice" fullName="Alice" email="alice@example.com" password="{SHA}5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" created="2006.06.25 at 14:50:54:000 EDT" lastModified="2006.01.26 at 14:50:54:000 EST"/>
+ <user loginName="Bob" wikiName="Bob" fullName="Bob" email="bob@example.com" password="{SHA}5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" created="2006.06.25 at 14:50:54:000 EDT" lastModified="2006.01.26 at 14:50:54:000 EST"/>
+ <user loginName="Charlie" wikiName="Charlie" fullName="Charlie" email="charlie@example.com" password="{SHA}5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" created="2006.06.25 at 14:50:54:000 EDT" lastModified="2006.01.26 at 14:50:54:000 EST"/>
+ <user loginName="Fred" wikiName="FredFlintstone" fullName="Fred Flintstone" email="fred@example.com" password="{SHA}5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" created="2006.06.25 at 14:50:54:000 EDT" lastModified="2006.01.26 at 14:50:54:000 EST"/>
+ <user loginName="Biff" wikiName="Biff" fullName="Biff" email="biff@example.com" password="{SHA}5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" created="2006.06.25 at 14:50:54:000 EDT" lastModified="2006.01.26 at 14:50:54:000 EST"/>
+</users>
\ No newline at end of file
Added: incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/web unit tests
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/web%20unit%20tests?rev=627275&view=auto
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/web unit tests (added)
+++ incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/web unit tests Tue Feb 12 22:29:30 2008
@@ -0,0 +1,188 @@
+Web unit tests
+--------------
+Each of these tests needs to be tested for five scenarios (webapps):
+
+/test-custom
+/test-container
+/test-custom-absolute
+/test-custom-jdbc
+/test-container-jdbc
+
+
+I. Test Anonymous View & Anonymous View Image
+0. Clear all session/assertion cookies using the browser options/preferences tools.
+1. Verify the presence of text "You have successfully installed" and "This wiki is done using"
+2. Verify that you can see the JSPWiki logo in the upper left corner.
+
+
+II. Test Login
+0. Clear all session/assertion cookies using the browser options/preferences tools.
+1. Go to front page.
+2. Log in with test user name and password (janne/myP@5sw0rd); verify redirect to front page.
+3. Verify "G'Day JanneJalkanen" on front page.
+
+
+III. Test Logout
+0. Keep session from previous test alive...
+1. Log out; verify redirect to front page.
+2. Verify "G'Day anonymous guest" on front page
+3. Verify that the cookie "JSPWikiAssertedName" is cleared in the browser.
+
+
+IV. Test Asserted Name
+0. Clear all session/assertion cookies using the browser options/preferences tools.
+1. Go to the Main page. Verify the 'G'day anonymous guest' message.
+2. Navivate to the 'My Prefs' page.
+3. Set the asserted-name cookies to "Don Quixote"
+4. Verify redirect to the Main page; verify the message "G'Day Don Quixote" (not logged in)"
+5. Verify that the browser's cookie JSPWikiAssertedName is "Don+Quixote"
+6. Go back to the "My Prefs" page and clear the asserted-name cookie.
+7. Verify redirect to the Main page; verify the message "G'Day anonymous guest"
+8. Verify that the cookie JSPWikiAssertedName is cleared.
+
+
+V. Test ACL: Asserted Permissions
+0. Clear all session/assertion cookies using the browser options/preferences tools.
+1. Log in with test user name and password (janne/myP@5sw0rd).
+2. Create a new group called "AssertedPermissions" with these menbers:
+
+JanneJalkanen
+Fred Flintstone
+
+3. After creation go to "/Group.jsp?group=AssertedPermissions"; verify that the group was created and that it contains janne and Fred Flintstone.
+4. Clear all session/assertion cookies using the browser options/preferences tools.
+5. Go to "/Group.jsp?group=AssertedPermissions"; verify that the anonymous user can't view the group.
+6. Log in with test user name and password (janne/myP@5sw0rd).
+7. Go to "/Group.jsp?group=AssertedPermissions"; verify that janne can still view the group.
+8. Clear all session/assertion cookies using the browser options/preferences tools.
+9. Set the asserted-name cookie to "Fred Flintstone"
+A. Go to "/Group.jsp?group=AssertedPermissions"; verify that Fred Flintstone can view the group.
+B. Go to "/EditGroup.jsp?group=AssertedPermissions"; verify that Fred Flintstone cannot edit; should be redirected to login page.
+
+
+VI. Test ACL: Authenticated
+0. Clear all session/assertion cookies using the browser options/preferences tools.
+1. Log in with test user name and password (janne/myP@5sw0rd).
+2. Create new page "ACLAuthenticated" with these contents:
+
+[{ALLOW view Authenticated}]
+We created this page to test redirects.
+
+3. Clear all session/assertion cookies using the browser options/preferences tools.
+4. Go to "/Wiki.jsp?page=ACLAuthenticated"; verify that anonymous can't view.
+5. Log in with test user name and password (janne/myP@5sw0rd).
+6. Verify that janne can see the page's text.
+
+
+VII. Test ACL: Janne Edit
+0. Clear all session/assertion cookies using the browser options/preferences tools.
+1. Log in as 'janne'
+2. Create new page via /Edit.jsp?page=AclEditOnly
+3. Add this text:
+
+[{ALLOW edit janne}]
+This page was created with an ACL by janne
+
+4. Click 'ok'
+5. Log out & clear cookies.
+6. Try to view page 'AclEditOnly'. It should NOT succeed; will be redirected to the login page.
+7. Try to edit page 'AclEditOnly'. It should NOT succeed; will be redirected to the login page.
+8. Login as 'janne' again.
+9. Try to view page 'AclEditOnly'. It should succeed.
+10. Try to edit page 'AclEditOnly'. It should succeed also.
+
+
+VIII. Test Acl: Janne Edit, All View
+0. Clear all session/assertion cookies using the browser options/preferences tools.
+1. Log in with test user name and password (janne/myP@5sw0rd).
+2. Create new page via /Edit.jsp?page=AclViewAndEdit
+3. Add this text:
+
+[{ALLOW edit janne}]
+[{ALLOW view All}]
+This page was created with an ACL by janne
+
+4. Click 'ok'
+5. Log out & clear cookies.
+6. Try to view page 'AclViewAndEdit'. It should succeed.
+7. Try to edit page 'AclViewAndEdit'. It should NOT succeed; will be redirected to the login page.
+8. Login as 'janne' again.
+9. Try to view page 'AclEditOnly'. It should succeed.
+10. Try to view page 'AclEditOnly'. It should succeed also.
+
+
+IX. Test Anonymous Create Group
+0. Clear all session/assertion cookies using the browser options/preferences tools.
+1. Try to create a new group by navigating to "/NewGroup.jsp"
+2. Verify redirect to login page.
+
+
+X. Test Create Group: Full Name
+0. Clear all session/assertion cookies using the browser options/preferences tools.
+1. Log in with test user name and password (janne/myP@5sw0rd).
+2. Create a new group called FullName with this member:
+
+Janne Jalkanen
+
+3. Go to "/Group.jsp?group=FullName"; verify that Janne Jalkanen is a member.
+4. Clear all session/assertion cookies using the browser options/preferences tools.
+5. Go to "/Group.jsp?group=FullName"; verify that anonymous can't view; should be redirected to login page.
+6. Go to "/EditGroup.jsp?group=FullName"; verify that anonymous can't view; should be redirected to login page.
+7. Log in with test user name and password (janne/myP@5sw0rd).
+8. Go to "/Group.jsp?group=FullName"; verify that janne can still view the group.
+9. Go to "/EditGroup.jsp?group=FullName"; verify that janne can still edit the group.
+
+
+XI. Test Create Group: Login Name
+0. Clear all session/assertion cookies using the browser options/preferences tools.
+1. Log in with test user name and password (janne/myP@5sw0rd).
+2. Create a new group called LoginName with this member:
+
+janne
+
+3. Go to "/Group.jsp?group=LoginName"; verify that janne is a member.
+4. Clear all session/assertion cookies using the browser options/preferences tools.
+5. Go to "/Group.jsp?group=LoginName"; verify that anonymous can't view; should be redirected to login page.
+6. Go to "/EditGroup.jsp?group=LoginName"; verify that anonymous can't view; should be redirected to login page.
+7. Log in with test user name and password (janne/myP@5sw0rd).
+8. Go to "/Group.jsp?group=LoginName"; verify that janne can still view the group.
+9. Go to "/EditGroup.jsp?group=LoginName"; verify that janne can still edit the group.
+
+
+XII. Test Create Group: Wiki Name
+0. Clear all session/assertion cookies using the browser options/preferences tools.
+1. Log in with test user name and password (janne/myP@5sw0rd).
+2. Create a new group called WikiName with this member:
+
+JanneJalkanen
+
+3. Go to "/Group.jsp?group=WikiName"; verify that JanneJalkanen is a member.
+4. Clear all session/assertion cookies using the browser options/preferences tools.
+5. Go to "/Group.jsp?group=WikiName"; verify that anonymous can't view; should be redirected to login page.
+6. Go to "/EditGroup.jsp?group=WikiName"; verify that anonymous can't view; should be redirected to login page.
+7. Log in with test user name and password (janne/myP@5sw0rd).
+8. Go to "/Group.jsp?group=WikiName"; verify that janne can still view the group.
+9. Go to "/EditGroup.jsp?group=WikiName"; verify that janne can still edit the group.
+
+
+XIII. Test Rename Profile
+0. Clear all session/assertion cookies using the browser options/preferences tools.
+1. Create new user profile with login name "TestRenameProfileUser", name "TestRenameProfileUser" and password "password".
+2. Verify that it was created by looking for the text "G'Day TestRenameProfileUser".
+3. Clear all session/assertion cookies using the browser options/preferences tools.
+4. Log in with test user name and password (janne/myP@5sw0rd).
+5. Create a new page called "TestRenameProfilePage" with these contents:
+
+[{ALLOW edit TestRenameProfileUser}]
+This page was created with an ACL by TestRenameProfileUser
+
+6. Clear all session/assertion cookies using the browser options/preferences tools.
+7. Log in with renamed user name (TestRenameProfileUser/password).
+8. Try to view page 'TestRenameProfilePage'. It should succeed.
+9. Try to edit page 'TestRenameProfilePage'. It should succeed also.
+A. Go to the My Prefs page, the Profile tab. Change the login name and wiki name to "RenamedUser".
+B. Verify that the front page now shows "G'Day RenamedUser".
+C. Try to edit page 'TestRenameProfilePage'. It should still succeed. Verify that the ACL contains:
+
+[{ALLOW edit RenamedUser}]
+This page was created with an ACL by TestRenameProfileUser
Added: incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/webtests.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/webtests.xml?rev=627275&view=auto
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/webtests.xml (added)
+++ incubator/jspwiki/branches/JSPWIKI_STRIPES_BRANCH/tests/etc/webtests.xml Tue Feb 12 22:29:30 2008
@@ -0,0 +1,288 @@
+<project name="JSPWiki-webtests" basedir="tests">
+
+ <!-- This Ant build file is designed to be called by the
+ "webtest-setup" macro in the top-level build.xml file.
+ If executed by itself, it will fail horribly and make
+ many unpleasant noises. It runs tests against a Tomcat
+ web application server running on port ${tomcat.port}.
+
+ The tests require a few properties to be defined
+ by the calling Ant script:
+
+ webtest.context: The webapp context that will be tested.
+ This will be something like
+ 'test-custom' or 'test-container'.
+ webtest.props: The jspwiki.properties file to use for the test.
+ webtest.webxml: The web.xml file to use for the test.
+
+ The test scripts are written using Selenium, and reside
+ in tests/etc/selenium.
+
+ For those of you following along at home, there are
+ some fairly black-belt Ant tricks in here,
+ notably the code that packages up the web contexts. -->
+
+ <!-- Pre-flight check that verifies Tomcat is set up the way we expect. -->
+ <target name="webtests-init">
+ <echo message="===============================================================" />
+ <echo message=" Pre-flight check for web unit tests" />
+ <echo message="- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" />
+ <echo message="" />
+ <echo message="To run web tests, we assume:" />
+ <echo message=" 1) Tomcat is on ${tomcat.host} and listens for requests on port ${tomcat.port}." />
+ <echo message=" 2) The Manager webapp is installed." />
+ <echo message=" 3) User '${tomcat.admin}' possesses the 'manager' role (so it" />
+ <echo message=" can install webapps)" />
+ <echo message=" 4) Tomcat's conf/tomcat-users.xml file contains a user entry" />
+ <echo message=" for the test user '${webtests.container.user}' with role 'Authenticated'." />
+ <echo message=" 5) The JDBC driver jar that you are using to test with is in" />
+ <echo message=" Tomcat's common/lib/directory on the server." />
+ <echo message=" 6) You have Firefox installed in the default install location." />
+ <echo message="" />
+ <echo message="We will verify that conditions 1-4 hold. You are on your own for 3-5." />
+ <echo message="Note: the defaults we use are stored in ${basedir}/build.properties." />
+ <echo message="" />
+
+ <echo message="Checking to see if Tomcat is running..." />
+ <fail message="Tomcat doesn't seem to be running. Start it first! (For example, run $CATALINA_HOME/bin/startup.sh)">
+ <condition>
+ <not>
+ <http url="${tomcat.protocol}://${tomcat.host}:${tomcat.port}" />
+ </not>
+ </condition>
+ </fail>
+
+ <echo message="Checking to see if the Manager app is running..." />
+ <fail message="The manager app doesn't seem to be running! For Tomcat 5.5 and higher, it should be in $CATALINA_HOME/server/webapps/manager.">
+ <condition>
+ <not>
+ <http url="${tomcat.protocol}://${tomcat.host}:${tomcat.port}/manager/html" errorsBeginAt="404" />
+ </not>
+ </condition>
+ </fail>
+
+ <echo message="Checking to see if container admin '${tomcat.admin}' possesses the 'manager' role." />
+ <tempfile property="webtests.manager.check" />
+ <get src="${tomcat.protocol}://${tomcat.host}:${tomcat.port}/manager/html/list"
+ dest="${webtests.manager.check}" ignoreerrors="true"
+ username="${tomcat.admin}" password="${tomcat.password}" />
+ <available file="${webtests.manager.check}" property="webtests.manager.ok" />
+ <delete file="${webtests.manager.check}" />
+ <fail unless="webtests.manager.ok">
+ Check your conf/tomcat-users file! The user '${tomcat.admin}' isn't a manager.</fail>
+
+ </target>
+
+ <!-- The main target. Calls the init target and deploys webapp,
+ tearing down previous version if needed -->
+ <target name="webtest-setup">
+ <echo message="===============================================================" />
+ <echo message=" Setting up web unit tests for '${webtest.context}'" />
+ <echo message="- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" />
+ <echo message="" />
+ <echo message="Creating Selenium test scripts..."/>
+ <delete dir="tests/build/selenium/${webtest.context}" />
+ <mkdir dir="tests/build/selenium/${webtest.context}" />
+ <copy flatten="true" toDir="tests/build/selenium/${webtest.context}">
+ <fileset dir="tests/etc/selenium/tests" />
+ <filterset>
+ <filter token="selenium.context" value="${webtest.context}" />
+ </filterset>
+ </copy>
+
+ <echo message="Undeploying old webapp... (might return an error, which is ok)"/>
+ <tomcat-undeploy context="${webtest.context}" />
+ <echo message="Deploying webapp..."/>
+ <tomcat-deploy context="${webtest.context}"
+ webxml="${webtest.webxml}"
+ props="${webtest.props}" />
+
+ <waitfor maxwait="30" maxwaitunit="second" timeoutproperty="webapp.not.installed">
+ <http url="${tomcat.protocol}://${tomcat.host}:${tomcat.port}/${webtest.context}/Wiki.jsp" />
+ </waitfor>
+ <fail if="webapp.not.installed">
+The webapp wasn't deployed for some reason. Here are some possible reasons why:
+
+* If [deploy] returned an HTTP 403 response, it usually means the
+manager user '${tomcat.admin}' isn't allowed to access the Manager app.
+Check $CATALINA_HOME/conf/tomcat-users.xml, and make sure the user
+'${tomcat.admin}' possesses the role 'manager'.
+
+* If the 'test-custom-*' and 'test-absolute' webapps deployed ok,
+but the 'test-*-jdbc' webapps did not, then Tomcat probably can't
+find your JDBC jar file, so you should copy it (example:
+${basedir}/tests/lib/hsqldb.jar) to $CATALINA_HOME/common/lib (5.5)
+or $CATALINA_HOME/lib (6.0), then restart Tomcat.
+ </fail>
+
+ </target>
+
+ <!-- Execute the web tests -->
+ <target name="webtest-selenium-exec">
+ <selenium-test context="${webtest.context}" />
+ </target>
+
+ <!-- Tears down the web tests -->
+ <target name="webtest-teardown" unless="webtests.keepup">
+ <tomcat-undeploy context="${webtest.context}" />
+ </target>
+
+ <!-- ============================================================== -->
+
+ <!-- Tomcat deployment tasks -->
+
+ <!-- These macros deploy and undeploy WAR files to a Tomcat
+ server, assumed to be already running on ${tomcat.host} port
+ ${tomcat.port}. The manager app MUST be installed and running in
+ order for this to work properly. Also, the 'tomcat.admin',
+ 'tomcat.password', 'tomcat.host', 'tomcat.protocol' and
+ 'tomcat.port' properties must be set in build.properties.
+ To run these macros, calling tasks must have already
+ run the task 'tomcat-init'.
+ -->
+ <macrodef name="tomcat-deploy">
+ <attribute name="context" />
+ <attribute name="webxml" />
+ <attribute name="props" />
+ <sequential>
+ <!-- We need the tomcat.admin and tomcat.password properties -->
+ <check-property prop="tomcat.admin" />
+ <check-property prop="tomcat.password" />
+ <check-property prop="tomcat.host" />
+ <check-property prop="tomcat.port" />
+ <check-property prop="tomcat.protocol" />
+
+ <!-- Declare the Tomcat deploy task -->
+ <taskdef classname="org.apache.catalina.ant.DeployTask" name="deploy">
+ <classpath>
+ <path refid="tomcat.classpath" />
+ </classpath>
+ </taskdef>
+
+ <!-- Create a context file for Tomcat -->
+ <mkdir dir="${tests.build}/@{context}" />
+ <copy flatten="true"
+ file="tests/etc/tomcat/context-@{context}.xml"
+ toFile="${tests.build}/@{context}/context.xml">
+ <filterset>
+ <filter token="docBase"
+ value="${tests.build}/@{context}/@{context}.war" />
+ <filtersfile file="tests/etc/jspwiki.properties" />
+ <filtersfile file="build.properties" />
+ </filterset>
+ </copy>
+
+ <!-- Create a page/log directory and point jspwiki.properties to it -->
+ <mkdir dir="${tests.build}/@{context}/wikipages" />
+ <copy toDir="${tests.build}/@{context}/wikipages" flatten="true" >
+ <fileset dir="src/wikipages">
+ <include name="Main.*" />
+ <include name="LeftMenu*.*" />
+ <include name="About.*" />
+ <include name="RecentChanges.*" />
+ <include name="WikiEtiquette.*" />
+ <include name="UnusedPages.*" />
+ <include name="UndefinedPages.*" />
+ <include name="PageIndex.*" />
+ </fileset>
+ </copy>
+ <copy file="@{props}" toFile="${tests.build}/@{context}/jspwiki.properties" flatten="true" />
+ <propertyfile file="${tests.build}/@{context}/jspwiki.properties">
+ <entry key="jspwiki.fileSystemProvider.pageDir"
+ value="${basedir}/${tests.build}/@{context}/wikipages" />
+ <entry key="jspwiki.basicAttachmentProvider.storageDir"
+ value="${basedir}/${tests.build}/@{context}/wikipages" />
+ <entry key="log4j.appender.FileLog.File"
+ value="${basedir}/${tests.build}/@{context}/jspwiki.log" />
+ </propertyfile>
+
+ <!-- Copy our sample user database -->
+ <copy file="tests/etc/userdatabase.xml"
+ toFile="${tests.build}/@{context}/userdatabase.xml" />
+
+ <!-- Build the war -->
+ <war warfile="${tests.build}/@{context}/@{context}.war"
+ webxml="@{webxml}">
+ <lib dir="lib" includes="*.jar" />
+ <lib file="${jarfile}" />
+ <lib file="${jdbc.driver.jar}" />
+ <fileset dir="${code.src}/webdocs" includes="**" />
+ <webinf dir="etc"
+ includes="**"
+ excludes="jspwiki.properties userdatabase.xml db/** **.tmpl web.xml" />
+ <webinf dir="${tests.build}/@{context}"
+ includes="jspwiki.properties userdatabase.xml" />
+ <classes dir="etc" includes="oscache.properties" />
+ <metainf dir="${tests.build}/@{context}" includes="context.xml" />
+ </war>
+
+ <!-- Deploy the webapp -->
+ <deploy url="${tomcat.protocol}://${tomcat.host}:${tomcat.port}/manager"
+ username="${tomcat.admin}" password="${tomcat.password}"
+ path="/@{context}" failonerror="false"
+ war="file:///${basedir}/${tests.build}/@{context}/@{context}.war" />
+ </sequential>
+ </macrodef>
+
+ <macrodef name="tomcat-undeploy">
+ <attribute name="context" />
+ <sequential>
+ <!-- We need the tomcat.admin and tomcat.password properties -->
+ <check-property prop="tomcat.admin" />
+ <check-property prop="tomcat.password" />
+ <check-property prop="tomcat.host" />
+ <check-property prop="tomcat.port" />
+ <check-property prop="tomcat.protocol" />
+
+ <!-- Declare the Tomcat deploy task -->
+ <taskdef classname="org.apache.catalina.ant.UndeployTask" name="undeploy">
+ <classpath>
+ <path refid="tomcat.classpath" />
+ </classpath>
+ </taskdef>
+
+ <!-- Undeploy the webapp -->
+ <undeploy url="${tomcat.protocol}://${tomcat.host}:${tomcat.port}/manager"
+ username="${tomcat.admin}" password="${tomcat.password}"
+ path="/@{context}" failonerror="false" />
+ </sequential>
+ </macrodef>
+
+ <!-- ============================================================== -->
+
+ <!-- Selenium execution test task -->
+
+ <!-- This macro executes the Selenium test plans located in
+ tests/build/selenium/@context@/, based on templates stored
+ in tests/etc/selenium/tests. It expects your favorite servlet
+ container up & running on ${tomcat.protocol}://${tomcat.host}:${tomcat.port}
+ For this reason, these properties must be set up in your
+ build.properties file.
+ -->
+
+ <macrodef name="selenium-test">
+ <attribute name="context"/>
+ <sequential>
+ <!-- We need the tomcat.host, tomcat.port, tomcat.protocol properties -->
+ <check-property prop="tomcat.host" />
+ <check-property prop="tomcat.port" />
+ <check-property prop="tomcat.protocol" />
+
+ <!-- Execute Selenium Test Plan -->
+ <echo message="Running web unit tests for context '@{context}'."/>
+ <mkdir dir="${tests.reports}/selenium" />
+ <java jar="tests/lib/selenium-server-0.9.2-patched.jar" fork="true"
+ output="${tests.reports}/selenium/@{context}.log">
+ <!--
+ <arg line="-browserSessionReuse" />
+ -->
+ <arg line="-htmlSuite" />
+ <arg line='"${webtests.browser}"' />
+ <arg line='"http://localhost:8080"' />
+ <arg line="${basedir}/tests/build/selenium/@{context}/JSPWikiTestSuite.html" />
+ <arg line="${basedir}/tests/reports/selenium/@{context}.html" />
+ </java>
+ </sequential>
+ </macrodef>
+
+</project>
\ No newline at end of file