TechnicalArchitectureWorx

The (Unofficial) ITWorx Technical Architecture Blog

Archive for the ‘Nader’ Category

Learn WPF

Posted by archworx on December 6, 2007

Microsoft has a free online course for WPF, I found it very useful.

take a look here

Posted in CuttingEdge, Nader | Leave a Comment »

First Cutting Edge Club Public Seminar

Posted by archworx on November 28, 2007

Last Saturday saw the Cutting Edge Club’s Technical Seminars go Public for the first time. This is interesting as it is contributing to a critical mass which I believe will herald a watershed period in the Egyptian IT industry. It is also relevant to this blog because in essence the club was the brain child of the Architecture Group. It is still headed by our very own Nader Ziada.

BTW – the event was extremely encouraging, and people’s reception was quite good. The speakers themselves were quite articulate and people seemed quite happy with the whole thing.

We’ll give you more details in due time, but this is just a quick announcement until then.

Posted in CuttingEdge, mkaram, Nader | 2 Comments »

Regular Expressions evaluation

Posted by archworx on August 23, 2007

Here are a couple of great sites for testing and evaluating regular expressions, any one of those sites can save you a ton of time of you are working with complex regular expressions

Site 1
Site 2

Thanks to the developers of these sites ūüôā

Posted in General, Nader | 9 Comments »

Nunit vs MsTest

Posted by archworx on June 10, 2007

After doing a lot some investigations and trying it for ourselves, we came to the conclusion that its better for us to use Nunit instead of using Mstest (the automated unit tests generated by Visual Studio 2005). Of coarse that’s not a general rule, depends of the project and your environment, but in most of our projects, we prefer Nunit for the following reasons

  1. It’s an open standard
  2. Works on all versions of Visual Studio, whereas MsTest only works with Team system or VSTS
  3. Much easier to integrate with Cruise Control (our continuous integration server)
  4. More suited for test driven development cause it allows you to start by coding the tests, whereas the main benefit of MsTest is that it can generates test stubs from your code.

Decide based on your project.

Posted in Continuous Integration, Extreme Programming, Nader | Leave a Comment »

MsTest working in CruiseControl.Net

Posted by archworx on June 6, 2007

I’ve trying to get MsTest, the unit tests generated by Visual Studio 2005, to work with cruise control for a while now. So finally I was able to get it to work following these steps below¬†

Let’s say we have a solution called ITT in the following path c:/ITT, first we’ll look at the ccnet config file, after you compile using the msbuild task, you have to call an exec task to execute the MsTests, but before that you have to delete the test results file because MsTest won’t run if the file is already there, we are doing this by calling a batch file to delete this test results file and also delete the temp folders created by MsTest. After that you have to merge the results file with build output so I can be displayed in the dashbaord.

¬†<project name=”ITT”>
    <webURL>http://localhost/ccnet</webURL&gt;
    <triggers>
¬†¬†¬†¬†¬† <intervalTrigger seconds=”100″ />
    </triggers>
    <modificationDelaySeconds>120</modificationDelaySeconds>

¬†¬†¬† <!– here you do the task to get the project from the source control –>
¬†¬†¬† <!–sourcecontrol type=”vss” autoGetSource=”true” applyLabel=”false”>
¬†¬†¬† </sourcecontrol–>

    <tasks>
¬†¬†¬†¬†¬† <!– task to build the solution–>¬†
      <msbuild>
        <executable>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe</executable>
        <workingDirectory>c:\ITT</workingDirectory>
        <projectFile>ITT.sln</projectFile>
        <targets>Build</targets>
        <timeout>60</timeout>
        <logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
      </msbuild>

      <exec>
¬†¬†¬†¬†¬†¬†¬† <!– call a batch file that deletes results.trx –>
¬†¬†¬†¬†¬†¬†¬† <!– this is required as MsTest will not create the file if it exists–>
¬†¬†¬†¬†¬†¬†¬† <!– the batch file also deletes the temp folders created by MsTest –>¬†
        <executable>delTestLog.bat</executable>
        <baseDirectory>c:\ITT</baseDirectory>
        <buildArgs></buildArgs>
        <buildTimeoutSeconds>30</buildTimeoutSeconds>
      </exec>
     
      <exec>
