Monday, February 28, 2011

Running SpecFlow Tests

We are setting up SpecFlow tests, in a BDD approach, before generating the code to satisfy the user stories (features and scenarios). Data layer is generated with Sharp Architecture.

The first error that pops out when trying to run the tests is

 ----> NHibernate.HibernateException : Could not create the driver from NHibernate.Driver.SQLite20Driver.

  ----> System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.

  ----> System.IO.FileLoadException : Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

   at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory()

To sort this out, check this linked article. Adding those few lines to your nunit-console application configuration file does the trick.

After this, see here how to set up running SpecFlow tests from Visual Studio and automatically generating the report.

Thursday, February 24, 2011

Import DDL Types for SQL Server 2008 into Enterprise Architect

While not difficult, adding new DDL types into Enterprise Architect is not quite straightforward. I needed SQL 2008 types added separate to existing SQL 2000 and (later imported) 2005.

The Data Modeling page (link) on Sparx site states that the DDL types can be downloaded from the Resources page. Head there and, under Data Modeling Data Types, download the XML file for SQL 2008 (or click directly here).

Once you download the XML file, go to Tools -> Import Reference Data in the Enterprise Architect. Select the downloaded file, then select the name in the list that appears later and click Import. That should be all there is.

Now, when adding a new table in the Data Model, SQL 2008 is available as a DB type, together with all the DDL types.

Wednesday, February 23, 2011

Redmine & Backlogs - "Updated by {{author}} {{age}} ago"

I just installed Redmine Backlogs plugin in order to display the burndown chart for issues in Redmine. However, the issue pages started showing "Updated by {{author}} {{age}} ago", as well as other template keys instead of real values.

Thanks to a discussion at

the solution seems to be some incompatibility in i18n gem for Ruby. The solution is to remove 0.5.0 of i18n package and install an older one. Here is the post that helped:

"I had a similar issue after installing a plugin that required the i18n gem which resulted in my unintentionally upgrading i18n to 0.5.0. When I rolled back to i18n 0.4.1 it solved the issue for me. Here were the commands I used:

gem install --no-rdoc --no-ri i18n -v 0.4.1

In order to make sure I had 0.4.1 available on my system, and then:

gem uninstall i18n

And then select the newer version of i18n that it is necessary to get rid of (in my case it was i18n 0.5.0), then restart Redmine.

I can't guarantee this is going to help, but in my case it did."