in

 

Eric Hexter

Where the rubber meets the road.
  • Running a x64 build server. Challenges overcome.

    We just setup a new build server on my current project and with it came some of those little hiccups which made the setup take longer than planned.

    Cruise Control Team Foundation Client  issues

    1. Although our continuous integration server (Cruise Control.Net) fully supports running on 64 bit not all of its dependencies do.  Team Foundation Client 2008 does not support 64 bit operating systems.  The fix was to force the .Net framework to run the cruise control service in 32 bit mode, by setting the 32 bit flag on the ccservice.exe. This was done using the corFlags.exe from the .Net SDK.  The actual command that was run is:

    CorFlags.exe ccservice.exe /32BIT+
     

    2. Running Asp.Net on wow32.

    Although our application code could run 64 bit.. not all of our dependencies can.  Our web application kept failing on startup claiming that one dll could not run on x64.  Rather than tracking down a new version for that dll only to deal with the next one I first wanted to see the application work on the server running wow32 (that's Windows On Windows 32 bit) there are the operations that need to be done in order to make this happen. The first two are enabling 32 bit in IIS and registering the 32 bit .Net framework.

    cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
    %SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i 

    The third step is enabling the Asp.net (32) in the Web Extensions in IIS Manager. This option show us after you run the aspnet_regiis command.

    Once I can test my application in 32 bit mode and I know it all works, now it is time to get back to 64 bit mode and track down the culprit that prevented this in the first place. 

  • Running your build/source code from a ram disk.

     

    As a test I wanted to run a build from a drive in ram rather than on a physical disk drive using the old Dos style Ram disk. For a trivial build that includes compilation, Asp.net compilation, database updates, unit test, and integration tests. I saw the build time decrease by 41%. That is pretty good.

    buildFromRamDisk

    Running MvcContrib build using this same method return the following results, a decrease in build time from 37 to 28.7 seconds.

    RamDiskCompileMvcContrib

    I am running this from an XP virtual machine with the ram disk that is available for free from here:  http://www.mydigitallife.info/2007/05/27/free-ramdisk-for-windows-vista-xp-2000-and-2003-server/

    This is just a prototype and I am just playing with this idea right now.  Next I am going to do some tests with loading database files to the ram disk and look at some options for ensuing all my data is not lost…. The important thing to know about the RAM Disk is that when the machine shuts down it dumps the contents of the disk.  There are some options where the drive can be mapped to an image file so that the drive can start up with some basic configuration.  More to come….

  • Come see me speak about Silverlight 2.0 at the Alamo Coders on Tuesday July 8th

    I am excited to have a chance to speak to the Alamo Coders user group about Silverlight 2.0.  I am planing on covering some general information about Silverlight and where if fits in the overall technology stack against some of the other technologies like AIR and FLEX.  I do plan on demonstrating the areas that I think makes it a legitimate Application platform which is it's built in support for testability and rich APIs. 

    The meeting will be at  Tuesday July 8th at 6:00pm at the New Horizons Learning Center .  If you are near San Antonio feel free to drop in and see me!

     

    You can subscribe to this feed here http://feeds.feedburner.com/EricHexter


    See you next week.

     

    Eric

  • Session materials posted for my Austin Code Camp 2008 Silverlight 2 Unit Testing session

     

    I have been really busy between starting as a Principal Consultant for Headspring Systems and a long awaited vacation.  I am just
    catching up on some blog posts.

    My Silverlight Unit Testing session at the Austin Code Camp 2008 went really well.   The source code and presentation is available for download here.
    I got some great feedback and look forward to being able to speak on the topic some more!

     

    I wanted to formally thank John Teague for all of his hard work organizing the code camp.  With a new baby at home there was no way I could have organized
    it this year so I was happy to have John pull it together while I was able to focus on sponsorships and swag.  I think it was a great event and I will have a retrospective
    with John so that we can share all that we have learned about running a camp as well as how to successfully hand off the execution from one person to the next.
    I think there is more value in being able to grow a community where we have more leaders who can execute these types of events and I believe we have some
    great lessons to share.


    There is some great material for all of the code camp sessions on our code camp source repository.  Please check it out here.

     

    Subscribe to my feed here http://feeds.feedburner.com/EricHexter

  • Silverlight Beta 2 Released and what that means for the Testing Framework.

    ok..  So Silverlight Beta 2 was released on and it has some great new features. But what is the story about testing...?


    1 Jeff Willcox blogged about a small change you will need to make in order to use the existing testing framework. It is
    essentially adding a cast to the initial startup code for the testing framework.  He also posted new C# and VB.net project
    and item templates. He also hinted that there will be a new release of the test framework and some samples of integration
    with a Continuous Integration server.  I am excited about that.  I have some prototypes that were half baked to do this,
    I just have not had any time to make it usable.

     

    2. The one feature that I am happy to see is the UI Automation (UIA) support. The UIA will make test driving the UI and
    producing a true end-to-end test possible with a well documented and supported API.  Accessibility is supported in WPF
    so there are some controls that implement these features in this latest release of silverlight. UI Automation has all the hooks to allow
    testing tools to drive an application through the U.  Reference http://en.wikipedia.org/wiki/Microsoft_UI_Automation 

    The best part about silverlight supporting UIA is that a number of people have already paved the way by testing WPF using
    this  API... http://blogs.msdn.com/llobo/archive/2007/09/06/testing-using-wpf-ui-automation.aspx 

    Once again I think ThoughtWorks leads the way with their open source project http://www.codeplex.com/white.  Looking at
    the getting started page, I am excited to see how easier their helper "core" library integrates with nunit.... What more could I ask for?

     

    As I upgrade my previous samples to the Beta 2 Framework and experiment with the White project I will have some posting coming soon.

     

    Happily Testing

    Eric Hexter

     

     

     

     

     

     

  • Silverlight Testing - Part 2 - Making the test easier understand.

    Now that we have a working test that can make the proper assertions, the next step is to make the test easier to understand.  First, here is the existing test.

    FluentUiTest

    The test is loaded with infrastructure code that helps execute the asynchronous calls with the testing framework. This does not help the readability of the tests.  More than half of the code in this methods are helper methods and plumbing.  This is far from ideal.  Another approach to this would be to use a fluent interface that abstracts the plumbing code and leaves a test that is easier to comprehend.

     

    FluentUiTest

    In this code you will see the UiTestHelper class which hides more of the magic EnqeueXXXX calls to the SilverlightTest base class. This class also hides the code needed to add/remove the control to the test surface as well as call the TestComplete method.  This approach is less complicated and as a result allows for easier comprehension when you need to come back and change the code or the tests later in the project.  The tests are doing the exact same work and making the same assertion. 

     

    Subscribe to this feed: http://feeds.feedburner.com/erichexter

     

    The code for this project is located here : http://erichexter.googlecode.com/svn/trunk/EndToEndSilverlightDemo

  • Silverlight Testing - Part 1 - Testing the untested.

    The Silverlight testing framework was recently released and shows some great potential for being
    a first class application platform. For more information about the test framework see this post from
    Jeff Wilcox.
    To start off I choose to use a code sample that had some complexity in it.  Brad Abrams just posted 
    a Silverlight walk
    End-to-End Data Centric Application with Silverlight 2. This seemed like a good
    sample to use, since the post did not consider how to test the code.
    Step 1:  Add a test project and test class. 
    After the installing the assemblies and project templates, add a new unit test project to the solution.
    Change the test class to inherit from SilverlightTest.
    The following code demonstrates a simple integration test.
    This test does the following: 
    • Instantiates the page.
    • Clears the local storage.
    • Adds the page to the Test framework TestSurface.
    • Enters the letter s into the text box.
    • Clicks the search button.
    • Verifies that 9 products are displayed in the DataGrid.
    • Removes the page from the TestSurface.

    Here is the code for the test class:
       1:      [TestClass]
       2:      public class The_data_page_should_load:SilverlightTest
       3:      {
       4:          
       5:          [TestMethod]
       6:          public void When_searching_for_products_starting_with_s_nine_products_should_be_displayed()
       7:          {
       8:              EndToEndSilverlightDemo.Page pageUnderTest = new EndToEndSilverlightDemo.Page();
       9:              IPageTestDriver testDriver = pageUnderTest;
      10:              testDriver.ClearLocalStorage();
      11:              this.Silverlight.TestSurface.Children.Add(pageUnderTest);
      12:              testDriver.TypeSearchPrefix("s");
      13:              testDriver.ClickSearchButton();
      14:              Assert.AreEqual(9,testDriver.DisplayedProductRows);
      15:              this.Silverlight.TestSurface.Children.Remove(pageUnderTest);
      16:          }
      17:      }
     
    Here is the Test Driver interface:
       1:  public interface IPageTestDriver
       2:     {
       3:         void TypeSearchPrefix(string searchPrefix);
       4:         void ClickSearchButton();
       5:         int DisplayedProductRows { get; }
       6:         void ClearLocalStorage();
       7:         bool WebserviceHasReturnedData();
       8:     }
    Here is the portions of the Page class that implement the IPageTestDriver interface. It is a good idea to 
    hide the complexity of the Page classes internal controls from the test class. This is equivalent to
    creating a Test Fixture in other frameworks.

       1:          void IPageTestDriver.TypeSearchPrefix(string searchPrefix)
       2:          {
       3:              this.txtProductString.Text = searchPrefix;
       4:          }
       5:   
       6:          void IPageTestDriver.ClickSearchButton()
       7:          {
       8:              this.Button_Click(this.btnOne,null);
       9:          }
      10:   
      11:          int IPageTestDriver.DisplayedProductRows
      12:          {
      13:              get { return (new List<object>((IEnumerable<object>) this.dataGridResults.ItemsSource)).Count; }
      14:          }
      15:   
      16:          void IPageTestDriver.ClearLocalStorage()
      17:          {
      18:              settings.Clear();
      19:              settings.Save();
      20:              dataGridResults.ItemsSource = null;
      21:          }
      22:   
      23:          bool IPageTestDriver.WebserviceHasReturnedData()
      24:          {
      25:              return dataGridResults.ItemsSource != null;
      26:          }
      27:      }
     
    Now run the test and everything is good right?  Not so.  But why is that?

    sl-test-failed

    The test has failed because the application is making an Asynchronous call to the web service.  This means
    our test runs and completes before the remote call to return data can complete and load the data into the data grid.
     

    Solution:  Use the Asynchronous features of the test framework.

    The framework provides the functionality to be able to drive unit tests in an async fashion.  This allows the
    test to run and wait for a condition to be met before proceeding.  In this case on line 10 the EnqueueConditional
    call waits until the helper method returns true before the test proceeds with the next call.
       1:          [TestMethod,Asynchronous]
       2:          public void When_searching_for_products_starting_with_s_nine_products_should_be_displayed_async()
       3:          {
       4:              EndToEndSilverlightDemo.Page pageUnderTest = new EndToEndSilverlightDemo.Page();
       5:              IPageTestDriver testDriver = pageUnderTest;
       6:              testDriver.ClearLocalStorage();
       7:              this.Silverlight.TestSurface.Children.Add(pageUnderTest);
       8:              EnqueueCallback(() => testDriver.TypeSearchPrefix("s"));
       9:              EnqueueCallback(() => testDriver.ClickSearchButton());
      10:              EnqueueConditional(testDriver.WebserviceHasReturnedData);
      11:              EnqueueCallback(() => Assert.AreEqual(9, testDriver.DisplayedProductRows));
      12:              EnqueueCallback(() => this.Silverlight.TestSurface.Children.Remove(pageUnderTest));
      13:              EnqueueTestComplete();
      14:          }
     
    And the results?....
    sl-test-passed

    The test passes and verifies the full remote call to the web service as well as getting the data back into the user interface.
    Pretty cool?  This sample demonstrates that it is possible to test drive the user interface.  The code to do so is far from
    being readable and comprehendible.  The next post in this series will address the readability of the testing code and put a
    fluent interface around the ugly Enqueue method calls. 

     

    The source code for this sample is available here; http://erichexter.googlecode.com/svn/trunk/EndToEndSilverlightDemo/EndToEndSilverlightDemo/ 

  • Silverlight Testing framework bug - FrameworkElements are not visible on the TestSurface

    Working with the Silverlight testing framework the last three weeks has been interesting.  I ran into a crazy intermittent bug which drove me made for about 2 hours.  The usercontrol that I was adding to the TestSurface would be visible about 50% of the time when running my tests. The test would still run and I could hear the audio portion of the videos that were playing as part of an integration test, but the Controls were not visible on the test surface. All I could see was the blank test surface and the testing framework status on the right side of the test runner.

     
    After resorting to reflector on the test framework I found that the TestSurface is a Grid control.  That got me to think that since my controls parent control is also a Grid control that maybe the nested grids are just having some sort of issue.  I ended up solving the problem by Adding my controls to a Canvas control and adding the Canvas instance to the TestSurface.  Code as follows......


    Subscribe to this feed: http://feeds.feedburner.com/erichexter 

    si-testing-testsurfacebug

     

    This solved my problem... The issue is not with the test framework as much as the silverlight runtime.  It is still beta so what do you expect?

    More posts on the test framework, both unit testing and integration testing, to come soon.

     

    Additional Info: 

    For more information about the silverlight testing framework see: http://www.jeff.wilcox.name/2008/03/31/silverlight2-unit-testing/

  • ASP.Net MVC framework - New version of the MVC Contrib project! - v 0.0.1.101

    There was a new source code release of the Asp.Net MVC framework .  We just got the MVC Contrib project upgraded to work against the new release.

    You can find the release here.

     

    First I would like to thank Jeremy Skinner for his hard work upgrading the release!

     

    Here is what changed in the release:

    • Upgraded to the 0416 Source Code drop of ASP.NET MVC.
    • Moved most of ConventionController's logic into ConventionControllerActionInvoker.
    • ControllerDescriptor now only treats methods that return an ActionResult as a valid action.
    • Moved the filters implementation more in line with the implementation in ControllerActionInvoker.
    • Removed the ReturnBinders implementation. The same result can be achieved by using custom ActionResults.
    • Introduced XmlResult to replace XmlReturnBinder.
    • Added RenderText and RenderXML methods to ConventionController.
    • TestControllerBuilder no longer proxies controllers or captures renderview/redirect calls

     

    Keep up to date by subscribing to http://feeds.feedburner.com/EricHexter

     

    Do you twitter?  You can follow the project on twitter here: http://twitter.com/mvccontrib

  • ASP.Net MVC - MvcContrib - We need your opinion!

    I started working with sandcastle to generate api documentation for the Asp.Net MVC - MvcContrib project (http://MvcContrib.org).  I wanted to get some feedback as to how useful the general API Namespace/Class listings are. Below are two of the outputs of the documentation. I encourage you to take a quick look at it so that you can provide feedback.


    To Subscribe to this RSS feed use this url:
    http://feeds.feedburner.com/EricHexter


    Here is an html versions that the project could host online.

    http://mvccontrib.googlecode.com/svn/trunk/Documentation/Help/Index.html

    Here is a CHM help file.  To view this you will need to Save As, than goto the file properties and click Unblock.  If you do not unblock the file you will see the navigation tree, but all of the content will display a page not found error.

    http://mvccontrib.googlecode.com/svn/trunk/Documentation/Help/MvcContrib-Api-Documentation.chm

    Questions I need feedback on:

    1. Does having the Namespaces and classes browsable in this format provide and value as a user of the mvccontrib project? 
    2. If all of the feature documentation from the CodePlex wiki was included in the help file would that make a difference to the value that this documentation provides? (The wiki docs are located here: http://www.codeplex.com/MVCContrib/Wiki/View.aspx?title=Documentation&referringTitle=Home)
    3. Is there a better way to provide general api documentation, do you have some examples of something you like?
  • Eric Hexter - About Me

    I thought I would take a moment to introduce myself and give some context around my opinions.

    For the past 12 years, I have been developing software professionally in consulting, product development, corporate IT, premium Brand web sites and e-commerce.  Until recently, I worked for a well-known golf equipment company as the Director of eCommerce Technology.  In this role I worked on a number of ecommerce sites and learned a great deal about online retail for both new and used products.  I learned a great deal about online marketing and order fulfillment.  It was a terrific opportunity and has really added to my previous experiences working for manufacturing companies.

    Recently, I started a new job.  I am working in the role of Technical Architect for Ascentium.  I am very excited about the company in terms of culture and opportunities. More to come on this in the future.

    Primarily, I use Microsoft .Net technologies and the Microsoft application stack (IIS, ASP.Net, Sql server).  I had the unfortunate experience to develop, maintain, support, and bring back to life web site based on Microsoft Commerce Server 2002.  This led me to developing some skills in running command line debuggers on production servers and analyzing User Mode memory dumps to help facilitate conversations with the Commerce Server support team about their use of COM and unmanaged code in a managed domain. If you ever meet me in person I could go into great deal about this.

    I am an advocate of agile project management and software engineering practices.  I have learned the hard way that writing un-testable tightly coupled code gets you no where fast.  In fact, that type of code usually keeps one in the same spot unable to change and adapt software to the ever-changing needs of the business that uses said software.

    As an active member in the Austin .Net Users Group, I am one of three directors who helps run the organization.  I organized and facilitated the 2007 code camp, which was a great success.  For the upcoming 2008 Code Camp, I will serve as an advisor. Many thanks to John Teague for chairing the 2008 Code Camp.  I have some new family commitments that just made running this camp unrealistic for me.  So I am glad to help pass the torch.  I have spent many phone calls and emails with user group leaders across the South Central district helping them understand how to run Code Camps and events, using what I learned from my experience.  I have spoken to User Groups and at the Code Camp as well.  My primary focus is around web site operations, deployment, and web farm management. 

    I have been actively working on the following Open Source Projects:

    MvcContrib  - This is a project that fills in the gaps of the upcoming ASP.Net MVC framework.  There are many contributors and I am happy to be part of this project.

    Tarantino - This is a project that has pulled together some libraries and utilities to facilitate application development and deployment.  The features that I am fond of is the Database Change Management tools, web farm management, and application deployment tools.  Kevin Hurwitz is the primary developer on this project and since he is not blogging I have encouraged his work on this and have been pitching in and really pushing to get some solid documentation in place so that the project can be easily picked up and used to help developer work less on infrastructure.

    TDD-Generator - This is a pet project that I am still working out.  It is a Visual Studio addin that generates Test,Interface, & Class files with a few keystrokes.  I found that Visual Studio makes it very difficult and to do things the right way.  The intent of this project is to make creating the code files used in TDD easier and with less friction than developing using the Project-Add  New file metaphor that is built into Visual Studio.  Here is a screen cast which demonstrates the addin http://erichexter.googlecode.com/svn/trunk/TestFirstGenerator/docs/ScreenCast.htm

  • New MvcContrib build released on CodePlex - Build 0.0.1.91 Beta

    I just released the latest build in binary and source code format on CodePlex.

    What's new in this release?
    The following items are changes from the previous release:

    Revision: 275
    - corrected some warnings/errors.
    - added ViewDataExtensions. This brings the functionality of the smartbag to ViewData.
    - now, we have easy adding and getting to and from ViewData. No more casting, and if you only put a single "Customer" in Viewdata using new Add() method, you just have to Get<Customer>(), and that's it.
    Revision: 272
    Patch 1018 By:alley Added support for Unity as IoC container.
    Revision: 270
    Replaced all remaining occurrences of the MVCContrib namespace with MvcContrib.
    Rev 267
    - the ability to use TestControllerBuilder with controllers that have constructor arguments
    - associated unit test

    You can download the release here:
    https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=MVCContrib&ReleaseId=12005


    The documentation for the features in the MvcContrib project are located here:
    http://www.codeplex.com/MVCContrib/Wiki/View.aspx?title=Documentation&referringTitle=Home


    If you have some cool feature that adds to the MVC framework then contribute and share with the community! Here are details on how to contribute.
    http://www.codeplex.com/MVCContrib/Wiki/View.aspx?title=Contribute&referringTitle=Home

  • Batch file to Checkout all root level project trunks in a Subversion repository

    Our source control tree is setup with the projects at the root of our server and each has a separate trunk, tags, and branches.  While this makes it very easy to have a location agnostic build and include all the dependencies in one place for a particular project, this aspect can be painful when you want to checkout the trunk of each project to a new developer machine.  I wrote a little batch file to ease the pain.

    Sample Source Control Repository

    Project1
       trunk
       tags
       branches

    Project2
       trunk
       tags
       branches

    ect ...

     

    Batch file to pull checkout all of the trunks.

       1: set svnbin="d:\Program Files\CollabNet Subversion Server\bin\svn.exe"
       2: set svnroot=http://sourceserver:8080/svn/cgi/
       3: %svnbin% list %svnroot%>projects.txt
       4: FOR /F "tokens=1" %%i IN (projects.txt) DO %svnbin% checkout %svnroot%%%itrunk %%i

     

    Subscribe to this feed:  http://feeds.feedburner.com/EricHexter


    This is pretty easy to modify, simple replace your bin location for subversion executable and update the svnroot to the path to your subversion repository and you are good to go.  The one important gotcha here is that subversion is case sensitive.  I ran into a problem where our repository has some of the trunks starting with a lowercase t and other starting with a uppercase t.  In that case, I just added an additional line 4 with the uppercase Trunk.  That batch file roles on without stopping if there is a mismatch in the case of trunk.

  • ASP.NET 3.5 Extensions Preview - New version of MS MVC is available.

    As part of the Mix 08 conference a new version of the Microsoft MVC framework is available for download.

    http://www.microsoft.com/downloads/details.aspx?FamilyId=A9C6BC06-B894-4B11-8300-35BD2F8FC908&displaylang=en

     

    The MvcContrib team will be working to get the contrib project up and running on the new version.

  • New MvcContrib build released on CodePlex - Build 0.0.1.75 Beta

    I just released the latest build in binary and source code format on CodePlex.

    The following items are changes from the previous release:

    • Added support for InputImage in FormHelper (new methods FormHelper.ImageButton())
    • Added Password Tag
    • Added support for Password tag in FormHelper (new methods FormHelper.PasswordField())
    • Updated test to maintain 100% on form helper and UI
    • Changed TextArea to use a full Close tag when value is empty instead of a XML tag close ("/>").
    • Fixed UI.Html/FormHelperTester.cs tests to anticipate new results.
    • Patch #882 - tehlike ReturnBinder implementation ported from MonoRail. / Modified tests slightly to reach 100% coverage.
    • Patch #864 - Woil This patch cleans up some of the namespaces from the older MvcTestFramework to the new MvcContrib.TestHelper namespace.
    • Added comments to all of the TestHelper classes which should make them easier to use. Applied with minor modification -
    • Sample test project referenced the Debug directory of MvcContrib.TestHelper, which caused CommitterBuild to fail. Changed to use $(Configuration) instead.
    • Made methods on FormHelper virtual. Fixed the namespace for the ObjectFactoryDependencyResolver, SpringDependencyResolver and StructureMapDependencyResolver - they were under the UnitTests namespace.

    You can download the release here:
    https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=MVCContrib&ReleaseId=11177


    The documentation for the features in the MvcContrib project are located here:
    http://www.codeplex.com/MVCContrib/Wiki/View.aspx?title=Documentation&referringTitle=Home


    If you have some cool feature that adds to the MVC framework then contribute and share with the community! Here are details on how to contribute.
    http://www.codeplex.com/MVCContrib/Wiki/View.aspx?title=Contribute&referringTitle=Home

More Posts Next page »
Copyright Los Techies 2007. All rights reserved.
Powered by Community Server (Commercial Edition), by Telligent Systems