¬†¬†¬†¬†¬†¬†¬† <!– the exec task to execute the MsTest task –>
        <executable>C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\MSTest.exe</executable>
        <baseDirectory>c:\ITT</baseDirectory>
        <buildArgs>/testcontainer:\ITT\AnalysisLibTests\bin\Debug\AnalysisLibTests.dll /runconfig:localtestrun.testrunconfig /resultsfile:results.trx</buildArgs>
        <buildTimeoutSeconds>600</buildTimeoutSeconds>
      </exec>

    </tasks>
    <publishers>
¬†¬†¬†¬†¬† <!–to get the test results in the dashboard we have to merge the results XML file –>
      <merge>
        <files>
          <file>c:\ITT\results.trx</file>
        </files>
      </merge>
      <xmllogger />
¬†¬†¬†¬†¬† <email from=”CruiseControl” mailhost=”mail” includeDetails=”TRUE”>

      </email>
    </publishers>
</project>

The next step is to modify the dashboard config file to display the test results, first we update the dashboard.config file to include the MsTests details menu item and then we add the MsTest results summary to the main build page. The required xsl files are already included with ccnet, you can customize the xsl to fit your needs

<buildReportBuildPlugin>
  <xslFileNames>
    <xslFile>xsl\header.xsl</xslFile>
    <xslFile>xsl\modifications.xsl</xslFile>
    <xslFile>xsl\compile.xsl</xslFile>
¬†¬†¬†¬†<xslFile>xsl\MsTestSummary.xsl</xslFile> <!– MsTest results summary in main page–>
¬†¬†¬†¬†<xslFile>xsl\unittests.xsl</xslFile> <!– Nunit test results, can be removed if not required any more –>
    <xslFile>xsl\fxcop-summary.xsl</xslFile>
    <xslFile>xsl\NCoverSummary.xsl</xslFile>
    <xslFile>xsl\SimianSummary.xsl</xslFile>
    <xslFile>xsl\fitnesse.xsl</xslFile>
  </xslFileNames>
 </buildReportBuildPlugin>
 <buildLogBuildPlugin />
¬†¬†¬†<xslReportBuildPlugin description=”NUnit Details” actionName=”NUnitDetailsBuildReport” xslFileName=”xsl\tests.xsl” />
¬†¬†¬†<xslReportBuildPlugin description=”NUnit Timings” actionName=”NUnitTimingsBuildReport” xslFileName=”xsl\timing.xsl” />
¬†¬†¬†<xslReportBuildPlugin description=”MSTest Report” actionName=”MSTESTReport” xslFileName=”xsl\MsTestReport.xsl”/> <!– menu item –>
¬†¬†¬†<xslReportBuildPlugin description=”NAnt Output” actionName=”NAntOutputBuildReport” xslFileName=”xsl\NAnt.xsl” />
¬†¬†¬†<xslReportBuildPlugin description=”NAnt Timings” actionName=”NAntTimingsBuildReport” xslFileName=”xsl\NAntTiming.xsl” />
¬†¬†¬†<xslReportBuildPlugin description=”FxCop Report” actionName=”FxCopBuildReport” xslFileName=”xsl\FxCopReport.xsl” />
¬†¬†¬†<xslReportBuildPlugin description=”NCover Report” actionName=”NCoverBuildReport” xslFileName=”xsl\NCover.xsl” />
¬†¬†¬†<xslReportBuildPlugin description=”Simian Report” actionName=”SimianBuildReport” xslFileName=”xsl\SimianReport.xsl”/>¬†

¬†That’s all

Posted in Continuous Integration, Nader, VS 2005 | 3 Comments »

Do you know TED?

Posted by archworx on March 9, 2007

There is something called the TED conference, held annually in Monterey, California, which brings together a very high-powered audience of technology big shots and an amazingly diverse set of speakers. Check it out, they have a blog and usually have clips of the talks. I have heard it described as the single most interesting way that a smart and curious person could spend a week.

Posted in Nader, Rant | Leave a Comment »

