<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bei Grabthar's Hammer!*</title>
	<atom:link href="http://blogs.itemis.de/feltes/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.itemis.de/feltes</link>
	<description>Weblog von Ingo Feltes</description>
	<lastBuildDate>Tue, 19 Oct 2010 14:10:05 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>XtendTools 1.0.1 released</title>
		<link>http://blogs.itemis.de/feltes/2010/10/19/xtendtools-1-0-1-released/</link>
		<comments>http://blogs.itemis.de/feltes/2010/10/19/xtendtools-1-0-1-released/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 14:10:05 +0000</pubDate>
		<dc:creator>Ingo Feltes</dc:creator>
				<category><![CDATA[MDSD]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[xpand]]></category>
		<category><![CDATA[xtend]]></category>
		<category><![CDATA[xtenddoc]]></category>

		<guid isPermaLink="false">http://blogs.itemis.de/feltes/?p=201</guid>
		<description><![CDATA[A new release of XtendTools is available! Release 1.0.1 contains some bug fixes and additions suggested in the comments of my blog post about the initial release of XtendTools (see change log for details) and also a complete Javadoc-like API documentation of XtendLib which has been generated using XtendDoc. As usual, comments, suggestions and contributions [...]]]></description>
				<content:encoded><![CDATA[<p>A new release of <a href="https://fornax.itemis.de/confluence/display/fornax/Xtend+Tools">XtendTools</a> is available!</p>
<p>Release 1.0.1 contains some bug fixes and additions suggested in the comments of <a href="http://blogs.itemis.de/feltes/2010/06/09/xtendtools-1-0-0-released/">my blog post about the initial release of XtendTools</a> (see change log for details) and also a complete Javadoc-like API documentation of XtendLib which has been generated using <a href="http://blogs.itemis.de/feltes/2010/08/06/api-documentation-generator-for-xtend/">XtendDoc</a>.</p>
<p>As usual, comments, suggestions and contributions are welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.itemis.de/feltes/2010/10/19/xtendtools-1-0-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>API Documentation Generator for Xtend</title>
		<link>http://blogs.itemis.de/feltes/2010/08/06/api-documentation-generator-for-xtend/</link>
		<comments>http://blogs.itemis.de/feltes/2010/08/06/api-documentation-generator-for-xtend/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 15:25:00 +0000</pubDate>
		<dc:creator>Ingo Feltes</dc:creator>
				<category><![CDATA[MDSD]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[javadoc]]></category>
		<category><![CDATA[xtend]]></category>
		<category><![CDATA[xtenddoc]]></category>
		<category><![CDATA[xtext]]></category>

		<guid isPermaLink="false">http://blogs.itemis.de/feltes/?p=186</guid>
		<description><![CDATA[During some of my last Xtext and/or Xpand based MDSD projects I wrote a lot of extensions and model transformations with Xtend. Unfortunately is it very hard to efficiently reuse extensions, if there was no API documentation at all or the documentation was scattered across a lot of files. I really wished to have something [...]]]></description>
				<content:encoded><![CDATA[<p>During some of my last <a href="http://www.eclipse.org/Xtext/">Xtext</a> and/or Xpand based MDSD projects I wrote a lot of extensions and model transformations with Xtend. Unfortunately is it very hard to efficiently reuse extensions, if there was no API documentation at all or the documentation was scattered across a lot of files.</p>
<p>I really wished to have something like <a href="http://en.wikipedia.org/wiki/Javadoc">Javadoc</a> for Xtend!</p>
<p>Well, to cut a long story short, here it is:</p>
<p>XtendDoc is a tool for generating HTML API documentation for the Xtend language. XtendDoc is obviously inspired by Javadoc and uses the same markup language and the generated documentation also looks similar to documentation generated by Javadoc.</p>
<p align="center">
<a href="http://blogs.itemis.de/feltes/files/2010/08/XtendDocExample.png"><img src="http://blogs.itemis.de/feltes/files/2010/08/XtendDocExample-300x204.png" alt="" width="300" height="204" class="aligncenter size-medium wp-image-189" /></a>
</p>
<p>You can download a preview version of XtendDoc right here:</p>
<ul>
<li><a href="http://dl.dropbox.com/u/4435227/xtenddoc-preview.zip">xtenddoc-preview-zip</a></li>
</ul>
<p>XtendDoc uses Xtext 1.0 to parse the Xtend files and extract the comments. A good starting point for the Xtend grammar was the <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=264188">expression grammar by Moritz Eyshold and Knut Wannheden</a>. The HTML documentation is generated using Xpand templates.</p>
<p>If you would like to have a look at the source code, or if you would like to participate, feel free to contact me!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.itemis.de/feltes/2010/08/06/api-documentation-generator-for-xtend/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Run Xtext (and other MWE2 Workflows) with Ant</title>
		<link>http://blogs.itemis.de/feltes/2010/07/02/how-to-run-xtext-and-other-mwe2-workflows-with-ant/</link>
		<comments>http://blogs.itemis.de/feltes/2010/07/02/how-to-run-xtext-and-other-mwe2-workflows-with-ant/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 18:23:04 +0000</pubDate>
		<dc:creator>Ingo Feltes</dc:creator>
				<category><![CDATA[MDSD]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[xpand]]></category>
		<category><![CDATA[xtext]]></category>

		<guid isPermaLink="false">http://blogs.itemis.de/feltes/?p=171</guid>
		<description><![CDATA[Some days ago Sebastian showed How to Deploy Xtext to a Headless Plain-Java Envorinment. It&#8217;s nearly as easy to run the Xtext generator with Apache Ant. You just need the required libraries and the following Ant snippet to run the Xtext generator (or any other MWE2 workflow): &#60;path id=&#34;gen.classpath&#34;&#62; &#60;fileset dir=&#34;lib&#34; includes=&#34;*.jar&#34;/&#62; &#60;pathelement location=&#34;src&#34;/&#62; &#60;/path&#62; [...]]]></description>
				<content:encoded><![CDATA[<p>Some days ago Sebastian showed <a href="http://zarnekow.blogspot.com/2010/06/how-to-deploy-xtext-standalone.html">How to Deploy Xtext to a Headless Plain-Java Envorinment</a>. It&#8217;s nearly as easy to run the Xtext generator with <a href="http://ant.apache.org">Apache Ant</a>.<br />
<span id="more-171"></span></p>
<p>You just need the required libraries and the following Ant snippet to run the Xtext generator (or any other MWE2 workflow):</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;gen.classpath&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;lib&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;*.jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;src&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;gen&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;java</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher&quot;</span> <span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;gen.classpath&quot;</span> <span style="color: #000066;">fork</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;path/to/your/workflow.mwe2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/java<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Using Xtext 1.0 the following libraries are required to run the generator:</p>
<pre>
antlr-2.7.7.jar
antlr-3.0.1.jar
com.google.collect_0.8.0.v201006161118.jar
com.google.inject_2.0.0.v201003051000.jar
com.ibm.icu_4.2.1.v20100412.jar
de.itemis.xtext.antlr_1.0.0.v201006151527.jar
org.antlr.runtime_3.0.0.v200803061811.jar
org.apache.commons.cli_1.0.0.v20080604-1500.jar
org.apache.commons.logging_1.1.1.v201005080502.jar
org.apache.log4j_1.2.15.v201005080500.jar
org.eclipse.emf.codegen.ecore_2.6.0.v20100614-1136.jar
org.eclipse.emf.codegen_2.6.0.v20100614-1136.jar
org.eclipse.emf.common_2.6.0.v20100614-1136.jar
org.eclipse.emf.ecore.xmi_2.5.0.v20100521-1846.jar
org.eclipse.emf.ecore_2.6.0.v20100614-1136.jar
org.eclipse.emf.mwe.core_1.0.0.v201006150535.jar
org.eclipse.emf.mwe.utils_1.0.0.v201006150535.jar
org.eclipse.emf.mwe2.language_1.0.0.v201006150907.jar
org.eclipse.emf.mwe2.launch_1.0.0.v201006150907.jar
org.eclipse.emf.mwe2.runtime_1.0.0.v201006150446.jar
org.eclipse.xpand_1.0.0.v201006150611.jar
org.eclipse.xtend.typesystem.emf_1.0.0.v201006150611.jar
org.eclipse.xtend.util.stdlib_1.0.0.v201006150611.jar
org.eclipse.xtend_1.0.0.v201006150611.jar
org.eclipse.xtext.common.types_1.0.0.v201006161118.jar
org.eclipse.xtext.generator_1.0.0.v201006161118.jar
org.eclipse.xtext.util_1.0.0.v201006161118.jar
org.eclipse.xtext.xtend_1.0.0.v201006161118.jar
org.eclipse.xtext_1.0.0.v201006161118.jar
stringtemplate-3.1b1.jar
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blogs.itemis.de/feltes/2010/07/02/how-to-run-xtext-and-other-mwe2-workflows-with-ant/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>XtendTools 1.0.0 released</title>
		<link>http://blogs.itemis.de/feltes/2010/06/09/xtendtools-1-0-0-released/</link>
		<comments>http://blogs.itemis.de/feltes/2010/06/09/xtendtools-1-0-0-released/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 12:22:30 +0000</pubDate>
		<dc:creator>Ingo Feltes</dc:creator>
				<category><![CDATA[MDSD]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[xpand]]></category>
		<category><![CDATA[xtend]]></category>

		<guid isPermaLink="false">http://blogs.itemis.de/feltes/?p=161</guid>
		<description><![CDATA[Today, the first release of XtendTools has been published! The Xtend Tools are a library of reusable extensions for Xtend/Xpand called Xtend Lib and a set of utility classes for testing Xpand templates and Xtend extensions using JUnit. Xtend Tools is a utility project hosted at the Fornax Platform, a development platform for tools related [...]]]></description>
				<content:encoded><![CDATA[<p>Today, the first release of <a href="http://fornax.itemis.de/confluence/display/fornax/Xtend+Tools">XtendTools</a> has been published!</p>
<p>The Xtend Tools are a library of reusable extensions for <a href="http://wiki.eclipse.org/Xpand">Xtend/Xpand</a> called Xtend Lib and a set of utility classes for testing Xpand templates and Xtend extensions using JUnit.</p>
<p>Xtend Tools is a utility project hosted at the <a href="http://www.fornax-platform.org/">Fornax Platform</a>, a development platform for tools related to the Model-Driven-Software-Development &#8211; MDSD.</p>
<p>Xtend Tools is open source and released under the Terms of the <a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License 2.0</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.itemis.de/feltes/2010/06/09/xtendtools-1-0-0-released/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Groovy EMF Builder</title>
		<link>http://blogs.itemis.de/feltes/2010/04/01/groovy-emf-builder/</link>
		<comments>http://blogs.itemis.de/feltes/2010/04/01/groovy-emf-builder/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 09:12:16 +0000</pubDate>
		<dc:creator>Ingo Feltes</dc:creator>
				<category><![CDATA[MDSD]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[emf]]></category>
		<category><![CDATA[groovy]]></category>

		<guid isPermaLink="false">http://blogs.itemis.de/feltes/?p=148</guid>
		<description><![CDATA[Yesterday I started the open source project Groovy EMF Builder. The project is hosted at SourceForge and licensed under the Apache License 2.0. As you alyready might have guessed the Groovy EMF Builder is a builder for the Groovy programming language to create EMF models. Using the EMF Builder, an EMF model can be created [...]]]></description>
				<content:encoded><![CDATA[<p>Yesterday I started the open source project <a href="http://emfbuilder.sf.net">Groovy EMF Builder</a>. The project is hosted at <a href="http://www.sourceforge.net">SourceForge</a> and licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0.txt">Apache License 2.0</a>.<br />
<span id="more-148"></span><br />
As you alyready might have guessed the Groovy EMF Builder is a builder for the <a href="http://groovy.codehaus.org/">Groovy</a> programming language to create <a href="http://www.eclipse.org/modeling/emf/">EMF</a> models.</p>
<p>Using the EMF Builder, an EMF model can be created like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="groovy" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">def</span> builder <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> EmfBuilder<span style="color: #66cc66;">&#40;</span>EcorePackage<span style="color: #66cc66;">&#41;</span>
<span style="color: #000000; font-weight: bold;">def</span> book <span style="color: #66cc66;">=</span> builder.<span style="color: #006600;">EClass</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'Book'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
  eStructuralFeatures <span style="color: #66cc66;">&#123;</span>
    title <span style="color: #66cc66;">=</span> EAttribute <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'title'</span>, eType: EcorePackage.<span style="color: #006600;">Literals</span>.<span style="color: #006600;">ESTRING</span> <span style="color: #66cc66;">&#41;</span>
    pages <span style="color: #66cc66;">=</span> EAttribute <span style="color: #66cc66;">&#40;</span> name: <span style="color: #ff0000;">'pages'</span>, eType: EcorePackage.<span style="color: #006600;">Literals</span>.<span style="color: #006600;">EINT</span> <span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>I&#8217;m planning to use it for unit tests for Xpand templates and Xtend extensions using XpandUnit and XtendUnit from the recently founded open source project <a href="http://fornax.itemis.de/confluence/display/fornax/Xtend+Tools">Xtend Tools</a>. But you may use it for whatever comes to your mind (as along as you respect the license).</p>
<p>I recognize that there already is a <a href="http://www.dinkla.net/groovy/emf.html">Groovy EMF Builder by Jörn Dinkla</a>, but it is published under the terms of the GPL, which are not appropriate for my intended use. So I had write my own from scratch.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.itemis.de/feltes/2010/04/01/groovy-emf-builder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mocking Framework Classes in Signed JARs</title>
		<link>http://blogs.itemis.de/feltes/2009/10/06/mocking-framework-classes-in-signed-jars/</link>
		<comments>http://blogs.itemis.de/feltes/2009/10/06/mocking-framework-classes-in-signed-jars/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 16:17:04 +0000</pubDate>
		<dc:creator>Ingo Feltes</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[eng]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blogs.itemis.de/feltes/?p=132</guid>
		<description><![CDATA[Recently, I had to write a unit test for a class that used the MWE WorkflowFacade (which is part of the Eclipse MWE project). As usual I used EasyMock to mock the workflow facade. Unfortunately, EasyMock failed to create a mock object for this class, due to a SecurityException. The Exception was raised because the [...]]]></description>
				<content:encoded><![CDATA[<p>Recently, I had to write a unit test for a class that used the MWE WorkflowFacade (which is part of the <a href="http://wiki.eclipse.org/Modeling_Workflow_Engine_%28MWE%29">Eclipse MWE project</a>). As usual I used <a href="http://www.easymock.org">EasyMock</a> to mock the workflow facade.</p>
<p>Unfortunately, EasyMock failed to create a mock object for this class, due to a SecurityException. The Exception was raised because the package containing the class was signed and CGLIB was unabled to create a proxy class in the same package.<br />
<span id="more-132"></span></p>
<pre>
Caused by: java.lang.SecurityException: class "org.eclipse.emf.mwe.core.WorkflowFacade$$EnhancerByCGLIB$$21bce57e"'s signer information does not match signer information of other classes in the same package
	at java.lang.ClassLoader.checkCerts(ClassLoader.java:775)
	at java.lang.ClassLoader.preDefineClass(ClassLoader.java:487)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:614)
	... 36 more
</pre>
<p>The solution I found was <a href="http://code.google.com/p/powermock/">PowerMock</a>. PowerMock is actually an extension for the popular mocking frameworks EasyMock and Mockito. PowerMock provides additional funktionality especially for testing &#8220;legacy code&#8221;, that was not designed for testing (e.g. mocking of static members, private members, partial mocking, and more). And PowerMock also supports mocking of classes in signed packages out of the box.</p>
<p>To use PowerMock, you have to use the PowerMockRunner to execute the tests (using the @RunWith annotation in JUnit 4) and tell PowerMock which classes need special treatment (using the @PrepareForTest annotation). Also most calls to the static methods of EasyMock have to be replaced with calls of the equivalent methods of org.powermock.api.easymock.PowerMock.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">static</span> org.<span style="color: #006633;">easymock</span>.<span style="color: #006633;">EasyMock</span>.<span style="color: #006633;">expect</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">static</span> org.<span style="color: #006633;">junit</span>.<span style="color: #000000; font-weight: bold;">Assert</span>.<span style="color: #006633;">assertEquals</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">static</span> org.<span style="color: #006633;">powermock</span>.<span style="color: #006633;">api</span>.<span style="color: #006633;">easymock</span>.<span style="color: #006633;">PowerMock</span>.<span style="color: #006633;">createMock</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">static</span> org.<span style="color: #006633;">powermock</span>.<span style="color: #006633;">api</span>.<span style="color: #006633;">easymock</span>.<span style="color: #006633;">PowerMock</span>.<span style="color: #006633;">replay</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">static</span> org.<span style="color: #006633;">powermock</span>.<span style="color: #006633;">api</span>.<span style="color: #006633;">easymock</span>.<span style="color: #006633;">PowerMock</span>.<span style="color: #006633;">verify</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">static</span> org.<span style="color: #006633;">powermock</span>.<span style="color: #006633;">reflect</span>.<span style="color: #006633;">Whitebox</span>.<span style="color: #006633;">invokeMethod</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.Test</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.runner.RunWith</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.powermock.core.classloader.annotations.PrepareForTest</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.powermock.modules.junit4.PowerMockRunner</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.emf.mwe.core.WorkflowFacade</span><span style="color: #339933;">;</span>
...
&nbsp;
@RunWith<span style="color: #009900;">&#40;</span>PowerMockRunner.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span>
@PrepareForTest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>WorkflowFacade.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyTest <span style="color: #009900;">&#123;</span>
&nbsp;
    ...
&nbsp;
    @Test
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testCheckWorkflow_success<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span>
        WorkflowFacade workflow <span style="color: #339933;">=</span> createMock<span style="color: #009900;">&#40;</span>WorkflowFacade.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        expect<span style="color: #009900;">&#40;</span>workflow.<span style="color: #006633;">check</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">andReturn</span><span style="color: #009900;">&#40;</span>issues<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        expect<span style="color: #009900;">&#40;</span>workflow.<span style="color: #006633;">getIssues</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">andReturn</span><span style="color: #009900;">&#40;</span>issues<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">anyTimes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        replay<span style="color: #009900;">&#40;</span>workflow<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        invokeMethod<span style="color: #009900;">&#40;</span>cut, <span style="color: #0000ff;">&quot;checkWorkflow&quot;</span>, workflow<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        assertEquals<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>, issues.<span style="color: #006633;">getErrors</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">length</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        assertEquals<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>, issues.<span style="color: #006633;">getWarnings</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">length</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        verify<span style="color: #009900;">&#40;</span>workflow<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>In my <a href="http://blogs.itemis.de/feltes/2009/09/25/accessing-private-members-in-java-for-unit-testing/">last blog entry</a> I gave a little example, how to <a href="http://blogs.itemis.de/feltes/2009/09/25/accessing-private-members-in-java-for-unit-testing/">call private members using the Java reflection API</a>. PowerMock offers the Whitebox class for the same purpose. The test above demonstrates the use of the Whitebox class to call a private member of my class-under-test.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.itemis.de/feltes/2009/10/06/mocking-framework-classes-in-signed-jars/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Accessing Private Members in Java (for Unit Testing)</title>
		<link>http://blogs.itemis.de/feltes/2009/09/25/accessing-private-members-in-java-for-unit-testing/</link>
		<comments>http://blogs.itemis.de/feltes/2009/09/25/accessing-private-members-in-java-for-unit-testing/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 11:15:06 +0000</pubDate>
		<dc:creator>Ingo Feltes</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blogs.itemis.de/feltes/?p=124</guid>
		<description><![CDATA[It&#8217;s quite simple to access private methods of classes using the Java reflection API. Here&#8217;s an example how to do it in a JUnit test case: public class ArrayListTest { @Test public void testFastRemove() throws Exception { ArrayList cut = new ArrayList(); cut.add("Test1"); cut.add("Test2"); Method m = ArrayList.class.getDeclaredMethod("fastRemove", Integer.TYPE); m.setAccessible(true); m.invoke(cut, 1); assert 1 == [...]]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s quite simple to access private methods of classes using the Java reflection API. Here&#8217;s an example how to do it in a JUnit test case:</p>
<pre>
public class ArrayListTest {
    
    @Test
    public void testFastRemove() throws Exception {
        ArrayList cut = new ArrayList();
        cut.add("Test1");
        cut.add("Test2");
        
        Method m = ArrayList.class.getDeclaredMethod("fastRemove", Integer.TYPE);
        m.setAccessible(true);
        m.invoke(cut, 1);
        
        assert 1 == cut.size();
    }

}
</pre>
<p>As this breaks encapsulation, you should only use this, if ever, for white box tests.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.itemis.de/feltes/2009/09/25/accessing-private-members-in-java-for-unit-testing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Convert FitNesse XML reports to HTML [Update]</title>
		<link>http://blogs.itemis.de/feltes/2009/06/23/convert-fitnesse-xml-reports-to-html/</link>
		<comments>http://blogs.itemis.de/feltes/2009/06/23/convert-fitnesse-xml-reports-to-html/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 16:25:44 +0000</pubDate>
		<dc:creator>Ingo Feltes</dc:creator>
				<category><![CDATA[MDSD]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[ci]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[fit4oaw]]></category>
		<category><![CDATA[fitnesse]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blogs.itemis.de/feltes/?p=92</guid>
		<description><![CDATA[I wrote some XSLT style sheets to transform FitNesse and fit4oaw XML reports to HTML or JUnit compatible test reports. The HTML reports contain the complete test output. However, the JUnit compatible test reports only contain the summary of each test. Download: fitnesse-xslt-101.zip The zip file contains style sheets for FitNesse and fit4oaw. However, the [...]]]></description>
				<content:encoded><![CDATA[<p>I wrote some XSLT style sheets to transform <a href="http://fitnesse.org">FitNesse</a> and <a href="http://fit4oaw.wiki.sourceforge.net">fit4oaw</a> XML reports to HTML or <a href="http://junit.org">JUnit</a> compatible test reports. The HTML reports contain the complete test output. However, the JUnit compatible test reports only contain the summary of each test.<span id="more-92"></span></p>
<ul>
<li>Download: <a href="http://blogs.itemis.de/feltes/files/2009/06/fitnesse-xslt-101.zip">fitnesse-xslt-101.zip</a></li>
</ul>
<p>The zip file contains style sheets for FitNesse and fit4oaw. However, the only difference is the &#8220;branding&#8221; of the reports.</p>
<p>I&#8217;m using the style sheets to create fancy reports during automated builds via <a href="http://ant.apache.org">Ant</a>:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xslt</span></span>
<span style="color: #009900;">  <span style="color: #000066;">in</span>=<span style="color: #ff0000;">&quot;${target.dir}/fit4oaw.xml&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">out</span>=<span style="color: #ff0000;">&quot;${target.dir}/fit4oaw.html&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;fit4oaw-html.xsl&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xslt</span></span>
<span style="color: #009900;">  <span style="color: #000066;">in</span>=<span style="color: #ff0000;">&quot;${target.dir}/fit4oaw.xml&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">out</span>=<span style="color: #ff0000;">&quot;${test-reports.dir}/TEST-fit4oaw.xml&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;fit4oaw-junit.xsl&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></td></tr></table></div>

<p><strong>Update:</strong> Released new stylesheets including some cosmetic fixes.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.itemis.de/feltes/2009/06/23/convert-fitnesse-xml-reports-to-html/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding fit4oaw to your CI build (using Ant and Hudson)</title>
		<link>http://blogs.itemis.de/feltes/2009/04/03/adding-fit4oaw-to-your-ci-build-using-ant-and-hudson/</link>
		<comments>http://blogs.itemis.de/feltes/2009/04/03/adding-fit4oaw-to-your-ci-build-using-ant-and-hudson/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 12:16:03 +0000</pubDate>
		<dc:creator>Ingo Feltes</dc:creator>
				<category><![CDATA[MDSD]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[fit4oaw]]></category>
		<category><![CDATA[hudson]]></category>
		<category><![CDATA[oaw]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blogs.itemis.de/feltes/?p=57</guid>
		<description><![CDATA[fit4oaw is a testing framework based on FitNesse for openArchitectureWare generators. To get automatic test reports the fit4oaw tests should be integrated into a continious build. In my case I am using Hudson to get my CI builds done; so I will demonstrate how to add fit4oaw to an Ant build that is run by [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://fit4oaw.wiki.sourceforge.net/">fit4oaw</a> is a testing framework based on <a href="http://fitnesse.org">FitNesse</a> for <a href="http://www.openarchitectureware.org">openArchitectureWare</a> generators. To get automatic test reports the fit4oaw tests should be integrated into a continious build. In my case I am using <a href="https://hudson.dev.java.net/">Hudson</a> to get my CI builds done; so I will demonstrate how to add fit4oaw to an <a href="http://ant.apache.org">Ant</a> build that is run by Hudson.<span id="more-57"></span></p>
<p>At first, add a target to start the FitNesse server.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;fit4oaw.start&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;java</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;fitnesse.FitNesse&quot;</span> <span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;fitnesse.classpath&quot;</span> <span style="color: #000066;">spawn</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">fork</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-o&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-p&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${fitnesse.port}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-d&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${basedir}/${fitnesse.dir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jvmarg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-Dtest.classpath=${toString:fit4oaw.runtime.classpath}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/java<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>The <code>${fitnesse.dir}</code> is the directory where FitNesseRoot is located. This should be an absolute path; therefore it&#8217;s preprended with <code>${basedir}</code>. The class path <code>fitnesse.classpath</code> should contain <code>fitnesse.jar</code>,  <code>htmlparser.jar</code> and <code>json.jar</code> and any other required jars from the FitNesse distribution. The class path <code>fit4oaw.runtime.classpath</code> should contain your classes directory (your system under test), all oAW dependencies (either from your local eclipse installation or from the maven repository that comes with fit4oaw), the <code>fitnesse.classpath</code>, <code>fit4oaw.jar</code> and any other dependencies required by your tests.</p>
<p>To use the <code>fit4oaw.runtime.classpath</code> in FitNesse just add the following to your <code>FitNesseRoot/content.txt</code>:</p>
<pre>!path ${test.classpath}</pre>
<p>The add a target to stop the FitNesse server:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;fit4oaw.stop&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;java</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;fitnesse.Shutdown&quot;</span> <span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;fitnesse.classpath&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-p&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${fitnesse.port}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/java<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>And last but not least add the target that actually runs the tests and processes the test results:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;fit4oaw.test&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;java</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;fitnesse.runner.TestRunner&quot;</span> <span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;fitnesse.classpath&quot;</span> <span style="color: #000066;">resultproperty</span>=<span style="color: #ff0000;">&quot;fit4oaw.result&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-v&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-xml&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${basedir}/${target.dir}/fit4oaw.xml&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;localhost&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${fitnesse.port}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${fitnesse.suite}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/java<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;condition</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;fit4oaw.failed&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;not<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;equals</span> <span style="color: #000066;">arg1</span>=<span style="color: #ff0000;">&quot;${fit4oaw.result}&quot;</span> <span style="color: #000066;">arg2</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/not<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/condition<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xslt</span></span>
<span style="color: #009900;">    <span style="color: #000066;">in</span>=<span style="color: #ff0000;">&quot;${target.dir}/fit4oaw.xml&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">out</span>=<span style="color: #ff0000;">&quot;${test-reports.dir}/TEST-fit4oaw.xml&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;${tool.dir}/fit4oaw/fit4oaw-junit.xsl&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>This target executes the test suite <code>${fitnesse.suite}</code> and sets the property <code>${fit4oaw.failed}</code> to &#8220;true&#8221; if tests failed. After that, the test results are transformed (using the XSLT stylesheet <a href="http://blogs.itemis.de/feltes/files/2009/04/fit4oaw-junit.zip">fit4oaw-junit</a>) to <a href="http://www.junit.org">JUnit</a>-like test results which can be processed by any tools that supports JUnit test results like the junitreport Ant task or Hudson. Hudson even merges the original JUnit test reports with the fit4oaw test reports, so you have all reports in one place.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.itemis.de/feltes/2009/04/03/adding-fit4oaw-to-your-ci-build-using-ant-and-hudson/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test-Driven MDSD mit fit4oaw</title>
		<link>http://blogs.itemis.de/feltes/2009/03/27/test-driven-mdsd-mit-fit4oaw/</link>
		<comments>http://blogs.itemis.de/feltes/2009/03/27/test-driven-mdsd-mit-fit4oaw/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 14:59:08 +0000</pubDate>
		<dc:creator>Ingo Feltes</dc:creator>
				<category><![CDATA[MDSD]]></category>
		<category><![CDATA[fit4oaw]]></category>
		<category><![CDATA[oaw]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blogs.itemis.de/feltes/?p=40</guid>
		<description><![CDATA[fit4oaw ist ein neues Open-Source-Projekt, das von Karsten Thoms ins Leben gerufen wurde. Es handelt sich dabei um ein Framework zum Test von openArchitectureWare-Artefakten wie Xpand-Templates, Xtend-Generator-Erweiterungen und Check-Constraints. fit4oaw schließt damit eine Lücke, denn bisher gab es keine Möglichkeit zur direkten Qualitätssicherung von MDSD-Generatoren. Lediglich die generierten Artefakte ließen sich mit den üblichen Tools [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://fit4oaw.sourceforge.net">fit4oaw</a> ist ein neues Open-Source-Projekt, das von <a href="http://kthoms.wordpress.com">Karsten Thoms</a> <a href="http://kthoms.wordpress.com/category/software-development/open-source/fit4oaw/">ins Leben gerufen</a> wurde. Es handelt sich dabei um ein Framework zum Test von <a href="http://www.openarchitectureware.org">openArchitectureWare</a>-Artefakten wie Xpand-Templates, Xtend-Generator-Erweiterungen und Check-Constraints. fit4oaw schließt damit eine Lücke, denn bisher gab es keine Möglichkeit zur direkten Qualitätssicherung von MDSD-Generatoren. Lediglich die generierten Artefakte ließen sich mit den üblichen Tools (JUnit, TestNG etc.) testen.<span id="more-40"></span></p>
<p>fit4oaw ist eine Erweiterung von <a href="http://www.fitnesse.org">FitNesse</a>; FitNesse ist ein Wiki-basiertes Framework für Akzeptanz-Tests, bei dem die Tests in tabellenform in Wiki-Seiten eingebettet werden. Sogenannte Fixtures interpretieren die Eingaben in den Tabellen, führen die Ensprechenden Tests gegen das zu testende System aus und markieren erfolgreiche und fehlgeschlagene Tests.</p>
<p>fit4oaw bietet nun eine Sammlung von Fixtures an, mit denen sich verschiedene Aspekte von oAW-Generatoren testen lassen. Derzeit liegt fit4oaw in der <a href="http://sourceforge.net/project/showfiles.php?group_id=255263&amp;package_id=312598">Version 1.0</a> vor. Diese Version bietet Fixtures für das Setup (Metamodell initialisieren, Modell laden etc.), Tests von Xtend Expression und rudimentäre Untersützung für Tests von Xpand Templates an. Für die kommende Version 1.1 habe ich in den letzten Tagen einige Fixtures für Tests von Check-Constraints und für Tests Xpand-Templates mit optisch ansprechenderer Darstellung des Diff-Ergebnisses beigesteuert:</p>
<p><strong>XpandTemplate und FileXpandTemplate </strong><strong>Fixtures</strong></p>
<p>Die XpandTemplate Fixtures vergleichen die Ausgabe eines Xpand-Templates, das mit einem bestimmte Modell-Element aufgerufen wurden mit dem erwarteten Text, der entweder direkt im Wiki notiert wird oder in einer externen Datei liegt. Das Ergebnis sieht dann etwa so aus:</p>
<p style="text-align: center"><a href="http://blogs.itemis.de/feltes/files/2009/03/fit4oaw2.png"><img class="size-medium wp-image-49 aligncenter" src="http://blogs.itemis.de/feltes/files/2009/03/fit4oaw2.png" alt="" width="251" height="152" /></a></p>
<p><strong>Check und CheckAll </strong><strong>Fixtures</strong></p>
<p>Die Check Fixtures prüfen die Constraints in einer Check-Datei gegen einzelne oder eine Menge von Modell-Elementen. Die erwarteten Fehler und Warnungen werden dann mit den tatsächlichen Fehlern und Warnungen abgeglichen. Das Ergebnis sieht etwa so aus:</p>
<p style="text-align: center"><a href="http://blogs.itemis.de/feltes/files/2009/03/fit4oaw1.png"><img class="size-medium wp-image-47 aligncenter" src="http://blogs.itemis.de/feltes/files/2009/03/fit4oaw1-300x149.png" alt="" width="300" height="149" /></a></p>
<p style="text-align: left"><strong>Test-Driven MDSD</strong></p>
<p style="text-align: left">Mit diesen Werkzeugen ausgerüstet ist es nun möglich, auch Code-Generatoren (M2T) und Modell-Transformatoren (M2M) <a href="http://de.wikipedia.org/wiki/Testgetriebene_Entwicklung">Test-getrieben</a> zu entwickeln. Aber egal, ob man die Tests vorher oder nachher schreibt, es gibt jetzt jedenfalls eine einfache Möglichkeit Templates, Extensions und Checks zu testen &#8211; und keine Ausreden mehr, es nicht zu tun!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.itemis.de/feltes/2009/03/27/test-driven-mdsd-mit-fit4oaw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
