Permalink
Browse files

backport from trunk the test suite changes and the random port alloca…

…tion feature

svn path=/branches/mono-1-2-6/xsp/; revision=90719
  • Loading branch information...
1 parent b39eca1 commit 920ad771daa7ff04df7ca8a8c676dde36b5b231f @grendello grendello committed Dec 4, 2007
Showing with 1,534 additions and 239 deletions.
  1. +47 −0 ChangeLog
  2. +2 −0 configure.in
  3. +23 −8 src/Mono.WebServer.XSP/main.cs
  4. +17 −0 src/Mono.WebServer/ApplicationServer.cs
  5. +2 −2 src/Mono.WebServer/XSPWebSource.cs
  6. +5 −0 test/1.1/Makefile.am
  7. +2 −1 test/1.1/asp.net/Makefile.am
  8. +3 −1 test/1.1/asp.net/browsercaps.aspx
  9. +3 −1 test/1.1/asp.net/code-render.aspx
  10. +3 −1 test/1.1/asp.net/codebehind1.aspx
  11. +4 −0 test/1.1/asp.net/header.inc
  12. +1 −1 test/1.1/asp.net/includetest.aspx
  13. +19 −0 test/1.1/asp.net/index.aspx
  14. +5 −1 test/1.1/asp.net/registertest.aspx
  15. +4 −2 test/1.1/asp.net/serial.aspx
  16. +6 −2 test/1.1/asp.net/server-side-object.aspx
  17. +4 −2 test/1.1/asp.net/session1.aspx
  18. +5 −1 test/1.1/asp.net/transfer1.aspx
  19. +5 −1 test/1.1/asp.net/transfer2.aspx
  20. +4 −2 test/1.1/asp.net/typedesc.aspx
  21. +7 −2 test/1.1/authtest/index.aspx
  22. +5 −1 test/1.1/authtest/login.aspx
  23. +19 −0 test/1.1/bugs/index.aspx
  24. +4 −2 test/1.1/cookieless/index.aspx
  25. +2 −1 test/1.1/customcontrol/Makefile.am
  26. +19 −0 test/1.1/customcontrol/index.aspx
  27. +13 −3 test/1.1/customcontrol/tabcontrol.aspx
  28. +6 −3 test/1.1/customcontrol/tabcontrol2.aspx
  29. +2 −1 test/1.1/databind/Makefile.am
  30. +3 −1 test/1.1/databind/databind-arraylist.aspx
  31. +3 −1 test/1.1/databind/databind-attribute.aspx
  32. +3 −1 test/1.1/databind/databind-class.aspx
  33. +3 −1 test/1.1/databind/databind-template.aspx
  34. +19 −0 test/1.1/databind/index.aspx
  35. +2 −1 test/1.1/handlers/Makefile.am
  36. +19 −0 test/1.1/handlers/index.aspx
  37. +19 −0 test/1.1/hangman-vb/index.aspx
  38. +2 −1 test/1.1/html/Makefile.am
  39. +3 −1 test/1.1/html/button.aspx
  40. +4 −1 test/1.1/html/htmlanchor.aspx
  41. +4 −1 test/1.1/html/htmlbutton.aspx
  42. +4 −1 test/1.1/html/htmlgeneric.aspx
  43. +4 −1 test/1.1/html/htmlimage.aspx
  44. +5 −1 test/1.1/html/htmlinputbutton.aspx
  45. +4 −2 test/1.1/html/htmlinputcheckbox.aspx
  46. +5 −1 test/1.1/html/htmlinputfile.aspx
  47. +5 −1 test/1.1/html/htmlinputhidden.aspx
  48. +5 −1 test/1.1/html/htmlinputimage.aspx
  49. +5 −1 test/1.1/html/htmlinputradiobutton.aspx
  50. +5 −1 test/1.1/html/htmlinputtext.aspx
  51. +3 −1 test/1.1/html/htmlselect.aspx
  52. +3 −1 test/1.1/html/htmltable.aspx
  53. +4 −2 test/1.1/html/htmltextarea.aspx
  54. +19 −0 test/1.1/html/index.aspx
  55. +19 −0 test/1.1/index.aspx
  56. +19 −0 test/1.1/runtime/index.aspx
  57. +23 −4 test/1.1/webcontrols/Makefile.am
  58. +3 −1 test/1.1/webcontrols/calendar.aspx
  59. +3 −3 test/1.1/webcontrols/datalist.aspx
  60. +26 −17 test/1.1/webcontrols/dbpage1.aspx
  61. +22 −10 test/1.1/webcontrols/dbpage2.aspx
  62. +85 −0 test/1.1/webcontrols/dbpage_test_setup.cs
  63. +19 −0 test/1.1/webcontrols/index.aspx
  64. +5 −2 test/1.1/webcontrols/listitem.aspx
  65. +4 −2 test/1.1/webcontrols/temperature.aspx
  66. +4 −2 test/1.1/webcontrols/validator1.aspx
  67. +4 −2 test/1.1/webcontrols/web_adrotator.aspx
  68. +5 −2 test/1.1/webcontrols/web_button.aspx
  69. +4 −2 test/1.1/webcontrols/web_checkbox.aspx
  70. +3 −1 test/1.1/webcontrols/web_checkboxlist.aspx
  71. +35 −0 test/1.1/webcontrols/web_comparevalidator.aspx
  72. +3 −1 test/1.1/webcontrols/web_datagrid.aspx
  73. +3 −1 test/1.1/webcontrols/web_datagrid_command.aspx
  74. +4 −1 test/1.1/webcontrols/web_dropdownlist.aspx
  75. +4 −2 test/1.1/webcontrols/web_hyperlink.aspx
  76. +4 −2 test/1.1/webcontrols/web_image.aspx
  77. +3 −1 test/1.1/webcontrols/web_imagebutton.aspx
  78. +4 −2 test/1.1/webcontrols/web_label.aspx
  79. +17 −5 test/1.1/webcontrols/web_linkbutton.aspx
  80. +4 −2 test/1.1/webcontrols/web_listbox.aspx
  81. +4 −2 test/1.1/webcontrols/web_literal.aspx
  82. +4 −2 test/1.1/webcontrols/web_panel.aspx
  83. +6 −2 test/1.1/webcontrols/web_placeholder.aspx
  84. +4 −2 test/1.1/webcontrols/web_radiobutton.aspx
  85. +5 −2 test/1.1/webcontrols/web_radiobuttonlist.aspx
  86. +5 −2 test/1.1/webcontrols/web_regularexpressionvalidator.aspx
  87. +4 −2 test/1.1/webcontrols/web_repeater.aspx
  88. +4 −2 test/1.1/webcontrols/web_table.aspx
  89. +4 −2 test/1.1/webcontrols/web_table2.aspx
  90. +4 −2 test/1.1/webcontrols/web_textbox.aspx
  91. +6 −1 test/1.1/webcontrols/web_xml.aspx
  92. +2 −1 test/1.1/webservice/Makefile.am
  93. +19 −0 test/1.1/webservice/index.aspx
  94. +5 −0 test/2.0/Makefile.am
  95. +3 −1 test/2.0/gridview/BasicGrid.aspx
  96. +3 −1 test/2.0/gridview/ObjectBoundGrid.aspx
  97. +19 −0 test/2.0/gridview/index.aspx
  98. +19 −0 test/2.0/index.aspx
  99. +2 −1 test/2.0/masterpages/Makefile.am
  100. +0 −1 test/2.0/masterpages/content1.aspx
  101. +3 −1 test/2.0/masterpages/frame.master
  102. +19 −0 test/2.0/masterpages/index.aspx
  103. +3 −1 test/2.0/masterpages/simple.master
  104. +2 −1 test/2.0/menu/Makefile.am
  105. +19 −0 test/2.0/menu/index.aspx
  106. +3 −0 test/2.0/menu/menu1.aspx
  107. +3 −0 test/2.0/menu/menu2.aspx
  108. +2 −1 test/2.0/treeview/Makefile.am
  109. +19 −0 test/2.0/treeview/index.aspx
  110. +4 −2 test/2.0/treeview/populate-on-demand.aspx
  111. +6 −0 test/2.0/treeview/treeview-databound.aspx
  112. +6 −1 test/2.0/treeview/treeview.aspx
  113. +18 −0 test/App_Code/Application.cs
  114. +7 −0 test/App_Code/Makefile.am
  115. +16 −4 test/Makefile.am
  116. +225 −0 test/SiteMapReader_1.1.cs
  117. +116 −0 test/Web.sitemap
  118. +15 −0 test/controls/BreadCrumbs_1.1.ascx
  119. +2 −0 test/controls/BreadCrumbs_2.0.ascx
  120. +30 −0 test/controls/FileList.ascx
  121. +10 −0 test/controls/Makefile.am
  122. +29 −0 test/controls/MonoSamplesHeader.ascx
  123. +57 −3 test/global.asax
  124. +17 −19 test/index.aspx
  125. +9 −51 test/index2.aspx
  126. +44 −0 test/missing_components.aspx
  127. +1 −0 test/mono-xsp.css
  128. +2 −2 test/web.config
