Home Jonas Albert Rafael Noam Grasshopper Dekel Yaacov Roei Philippe Tal
 
  

Archive for the ‘Under Construction’ Category

AJAX Extensions support

October 18th, 2007 by Noam Lampert

We are proud to announce a preview release of Grasshopper with AJAX Extensions support.

This release contains an implementation of System.Web.Extensions, and a sample containing the AJAX Control Toolkit together with its sample web site, all running on Tomcat.

For more information about AJAX Extensions see http://www.asp.net/ajax.

It is worth pointing out that the entire development of this feature is completely open source:

  • The System.Web.Extensions implementation was contributed to Mono and is available at
    svn://anonsvn.mono-project.com/source/trunk/mcs/class/System.Web.Extensions
  • The Microsoft AJAX Library is based on the Microsoft implementation that was released under the MS-PL
  • Also the AJAX Control Toolkit, together with its sample are also available for download on CodePlex under the MS-PL

Come and get it from http://dev.mainsoft.com

A few technical notes worth mentioning:

  1. We are currently using the debug version of the Microsoft AJAX Library. This has some performance implications due to the size of the JavaScript files and other differences compared to the optimized JavaScript.
  2. We have invested some energy in different performance optimizations by preserving the rendering flow without any difference between AJAX and non-AJAX requests. Same for JSON de/serialization (we avoid creating an intermediate dictionary and perform single pass de/serialization).
  3. Porting the AJAX Control Toolkit succeeded without any runtime source code changes. We did need to disable the designer code that is not supported in Grasshopper.

We are interested in feedback. Please give this preview a test drive and let us know what you think. You can ask technical questions, report bugs, or just let us know what you think and what other features you would like to see in the next Grasshopper release by posting in the Grasshopper developer forums at http://dev.mainsoft.com/default.aspx?tabid=27&view=topics&forumid=19

Noam


Unit Testing for ASP.Net on mono

July 24th, 2007 by Konstantin Triger

Hello everyone! This is my first post here, so I would like to introduce myself first. My name is Konstantin Triger and I’m a Team Lead for .Net libraries at Mainsoft, including System.Web, System.Data, System, System.Xml etc. The development of all those libraries is hosted and collaborated with the mono project. For example, during the last year we contributed a lot of functionality for the ASP.Net 2.0 stack in the mono project and currently we are working on an implementation of ASP.NET AJAX support in mono (here is the MS version and here is the mono/Grasshopper one).

As part of developing the ASP.Net 2.0 controls for the mono project we faced a serious problem: how to test code, which must run on top of a Web Server without requiring an actual Web Server? We also wanted something that is easy and fast to use, easy to automate and produces an easily analyzable report… In short, we wanted to run it with our nunit framework.

Wait, but for running an aspx page we need a Web Server, a Web Client – how can one talk about plain unit testing? Well, that’s not exactly true. In order to run an ASP.Net application, the System.Web assembly should be plugged in using its hosting interface. This interface provides an API to abstract a Web request to be handled by the System.Web runtime. This is exactly what IIS does using the ISAPIRuntime.

So, if we could host the System.Web runtime inside our test framework, we would not need a Web Server. I would like to introduce the NunitWeb framework which we developed and does exactly that.

How does it work?

Basically, all we need is to create our special HttpWorkerRequest and call HttpRuntime.ProcessRequest (I omit lots initialization stuff for clarity, but it can be seen here). Next, we needed a possibility to hook into page events (like Page_Load), support for postback(s) … all is there!

Here is an example of an NunitWeb based test (taken from here):

[Test]
[Category ("NunitWeb")]  // not required
public void UseSubmitBehavior () {
    WebTest t = new WebTest (PageInvoker.CreateOnLoad (UseSubmitBehavior_Load));
    string html = t.Run ();
    if (html.IndexOf ("onclick") == -1)
        Assert.Fail ("Button Postback script not created fail");
} 

// the following actually runs in Page_Load event!
public static void UseSubmitBehavior_Load (Page p) {
    Button b = new Button ();
    b.UseSubmitBehavior = false;
    p.Controls.Add (b);
}

…and you can see much more examples – search for “[Category (“NunitWeb”)]” – all the NunitWeb based tests are marked this way.

Here is an example of our tests running on mono:

There are 3,245 unit tests in System.Web running automatically on each commit and build. Of those, 334 are NunitWeb based. In the entire runtime, there are 25,774 unit tests running with each and every build.

Resources:

http://anonsvn.mono-project.com/viewcvs/trunk/mcs/class/System.Web/Test/mainsoft/NunitWeb - NunitWeb framework.

http://anonsvn.mono-project.com/viewcvs/trunk/mcs/class/System.Web/Test - System.Web tests.


Grasshopper and the Resharper Addin

July 19th, 2007 by Adar Wesley

As a .NET Developer I use an addin called Resharper for Visual Studio 2003 and 2005. It’s made by a company called JetBrains, which also happens to make a very power Java IDE called IntelliJ IDEA.

At it’s current state, Grasshopper doesn’t play well with Resharper, but we’ve find out what the problems are and we’re working hard on releasing a service pack for Grasshopper in the coming weeks that will address this problem and other problems found. Like any product that has to play well with other products in a host environment, there are many things to consider, and working well with other addins is now considered top priority.

I’m working on my machine with an internal build which plays very well with the latest version of Resharper (3.0). The problems used to be mainly around being able to right click on a regular .NET project and selecting “Generate Java EE project”. Resharper would just hang, start throwing various exceptions and in some cases even crash visual studio.

If you’ve tried GH and found this problem, it should be fixed in our upcoming service pack (as I said, a couple of weeks from now we hope).

If you have other addins that you feel aren’t working well with Grasshopper, feel free to either comment on this post or use the forums to see if there is a fix for it.


ASP.NET AJAX development is underway

July 11th, 2007 by Noam Lampert

Since this is my first post, let me introduce myself shortly. My name is Noam Lampert. I am leading the Grasshopper R&D team.

A few weeks ago, we have begun implementation of the ASP.NET AJAX API. This will enable Grasshopper users to develop ASP.NET applications that also use the ASP.NET AJAX extensions and control toolkit.

We have begun by developing an initial implementation for the infrastructure and basic atoms: ScriptManager, UpdatePanel, UpdateProgress, and Timer controls.

Using this implementation we have also ported the AJAX Control Toolkit (source available at CodePlex user the Ms-PL) and have begun running the sample web site. As you can see below, the sample web site is beginning to work and we are currently continuing to iron out the bugs. 

AJAXSnapshot_thumb[4]_thumb_thumb_thumb 

As usual, the development of this library is shared with the mono project. You can download the source code and view our progress at

 svn://anonsvn.mono-project.com/source/trunk/mcs/class/System.Web.Extensions

We still have much work remaining on stabilization and QA but I will be hope to see this exciting feature released soon with the next release of Grasshopper.


  
 

Close
E-mail It