[Cleanup] Removed TARGET_JVM
[mono.git] / mcs / class / System.Web / Test / mainsoft / NunitWeb / NunitWeb / FAQ
1 Thanks to Julien Couvreur for the questions.
2
3 Q: You mention that the test gets invoked in the web appdomain. But does
4 this have any impact on the kind of tests that you can do?
5
6 A: I'm not aware of any impact yet.
7
8 Q: Does that mean that the test class would need to be serializable if it
9 needs to keep any state?
10
11 A: This turned out to be a complex problem. If you pass a delegate to
12 another appdomain, it's serialized only in one way. So, if during this
13 delegate you change instance fields, those changes will be lost. I could
14 not work around this problem with passing delegate by ref, because then a
15 new instance is created and the original remains intact. So to provide an
16 ability to pass user data back and forth, I made WebTest.UserData property.
17 If few WebTest's run in different threads, each one has it's own UserData.
18
19 Q: Do you really think that there is going to be different types of hooks?
20 Currently, you have BaseInvoker and PageInvoker, but maybe the base class
21 is superfluous?
22
23 A: Currently, there are 3 Invokers: BaseInvoker, HandlerInvoker and
24 PageInvoker.
25
26 BaseInvoker is a stub, only ensuring somebody called it. It exists for
27 tests that need no callback, for example for rendering some aspx page.
28
29 HandlerInvoker enables to execute a method without parameters in the web
30 appdomain. NET 2.0 anonymous delegates are useful here. There is no need to
31 instrument anything for this invoker, or to set the URL of the request, the
32 DefaultUrl of the HandlerInvoker is sufficient.
33
34 PageInvoker calls a method with Page argument, and is used when the test
35 must work on a web page. The page must be instrumented to enable the
36 framework to do its job.