<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Andreas Höhmann&#039;s Weblog &#187; TestNG</title>
	<atom:link href="http://ahoehma.wordpress.com/category/softwareentwicklung/testng/feed/" rel="self" type="application/rss+xml" />
	<link>http://ahoehma.wordpress.com</link>
	<description></description>
	<lastBuildDate>Thu, 26 Nov 2009 15:53:12 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='ahoehma.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/6b74f500a29ea048aa3d7a14adc1a24f?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Andreas Höhmann&#039;s Weblog &#187; TestNG</title>
		<link>http://ahoehma.wordpress.com</link>
	</image>
			<item>
		<title>Realworld JSF Application Story</title>
		<link>http://ahoehma.wordpress.com/2009/04/27/realworld-jsf-application-story/</link>
		<comments>http://ahoehma.wordpress.com/2009/04/27/realworld-jsf-application-story/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 10:30:00 +0000</pubDate>
		<dc:creator>Andreas Höhmann</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Richfaces]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[TestNG]]></category>
		<category><![CDATA[Example]]></category>
		<category><![CDATA[Facelets]]></category>
		<category><![CDATA[Realworld]]></category>
		<category><![CDATA[Siemens]]></category>

		<guid isPermaLink="false">http://ahoehma.wordpress.com/?p=139</guid>
		<description><![CDATA[Vielleicht hatte ich es in einem früheren Posting schonmal erwähnt, ich arbeite momentan für Siemens an einem Web 2.0 Projekt und das ist jetzt fertig  .
Los ging es November 2007 und nun konnten wir planmässig im April 2009 live gehen. Wir konnten dabei all die wunderbaren &#8220;neuen&#8221; Technologien einsetzen und ausprobieren, u.a. JSF und [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=139&subd=ahoehma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Vielleicht hatte ich es in einem früheren Posting schonmal erwähnt, ich arbeite momentan für Siemens an einem Web 2.0 Projekt und das ist jetzt fertig <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>Los ging es November 2007 und nun konnten wir planmässig im April 2009 live gehen. Wir konnten dabei all die wunderbaren &#8220;neuen&#8221; Technologien einsetzen und ausprobieren, u.a. JSF und damit eine funktionsfähige (also den Anforderungen des Kunden voll entsprechende) und zugleich performante &#8220;Web 2.0&#8243; Applikation bauen. Die Applikation nimmt sich dem Thema &#8220;Sicherheitstechnik&#8221; (für die Auskenner: <span><span style="color:black;">ISO 13849-1 und IEC 62061) an.</span></span></p>
<p><span><span style="color:black;">Mal kurz zu den verwendeten &#8220;Technologien/Frameworks/Tools/Ideen&#8221;:</span></span></p>
<ul>
<li><span><span style="color:black;">Daten ziehen wir aus einer SAP Knowledgebase (selbst gestrickt) und aus einer Datenbank via OpenJPA</span></span></li>
<li><span><span style="color:black;"> Services/Manager sind &#8220;normale&#8221; Javaklassen (Stichwort Design-Pattern),<br />
als Kleber verwenden wir Spring (Stichwort Dependency Injection)</span></span></li>
<li><span><span style="color:black;">UI mit JBoss Richfaces (Stichwort Ajax), JSF + Facelets (Stichwort Xhtml-Template), jQuery, CSS, etc.<br />
</span></span></li>
<li><span><span style="color:black;">Buildsystem, Projektseiten mit Maven2</span></span></li>
<li><span><span style="color:black;">Continues Integration via TeamCity und Maven2</span></span></li>
<li><span><span style="color:black;">Tests hauptsächlich mit TestNG aber teilweise auch mit JUnit</span></span></li>
<li><span><span style="color:black;">Laden/Speichern von Benutzerdaten via XStream (FileupLoad via Tomahawk), das alles noch Versionskompatibel, d.h. selbsgestrickte XML-Transformationskette für DomainModell-Updates<br />
</span></span></li>
<li><span><span style="color:black;">PDF Reportgenerierung mit iText</span></span></li>
<li><span><span style="color:black;">Anbindung an Siemens &#8220;Single Sign On&#8221; System via Spring Security, Webservices<br />
</span></span></li>
</ul>
<p>Im Rückblick kann ich sagen, dass eigentlich alles ohne größere Probleme miteinander funktioniert hat<br />
&#8230; so soll es sein <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><a title="Safety Evaluation Tool" href="https://www.automation.siemens.com/cd/safety/html_00/produkte/si_normen/tool.htm" target="_blank">https://www.automation.siemens.com/cd/safety/html_00/produkte/si_normen/tool.htm</a></p>
<p>(Für die Applikation muss man sich registrieren)</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ahoehma.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ahoehma.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ahoehma.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ahoehma.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ahoehma.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ahoehma.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ahoehma.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ahoehma.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ahoehma.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ahoehma.wordpress.com/139/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=139&subd=ahoehma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ahoehma.wordpress.com/2009/04/27/realworld-jsf-application-story/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/438fe36eabd9440a47ba9463aa194ac1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ahoehma</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Session/Request-Scoped SpringBeans in TestNG</title>
		<link>http://ahoehma.wordpress.com/2008/10/15/using-sessionrequest-scoped-springbeans-in-testng/</link>
		<comments>http://ahoehma.wordpress.com/2008/10/15/using-sessionrequest-scoped-springbeans-in-testng/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 15:18:30 +0000</pubDate>
		<dc:creator>Andreas Höhmann</dc:creator>
				<category><![CDATA[Spring]]></category>
		<category><![CDATA[TestNG]]></category>
		<category><![CDATA[request]]></category>
		<category><![CDATA[scope]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[singleton]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[unit]]></category>

		<guid isPermaLink="false">http://ahoehma.wordpress.com/?p=85</guid>
		<description><![CDATA[Today i will show you how to use spring-beans (especially session-scoped respectively request-scoped) in Unittests.
First of all &#8230; its easy to use a singleton bean (no scope) in a unit-test, load the ClassPathXmlApplicationContext with configLocations, use getBean(&#8220;name&#8221;) and then use the returned objects.
But if you want use a enhanced (J2EE) spring-configuration in your unit-test you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=85&subd=ahoehma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today i will show you how to use spring-beans (especially session-scoped respectively request-scoped) in Unittests.</p>
<p>First of all &#8230; its easy to use a singleton bean (no scope) in a unit-test, load the ClassPathXmlApplicationContext with configLocations, use getBean(&#8220;name&#8221;) and then use the returned objects.</p>
<p><strong>But</strong> if you want use a enhanced (J2EE) spring-configuration in your unit-test you have to use the XmlWebApplicationContext.</p>
<p>Lets use a simple example! Imagine you have different context-files, e.g. <em>spring-beans-application.xml</em>:</p>
<pre class="brush: xml;">
  &lt;bean id=&quot;Foobar1&quot; class=&quot;de.ahoehma.test.Foobar&quot; scope=&quot;request&quot;/&gt;
  &lt;bean id=&quot;Foobar2&quot; class=&quot;de.ahoehma.test.Foobar&quot; scope=&quot;session&quot;/&gt;
  &lt;bean id=&quot;Foobar3&quot; class=&quot;de.ahoehma.test.Foobar&quot; /&gt;
</pre>
<p>Then you have your <em>unit-test</em>:</pre>
<pre class="brush: java;">
public class SpringBeansTestNg {

  //
  // XXX we have to define all spring-context-files - later this could be done via test-ng-provider or
  //     via spring with &quot;spring-beans-*.xml&quot; (i try it but it doesnt work)
  //
  private final String[] contextLocations = new String[]{
      &quot;spring-beans-application.xml&quot;,
      &quot;spring-beans-services.xml&quot;,
      &quot;spring-beans-persistence.xml&quot;,
      &quot;spring-beans-security.xml&quot;,};

  private ApplicationContext applicationContext;

  @BeforeTest
  private void loadApplicationContext() {
    final XmlWebApplicationContext xmlApplicationContext = new XmlWebApplicationContext();
    xmlApplicationContext.setConfigLocations(contextLocations);
    final MockServletContext servletContext = new MockServletContext(&quot;&quot;);
    xmlApplicationContext.setServletContext(servletContext);
    final RequestContextListener requestContextListener = new RequestContextListener();
    final MockHttpServletRequest request = new MockHttpServletRequest(servletContext);
    final ServletRequestEvent requestEvent = new ServletRequestEvent(servletContext, request);
    requestContextListener.requestInitialized(requestEvent);
    xmlApplicationContext.refresh();
    applicationContext = xmlApplicationContext;
  }

  /**
   * @return request scoped bean
   */
  private Foobar getFoobar1() {
    return (Foobar) applicationContext.getBean(&quot;Foobar1&quot;); //$NON-NLS-1$
  }

 /**
   * @return session scoped bean
   */
  private Foobar getFoobar2() {
    return (Foobar) applicationContext.getBean(&quot;Foobar2&quot;); //$NON-NLS-1$
  }

 /**
   * @return singleton bean
   */
  private Foobar getFoobar3() {
    return (Foobar) applicationContext.getBean(&quot;Foobar3&quot;); //$NON-NLS-1$
  }
}
</pre>
<p>The magic happend in the <strong>loadApplicationContext</strong>.</p>
<p>Try it <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ahoehma.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ahoehma.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ahoehma.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ahoehma.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ahoehma.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ahoehma.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ahoehma.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ahoehma.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ahoehma.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ahoehma.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=85&subd=ahoehma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ahoehma.wordpress.com/2008/10/15/using-sessionrequest-scoped-springbeans-in-testng/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/438fe36eabd9440a47ba9463aa194ac1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ahoehma</media:title>
		</media:content>
	</item>
	</channel>
</rss>