View
@@ -1,3 +1,50 @@
+2007-12-04 Marek Habersack <mhabersack@novell.com>
+
+ * src/Mono.WebServer/ApplicationServer.cs: added a new property,
+ Port, to report the actual port ApplicationServer is listening on
+
+ * src/Mono.WebServer.XSP/main.cs: accept an extra parameter to
+ attach XSP to a random port. The actual port is printed to the
+ console instead of the configured one, as it was done before.
+
+2007-11-21 Marek Habersack <mhabersack@novell.com>
+
+ * Added several index.aspx files to avoid 404 errors on accessing
+ directories.
+
+2007-11-20 Marek Habersack <mhabersack@novell.com>
+
+ * test/1.1/customcontrol/tabcontrol.aspx: explain how adding links
+ works.
+
+ * test/1.1/webcontrols/Makefile.am: generate the .sqlite files
+ when needed. Fixes make dist.
+
+ * test/1.1/webcontrols/web_linkbutton.aspx: make the sample
+ work. Clicking 'Remove this link' actually does something
+ now. Same for the 'Click me!' button.
+
+ * All the samples are using common look now. A common header has
+ been added to provide consistent look and sample navigation. 1.1
+ mode uses a poor man's implementation of the 2.0 SiteMap reader,
+ to be able to read the samples map from the Web.sitemap file.
+ * The test suite for 1.1 MUST now be ran from the directory into
+ which 'make install' put the samples - it requires the
+ SiteMapReader_1.1.dll to be present. If a user runs the test suite
+ from the source directory (or from one missing the required
+ components) a page explaining the steps to get it working is
+ shown. The 2.0 profile isn't subject to this requirement, as it will run
+ most samples from the source direcory.
+ * The 1.1/webcontrols/dbpage*.aspx samples now use Sqlite
+ databases installed along with the test suite. The databases are
+ generated by the dbpage_test_setup.exe utility found in the same
+ directory where the samples are.
+
+2007-11-20 Juraj Skripsky <js@hotfeet.ch>
+
+ * test/1.1/webcontrols/web_comparevalidator.aspx: add test page
+ for the CompareValidator control.
+
2007-11-08 Wade Berrier <wberrier@novell.com>
* configure.in: version bump -> 1.2.6
View
@@ -118,6 +118,8 @@ AC_OUTPUT([
src/Mono.WebServer.XSP/Makefile
src/Mono.WebServer.XSP/AssemblyInfo.cs
test/Makefile
+ test/controls/Makefile
+ test/App_Code/Makefile
test/1.1/Makefile
test/1.1/authtest/Makefile
test/1.1/asp.net/Makefile
@@ -59,7 +59,7 @@ static void ShowVersion ()
Console.WriteLine ("{0} {1}\n(c) {2}\n{3}",
Path.GetFileName (assembly.Location), version, copyright, description);
}
-
+
static void ShowHelp ()
{
Console.WriteLine ("XSP server is a sample server that hosts the ASP.NET runtime in a");
@@ -70,6 +70,8 @@ static void ShowHelp ()
Console.WriteLine (" --port N: n is the tcp port to listen on.");
Console.WriteLine (" Default value: 8080");
Console.WriteLine (" AppSettings key name: MonoServerPort");
+ Console.WriteLine (" --random-port: listen on a randomly assigned port. The port numer");
+ Console.WriteLine (" will be reported to the caller via a text file.");
Console.WriteLine ();
Console.WriteLine (" --address addr: addr is the ip address to listen on.");
Console.WriteLine (" Default value: 0.0.0.0");
@@ -164,7 +166,8 @@ enum Options {
Port = 1 << 8,
Terminate = 1 << 9,
Https = 1 << 10,
- Master = 1 << 11
+ Master = 1 << 11,
+ RandomPort = 1 << 12
}
static void CheckAndSetOptions (string name, Options value, ref Options options)
@@ -184,6 +187,11 @@ static void CheckAndSetOptions (string name, Options value, ref Options options)
Console.WriteLine ("ERROR: --port/--address and --filename are mutually exclusive");
Environment.Exit (1);
}
+
+ if ((options & Options.Port) != 0 && value == Options.RandomPort) {
+ Console.WriteLine ("ERROR: --port and --random-port are mutually exclusive");
+ Environment.Exit (1);
+ }
}
static AsymmetricAlgorithm GetPrivateKey (X509Certificate certificate, string targetHost)
@@ -225,8 +233,8 @@ public static int Main (string [] args)
object oport;
string ip = AppSettings ["MonoServerAddress"];
bool master = false;
-
- if (ip == "" || ip == null)
+
+ if (ip == null || ip.Length == 0)
ip = "0.0.0.0";
oport = AppSettings ["MonoServerPort"];
@@ -276,6 +284,10 @@ public static int Main (string [] args)
CheckAndSetOptions (a, Options.Port, ref options);
oport = args [++i];
break;
+ case "--random-port":
+ CheckAndSetOptions (a, Options.RandomPort, ref options);
+ oport = 0;
+ break;
case "--address":
CheckAndSetOptions (a, Options.Address, ref options);
ip = args [++i];
@@ -318,6 +330,7 @@ public static int Main (string [] args)
IPAddress ipaddr = null;
ushort port;
try {
+
port = Convert.ToUInt16 (oport);
} catch (Exception) {
Console.WriteLine ("The value given for the listen port is not valid: " + oport);
@@ -374,15 +387,17 @@ public static int Main (string [] args)
if (!master && apps == null && appConfigDir == null && appConfigFile == null)
server.AddApplicationsFromCommandLine ("/:.");
- Console.WriteLine ("Listening on port: {0} {1}", port, security);
- Console.WriteLine ("Listening on address: {0}", ip);
-
+ Console.WriteLine ("Listening on address: {0}", ip);
Console.WriteLine ("Root directory: {0}", rootDir);
try {
if (server.Start (!nonstop) == false)
return 2;
-
+
+ Console.WriteLine ("Listening on port: {0} {1}", server.Port, security);
+ if (port == 0)
+ Console.Error.WriteLine ("Random port: {0}", server.Port);
+
if (!nonstop) {
Console.WriteLine ("Hit Return to stop the server.");
Console.ReadLine ();
@@ -93,6 +93,23 @@ public class ApplicationServer : MarshalByRefObject
// This is much faster than hashtable for typical cases.
ArrayList vpathToHost = new ArrayList ();
+
+ public int Port {
+ get {
+ if (listen_socket == null
+#if NET_2_0
+ || !listen_socket.IsBound
+#endif
+ )
+ return -1;
+
+ IPEndPoint iep = listen_socket.LocalEndPoint as IPEndPoint;
+ if (iep == null)
+ return -1;
+
+ return iep.Port;
+ }
+ }
public ApplicationServer (WebSource source)
{
@@ -58,8 +58,8 @@ public class XSPWebSource: WebSource
bool requireClientCert;
public XSPWebSource(IPAddress address, int port, SecurityProtocolType securityProtocol,
- X509Certificate cert, PrivateKeySelectionCallback keyCB,
- bool allowClientCert, bool requireClientCert)
+ X509Certificate cert, PrivateKeySelectionCallback keyCB,
+ bool allowClientCert, bool requireClientCert)
{
secureConnection = (cert != null && keyCB != null);
this.bindAddress = new IPEndPoint (address, port);
View
@@ -1 +1,6 @@
SUBDIRS = authtest asp.net webcontrols html webservice databind handlers customcontrol
+
+samplesdir = $(pkglibdir)/test/1.1/
+samples_DATA = index.aspx
+
+EXTRA_DIST = $(samples_DATA)
@@ -12,7 +12,8 @@ testfiles = \
registertest.aspx \
server-side-object.aspx \
session1.aspx \
- typedesc.aspx
+ typedesc.aspx \
+ index.aspx
typedesc_src = typedesc.cs
codebehind_src = codebehind1.cs
@@ -1,4 +1,5 @@
<%@ Page Language="C#" %>
+<%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %>
<%@ Import namespace="System.Reflection" %>
<style type="text/css">
<!--
@@ -73,8 +74,9 @@ div.normal {
}
}
</script>
+<link rel="stylesheet" type="text/css" href="/mono-xsp.css">
</head>
-<body>
+<body><mono:MonoSamplesHeader runat="server"/>
<h3>HttpBrowserCapabilities</h3>
<form runat="server">
<div class="normal">User agent: <%= Request.UserAgent %></div><br>
@@ -1,13 +1,15 @@
<%@ Page Language = "C#" %>
+<%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %>
<html>
<script runat="server">
string [] msgs = new string [] { "hi!", "hello", "hola",
"Ciao", "adios"};
</script>
<head>
<title>Code Render</title>
+<link rel="stylesheet" type="text/css" href="/mono-xsp.css">
</head>
-<body>
+<body><mono:MonoSamplesHeader runat="server"/>
<% for (int i = 0; i < 5; i++) {%>
<%= msgs [i] %> message number <%= i %>.
<p>
@@ -1,4 +1,5 @@
<%@ Page language="c#" Inherits="MonoTest.Test" %>
+<%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
@@ -7,8 +8,9 @@
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
+ <link rel="stylesheet" type="text/css" href="/mono-xsp.css">
</HEAD>
- <body>
+ <body><mono:MonoSamplesHeader runat="server"/>
<form id="Test" method="post" runat="server">
<P>
<asp:Label id="Label1" runat="server">Text will go here.</asp:Label></P>
@@ -1,7 +1,11 @@
<%@ Page language="C#" %>
+<%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %>
<%-- we can even override the asp prefix with @ register --%>
<%@ Register TagPrefix="Acme" namespace="System.Web.UI.WebControls" assembly="System.Web" %>
<%@ Register TagPrefix="Acme" TagName="One" Src="registertest1.ascx" %>
<%@ Register TagPrefix="Acme" TagName="Two" Src="registertest2.ascx" %>
<html>
+<head>
+<link rel="stylesheet" type="text/css" href="/mono-xsp.css">
+</head>
@@ -10,7 +10,7 @@
}
</script>
-<body>
+<body><mono:MonoSamplesHeader runat="server"/>
This is pretty much the same as registertest.aspx, but splitted in 3 files.
<p>
<!-- #include virtual="body.inc" -->
@@ -0,0 +1,19 @@
+<%@ Page Language="C#" %>
+<%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %>
+<%@ Register TagPrefix="mono" TagName="FileList" src="~/controls/FileList.ascx" %>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>Directory index</title>
+<link rel="stylesheet" type="text/css" href="/mono-xsp.css">
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+</head>
+<body><mono:MonoSamplesHeader runat="server"/>
+<form runat="server">
+ <p>The following directories and files are found in this directory:</p>
+ <blockquote>
+ <mono:FileList runat="server"/>
+ </blockquote>
+</form>
+</body>
+</html>
@@ -1,10 +1,14 @@
<%@ Page language="C#" %>
+<%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %>
<%-- we can even override the asp prefix with @ register --%>
<%@ Register TagPrefix="Acme" namespace="System.Web.UI.WebControls" assembly="System.Web" %>
<%@ Register TagPrefix="Acme" TagName="One" Src="registertest1.ascx" %>
<%@ Register TagPrefix="Acme" TagName="Two" Src="registertest2.ascx" %>
<html>
+<head><title>Register test</title>
+<link rel="stylesheet" type="text/css" href="/mono-xsp.css">
+</head>
<script language="C#" runat="server">
void Clicked (object sender, EventArgs e)
{
@@ -16,7 +20,7 @@
}
</script>
-<body>
+<body><mono:MonoSamplesHeader runat="server"/>
<form runat="server">
<Acme:One id="One" Text="This is a default One!" Color="blue" runat="server"/>
<p>
@@ -1,4 +1,5 @@
-<%@ language="C#" debug="true"%>
+<%@ Page language="C#" debug="true"%>
+<%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %>
<%@ Import namespace="System.ComponentModel" %>
<%@ Import namespace="System.Globalization" %>
<!-- This test was used to fix bug #59495
@@ -9,6 +10,7 @@
<html>
<head>
<title>ViewState + TypeConverter</title>
+<link rel="stylesheet" type="text/css" href="/mono-xsp.css">
<script runat="server">
public class MyStuffConverter : TypeConverter
{
@@ -73,7 +75,7 @@
}
</script>
</head>
-<body>
+<body><mono:MonoSamplesHeader runat="server"/>
<form runat="server">
<asp:button type="submit" runat="server" Text="Click here" />
<asp:label id="lbl" runat="server" />
@@ -1,5 +1,9 @@
-<%@ Language="C#" %>
+<%@ Page Language="C#" %>
+<%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %>
<html>
+ <head><title>Server-side object</title>
+ <link rel="stylesheet" type="text/css" href="/mono-xsp.css">
+ </head>
<object id="items" runat="server" class="System.Collections.ArrayList" />
<script language="C#" runat=server>
void Page_Load(Object sender, EventArgs e) {
@@ -12,7 +16,7 @@
}
</script>
- <body>
+ <body><mono:MonoSamplesHeader runat="server"/>
<asp:datalist id="MyList" runat=server>
<ItemTemplate>
Here is a value: <%# Container.DataItem %>
@@ -1,4 +1,5 @@
-<%@ language="C#" %>
+<%@ Page Language="C#" %>
+<%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %>
<html>
<script runat=server>
private static int _clicked = 0;
@@ -15,8 +16,9 @@
</script>
<head>
<title>Session Test</title>
+<link rel="stylesheet" type="text/css" href="/mono-xsp.css">
</head>
-<body>
+<body><mono:MonoSamplesHeader runat="server"/>
<form runat="server">
<asp:Button id="btn"
Text="Submit"
@@ -1,12 +1,16 @@
<%@ Page Language="C#" Debug="true" %>
+<%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %>
<script runat="server">
void Page_Load ()
{
Server.Transfer ("transfer2.aspx");
}
</script>
<html>
-<body>
+<head><title>Transfer test 1</title>
+<link rel="stylesheet" type="text/css" href="/mono-xsp.css">
+</head>
+<body><mono:MonoSamplesHeader runat="server"/>
This will never be seen on the browser. Miguel sucks.
</body>
</html>
Oops, something went wrong.

0 comments on commit 920ad77

Please sign in to comment.