Running Ant scripts from Eclipse

Posted by archworx on January 28, 2007

Getting Ant scripts to run from eclipse can sometimes be tricky if you are using Ant tasks that require external jar files, for example to run a script to deploy/undeploy to a tomcat server you have to add the make the following configuration changes, the same applies to junit and other external tasks

  • In Eclipse go to Window | Preferences | Ant
  • Open the Runtime section
  • In the Classpath tab: Add to the Global Entries the the catalina-ant.jar file as indicated by the following screen shot.

Eclipse-Ant jar file

  • In the Tasks tab: Add the Deploy and Undeploy tasks as shown in the following screen shot

Eclipse-Ant deploy

Eclipse-Ant Undeploy

Posted in Java, Nader | 13 Comments »

Book about Creating and Manipulating PDF

Posted by archworx on November 29, 2006

In iText in Action: Creating and Manipulating PDF, author Bruno Lowagie walks through everything PDF, Adobe’s Portable Document Format, from a Java developer’s point of view. Lowagie covers how to use iText in a Java/J2EE application for the production and/or manipulation of PDF documents. Along the way, Lowagie describes interesting PDF features and explains more obscure e-document functionalities. In addition to many small code samples, this book includes XML-based, ready-made solutions that can easily be adapted and integrated into projects.

There is a sample chapter¬†titled “PDF: why and when“. The first section of this chapter explains why PDF was invented and how it evolved into a de facto standard. In the second section, Lowagie describes the different PDF “flavors,” some of which are described in an International Standards Organization (ISO) standard. Lowagie uses a table listing different versions of the PDF specification to focus on specific features such as compression and encryption. He also uses “Hello World” examples to show how to compress/decompress and encrypt/decrypt PDF files.

Posted in Java, Nader, Programming | Leave a Comment »

Wiki

Posted by archworx on November 27, 2006

A wiki is a Web¬†site that enables users to add new content or edit existing content. As soon¬†as you post on a wiki all¬†users are able to add or change your original content¬†without needing any permissions. The purpose of the wiki to make it easy to collaborate on shared documents, once you publish your document; you relinquish ownership of that content. Most advanced wiki software allows advanced editing such as rich text fonts, graphics and HTML tags. This makes collaboration easy and fast. The term “wiki” comes from the Hawaiian word for “quick”.

For our internal wiki, we choose to use MoinMoin which is a python wiki engine, its open source and very easy to setup and use.

For installation on IIS 6.0 on a windows 2003 server, use the following instructions

http://moinmoin.wikiwikiweb.de/HelpOnInstalling/InternetInformationServer

For more details on installation of the wiki engine:

http://moinmoin.wikiwikiweb.de/HelpOnInstalling/BasicInstallation

For more details on creating the wiki instance:

http://moinmoin.wikiwikiweb.de/HelpOnInstalling/WikiInstanceCreation

Posted in General, Nader | Leave a Comment »

Unit testing

Posted by archworx on November 14, 2006

Do you want to know as soon as your new code breaks some older piece of code, either yours or someone else? I’m sure we all would like that. Well, Extreme programming answer to this is automated unit tests. The idea is that you have a set of classes testing your code; you write a test for each function you have, checking the expected result against actual results. Once you change any part of the code base or add new code, you run the test suite and right there you find out if there is anything broken, the failing tests also show you exactly which part is broken. If all the tests pass, then you know for sure you changes are ready to be integrated with the rest of the system.
The biggest resistance to dedicating any amount of time to unit tests is a fast approaching deadline. But during the life of a project an automated test can save you a hundred times the cost to create it by finding and guarding against bugs. The time it takes to find and fix a bug as you are developing your code is much less than finding it and fixing it after you are done and the system is being tested by the client. The harder the test is to write the more you need it because the greater your savings will be. Discovering all the problems that can occur take time, so to have a complete unit test suite when you need it you must begin creating the tests as you build the code.
Examples of unit test frameworks are NUnit (http://www.nunit.org/) for .net and JUnit (http://www.junit.org) for Java

Posted in Extreme Programming, Nader | Leave a Comment »