<?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>Swiftmind</title>
	<atom:link href="http://www.swiftmind.com/de/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.swiftmind.com/de</link>
	<description>Die Experten für Enterprise Java, Spring, OSGi und Software Engineering Best Practices</description>
	<lastBuildDate>Sat, 15 Jun 2013 21:02:04 +0000</lastBuildDate>
	<language>de-DE</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Neo4j Tutorial in Zürich &#8211; Retrospective</title>
		<link>http://www.swiftmind.com/de/2013/06/15/neo4j-tutorial-in-zurich-retrospective/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=neo4j-tutorial-in-zurich-retrospective</link>
		<comments>http://www.swiftmind.com/de/2013/06/15/neo4j-tutorial-in-zurich-retrospective/#comments</comments>
		<pubDate>Sat, 15 Jun 2013 20:15:03 +0000</pubDate>
		<dc:creator>Patrick Baumgartner</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.swiftmind.com/de/?p=1985</guid>
		<description><![CDATA[<p>This week, Swiftmind organized the first Neo4j Tutorial in Zurich. Stefan &#8230; <a href="http://www.swiftmind.com/de/2013/06/15/neo4j-tutorial-in-zurich-retrospective/" class="more">mehr darüber »</a></p><p>The post <a href="http://www.swiftmind.com/de/2013/06/15/neo4j-tutorial-in-zurich-retrospective/">Neo4j Tutorial in Zürich &#8211; Retrospective</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>This week, Swiftmind organized the first <a title="Neo4j" href="http://www.neo4j.org/" target="_blank">Neo4j</a> Tutorial in Zurich. <a title="Stefan Armbruster" href="https://twitter.com/darthvader42" target="_blank">Stefan Armbruster</a> from <a href="http://www.neotechnology.com/" target="_blank">Neotechnology</a> came over from Munich and was running the training for 10 Swiss graphistas.</p>
<p>The evening before the training, he joined the <a href="http://www.meetup.com/Neo4j-Zurich/" target="_blank">Neo4j-Zurich Meetup</a> and presented a newsflash and some insights for the upcoming release of Neo4j 2.0.</p>
<p>Like in other trainings, a lot of insights about the topic itself and project experience you gain during the discussions in the breaks and at lunchtime. To challenge Stefan we introduced “t-shirt questions”, where one was able to get a t-shirt when asking a very difficult question.</p>
<p><img class=" wp-image-1986 alignnone" alt="Neo4j Tutorial" src="http://www.swiftmind.com/de/files/2013/06/Neo4j-Tutorial-572x429.jpg" width="572" height="429" /></p>
<p>We all had so much fun using Cypher and modeling several graphs. Swiftmind looks forward to organize another Neo4j Tutorial soon again. If you are interested, drop me a line at <a href="m&#97;&#105;l&#116;o&#58;p&#97;t&#114;&#105;c&#107;.ba&#117;mga&#114;t&#110;e&#114;&#64;&#115;w&#105;&#102;&#116;&#109;&#105;&#110;d&#46;co&#109;">&#112;a&#116;rick.&#98;&#97;um&#103;&#97;&#114;t&#110;er&#64;&#115;w&#105;ft&#109;&#105;&#110;&#100;&#46;c&#111;m</a></p>
<p>The post <a href="http://www.swiftmind.com/de/2013/06/15/neo4j-tutorial-in-zurich-retrospective/">Neo4j Tutorial in Zürich &#8211; Retrospective</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.swiftmind.com/de/2013/06/15/neo4j-tutorial-in-zurich-retrospective/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Neo4j Tutorial in Zurich</title>
		<link>http://www.swiftmind.com/de/2013/05/07/neo4j-tutorial-in-zurich/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=neo4j-tutorial-in-zurich</link>
		<comments>http://www.swiftmind.com/de/2013/05/07/neo4j-tutorial-in-zurich/#comments</comments>
		<pubDate>Tue, 07 May 2013 21:51:29 +0000</pubDate>
		<dc:creator>Patrick Baumgartner</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.swiftmind.com/de/?p=1971</guid>
		<description><![CDATA[<p>Swiftmind brings the Neo4j Tutorial in June to Zurich. Wednesday, June 12, 2013 - 9:00 AM to 5:00 PM <a href="http://www.swiftmind.com/de/2013/05/07/neo4j-tutorial-in-zurich/" class="more">mehr darüber »</a></p><p>The post <a href="http://www.swiftmind.com/de/2013/05/07/neo4j-tutorial-in-zurich/">Neo4j Tutorial in Zurich</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Swiftmind brings the Neo4j Tutorial in June to Zurich. Make sure you save the date and register for this awesome introduction to graph data stores.</p>
<p><strong>Date &amp; Time</strong><br />
Wednesday, June 12, 2013<br />
9:00 AM to 5:00 PM</p>
<p><strong>Location</strong><br />
Pfingstweidstrasse 6, Zürich</p>
<p><strong>Price</strong><br />
CHF 125.00/per person</p>
<p><strong>Description</strong><br />
This tutorial covers the core functionality of the Neo4j graph database. With a mixture of theory and hands-on practice sessions, attendees will quickly learn how easy it is to develop a Neo4j-backed application. The morning will consist of interactive learning and attendees will have the opportunity in the afternoon to model and query their own data.</p>
<p>Topics covered include:</p>
<ul>
<li>Introduction to Neo4j</li>
<li>Overview of Cypher query language</li>
<li>Social use cases including recommendations</li>
<li>Permissions modeling</li>
<li>Other case studies in real world domains</li>
<li>Opportunity to consult with Neo4j engineers on current projects, possible implementations and proof of concepts</li>
</ul>
<p>Attendees won&#8217;t need any previous experience with Neo4j, NOSQL databases or specific development languages, but will need their own laptop.</p>
<p><a href="http://info.neotechnology.com/0612-zurich-register.html">http://info.neotechnology.com/0612-zurich-register.html</a><br />
Register with the promo code <em><strong>zurich4j</strong></em> and you will get 10% discount!</p>
<p>The post <a href="http://www.swiftmind.com/de/2013/05/07/neo4j-tutorial-in-zurich/">Neo4j Tutorial in Zurich</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.swiftmind.com/de/2013/05/07/neo4j-tutorial-in-zurich/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Berlin Expert Days 2013</title>
		<link>http://www.swiftmind.com/de/2013/03/20/berlin-expert-days-2013/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=berlin-expert-days-2013</link>
		<comments>http://www.swiftmind.com/de/2013/03/20/berlin-expert-days-2013/#comments</comments>
		<pubDate>Tue, 19 Mar 2013 22:39:37 +0000</pubDate>
		<dc:creator>Patrick Baumgartner</dc:creator>
				<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://www.swiftmind.com/de/?p=1900</guid>
		<description><![CDATA[<p><a title="Patrick Baumgartner" href="http://www.swiftmind.com/de/ueber-uns/team/patrick-baumgartner/">Patrick Baumgartner</a> spricht am Donnerstag, 4. April 2013, zum Thema "<a title="Daten natürlich modelieren und verarbeiten mit Neo4j" href="http://bed-con.org/2013/talks/daten-naturlich-modelieren-und-verarbeiten-mit-neo4j/" target="_blank">Daten natürlich modellieren und verarbeiten mit Neo4j</a>" auf den <a title="BED Con" href="http://bed-con.org/" target="_blank">Berlin Expert Days (Bed-Con)</a> <a href="http://www.swiftmind.com/de/2013/03/20/berlin-expert-days-2013/" class="more">mehr darüber »</a></p><p>The post <a href="http://www.swiftmind.com/de/2013/03/20/berlin-expert-days-2013/">Berlin Expert Days 2013</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><a title="Patrick Baumgartner" href="http://www.swiftmind.com/de/ueber-uns/team/patrick-baumgartner/">Patrick Baumgartner</a> spricht am Donnerstag, 4. April 2013, zum Thema &#8220;<a title="Daten natürlich modelieren und verarbeiten mit Neo4j" href="http://bed-con.org/2013/talks/daten-naturlich-modelieren-und-verarbeiten-mit-neo4j/" target="_blank">Daten natürlich modellieren und verarbeiten mit Neo4j</a>&#8220; auf den <a title="BED Con" href="http://bed-con.org/" target="_blank">Berlin Expert Days (Bed-Con)</a></p>
<p><a href="http://www.swiftmind.com/de/files/2013/03/BED-Con-2013-orange-v3.png"><img class="aligncenter size-full wp-image-1901" alt="BED-Con-2013-orange-v3" src="http://www.swiftmind.com/de/files/2013/03/BED-Con-2013-orange-v3.png" width="533" height="95" /></a></p>
<p>Die technisch-orientierte Konferenz bietet eine Plattform zum Erfahrungsaustausch und persönlichem Gespräch. Die Themenbereiche drehen sich rund um die Java Welt, z. B: Java, Java EE, Spring, JavaScript, funktionale Sprachen, NoSQL, Continuous Delivery, DevOps und User Experience.</p>
<p>Das gesamte Programm der 2-tägigen Java-Konferenz gibt es unter <a title="Programm 2013" href="http://bed-con.org/2013/programm/" target="_blank">http://bed-con.org/2013/programm/</a></p>
<p>The post <a href="http://www.swiftmind.com/de/2013/03/20/berlin-expert-days-2013/">Berlin Expert Days 2013</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.swiftmind.com/de/2013/03/20/berlin-expert-days-2013/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NoSQL Search Roadshow 2013 Munich</title>
		<link>http://www.swiftmind.com/de/2013/03/17/nosql-search-roadshow-munchen/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=nosql-search-roadshow-munchen</link>
		<comments>http://www.swiftmind.com/de/2013/03/17/nosql-search-roadshow-munchen/#comments</comments>
		<pubDate>Sun, 17 Mar 2013 15:22:57 +0000</pubDate>
		<dc:creator>Patrick Baumgartner</dc:creator>
				<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://www.swiftmind.com/de/?p=1893</guid>
		<description><![CDATA[<p><a title="Patrick Baumgartner" href="http://www.swiftmind.com/de/ueber-uns/team/patrick-baumgartner/">Patrick Baumgartner</a> will be presenting “<a href="http://nosqlroadshow.com/nosql-munich-2013/presentation/NoSQL%20in%20Enterprise%20Java%20Applications" target="_blank">NoSQL in Enterprise Java Applications</a>” at the <a title="NoSQL Search Roadshow Munich" href="http://nosqlroadshow.com/nosql-munich-2013/" target="_blank">NoSQL Search Road Show</a> in Munich, on Thursday, April 16, 2013. <a href="http://www.swiftmind.com/de/2013/03/17/nosql-search-roadshow-munchen/" class="more">mehr darüber »</a></p><p>The post <a href="http://www.swiftmind.com/de/2013/03/17/nosql-search-roadshow-munchen/">NoSQL Search Roadshow 2013 Munich</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><a title="Patrick Baumgartner" href="http://www.swiftmind.com/de/ueber-uns/team/patrick-baumgartner/">Patrick Baumgartner</a> will be presenting “<a href="http://nosqlroadshow.com/nosql-munich-2013/presentation/NoSQL%20in%20Enterprise%20Java%20Applications" target="_blank">NoSQL in Enterprise Java Applications</a>” at the <a title="NoSQL Search Roadshow Munich" href="http://nosqlroadshow.com/nosql-munich-2013/" target="_blank">NoSQL Search Road Show</a> in Munich, on Thursday, April 16, 2013.</p>
<p><img class="aligncenter size-large wp-image-1895" alt="NoSQL_SEACH_Roadshow_Munich_960x175_april16" src="http://www.swiftmind.com/de/files/2013/03/NoSQL_SEACH_Roadshow_Munich_960x175_april16-572x104.png" width="572" height="104" /></p>
<p>Are you frustrated by growing data requirements and interested in how non-relational databases could help? Curious about where and how NoSQL systems are being deployed? Want to build a “real” Highly Scalable System? Answered yes to any of these questions? Then the NoSQL Search Roadshow might be of interest to you.</p>
<p>The program is divided into two tracks targeted developers and executives respectively. After introducing the business problems, you will hear first-hand how organisations are able to solve their modern data problems with innovative solutions like Riak, MongoDB, Cassandra, Hadoop, and many others.</p>
<p>The NoSQL Roadshows offer ideal opportunities for learning, networking and tracking innovation within the the changing landscape around Data Management.</p>
<p>Get one of the last seats with our promo code “<strong>Baum75</strong>” and get <strong>75 EUR discount on your ticket</strong>.</p>
<p>The post <a href="http://www.swiftmind.com/de/2013/03/17/nosql-search-roadshow-munchen/">NoSQL Search Roadshow 2013 Munich</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.swiftmind.com/de/2013/03/17/nosql-search-roadshow-munchen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Browser Routing Weiche mit Spring Mobile Device</title>
		<link>http://www.swiftmind.com/de/2013/02/18/spring-mobile-device-browser-routing-weiche/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=spring-mobile-device-browser-routing-weiche</link>
		<comments>http://www.swiftmind.com/de/2013/02/18/spring-mobile-device-browser-routing-weiche/#comments</comments>
		<pubDate>Mon, 18 Feb 2013 06:08:26 +0000</pubDate>
		<dc:creator>Odilo Oehmichen</dc:creator>
				<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://www.swiftmind.com/de/?p=1824</guid>
		<description><![CDATA[<p><a href="/de/ueber-uns/team/odilo-oehmichen/" title="Odilo Oehmichen">Odilo Oehmichen</a> stellt die Arbeitsweise und Vorzüge des Spring Mobile Device Projektes vor. <a href="http://www.swiftmind.com/de/2013/02/18/spring-mobile-device-browser-routing-weiche/" class="more">mehr darüber »</a></p><p>The post <a href="http://www.swiftmind.com/de/2013/02/18/spring-mobile-device-browser-routing-weiche/">Browser Routing Weiche mit Spring Mobile Device</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Nach und nach ist überall angekommen, dass eine Internetpräsenz auch auf einem Smartphone sauber dargestellt werden soll bzw. der dargestellte Inhalt für das kleinere Display optimiert sein sollte. &#8211; Was aber, wenn für den bestehenden Webauftritt gerade kein Relaunch ansteht? Etliche Kunden entscheiden sich in solch einem Fall, einen eigenen mobilen Webauftritt (meist unter einer eigenen Subdomain) aufzubauen, der dann mit speziell aufbereitetem Content bestückt wird.</p>
<p>Damit ein Besucher dann aber auch auf dem mobilen Auftritt landet, wenn er die Adresse der normalen Version von seinem Smartphone aus aufruft, gibt es sogenannte Browser Routing Weichen: Diese erkennen mit was für einem Browser bzw. Gerät ein Request getätigt wurde und leiten &#8211; wenn nötig &#8211; den Benutzer um.</p>
<p>Ein kleines Projekt aus dem <a title="Spring Ökosystem" href="http://www.springsource.org/" target="_blank">Spring Ökosystem</a>, das eine ebensolche Browser-Weiche implementiert, ist das <a href="http://static.springsource.org/spring-mobile/docs/current/reference/html/spring-mobile-device.html" target="_blank">Spring Mobile Device</a> Projekt. Dieses ist momentan in der Version 1.0.0 verfügbar.</p>
<p>Das Projekt integriert sich hervorragend in Projekte, die bereits <a href="http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html">Spring MVC</a> bzw. <a href="http://static.springsource.org/spring-webflow/docs/current/reference/html/index.html">Spring Webflow</a> einsetzen. Mit Version 1.1.0, an der gerade gearbeitet wird, kommen noch einige Komponenten hinzu, welche die Unterstützung für Nicht-Spring-MVC Projekte verbessern &#8211; aber dazu später mehr.</p>
<h1>Spring Mobile Device</h1>
<p>Das Projekt kommt mit einer Handvoll Klassen daher (wenn ich mich nicht verzählt habe, sind es 24) und bildet drei Aspekte einer Browser-Weiche ab:</p>
<ul>
<li>Device Detection</li>
<li>Site Switching</li>
<li>Site Preference Handling</li>
</ul>
<h2>Device Detection</h2>
<p>Implementiert als ServletFilter (<code>DeviceResolverRequestFilter</code>) bzw. <a title="HandlerMappingInterceptor" href="http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-handlermapping-interceptor" target="_blank">HandlerInterceptor</a> (<code>DeviceResolverHandlerInterceptor</code>) kümmert sich die Device Detection darum, mittels des Request-Headers &#8220;<code>User-Agent</code>&#8221; herausfinden, welcher Gerätetyp den Request abgesendet hat: Normal, Mobile oder Tablet.</p>
<p>Die Information wird in Form eines <code>Device</code>-Objekts in den Request-Attributes abgelegt, so dass sie von dort von anderen Komponenten bzw. Controllern genutzt werden kann.</p>
<p>Die Erkennung des Device erfolgt nach einem recht einfachen <a href="https://plugins.trac.wordpress.org/browser/wordpress-mobile-pack/trunk/plugins/wpmp_switcher/lite_detection.php" target="_blank">Algorithmus</a>, welcher vom <a title="Wordpress mobile pack" href="https://wordpress.org/extend/plugins/wordpress-mobile-pack/" target="_blank">WordPress Mobile Pack</a> kopiert wurde. Es werden die gängigsten 90 mobile User Agent Strings erkannt. &#8211; Der Einsatz der oft genannten <a title="Wurfl" href="http://wurfl.sourceforge.net/" target="_blank">WURFL-Library</a> ist hier nicht notwendig (aber über ein <a href="http://homepages.abdn.ac.uk/b.scharlau/pages/teaching/CS5087/practicals/practical_spring_wurfl.shtml" target="_blank">gesondertes Projekt</a> möglich), da für das Browser Routing eine einfache Kategorisierung genügt.</p>
<h2>Site Switching</h2>
<p>Für den möglichen Wechsel auf die mobile Version einer Site, ist der <code>SiteSwitcherHandlerInterceptor</code> verantwortlich. Diese ebenfalls als HandlerInterceptor implementierte Komponente entscheidet mit Hilfe eines <code>SitePreferenceHandler</code> (siehe unten), ob ein Request umgeleitet werden muss und führt wenn nötig einen Redirect durch.</p>
<h2>Site Preference Handling</h2>
<p>Wie das Wort Preference schon sagt, kümmert sich ein <code>SitePreferenceHandler</code> (welches als POJO implementiert ist), um die Webseiten-Präferenz des Besuchers: So möchte dieser etwa beim Aufruf mit dem Smartphone lieber die normale Version sehen, anstatt die automatisch selektierte mobile Version.</p>
<p>Mittels dem zusätzlichen Request-Parameter <code>site_preference</code> (Werte: <code>normal</code> | <code>mobile</code> | <code>tablet</code>) kann diese Auswahl kundgetan werden und wird dann in einem Cookie gespeichert, so dass auch beim einem späteren Besuch die bevorzugte Seitenversion ausgeliefert. &#8211; Meist enthält die mobile Version im Footer einen Link auf die normale Version. Dieser Link sollte dann den beschriebenen Parameter enthalten.</p>
<p>Der <code>SitePreferenceHandler</code> trittt in der folgenden Reihenfolge die Auswahl für die auszuliefernden Seitenversion:</p>
<ul>
<li>Auslesen des Query-Parameter <code>site_preference</code> (wenn vorhanden)</li>
<li>Auslesen eines (in einem Cookie) persistierten Wertes</li>
<li>Default für das <code>Device</code></li>
</ul>
<h1>Ausblick</h1>
<p>Wie bereits eingangs geschrieben, laufen gerade die Arbeiten an Version 1.1.0 &#8211; darin wird unter anderem der <code>SiteSwitchingHandlerInterceptor</code> um eine ServletFilter-Implementierung (<code>SiteSwitchRequestFilter</code>) ergänzt.</p>
<p>Ausserdem wird es einen <code>ViewResolver</code> (<code>LiteDeviceDelegatingViewResolver</code>) geben, welcher Views in abhängigkeit des erkannten Devices selektiert.</p>
<p>Der Fortschritt der Arbeiten kann im <a title="Jira" href="https://jira.springsource.org/browse/MOBILE" target="_blank">Projekt-Jira</a> verfolgt werden.</p>
<h1>Konklusion</h1>
<p>Spring Mobile Device ist ein sehr zielgerichtetes Projekt, mit dem man sehr schnell und einfach eine Browserweiche in sein bestehendes Projekt integrieren kann &#8211; ohne das Rad neu erfinden zu müssen.</p>
<p>Als weiterführenden Lektüre empfehlen wir die <a title="Spring  Mobile Device Reference Doku" href="http://static.springsource.org/spring-mobile/docs/current/reference/html/spring-mobile-device.html" target="_blank">Reference Dokumentation</a> zum Projekt.</p>
<p>The post <a href="http://www.swiftmind.com/de/2013/02/18/spring-mobile-device-browser-routing-weiche/">Browser Routing Weiche mit Spring Mobile Device</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.swiftmind.com/de/2013/02/18/spring-mobile-device-browser-routing-weiche/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Patrick Baumgartner becomes a Scrum.org Professional Scrum Trainer</title>
		<link>http://www.swiftmind.com/de/2013/02/10/patrick-baumgartner-becomes-a-scrum-org-professional-scrum-trainer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=patrick-baumgartner-becomes-a-scrum-org-professional-scrum-trainer</link>
		<comments>http://www.swiftmind.com/de/2013/02/10/patrick-baumgartner-becomes-a-scrum-org-professional-scrum-trainer/#comments</comments>
		<pubDate>Sun, 10 Feb 2013 17:23:23 +0000</pubDate>
		<dc:creator>Patrick Baumgartner</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.swiftmind.com/de/?p=1767</guid>
		<description><![CDATA[<p>Swiftmind is proud to announce that Patrick Baumgartner has recently become a &#8230; <a href="http://www.swiftmind.com/de/2013/02/10/patrick-baumgartner-becomes-a-scrum-org-professional-scrum-trainer/" class="more">mehr darüber »</a></p><p>The post <a href="http://www.swiftmind.com/de/2013/02/10/patrick-baumgartner-becomes-a-scrum-org-professional-scrum-trainer/">Patrick Baumgartner becomes a Scrum.org Professional Scrum Trainer</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Swiftmind is proud to announce that <a title="Patrick Baumgartner" href="http://www.swiftmind.com/de/ueber-uns/team/patrick-baumgartner/">Patrick Baumgartner</a> has recently become a licensed <a href="http://www.scrum.org" target="_blank">Scrum.org</a> <em>Professional Scrum Trainer</em>. In this role, Patrick will run public and private Scrum trainings that will allow attendees to obtain official Scrum.org certifications.</p>
<p>For Patrick, this is the next logical step in his continuing involvement in the Swiss Scrum community where he actively moderates the <a title="Scrum Breakfast Zurich" href="http://swissict.ch/expertenwissen/fachanlaesse/?tx_events_pi_search%5Bsearchword%5D=z%C3%BCrich&amp;tx_events_pi_search%5Bcategories%5D=3" target="_blank">Scrum Breakfast</a> and organizes the <a title="Lean, Agile &amp; Scrum Conference" href="http://www.lean-agile-scrum.ch/" target="_blank">Lean, Agile &amp; Scrum Conference</a> in Zurich.</p>
<p>In line with Swiftmind&#8217;s strong focus on enterprise Java technologies and software engineering best practices, Patrick&#8217;s certification further complements Swiftmind&#8217;s offering for its customers with skills that are essential to the delivery of successful software projects.</p>
<p>Swiftmind will begin offering <a href="http://www.scrum.org/Courses/Professional-Scrum-Foundations" target="_blank">Professional Scrum Foundation (PSF)</a> and <a href="http://www.scrum.org/Courses/Professional-Scrum-Developer" target="_blank">Professional Scrum Developer (PSD)</a> trainings within the coming weeks.</p>
<p>Interested in any of our <a title="professional trainings" href="http://www.swiftmind.com/de/trainings/" target="_blank">professional trainings</a>? <a title="Anfrage zu Trainings" href="http://www.swiftmind.com/de/trainings/anfrage-zu-trainings/" target="_blank">Get in touch with us!</a></p>
<p>The post <a href="http://www.swiftmind.com/de/2013/02/10/patrick-baumgartner-becomes-a-scrum-org-professional-scrum-trainer/">Patrick Baumgartner becomes a Scrum.org Professional Scrum Trainer</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.swiftmind.com/de/2013/02/10/patrick-baumgartner-becomes-a-scrum-org-professional-scrum-trainer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Swiftmind geht Consulting Partnerschaft mit Neo Technology ein</title>
		<link>http://www.swiftmind.com/de/2013/02/05/swiftmind-geht-consulting-partnerschaft-mit-neo-technology-ein/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=swiftmind-geht-consulting-partnerschaft-mit-neo-technology-ein</link>
		<comments>http://www.swiftmind.com/de/2013/02/05/swiftmind-geht-consulting-partnerschaft-mit-neo-technology-ein/#comments</comments>
		<pubDate>Tue, 05 Feb 2013 06:14:36 +0000</pubDate>
		<dc:creator>Odilo Oehmichen</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.swiftmind.com/de/?p=1786</guid>
		<description><![CDATA[<p>Wir sind stolz, neuer Consulting Partner von Neo Technology zu &#8230; <a href="http://www.swiftmind.com/de/2013/02/05/swiftmind-geht-consulting-partnerschaft-mit-neo-technology-ein/" class="more">mehr darüber »</a></p><p>The post <a href="http://www.swiftmind.com/de/2013/02/05/swiftmind-geht-consulting-partnerschaft-mit-neo-technology-ein/">Swiftmind geht Consulting Partnerschaft mit Neo Technology ein</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.neotechnology.com/" target="_blank"><img class="alignleft size-medium wp-image-1800" alt="Neo_Technology_Logo" src="http://www.swiftmind.com/de/files/2013/02/Neo_Technology_Logo-164x29.png" width="164" height="29" /></a></p>
<p>Wir sind stolz, neuer Consulting Partner von <a title="Neo Technology" href="http://www.neotechnology.com" target="_blank">Neo Technology</a> zu sein. Neo Technology ist mit seiner Open-Source Graphdatenbank <a title="Neo4j" href="http://neo4j.com/" target="_blank">Neo4j</a> (&#8220;World&#8217;s Leading Graph Database&#8221;) einer der führenden Anbieter auf dem NoSQL-Datenbankmarkt.</p>
<p>Neo4j ist in Java implementiert und bietet volle Unterstützung für ACID-Transaktionen. Die Datenbank ist sowohl als Standalone-Runtime als auch als Embedded-Lösung verfügbar und nutzt zur Persistenz einen diskbasierten Storage Manager.</p>
<p>Für Swiftmind, mit ihrer weitreichenden Erfahrung rund um das <a href="http://www.springsource.org/" target="_blank">Spring Framework</a>, bietet Neo4j nicht zuletzt durch seine ausgereifte Integration in das <a title="Spring Data" href="http://www.springsource.org/spring-data" target="_blank">Spring Data Projekt</a> eine optimale Ergänzung ihres Technologie Stack.</p>
<p>Die Partnerschaft mit Neo Technology ermöglicht uns direkten Zugriff auf das Knowhow der Neo4j Entwickler und garantiert so die bestmögliche Unterstützung unserer Kunden &#8211; darüberhinaus besteht Zugang zum Trainings- und Zertifizierungsprogramm von Neo Technology. Dank der Möglichkeit an Partner Konferenzen bzw. Produkt Roadmap Diskussionen teilnehmen zu können, wird Swiftmind sehr früh die Weiterentwicklungen und neuen Features von Neo4j kennenlernen.</p>
<p>Sollten Sie Interesse an einer Demonstration der Möglichkeiten für den Einsatz von Graphdatenbanken und insbesondere Neo4j haben, freuen wir uns über <a title="Anfrage" href="http://www.swiftmind.com/de/kontakt/">Ihre Anfrage</a>.</p>
<p>The post <a href="http://www.swiftmind.com/de/2013/02/05/swiftmind-geht-consulting-partnerschaft-mit-neo-technology-ein/">Swiftmind geht Consulting Partnerschaft mit Neo Technology ein</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.swiftmind.com/de/2013/02/05/swiftmind-geht-consulting-partnerschaft-mit-neo-technology-ein/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring Framework 3.2: What&#8217;s New &#8211; Slides from Swiss JUG</title>
		<link>http://www.swiftmind.com/de/2013/01/30/spring-framework-3-2-whats-new-slides-from-swiss-jug/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=spring-framework-3-2-whats-new-slides-from-swiss-jug</link>
		<comments>http://www.swiftmind.com/de/2013/01/30/spring-framework-3-2-whats-new-slides-from-swiss-jug/#comments</comments>
		<pubDate>Wed, 30 Jan 2013 12:18:01 +0000</pubDate>
		<dc:creator>Sam Brannen</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://www.swiftmind.com/de/?p=1688</guid>
		<description><![CDATA[<p>The slides for the presentation &#8220;Spring Framework 3.2: What&#8217;s New&#8221; &#8230; <a href="http://www.swiftmind.com/de/2013/01/30/spring-framework-3-2-whats-new-slides-from-swiss-jug/" class="more">mehr darüber »</a></p><p>The post <a href="http://www.swiftmind.com/de/2013/01/30/spring-framework-3-2-whats-new-slides-from-swiss-jug/">Spring Framework 3.2: What&#8217;s New &#8211; Slides from Swiss JUG</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>The slides for the presentation &#8220;<em>Spring Framework 3.2: What&#8217;s New</em>&#8221; by <a title="Sam Brannen" href="http://www.swiftmind.com/de/ueber-uns/team/sam-brannen/">Sam Brannen</a> from the <a title="Swiss JUG" href="http://www.jug.ch/html/events/2013/spring_framework.html" target="_blank">Swiss JUG</a> event in Zurich, Switzerland are now available on <a title="Slides – Spring Framework 3.2: What's New" href="http://www.slideshare.net/sbrannen/spring-framework-32-whats-new" target="_blank">SlideShare</a>.</p>
<div class='embed-container'><iframe src="http://www.slideshare.net/slideshow/embed_code/16245483" width="640" height="519" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe><br/><br/></div>
<p>We&#8217;d like to take this opportunity to thank the <em>Java User Group Switzerland</em> for organizing the event and to thank all of the attendees who showed up to make this event such a success.</p>
<p>And when you&#8217;re a speaker at a Swiss JUG event, you get a really cool Swiss army knife for geeks (a.k.a., the &#8220;<em>CyberTool</em>&#8220;) as can be seen below.</p>
<p><a href="http://www.swiftmind.com/de/files/2013/01/JUGS-Swiss-Army-Knife-small.jpg"><img class="alignnone size-large wp-image-1692" src="http://www.swiftmind.com/de/files/2013/01/JUGS-Swiss-Army-Knife-small-572x427.jpg" alt="" width="572" height="427" /></a></p>
<p>The post <a href="http://www.swiftmind.com/de/2013/01/30/spring-framework-3-2-whats-new-slides-from-swiss-jug/">Spring Framework 3.2: What&#8217;s New &#8211; Slides from Swiss JUG</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.swiftmind.com/de/2013/01/30/spring-framework-3-2-whats-new-slides-from-swiss-jug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring Framework 3.2 RC1: New Testing Features</title>
		<link>http://www.swiftmind.com/de/2012/11/07/spring-framework-3-2-rc1-new-testing-features/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=spring-framework-3-2-rc1-new-testing-features</link>
		<comments>http://www.swiftmind.com/de/2012/11/07/spring-framework-3-2-rc1-new-testing-features/#comments</comments>
		<pubDate>Wed, 07 Nov 2012 16:42:23 +0000</pubDate>
		<dc:creator>Sam Brannen</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.swiftmind.com/de/?p=1645</guid>
		<description><![CDATA[<p><a href="/de/ueber-uns/team/sam-brannen/" title="Sam Brannen">Sam Brannen</a> discusses the latest testing features in Spring Framework 3.2. <a href="http://www.swiftmind.com/de/2012/11/07/spring-framework-3-2-rc1-new-testing-features/" class="more">mehr darüber »</a></p><p>The post <a href="http://www.swiftmind.com/de/2012/11/07/spring-framework-3-2-rc1-new-testing-features/">Spring Framework 3.2 RC1: New Testing Features</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>
As <a href="http://blog.springsource.org/author/juergenh/" target="_blank" title="Juergen Hoeller">Juergen Hoeller</a> mentioned in his post announcing the <a href="http://blog.springsource.org/2012/11/05/spring-framework-3-2-rc1-released/" title="Spring Framework 3.2 RC1 released" target="_blank">release of Spring Framework 3.2 RC1</a>, the Spring Team has introduced some exciting new features in terms of testing support. Most importantly, we&#8217;ve added first-class support for testing web applications. <em>[1]</em>
</p>
<p>
In this post we&#8217;ll first take a look at some of the general new testing features in the Spring Framework, and then we&#8217;ll go into detail regarding support for testing with a <code>WebApplicationContext</code> as well as <em>request</em> and <em>session</em> scoped beans. We&#8217;ll close with a look at support for <code>ApplicationContextInitializers</code> and a brief discussion of the road map for testing with application context hierarchies.
</p>
<p>
<a href="http://blog.springsource.org/author/rstoyanchev/" title="Rossen Stoyanchev" target="_blank">Rossen Stoyanchev</a> will later follow up with a detailed post on the <a href="http://blog.springsource.org/" title="SpringSource Team Blog" target="_blank">SpringSource Team Blog</a> covering the new <em>Spring MVC Test</em> framework that provides first-class support for testing Spring MVC applications. So be sure to stay tuned for that as well, since it builds on the basic web testing support discussed later in this post.
</p>
<p><!-- =============================================================== --></p>
<h1>General New Features and Updates</h1>
<h2>Build and Dependencies</h2>
<p>The <code>spring-test</code> module now builds against and supports <a href="http://www.junit.org" title="JUnit" target="_blank">JUnit 4.10</a> and <a href="http://testng.org" title="TestNG" target="_blank">TestNG 6.5.2</a>, and <code>spring-test</code> now depends on the <code>junit:junit-dep</code> Maven artifact instead of <code>junit:junit</code> which means that you have full control over your dependencies on <a href="http://code.google.com/p/hamcrest/" title="Hamcrest" target="_blank">Hamcrest</a> libraries (e.g., <code>hamcrest-core</code>, <code>hamcrest-all</code>, etc.).</p>
<h2>Generic Factory Methods</h2>
<p>
<em>Generic factory methods</em> are methods that implement the <a href="http://en.wikipedia.org/wiki/Factory_method_pattern" target="_blank" title="Factory Method Design Pattern">Factory Method Design Pattern</a> using Java Generics. Here are some example signatures of generic factory methods:
</p>
<pre class="brush: java; title: Generic Factory Methods; notranslate">
public static &lt;T&gt; T mock(Class&lt;T&gt; clazz) { ... }

public static &lt;T&gt; T proxy(T obj) { ... }
</pre>
<p>
The use of <em>generic factory methods</em> in Spring configuration is by no means specific to testing, but generic factory methods such as <code>EasyMock.createMock(MyService.class)</code> or <code>Mockito.mock(MyService.class)</code> are often used to create dynamic mocks for Spring beans in a test application context. For example, prior to Spring Framework 3.2 the following configuration could fail to autowire the <code>OrderRepository</code> into the <code>OrderService</code>. The reason is that, depending on the order in which beans are initialized in the application context, Spring would potentially infer the type of the <code>orderRepository</code> bean to be <code>java.lang.Object</code> instead of <code>com.example.repository.OrderRepository</code>.
</p>
<pre class="brush: xml; title: test-config.xml; notranslate">
&lt;beans&gt;

  &lt;!-- OrderService is autowired with OrderRepository --&gt;
  &lt;context:component-scan base-package=&quot;com.example.service&quot;/&gt;

  &lt;bean id=&quot;orderRepository&quot; class=&quot;org.easymock.EasyMock&quot;
    factory-method=&quot;createMock&quot;
    c:_=&quot;com.example.repository.OrderRepository&quot; /&gt;

&lt;/beans&gt;
</pre>
<p>
In Spring 3.2, generic return types for factory methods are now properly inferred, and <em>autowiring by type</em> for mocks should work as expected. As a result, custom work-arounds such as a <code>MockitoFactoryBean</code>, <code>EasyMockFactoryBean</code>, or <a href="https://bitbucket.org/kubek2k/springockito/wiki/Home" target="_blank" title="Springockito">Springockito</a> are likely no longer necessary.
</p>
<h2>Mock Objects</h2>
<p>
We&#8217;ve introduced <code>MockEnvironment</code> which complements the existing <code>MockPropertySource</code> to complete support for mocking out the environment and property source abstractions introduced in Spring 3.1.
</p>
<p>
Regarding unit testing support for web components, we&#8217;ve added new features to existing Servlet API mocks such as <code>MockServletContext</code>, <code>MockHttpSession</code>, <code>MockFilterChain</code>, and <code>MockRequestDispatcher</code>, and we&#8217;ve introduced new mocks related to REST Web Services: <code>MockClientHttpRequest</code> and <code>MockClientHttpResponse</code> for the client side as well as <code>MockHttpInputMessage</code> and <code>MockHttpOutputMessage</code> for the server side.
</p>
<h2>JDBC Testing Support</h2>
<p>In Spring 3.2 we&#8217;ve deprecated <code>SimpleJdbcTestUtils</code> in favor of the improved <code>JdbcTestUtils</code> class which offers new <code>countRowsInTableWhere()</code> and <code>dropTables()</code> utility methods in addition to everything that <code>SimpleJdbcTestUtils</code> previously offered. These changes help to avoid the compiler warnings associated with the use of the deprecated <code>SimpleJdbcTemplate</code> and provide a convenient means for counting the number of rows in a table using a <code>WHERE</code> clause and for dropping a list of tables. On a similar note, <code>AbstractTransactionalJUnit4SpringContextTests</code> and <code>AbstractTransactionalTestNGSpringContextTests</code> have been retrofitted with a <code>jdbcTemplate</code> instance variable as well as <code>countRowsInTableWhere()</code> and <code>dropTables()</code> methods which delegate to their counterparts in <code>JdbcTestUtils</code>. </p>
<h2>Transaction Manager Configuration</h2>
<p>
If you&#8217;re familiar with the support for <a href="http://static.springsource.org/spring/docs/3.2.0.RC1/reference/html/testing.html#testcontext-tx" title="Transaction management in the Spring TestContext Framework" target="_blank">transactional integration tests</a> in the <em>Spring TestContext Framework</em>, then you&#8217;re probably aware that the transaction manager used for tests must be called <em>&#8220;transactionManager&#8221;</em> by convention. Since Spring 2.5, this has been overridable via the <code>@TransactionConfiguration</code> annotation (e.g., <code>@TransactionConfiguration(transactionManager="txMgr")</code>); however, the use of this annotation is no longer necessary if there is a single <code>PlatformTransactionManger</code> present in the application context. In other words, as long as there is only one transaction manager defined in the context, there&#8217;s no longer a need to <em>qualify</em> what the name of that transaction manager is: if there&#8217;s only one, the TestContext framework will simply use it.
</p>
<p>
Spring 3.1 introduced the <code>TransactionManagementConfigurer</code> interface for programmatically specifying the transaction manager to use with <code>@Transactional</code> methods when using <code>@Configuration</code> classes in conjunction with <code>@EnableTransactionManagement</code> (i.e., as opposed to using XML configuration with <code>&lt;tx:annotation-driven /&gt;</code>). So as of Spring 3.2, if one of your components (i.e., typically an <code>@Configuration</code> class) implements <code>TransactionManagementConfigurer</code>, the TestContext framework will use the transaction manager specified by that component.
</p>
<p><!-- =============================================================== --></p>
<h1>The Spring TestContext Framework</h1>
<p>
<em>The rest of this post deals explicitly with new features in the Spring TestContext Framework. If you&#8217;re already familiar with the TestContext framework, feel free to skip to the next section. Otherwise, you might want to first familiarize yourself with the information provided via the links in the following paragraphs.</em>
</p>
<p>
In Spring 2.5 we introduced the <a href="http://static.springsource.org/spring/docs/3.2.0.RC1/reference/html/testing.html#testcontext-framework" target="_blank" title="Spring TestContext Framework"><em>Spring TestContext Framework</em></a> which provides annotation-driven integration testing support that can be used with JUnit or TestNG. The examples in this post will focus on JUnit-based tests, but all features used here apply to TestNG as well.
</p>
<p>
In Spring 3.1 we revised the <em>Spring TestContext Framework</em> with added support for <a href="http://www.swiftmind.com/de/2011/06/22/spring-3-1-m2-testing-with-configuration-classes-and-profiles/" target="_blank" title="Spring 3.1 M2: Testing with @Configuration Classes and Profiles">testing with <code>@Configuration</code> classes and environment profiles</a>.
</p>
<p><!-- =============================================================== --></p>
<h1>Loading a WebApplicationContext</h1>
<ul>
<li><strong>Question</strong>: How do you tell the TestContext framework to load a <code>WebApplicationContext</code>?
<li><strong>Answer</strong>: Just annotate your test class with <code>@WebAppConfiguration</code>.
</ul>
<p>
That&#8217;s really all there is to it. The presence of <code>@WebAppConfiguration</code> on your test class instructs the TestContext framework (TCF) that a <code>WebApplicationContext</code> (WAC) should be loaded for your integration tests. In the background the TCF makes sure that a <code>MockServletContext</code> is created and supplied to your test&#8217;s WAC. By default the base resource path for your <code>MockServletContext</code> will be set to <em>&#8220;src/main/webapp&#8221;</em>. This is interpreted as a path relative to the root of your JVM (i.e., normally the path to your project). If you&#8217;re familiar with the directory structure of a web application in a Maven project, you&#8217;ll know that <em>&#8220;src/main/webapp&#8221;</em> is the default location for the root of your WAR. If you need to override this default, simply provide an alternate path to the <code>@WebAppConfiguration</code> annotation (e.g., <code>@WebAppConfiguration("src/test/webapp")</code>). If you wish to reference a base resource path from the classpath instead of the file system, just use Spring&#8217;s <em>classpath:</em> prefix.
</p>
<p>
Please note that Spring&#8217;s testing support for <code>WebApplicationContexts</code> is on par with its support for standard <code>ApplicationContexts</code>. When testing with a <code>WebApplicationContext</code> you are free to declare either XML configuration files or <code>@Configuration</code> classes via <code>@ContextConfiguration</code>. You are of course also free to use any other test annotations such as <code>@TestExecutionListeners</code>, <code>@TransactionConfiguration</code>, <code>@ActiveProfiles</code>, etc.
</p>
<p>
Let&#8217;s take a look at some examples&#8230;
</p>
<p>
<code>Conventions</code></p>
<pre class="brush: java; title: Conventions; notranslate">
@RunWith(SpringJUnit4ClassRunner.class)

// defaults to &quot;file:src/main/webapp&quot;
@WebAppConfiguration

// detects either &quot;WacTests-context.xml&quot; in the same package
// or static nested @Configuration classes
@ContextConfiguration

public class WacTests {
    //...
}
</pre>
<p>
The above example demonstrates the TestContext framework&#8217;s support for <em>convention over configuration</em>. If you annotate a test class with <code>@WebAppConfiguration</code> without specifying a resource base path, the resource path will effectively default to <em>&#8220;file:src/main/webapp&#8221;</em>. Similarly, if you declare <code>@ContextConfiguration</code> without specifying resource <code>locations</code>, annotated <code>classes</code>, or context <code>initializers</code>, Spring will attempt to detect the presence of your configuration using conventions (i.e., <em>&#8220;WacTests-context.xml&#8221;</em> in the same package as the <code>WacTests</code> class or static nested <code>@Configuration</code> classes).
</p>
<p>
<code>Default Resource Semantics</code></p>
<pre class="brush: java; title: Default Resource Semantics; notranslate">
@RunWith(SpringJUnit4ClassRunner.class)

// file system resource
@WebAppConfiguration(&quot;webapp&quot;)

// classpath resource
@ContextConfiguration(&quot;/spring/test-servlet-config.xml&quot;)

public class WacTests {
    //...
}
</pre>
<p>
This example demonstrates how to explicitly declare a resource base path with <code>@WebAppConfiguration</code> and an XML resource location with <code>@ContextConfiguration</code>. The important thing to note here is the different semantics for paths with these two annotations. By default, <code>@WebAppConfiguration</code> resource paths are file system based; whereas, <code>@ContextConfiguration</code> resource locations are classpath based.
</p>
<p>
<code>Explicit Resource Semantics</code></p>
<pre class="brush: java; title: Explicit Resource Semantics; notranslate">
@RunWith(SpringJUnit4ClassRunner.class)

// classpath resource
@WebAppConfiguration(&quot;classpath:test-web-resources&quot;)

// file system resource
@ContextConfiguration(&quot;file:src/main/webapp/WEB-INF/servlet-config.xml&quot;)

public class WacTests {
    //...
}
</pre>
<p>
In this third example, we see that we can override the default resource semantics for both annotations by specifying a Spring resource prefix. Contrast the comments in this example with the previous example.
</p>
<p><!-- =============================================================== --></p>
<h1>Working with Web Mocks</h1>
<p>
To provide comprehensive web testing support, Spring 3.2 introduces a new <code>ServletTestExecutionListener</code> that is enabled by default. When testing against a <code>WebApplicationContext</code> this <a href="http://static.springsource.org/spring/docs/3.2.0.RC1/reference/html/testing.html#testcontext-key-abstractions" target="_blank" title="TestExecutionListener">TestExecutionListener</a> sets up default thread-local state via Spring Web&#8217;s <code>RequestContextHolder</code> before each test method and creates a <code>MockHttpServletRequest</code>, <code>MockHttpServletResponse</code>, and <code>ServletWebRequest</code> based on the base resource path configured via <code>@WebAppConfiguration</code>. <code>ServletTestExecutionListener</code> also ensures that the <code>MockHttpServletResponse</code> and <code>ServletWebRequest</code> can be injected into the test instance, and once the test is complete it cleans up thread-local state.
</p>
<p>
Once you have a <code>WebApplicationContext</code> loaded for your test you might find that you need to interact with the web mocks &mdash; for example, to set up your test fixture or to perform assertions after invoking your web component. The following example demonstrates which mocks can be autowired into your test instance. Note that the <code>WebApplicationContext</code> and <code>MockServletContext</code> are both cached across the test suite; whereas, the other mocks are managed per test method by the <code>ServletTestExecutionListener</code>.
</p>
<p>
<code>Injecting Mocks</code></p>
<pre class="brush: java; title: Injecting Mocks; notranslate">
@WebAppConfiguration
@ContextConfiguration
public class WacTests {
	
	@Autowired WebApplicationContext wac; // cached
	
	@Autowired MockServletContext servletContext; // cached
	
	@Autowired MockHttpSession session;
	
	@Autowired MockHttpServletRequest request;
	
	@Autowired MockHttpServletResponse response;
	
	@Autowired ServletWebRequest webRequest;
	
	//...
}
</pre>
<p><!-- =============================================================== --></p>
<h1>Request and Session Scoped Beans</h1>
<p>
<a href="http://static.springsource.org/spring/docs/3.2.0.RC1/reference/html/beans.html#beans-factory-scopes-other" target="_blank" title="Request, session, and global session scopes">Request and session scoped beans</a> have been supported by Spring for several years now, but it&#8217;s always been a bit non-trivial to test them. As of Spring 3.2 it&#8217;s now a breeze to test your request-scoped and session-scoped beans by following these steps:
</p>
<ol>
<li>Ensure that a <code>WebApplicationContext</code> is loaded for your test by annotating your test class with <code>@WebAppConfiguration</code>.</li>
<li>Inject the mock request or session into your test instance and prepare your test fixture as appropriate.</li>
<li>Invoke your web component that you retrieved from the configured <code>WebApplicationContext</code> (i.e., via dependency injection).</li>
<li>Perform assertions against the mocks.</li>
</ol>
<p>
The following code snippet displays the XML configuration for a login use case. Note that the <code>userService</code> bean has a dependency on a request-scoped <code>loginAction</code> bean. Also, the <code>LoginAction</code> is instantiated using <a href="http://static.springsource.org/spring/docs/3.2.0.RC1/reference/html/expressions.html" target="_blank" title="Spring Expression Language">SpEL expressions</a> that retrieve the username and password from the current HTTP request. In our test, we will want to configure these request parameters via the mock managed by the TestContext framework.
</p>
<p>
<code>Request-scoped Bean Config</code></p>
<pre class="brush: xml; title: Request-scoped Bean Config; notranslate">
&lt;beans&gt;

  &lt;bean id=&quot;userService&quot;
      class=&quot;com.example.SimpleUserService&quot;
      c:loginAction-ref=&quot;loginAction&quot; /&gt;

  &lt;bean id=&quot;loginAction&quot; class=&quot;com.example.LoginAction&quot;
      c:username=&quot;#{request.getParameter('user')}&quot;
      c:password=&quot;#{request.getParameter('pswd')}&quot;
      scope=&quot;request&quot;&gt;
    &lt;aop:scoped-proxy /&gt;
  &lt;/bean&gt;
	
&lt;/beans&gt;
</pre>
<p>
In <code>RequestScopedBeanTests</code> we inject both the <code>UserService</code> (i.e., the subject under test) and the <code>MockHttpServletRequest</code> into our test instance. Within our <code>requestScope()</code> test method we set up our test fixture by setting request parameters in the provided <code>MockHttpServletRequest</code>. When the <code>loginUser()</code> method is invoked on our <code>userService</code> we are assured that the user service has access to the request-scoped <code>loginAction</code> for the current <code>MockHttpServletRequest</code> (i.e., the one we just set parameters in). We can then perform assertions against the results based on the known inputs for the username and password.
</p>
<p>
<code>Request-scoped Bean Test</code></p>
<pre class="brush: java; title: Request-scoped Bean Test; notranslate">
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@WebAppConfiguration
public class RequestScopedBeanTests {
	
	@Autowired UserService userService;
	@Autowired MockHttpServletRequest request;
	
	@Test
	public void requestScope() {
		
		request.setParameter(&quot;user&quot;, &quot;enigma&quot;);
		request.setParameter(&quot;pswd&quot;, &quot;$pr!ng&quot;);
		
		LoginResults results = userService.loginUser();
		
		// assert results
	}
}
</pre>
<p>
The following code snippet is similar to the one we saw above for a request-scoped bean; however, this time the <code>userService</code> bean has a dependency on a session-scoped <code>userPreferences</code> bean. Note that the <code>UserPreferences</code> bean is instantiated using a SpEL expression that retrieves the <em>theme</em> from the current HTTP session. In our test, we will need to configure a theme in the mock session managed by the TestContext framework.
</p>
<p>
<code>Session-scoped Bean Config</code></p>
<pre class="brush: xml; title: Session-scoped Bean Config; notranslate">
&lt;beans&gt;

  &lt;bean id=&quot;userService&quot;
      class=&quot;com.example.SimpleUserService&quot;
      c:userPreferences-ref=&quot;userPreferences&quot; /&gt;

  &lt;bean id=&quot;userPreferences&quot;
      class=&quot;com.example.UserPreferences&quot;
      c:theme=&quot;#{session.getAttribute('theme')}&quot;
      scope=&quot;session&quot;&gt;
    &lt;aop:scoped-proxy /&gt;
  &lt;/bean&gt;

&lt;/beans&gt;
</pre>
<p>
In <code>SessionScopedBeanTests</code> we inject the <code>UserService</code> and the <code>MockHttpSession</code> into our test instance. Within our <code>sessionScope()</code> test method we set up our test fixture by setting the expected &#8220;theme&#8221; attribute in the provided <code>MockHttpSession</code>. When the <code>processUserPreferences()</code> method is invoked on our <code>userService</code> we are assured that the user service has access to the session-scoped <code>userPreferences</code> for the current <code>MockHttpSession</code>, and we can perform assertions against the results based on the configured theme.
</p>
<p>
<code>Session-scoped Bean Test</code></p>
<pre class="brush: java; title: Session-scoped Bean Test; notranslate">
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@WebAppConfiguration
public class SessionScopedBeanTests {

  @Autowired UserService userService;
  @Autowired MockHttpSession session;

  @Test
  public void sessionScope() throws Exception {

    session.setAttribute(&quot;theme&quot;, &quot;blue&quot;);

    Results results = userService.processUserPreferences();

    // assert results
  }
}
</pre>
</p>
<p><!-- =============================================================== --></p>
<h1>Application Context Initializers</h1>
<p>
Spring 3.1 introduced the <code>ApplicationContextInitializer</code> interface that allows for programmatic initialization of a <code>ConfigurableApplicationContext</code> &mdash; for example, to register property sources or activate bean definition profiles against the Spring <code>Environment</code> abstraction. Initializers can be configured in <code>web.xml</code> by specifying <code>contextInitializerClasses</code> via a <code>context-param</code> for the <code>ContextLoaderListener</code> and via an <code>init-param</code> for the <code>DispatcherServlet</code>.
</p>
<p>
To use context initializers in integration tests, simply declare the initializer classes in <code>@ContextConfiguration</code> via the new <code>initializers</code> attribute introduced in Spring 3.2. Inheritance of initializers across a test class hierarchy can be controlled via the <code>inheritInitializers</code> attribute which is <code>true</code> by default. Since an <code>ApplicationContextInitializer</code> provides a fully programmatic approach to initializing an application context, an initializer may optionally configure the entire context. In other words, XML resource locations or annotated classes are no longer absolutely required in integration tests that are configured via <code>@ContextConfiguration</code> if initializers have been declared. Last but not least, context initializers are <em>ordered</em> based on Spring&#8217;s <code>Ordered</code> interface or the <code>@Order</code> annotation.
</p>
<p>
The following code examples demonstrate the various ways that context initializers can be used in integration tests. The first shows how to configure a single initializer in conjunction with XML resource locations. The next example declares multiple context initializers. The third listing demonstrates the use of initializers in a class hierarchy where the list of context initializers declared in the <code>ExtendedTest</code> will be merged with those declared in the <code>BaseTest</code>. Recall that invocation order of initializers is influenced based on the implementation of Spring&#8217;s <code>Ordered</code> interface or the presence of the <code>@Order</code> annotation. The fourth example is identical to the third example except that the <code>inheritInitializers</code> attribute in <code>@ContextConfiguration</code> has been set to <code>false</code>. The result is that any context initializers declared in parent classes will be ignored (i.e., overridden). The final listing demonstrates that an <code>ApplicationContext</code> can be loaded solely from context initializers without the need to declare XML resource locations or annotated classes.
</p>
<p>
<code>Single Initializer</code></p>
<pre class="brush: java; title: Single Initializer; notranslate">
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(
    locations = &quot;/app-config.xml&quot;,
    initializers = CustomInitializer.class)
public class ApplicationContextInitializerTests {}
</pre>
</p>
<p>
<code>Multiple Initializers</code></p>
<pre class="brush: java; title: Multiple Initializers; notranslate">
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(
  locations = &quot;/app-config.xml&quot;,
  initializers = {
    PropertySourceInitializer.class,
    ProfileInitializer.class
  })
public class ApplicationContextInitializerTests {}
</pre>
</p>
<p>
<code>Merged Initializers</code></p>
<pre class="brush: java; title: Merged Initializers; notranslate">
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(
    classes = BaseConfig.class,
    initializers = BaseInitializer.class)
public class BaseTest {}


@ContextConfiguration(
    classes = ExtendedConfig.class,
    initializers = ExtendedInitializer.class)
public class ExtendedTest extends BaseTest {}
</pre>
</p>
<p>
<code>Overridden Initializers</code></p>
<pre class="brush: java; title: Overridden Initializers; notranslate">
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(
    classes = BaseConfig.class,
    initializers = BaseInitializer.class)
public class BaseTest {}


@ContextConfiguration(
    classes = ExtendedConfig.class,
    initializers = ExtendedInitializer.class,
    inheritInitializers = false)
public class ExtendedTest extends BaseTest {}
</pre>
</p>
<p>
<code>Initializer without Resources</code></p>
<pre class="brush: java; title: Initializer without Resources; notranslate">
// does not declare 'locations' or 'classes'
@ContextConfiguration(initializers = EntireAppInitializer.class)
public class InitializerWithoutConfigFilesOrClassesTest {}
</pre>
</p>
<p><!-- =============================================================== --></p>
<h1>Context Caching</h1>
<p>
Once the TestContext framework loads an <code>ApplicationContext</code> for a test, that context will be cached and reused for <strong>all</strong> subsequent tests that declare the same unique context configuration within the same test suite. The important thing to keep in mind here is that an <code>ApplicationContext</code> is uniquely identified by its <em>context cache key</em> (i.e., the combination of configuration parameters that are used to load it).
</p>
<p>
As of Spring 3.2 <code>ApplicationContextInitializer</code> classes are also included the <em>context cache key</em>. Furthermore, if the context is a <code>WebApplicationContext</code> its base resource path (defined via <code>@WebAppConfiguration</code>) will also be included in the <em>context cache key</em>. For further details on caching, consult the <a href="http://static.springsource.org/spring/docs/3.2.0.RC1/reference/html/testing.html#testcontext-ctx-management-caching" target="_blank" title="Context caching">Context caching</a> section of the reference manual.
</p>
<p><!-- =============================================================== --></p>
<h1>Application Context Hierarchies</h1>
<p>
<strong>NOTE</strong>: <em>As of Spring Framework 3.2 RC1, support for context hierarchies has not yet been implemented.</em>
</p>
<p>
In integration tests managed by the Spring TestContext Framework, currently only flat, non-hierarchical contexts are supported. In other words, there is no easy way to create contexts with parent-child relationships for tests. But context hierarchies are supported in production deployments. So it would be nice to be able to test them.
</p>
<p>
With that in mind, the Spring Team would like to introduce integration testing support for loading a test application context with a parent context, and ideally the following common hierarchies would be supported.
</p>
<ul>
<li>Root <code>WebApplicationContext</code> &#x2190; Dispatcher <code>WebApplicationContext</code></li>
<li>EAR &#x2190; Root <code>WebApplicationContext</code> &#x2190; Dispatcher <code>WebApplicationContext</code></li>
</ul>
<p>
The current proposal includes the introduction of a new <code>@ContextHierarchy</code> annotation that would contain nested <code>@ContextConfiguration</code> declarations plus a new <code>name</code> attribute in <code>@ContextConfiguration</code> that could be used for <em>merging</em> or <em>overriding</em> named configuration in the context hierarchy.
</p>
<p>
To shed some light on the proposal, let&#8217;s take a look at a few examples&#8230;
</p>
<p>
<code>AppCtxHierarchyTests</code> demonstrates a parent-child context hierarchy declared within a single test class, where the contexts are standard contexts (i.e., non-web).
</p>
<p>
<code>Single Test with Context Hierarchy</code></p>
<pre class="brush: java; title: Single Test with Context Hierarchy; notranslate">
@RunWith(SpringJUnit4ClassRunner.class)

@ContextHierarchy({
	@ContextConfiguration(&quot;parent.xml&quot;),
	@ContextConfiguration(&quot;child.xml&quot;)
})
public class AppCtxHierarchyTests {}
</pre>
</p>
<p>
<code>ControllerIntegrationTests</code> demonstrates a parent-child context hierarchy declared within a single test class, where the contexts are <code>WebApplicationContexts</code> and model a typical Spring MVC deployment.
</p>
<p>
<code>Root WAC &amp; Dispatcher WAC</code></p>
<pre class="brush: java; title: Root WAC &amp; Dispatcher WAC; notranslate">
@RunWith(SpringJUnit4ClassRunner.class)

@WebAppConfiguration

@ContextHierarchy({
    @ContextConfiguration(
		name = &quot;root&quot;,
		classes = WebAppConfig.class),
    @ContextConfiguration(
		name = &quot;dispatcher&quot;,
		locations = &quot;/spring/dispatcher-config.xml&quot;)
})
public class ControllerIntegrationTests {}
</pre>
</p>
<p>
The following code listing demonstrates how a context hierarchy could be built up across a test class hierarchy, where each level in the test class hierarchy is responsible for configuring its own level in the context hierarchy. Executing tests in both of these subclasses would result in three application contexts being loaded (and cached) and two distinct context hierarchies.
</p>
<p>
<code>Class &amp; Context Hierarchies</code></p>
<pre class="brush: java; title: Class &amp; Context Hierarchies; notranslate">
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(&quot;file:src/main/webapp/WEB-INF/applicationContext.xml&quot;)
public abstract class AbstractWebTests{}

@ContextHierarchy(@ContextConfiguration(&quot;/spring/soap-ws-config.xml&quot;))
public class SoapWebServiceTests extends AbstractWebTests{}

@ContextHierarchy(@ContextConfiguration(&quot;/spring/rest-ws-config.xml&quot;))
public class RestWebServiceTests extends AbstractWebTests{}
</pre>
</p>
<h3>Feedback is Welcome</h3>
<p>
If you are interested in further information on the proposal for context hierarchies or want to take part in the discussion, please feel free to <em>watch</em> the following JIRA issues and provide us your feedback.</p>
<ul>
<li><a href="https://jira.springsource.org/browse/SPR-5613" target="_blank" title="SPR-5613">SPR-5613</a>: context hierarchy support</li>
<li><a href="https://jira.springsource.org/browse/SPR-9863" target="_blank" title="SPR-9863">SPR-9863</a>: web context hierarchy support</li>
</ul>
<p><!-- =============================================================== --></p>
<h1>Summary</h1>
<p>
Spring Framework 3.2 introduces several new testing features with a strong focus on first-class support for testing web applications. We encourage you to try out these features as soon as you can and give us feedback. Also, stay tuned for <a href="http://blog.springsource.org/author/rstoyanchev/" title="Rossen Stoyanchev" target="_blank">Rossen Stoyanchev&#8217;s</a> follow-up post on the new <em>Spring MVC Test</em> framework. And if you find any bugs or have any suggestions for improvements, now is the time to <a title="Spring JIRA issue tracker" href="https://jira.springsource.org/browse/SPR" target="_blank">take action</a>!
</p>
<p><!-- =============================================================== --></p>
<hr />
<p>
<em>[1] The reference manual has not yet been updated to reflect testing support for web applications, but these features will certainly be well documented by Spring 3.2 GA.</em>
</p>
<p>
<em>Please note: I have cross posted this blog entry on the <a title="Spring Team Blog" href="http://blog.springsource.org/2012/11/07/spring-framework-3-2-rc1-new-testing-features/" target="_blank">Spring Team Blog</a> as well.</em></p>
<p>The post <a href="http://www.swiftmind.com/de/2012/11/07/spring-framework-3-2-rc1-new-testing-features/">Spring Framework 3.2 RC1: New Testing Features</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.swiftmind.com/de/2012/11/07/spring-framework-3-2-rc1-new-testing-features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SpringOne 2GX &#8211; 2012</title>
		<link>http://www.swiftmind.com/de/2012/10/05/springone-2gx-2012/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=springone-2gx-2012</link>
		<comments>http://www.swiftmind.com/de/2012/10/05/springone-2gx-2012/#comments</comments>
		<pubDate>Fri, 05 Oct 2012 18:03:50 +0000</pubDate>
		<dc:creator>Sam Brannen</dc:creator>
				<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://www.swiftmind.com/de/?p=1621</guid>
		<description><![CDATA[<p><a title="Sam Brannen" href="http://www.swiftmind.com/de/ueber-uns/team/sam-brannen/">Sam Brannen</a> and <a title="Rossen Stoyanchev" href="http://rossenstoyanchev.org/blog/" target="_blank">Rossen Stoyanchev</a> will be presenting <a href="https://springone2gx.com/topics/testing_web_applications_with_spring_3_2" target="_blank"><em>"Testing Web Applications with Spring 3.2"</em></a> at SpringOne 2GX in Washington, DC on Thursday, October 18, 2012. <a href="http://www.swiftmind.com/de/2012/10/05/springone-2gx-2012/" class="more">mehr darüber »</a></p><p>The post <a href="http://www.swiftmind.com/de/2012/10/05/springone-2gx-2012/">SpringOne 2GX &#8211; 2012</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><a title="Sam Brannen" href="http://www.swiftmind.com/de/ueber-uns/team/sam-brannen/">Sam Brannen</a> and <a title="Rossen Stoyanchev" href="http://rossenstoyanchev.org/blog/" target="_blank">Rossen Stoyanchev</a> will be presenting <a href="https://springone2gx.com/topics/testing_web_applications_with_spring_3_2" target="_blank"><em>&#8220;Testing Web Applications with Spring 3.2&#8243;</em></a> at SpringOne 2GX in Washington, DC on Thursday, October 18, 2012.</p>
<p><a href="http://www.springone2gx.com/" target="_blank" title="SpringOne 2GX - 2012"><img src="http://www.swiftmind.com/de/files/2012/10/springone2gx_logo.png" alt="SpringOne 2GX - 2012" width="483" height="351" class="alignnone size-full wp-image-1623" /></a></p>
<p>Be part of one of the year&#8217;s premier Java events with some 100 sessions over 4 days in historic Washington, DC.</p>
<p><a href="http://www.springsource.org" target="_blank" title="SpringSource">SpringSource</a> and <a href="http://www.nofluffjuststuff.com/" target="_blank" title="No Fluff Just Stuff">No Fluff Just Stuff</a> bring you SpringOne 2GX 2012, a one-of-a-kind conference for application developers, solution architects, web operations and IT teams who develop business applications, create multi-device aware web applications, design cloud architectures, and manage high performance infrastructure. The sessions are specifically tailored for developers using the hugely popular open source Spring technologies, Groovy &amp; Grails, and Tomcat. Whether you&#8217;re building and running mission-critical business applications or designing the next killer cloud application, SpringOne 2GX will keep you up to date with the latest enterprise technology.</p>
<p>For further details about the conference and to register, visit the official <a title="SpringOne 2GX" href="http://www.springone2gx.com" target="_blank">SpringOne 2GX Conference Website</a>.</p>
<p>The post <a href="http://www.swiftmind.com/de/2012/10/05/springone-2gx-2012/">SpringOne 2GX &#8211; 2012</a> appeared first on <a href="http://www.swiftmind.com/de">Swiftmind</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.swiftmind.com/de/2012/10/05/springone-2gx-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.456 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-06-19 02:04:14 -->
