<?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>Blog.Project13.pl &#187; jee</title>
	<atom:link href="http://www.blog.project13.pl/index.php/tag/jee/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blog.project13.pl</link>
	<description>The Blog of a Coder</description>
	<lastBuildDate>Sun, 05 Feb 2012 02:28:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>[fun] &#8220;Holy turnaround, Batman!&#8221;</title>
		<link>http://www.blog.project13.pl/index.php/fun/1385/fun-holy-turnaround-batman/</link>
		<comments>http://www.blog.project13.pl/index.php/fun/1385/fun-holy-turnaround-batman/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 00:22:03 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[jrebel]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=1385</guid>
		<description><![CDATA[&#160; I&#8217;ve been featured in the JRebel Blog for my killer tweeting skillz&#8230; ;-) Thanks guys for the cool tool and for being so cool to the community! :-) http://zeroturnaround.com/blog/bazinga-rebellions-on-twitter-on-the-road-and-some-more-exciting-news/]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>I&#8217;ve been featured in the <a title="JRebel Blog" href="http://zeroturnaround.com/blog/bazinga-rebellions-on-twitter-on-the-road-and-some-more-exciting-news/" onclick="urchinTracker('/outgoing/zeroturnaround.com/blog/bazinga-rebellions-on-twitter-on-the-road-and-some-more-exciting-news/?referer=');">JRebel Blog</a> for my killer tweeting skillz&#8230; ;-)<br />
Thanks guys for the cool tool and for being so cool to the community! :-)</p>
<p style="text-align: center;"><a href="http://www.blog.project13.pl/wp-content/uploads/2011/11/zero_turnaround_ktoso.png"><img class="aligncenter size-medium wp-image-1386" title="zero_turnaround_ktoso" src="http://www.blog.project13.pl/wp-content/uploads/2011/11/zero_turnaround_ktoso-300x290.png" alt="" width="370" /></a></p>
<p style="text-align: center;"><a href="http://zeroturnaround.com/blog/bazinga-rebellions-on-twitter-on-the-road-and-some-more-exciting-news/" onclick="urchinTracker('/outgoing/zeroturnaround.com/blog/bazinga-rebellions-on-twitter-on-the-road-and-some-more-exciting-news/?referer=');">http://zeroturnaround.com/blog/bazinga-rebellions-on-twitter-on-the-road-and-some-more-exciting-news/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/fun/1385/fun-holy-turnaround-batman/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PL] Trzeźwe spojrzenie na: CoFoJa (Design By Contract form Google)</title>
		<link>http://www.blog.project13.pl/index.php/coding/1168/pl-trzezwe-spojrzenie-na-cofoja-design-by-contract-form-google/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/1168/pl-trzezwe-spojrzenie-na-cofoja-design-by-contract-form-google/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 22:18:51 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[codnig]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[libs]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=1168</guid>
		<description><![CDATA[Design By Contract Dzisiejszy wpis będzie o znanej i generalnie dość znanej i mającej wiele zalet metodyce Design By Contract. Temat &#8220;wypłynął&#8221; ponownie dla wielu javovców tym razem dzięki wydaniu biblioteki  CoFoJa (o którym właśnie będzie ten post) przez dwóch pracowników Google przy ścisłej współpracy z autorem pierwowzoru tego projektu. Dlaczego jednak nietypowy tytuł posta [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Design By Contract</strong></p>
<p>Dzisiejszy wpis będzie o znanej i generalnie dość znanej i mającej wiele zalet metodyce <strong>Design By Contract</strong>. Temat &#8220;wypłynął&#8221; ponownie dla wielu javovców tym razem dzięki wydaniu biblioteki  <strong>CoFoJa</strong> (o którym właśnie będzie ten post) przez dwóch pracowników <strong>Google</strong> przy ścisłej współpracy z <a href="http://www.linkedin.com/pub/dir/Johannes/Rieken" onclick="urchinTracker('/outgoing/www.linkedin.com/pub/dir/Johannes/Rieken?referer=');">autorem pierwowzoru tego projektu</a>. Dlaczego jednak nietypowy tytuł posta &#8211; &#8220;trzeźwe spojrzenie&#8221;? Ponieważ w odróżnieniu od niektórych nie oceniam technologii na podstawie &#8220;wow factor&#8221; a realnej używalności. Gotowi mini review tego toola? No to lecimy&#8230; :-)</p>
<p><strong>Contracts For Java</strong></p>
<p>Na początek warto rzucić okiem na <a href="http://google-opensource.blogspot.com/2011/02/contracts-for-java.html" onclick="urchinTracker('/outgoing/google-opensource.blogspot.com/2011/02/contracts-for-java.html?referer=');">googlowy blog</a> gdzie ogłoszono premierę tego narzędzia oraz oczywiście samą <a href="http://code.google.com/p/cofoja/" onclick="urchinTracker('/outgoing/code.google.com/p/cofoja/?referer=');">stronę domową projektu </a><acronym title="Contracts For Java"><a href="http://code.google.com/p/cofoja/" onclick="urchinTracker('/outgoing/code.google.com/p/cofoja/?referer=');"><strong>CoFoJa</strong></a></acronym>. Oczywiście na samym przekierowaniu nie poprzestanę więc zaczniemy od mini definicji od strony użytkownika metodyki design by contract. Jak możemy przeczytać chociażby <strong>w pragmatycznym programiście </strong>metodyka ta ma dość spory potencjał i ciekawe możliwości &#8211; generalnie chodzi o określanie &#8220;kontraktów&#8221; na naszych metodach. Zakładanie kontraktów ma pewną wyższość nad pisanie testów jednostkowych ponieważ możemy kontrakt założyć na interfejsie a wszystkie implementujące go klasy będą z nim związane</p>
<p>Kontrakt może na przykład zapewnić:</p>
<ul>
<li>wykonanie danej metody tylko i wyłącznie wtedy gdy przekazane jej argumenty spełniają pewne kryteria (w kontekście CoFoJa byłoby to <strong>@Requires</strong>)</li>
<li>zagwarantowanie spełnienia pewnych warunków po opuszczeniu metody (w kontekście CoFoJa byłoby to <strong>@Ensures</strong> ewentualnie <strong>@ThrowEnsures</strong> jeśli chcemy mieć kontrakt na rzucenie wyjątku)</li>
<li>zagwarantowanie ogólnych warunków na konkretnej np. klasie (<strong>@Invariant</strong>)</li>
</ul>
<p>Ok, skoro znamy podstawowe building blocks (zaczerpnięte skądżeby inąd niż z <a href="http://en.wikipedia.org/wiki/Eiffel_%28programming_language%29" onclick="urchinTracker('/outgoing/en.wikipedia.org/wiki/Eiffel_28programming_language_29?referer=');">Eiffla</a> oczywiście) zobaczmy jakieś przykładowe poadnotowane nimi API:</p>
<p><script src="https://gist.github.com/817547.js?file=gistfile1.java"></script> <strong>A teraz praktycznie</strong></p>
<p>Najlepiej jest chwilkę się w niego wgryźć, powinien być stosunkowo zrozumiały. Nie chcemy nigdy mieć ujemnej ilości bananów &#8211; spowodowałoby to złamanie kontraktu. Podobne przykładowe kontrakty wejściowe/wyjściowe widzimy na metodach oraz jeden mały tip: metoda <strong>old()</strong> jest dostarczana automagicznie i oznacza &#8220;starą wartość tego wywołania&#8221; czyli przed wykonaniem metody na którą zakładamy ten kontrakt. Poza tym mamy tutaj do czynienia w sumie z zwyczajnym kodem Java który niestety jest wewnątrz stringa&#8230; Świadomy programista zapewne już ma zapaloną lampkę alarmową, że to będzie nie refaktorowalne i bez sensu&#8230; Na pocieszenie dodam iż kod Java zawarty w tych stringach faktycznie jest &#8220;kompilowany&#8221;i jak coś popsujemy składniowo, kontrakty się nie skompilują i dostaniemy normalne informacje jakby to się nam nie kompilował normalny &#8220;nasz kod&#8221;. Co do wygody refaktoringu&#8230; Na szczęscie korzystam z porządnego IDE (<strong>IntelliJ IDEA</strong>) i takie &#8220;problemy&#8221; mnie nie dotyczą ;-). Wybrałem inject języka <strong>Groovy</strong> do tych stringów aby parser składniowy nie dziwił się pojawienia się metody old() &#8220;z nikąd&#8221;:<a href="http://xlab.pl/wp-content/uploads/2011/02/intellij.png" onclick="urchinTracker('/outgoing/xlab.pl/wp-content/uploads/2011/02/intellij.png?referer=');"><img class="aligncenter size-full wp-image-1752" title="intellij" src="http://xlab.pl/wp-content/uploads/2011/02/intellij.png" alt="" width="600" /></a> <strong>Problem</strong> z &#8220;nie podpowiadaniem metod&#8221; jak i &#8220;nie da się refaktorować&#8221; jak widać został od razu <strong>wyeliminowany</strong> :-) <em><strong>Hooray for JetBrains.</strong></em> Poszukajmy jednak kolejnego problemu z tym API&#8230; Tak jest, <strong>@ThrowEnsures </strong>jest trochę brzydki a nie koniecznie musi być cały w stringu. Jak działa obecnie? Przekazujemy mu listę stringów gdzie parami występują &#8220;wyjątek&#8221; + &#8220;warunek kiedy ma zostać rzucony&#8221;. Chętniej zobaczył bym to w formie podobnej do poniższej (tylko szybki szkic taki), a wy?</p>
<p><script src="https://gist.github.com/817695.js?file=gistfile1.java"></script></p>
<p>Ok czas na uruchomienie kodu z &#8220;włączonymi kontraktami&#8221;&#8230; I&#8230; niestety nie okazało się to takie trywialne na obecnym etapie projektu. Niestety trzeba sobie ręcznie poustawiać processowanie adnotacji (norma, tutaj się niewiele zmieni) jednak trochę problemów nastarcza mi obecnie widoczność klas/pól dla CoFoJa w intellij. Classpath (dla procesora) zdaje się być ustawiony poprawny oraz jego klasa jak i inne opcje też jednak nie dochodzi do poprawnego przeparsowania wszystkich reguł. No cóż, może jutro się uda &#8211; tymczasem odsyłam do <a href="http://fsteeg.com/2011/02/07/setting-up-contracts-for-java-in-eclipse/" onclick="urchinTracker('/outgoing/fsteeg.com/2011/02/07/setting-up-contracts-for-java-in-eclipse/?referer=');">poradnika dla użytkowników Eclipse</a> gdzie to członek społeczności sprawnie poradził sobie z tym problemem :-)</p>
<p><strong>Trzeźwe spojrzenie: &#8220;Czy obecnie warto?</strong>&#8221;</p>
<p>Pozostaje pytanie&#8230; Czy warto się zainteresować CoFoJa jak i samym DBC? Pytanie jest chyba równie ogólne jak &#8220;czy warto meta-programować?&#8221; także wprost odpowiedzi nie udzielę. Miejmy jednak na uwadze że jak na razie używanie CoFoJa nie jest zbyt wygodne a adnotacje można by jeszcze trochę poszlifować. Trzeba by jeszcze rzucić okiem jak stoimy z integracją tego z Maven &#8211; aby normalnie testując bądź klikając sobie po projekcie te kontrakty mogły się przydawać. Sama idea jest ciekawa i jakby integracja z narzędziami była wygodniejsza &#8211; a może od razu pluginy do IDE &#8211; można by się nad tym porządniej zastanawiać. <strong>Jak na razie projekcik odkładamy ten projekt spokojnie na półkę &#8220;worth watching&#8221; i liczymy na rychłe wydanie 2.0.</strong> :-)</p>
<p>PS: Jeżeli interesują Cię takie jak i inne ciekawe metodyki i sposoby tworzenia <strong>pięknego</strong>, czystego<strong> kodu, </strong>zapraszam serdecznie na co 2 tygodniowe spotkania <em><a href="http://sckrk.com" onclick="urchinTracker('/outgoing/sckrk.com?referer=');">SCKRK </a></em>gdzie obecnie dyskutujemy w formie &#8220;reading club&#8221; nad <strong>D</strong>omain <strong>D</strong>riven <strong>D</strong>esign :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/1168/pl-trzezwe-spojrzenie-na-cofoja-design-by-contract-form-google/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>@RunWith JUnit4 with BOTH SpringJUnit4ClassRunner and Parameterized</title>
		<link>http://www.blog.project13.pl/index.php/coding/1077/runwith-junit4-with-both-springjunit4classrunner-and-parameterized/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/1077/runwith-junit4-with-both-springjunit4classrunner-and-parameterized/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 00:05:39 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[junit]]></category>
		<category><![CDATA[junit4]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=1077</guid>
		<description><![CDATA[Ok, now for a quick trick before I get into writing more about git and our last javacamp (movies are still being converted, sorry for the long wait). If you code in Java, you most probably use (you really should use) some dependecy injection mechanisms. They&#8217;re really great and take care about all the setup [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, now for a quick trick before I get into writing more about git and our last javacamp (movies are still being converted, sorry for the long wait).</p>
<p>If you code in Java, you most probably use (you really should use) some dependecy injection mechanisms. They&#8217;re really great and take care about all the setup that need&#8217;s to be done before you can move on to your coding. The same thigh applies to testing, you&#8217;d rather write:</p>
<div class="geshi no java">
<div class="head">//yay</div>
<ol>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @Autowired</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; MyComponent component<span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>Than use the new operator, or worse, perform some super weird setup to build this object. If you use spring, you&#8217;d write an test like this to make it support Spring&#8217;s DI:</p>
<div class="geshi no java">
<div class="head">//an JUnit test with spring DI</div>
<ol>
<li class="li1">
<div class="de1">@RunWith<span class="br0">&#40;</span>SpringJUnit4ClassRunner.<span class="kw2">class</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">@ContextConfiguration<span class="br0">&#40;</span>locations = <span class="br0">&#123;</span><span class="st0">&quot;classpath:applicationContext.xml&quot;</span><span class="br0">&#125;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">public</span> <span class="kw2">class</span> EmailTest <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @Autowired</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; MyComponent component<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">//&#8230; awesome tests</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>That&#8217;s all you need to make your tests properly autowire all components they&#8217;re using. So far so good &#8211; probably nothing new here, and nothing complicated. So let&#8217;s move on to some &#8220;super big data set&#8221; that needs to be tested, over the same flow over and over again. We&#8217;ll use an super conplicated example to showcase what I mean:</p>
<div class="geshi no java">
<div class="head">//inside an test class</div>
<ol>
<li class="li1">
<div class="de1">@Test</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">public</span> <span class="kw4">void</span> testIsValidEmail<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw2">throws</span> <span class="kw3">Exception</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; assertTrue<span class="br0">&#40;</span><span class="st0">&quot;hey, that&#39;s an good email!&quot;</span>, isValidEmail<span class="br0">&#40;</span>validEmail1<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">//&#8230; more tests&#8230;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; assertTrue<span class="br0">&#40;</span><span class="st0">&quot;hey, that&#39;s an good email!&quot;</span>, isValidEmail<span class="br0">&#40;</span>validEmail2<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">//&#8230;over and over again&#8230;</span></div>
</li>
</ol>
</div>
<p>Ok, that&#8217;s obviously stupid&#8230; :-) So, how do we deal with repetitive tests, that need some bigger dataset than just this email example (given here because it&#8217;s short and good enough for our example test)&#8230;? We&#8217;d use @RunWith(Parameterized.class), the class would then look something like this:</p>
<div class="geshi no java">
<div class="head">//my test with only params</div>
<ol>
<li class="li1">
<div class="de1">@RunWith<span class="br0">&#40;</span>Parameterized.<span class="kw2">class</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw2">class</span> EmailTest <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">String</span> validEmail<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="coMULTI">/** We&#39;re testing only good emails, for the sake of simplicity of the example */</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @Parameters</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw2">static</span> Collection<span class="sy0">&amp;</span>lt<span class="sy0">;</span>Object<span class="br0">&#91;</span><span class="br0">&#93;</span><span class="sy0">&amp;</span>gt<span class="sy0">;</span> data<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw3">Arrays</span>.<span class="me1">asList</span><span class="br0">&#40;</span><span class="kw2">new</span> <span class="kw3">Object</span><span class="br0">&#91;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="br0">&#93;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="st0">&quot;a@a.pl&quot;</span> <span class="coMULTI">/*more params here*/</span><span class="br0">&#125;</span>, <span class="br0">&#123;</span><span class="st0">&quot;exmaple@example.com&quot;</span>, <span class="coMULTI">/* more params here*/</span><span class="br0">&#125;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> EmailTest<span class="br0">&#40;</span><span class="kw3">String</span> validEmail <span class="coMULTI">/* more params would land here*/</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">this</span>.<span class="me1">validEmail</span> = validEmail<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @Test</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw4">void</span> testIsValidEmail<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw2">throws</span> <span class="kw3">Exception</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">boolean</span> wasOk = StringTools.<span class="me1">isEmail</span><span class="br0">&#40;</span>validEmail<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; assertTrue<span class="br0">&#40;</span><span class="st0">&quot;This should have been ok&quot;</span>, wasOk<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">//&#8230; more stuff</span></div>
</li>
</ol>
</div>
<p>Ok, that&#8217;s a nice way to make your code in the tests smaller yet have an nice overview through all of your tested data. Each array will be inserted in the constructor, and then ran as an seperate test &#8211; with each dataset. Nice, isn&#8217;t it?</p>
<p>Ok, but what if we want to have both Spring&#8217;s DI and an @Parameters &#8220;test data provider&#8221;&#8230;? Can you spot the problem? Yup, JUnit4 can only have ONE @RunWith annotation, and it doesn&#8217;t accept multiple runners. Which totaly makes sense when you think about it, but then there is our special case of DI, which really doesn&#8217;t change the way an test wotks, it just makes setup easier&#8230; All that said, here&#8217;s how to use both spring and parameters in your Junit4 tests:</p>
<div class="geshi no java">
<div class="head">//mytest with DI and params</div>
<ol>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @RunWith<span class="br0">&#40;</span>Parameterized.<span class="kw2">class</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @ContextConfiguration<span class="br0">&#40;</span>locations = <span class="br0">&#123;</span><span class="st0">&quot;classpath:applicationContext.xml&quot;</span><span class="br0">&#125;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw2">class</span> EmailTest <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">private</span> TestContextManager testContextManager<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">String</span> validEmail<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @Before</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw4">void</span> setUpContext<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw2">throws</span> <span class="kw3">Exception</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//this is where the magic happens, we actually do &quot;by hand&quot; what the spring runner would do for us,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// read the JavaDoc for the class bellow to know exactly what it does, the method names are quite accurate though</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">this</span>.<span class="me1">testContextManager</span> = <span class="kw2">new</span> TestContextManager<span class="br0">&#40;</span>getClass<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">this</span>.<span class="me1">testContextManager</span>.<span class="me1">prepareTestInstance</span><span class="br0">&#40;</span><span class="kw2">this</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @Parameters</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw2">static</span> Collection<span class="sy0">&lt;</span>object <span class="br0">&#91;</span><span class="br0">&#93;</span><span class="sy0">&gt;</span> data<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw3">Arrays</span>.<span class="me1">asList</span><span class="br0">&#40;</span><span class="kw2">new</span> <span class="kw3">Object</span><span class="br0">&#91;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="br0">&#93;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="st0">&quot;a@a.pl&quot;</span><span class="br0">&#125;</span>,<span class="br0">&#123;</span><span class="st0">&quot;exmaple@example.com&quot;</span><span class="br0">&#125;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> EmailTest<span class="br0">&#40;</span><span class="kw3">String</span> validEmail<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">this</span>.<span class="me1">validEmail</span> = validEmail<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @Test</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw4">void</span> testIsValidEmail<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw2">throws</span> <span class="kw3">Exception</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">boolean</span> email = StringTools.<span class="me1">isEmail</span><span class="br0">&#40;</span>validEmail<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; assertTrue<span class="br0">&#40;</span><span class="st0">&quot;should be OK&quot;</span>, wasOk<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">//&#8230; more stuff&#8230;&lt;/object&gt;</span></div>
</li>
</ol>
</div>
<p>That&#8217;s it :-) We do what the spring Runner would do for us, instanciate an application context and prepare it &#8211; that&#8217;s when the DI happens. Note that we cant use another runner annotation, but we can as usual specify where to find the appContext.xml&#8217;s.</p>
<p>That&#8217;s all, hope this will prove useful to some of you :-) <strong>Keep your tests clean!</strong></p>
<p>PS: Warning, most of this code was written in wordpress, it may contain minor spelling errors ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/1077/runwith-junit4-with-both-springjunit4classrunner-and-parameterized/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>[review] JDD 2010</title>
		<link>http://www.blog.project13.pl/index.php/coding/872/review-jdd-201/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/872/review-jdd-201/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 20:53:19 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[jdd]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[meeting]]></category>
		<category><![CDATA[scala]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=872</guid>
		<description><![CDATA[After I came back to Poland this week I had an bazillion of things to do&#8230; Now it&#8217;s just getting even more but I&#8217;ll try survive this. One additional time-taker this week was this years Java Developers&#8217; Day. In fact, it should have been renamed and I&#8217;m very wondered that it wasn&#8217;t to: &#8220;Java Developer [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter" title="Java Developer Days" src="http://10.jdd.org.pl/images/jdd_01.gif" alt="Java Developer Days" height="70" /></p>
<p>After I came back to Poland this week I had an <a href="http://www.urbandictionary.com/define.php?term=bazillion" onclick="urchinTracker('/outgoing/www.urbandictionary.com/define.php?term=bazillion&amp;referer=');">bazillion</a> of things to do&#8230; Now it&#8217;s just getting even more but I&#8217;ll try survive this.</p>
<p>One additional time-taker this week was this years Java Developers&#8217; Day. In fact, it should have been renamed and I&#8217;m very wondered that it wasn&#8217;t to: &#8220;Java Developer Days&#8221; or something like this, as this time the event lasted 2 days, from 8h per day. Of course it&#8217;s an paid conference. Having all that said, JDD was the first Java conference I took part in some time ago. I was lucky enough to see the amazing Scott Davis in action and a whole lot of other VERY inspiring talks during the last JDD I&#8217;ve seen. So I decided to go there once more, to get inspired once again&#8230; and <strong>was it worth it this year&#8230;? I&#8217;m not really sure&#8230; </strong>But let&#8217;s continue with an quick-review:</p>
<p>(There was only one session path on each day &#8211; no concurent sessions, thus I attended &#8220;all there was&#8221;.)</p>
<h2><em>RESTful Java</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/bill-burke" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/bill-burke?referer=');">Bill Burke</a></strong></h2>
<p>I wouldn&#8217;t say it was a &#8220;bad&#8221; presentation. But with practically no coding, and mostly speaking about the core concepts of ROA and REST it wasn&#8217;t an interesting nor informative talk. Even more as <a href="http://www.youtube.com/watch?v=nPvx16UtYrY&amp;feature=related" target="_blank" onclick="urchinTracker('/outgoing/www.youtube.com/watch?v=nPvx16UtYrY_amp_feature=related&amp;referer=');">last year we&#8217;ve seen the amazing Scott Davis talking</a> about the same topic (and being an total mind-opener and show-maker). I mean, hey, we&#8217;re Java Devs, we know about JAX-RS, right? Or am I just living in my bobble where everyone is well informed about such technology. Well it&#8217;s not that new of a technology to start with. REST is everywhere so it was kinda weird to start again with just the basic example use cases. I&#8217;d wish Bill would&#8217;ve showed a little more complicated scenarios &#8211; such as just coding an client (with maybe some nice tricks for it) or working with JSON or custom Object-&gt;XML serialization or something, not just the basic &#8220;HTTP method = java method mapping&#8221; stuff.</p>
<h2><em>Java Programming in a Multicore World</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/angelika-langer" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/angelika-langer?referer=');">Angelika Langer</a></strong></h2>
<p>This presentation came as an small surprise to us. Angelika indeed seems to know a lot about the internals of the JVM and the presentation did cover some interesting quirks about when memory is &#8220;flushed&#8221; (let&#8217;s call it like that for simplicities sake) so other threads would see an changed state. There was an particiulary interesting note about how transient REALLY works. Although not being an eye-opener, this presentation had some tips and tricks.<strong><br />
</strong></p>
<h2><em>Testing the Efficiency of Java Enterprise Applications</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/jaroslaw-blad" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/jaroslaw-blad?referer=');">Jarosław Błąd</a></strong></h2>
<p>I believe I&#8217;ve seen some of Jarosław&#8217;s speeches on some recordings, and they kinda keep an steady level, but are not that shocking after you&#8217;ve spent some time in JEE and such enviroments. There were some more or less useful sidenotes and some info about &#8220;how they did it&#8221; which is always interesting to hear&#8230; I&#8217;d give another 0.5pt to JDD for this one.</p>
<h2><em>The Busy Developer’s Guide to Functional Programming in Java</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/ted-neward" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/ted-neward?referer=');">Ted Neward</a></strong></h2>
<p>Ted did very well with delivering quite an &#8220;show&#8221; on stage and we had a ton of laughter. The basic idea behind this presentation was to show some basic Functional Progremming concepts CAN be implemented using plain Java. Yeah, with all the verboseness of interfaces and anonymous inner classes but it can be done. As I&#8217;ve been hacking a little with python/scala/groovy I felt quite at home with some of the presented methods, whilst I need to note that Ted&#8217;s explainations were really good&#8230; After this presentation my urge to code in Scala grew even bigger, as most of such functional tasks would be an charm to implement in Scala&#8230; Ah well, for the time being we (you :P) can use some library such as <a href="http://functionaljava.org/" onclick="urchinTracker('/outgoing/functionaljava.org/?referer=');">Functional Java</a> or <a href="http://code.google.com/p/guava-libraries" target="_blank" onclick="urchinTracker('/outgoing/code.google.com/p/guava-libraries?referer=');">Google Guava</a> which both introduce some basic Functional Ideas in an quite nice manner. (BTW: Please do remember that Java&#8217;s not really fit to use such mechanisms, but it&#8217;s a good idea to get used to it, as we&#8217;ll get closures someday, and a LOT of langs are getting more and more functional lately&#8230; :-)) I really like Guava and have even given an presentation about it sometime ago&#8230; :-) Another point for JDD for this speaker.</p>
<h2><em>Flex in the front, Java in the back: multi-screen RIAs with Adobe AIR and Flex</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/piotr-walczyszyn" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/piotr-walczyszyn?referer=');">Piotr Walczyszyn</a></strong></h2>
<p>We&#8217;ve all seen Piotr talk about FLEX sometime I guess (well, if you go to a lot conferences I&#8217;m sure you have) and if you&#8217;re not an FLEX fan it can get a little tiresome. But this time we were <strong>positively suprised</strong>. His flow though the presentation was quite nice and there weren&#8217;t much downtimes. Also he presented the upcoming support for AIR on Android devices (since Android 2.2). As my friend from work didn&#8217;t know anything about flex before, the presentation seemed to introduce him quite well into the basic concepts how such an app would work.</p>
<h2><em>Fearless Change: Patterns for Introducing New Ideas</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/linda-rising" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/linda-rising?referer=');">Linda Rising</a></strong></h2>
<p>Linda&#8217;s talk was supposed to be the &#8220;weird talk&#8221; as she called it herself. I think that even thought most of us won&#8217;t admitt it, the talk she gave was really important I think. I&#8217;ve been trying to introduce an &#8220;new idea&#8221; in our company ever since &#8220;week 1&#8243; and now it seems that we&#8217;re getting ready for it&#8230; Along with the support of some other coders and our new R&amp;D team. I noticed that all the patterns Linda mentioned, were used by us sometime during this process. It wasn&#8217;t like &#8220;hey! let&#8217;s change everything!&#8221;, but just as she said, this process took time and the support of some other team members&#8230; Let&#8217;s hope we&#8217;re able to implement this &#8220;new idea&#8221; in XSolve &#8211; I&#8217;d be very happy if we did &#8211; everyone together&#8230; :-)</p>
<h2><em>Apprenticeship – way to effective professional development</em> – <a href="http://10.jdd.org.pl/prelegenci/lukasz-szydlo" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/lukasz-szydlo?referer=');"><strong>Łukasz Szydło</strong></a></h2>
<p>And we arrived at day 2 of this conference&#8230; This presentation was a little like Linda&#8217;s on the previous day. Even Łukasz mentioned that he used some of Linda&#8217;s patterns in action and showed us how he managed to do some things in his work life&#8230; Not so much new ideas, but it was an quite OK talk I guess.</p>
<p>(Łukasz is working for one of the sponsors of JDD. And as you&#8217;ll notice &#8211; moste of the people presenting on this day were sponsored&#8230; I really didn&#8217;t like this all that much, since We&#8217;ve paid for this conference and didn&#8217;t even have an CHOICE but to listen to sponsored talks&#8230;? That&#8217;s NOT nice.)</p>
<h2><em>Comet enabled application with Lift in 15 minutes</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/lukasz-kuczera" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/lukasz-kuczera?referer=');">Łukasz Kuczera</a></strong></h2>
<p>Łukasz was talking about Lift on our 4th JavaCamp, but this time all the focus went on on stage coding and Comet. Lift is an quite nice small and simple framework and a nice point to start using Scala if you can&#8217;t find any other place for it. Implementing an coment chat was shockingly simple &#8211; even though I anticipated that it&#8217;ll be &#8220;easy&#8221; thanks to Scala&#8217;s and Lift&#8217;s abstrctions around everything. It was a very nice presentation and I liked how it showed both Scala and Lift in action. My coluege from work was also quite amazed at the elegance of Scala (he hasn&#8217;t been coding in it before) and we&#8217;ve talked a little about it later&#8230; A big big point here&#8230; :-)</p>
<h2><em>One size won’t fit everyone: on NoSQL in Java</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/jaroslaw-palka" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/jaroslaw-palka?referer=');">Jarosław Pałka</a></strong></h2>
<p>A quick review of some of the NOSQL databases out there. Jarek mailny covered <strong>neo4j</strong> and <strong>BarkleyDB</strong> as well as <strong>CouchDB</strong> (about which we had an interesting talk during the NOSQL Summer I&#8217;ve attended (it&#8217;s using <strong>map/reduce</strong>)). His talk was an very in depth insight into HOW and WHY one would or wouldn&#8217;t use <strong>NotOnly SQL</strong> databases.  (I really like the term Not Only SQL by the way, it explains so much of the philosophy in so little words&#8230; :-)) Also a nice presentation &#8211; espessialy if someone was not well informed about NOSQL databases before. I was also quite happy with it as I wasn&#8217;t too familiar with <strong>neo4j</strong> and always thought that it&#8217;s cleanly an very interesting DB for some specific operations (anything graph heavy&#8230; ;-)).</p>
<h2><em>Advanced HTTP session management with Oracle Coherence</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/michal-kuratczyk" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/michal-kuratczyk?referer=');">Michał Kuratczyk</a></strong></h2>
<p>As I&#8217;ve been listening to talks about Coherence for over an year now&#8230;<strong> </strong>I kinda went on with hacking some of my stuff on my notebook during this presentation. Coherence is nice, of course as is any Map shared among multiple nodes, but it&#8217;s a) uber-expensive b) there are other non-oracle tools that can be used to achieve this goal. Of course, if you really need some heavy weight enterprise support you&#8217;d go with Oracle&#8217;s solution. BTW, normally Waldemar Kot would be talking about this and Michał seemed to be more like an replacement for Waldek? Also, he was surprised with having to talk in english &#8211; which he cleanly didn&#8217;t expect.</p>
<h2><em>Technical Debt</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/thomas-sundberg" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/thomas-sundberg?referer=');">Thomas Sundberg</a></strong></h2>
<p>The<strong> </strong>last presentation on this year&#8217;s JDD&#8230; Most of the ideas Thomas supplied were already covered by Linda or Łukasz &#8211; study groups etc etc. And the &#8220;Technical Debt&#8221; is basically just an name for how much shitty parts you have in your codebase. I didn&#8217;t really like this presentation as it was mostly &#8220;all talk and no &#8216;do&#8217;&#8230;&#8221; but it may have inspired someone to cleanup his code base on next monday etc&#8230; ;-)</p>
<p>All in all&#8230; The <strong>organization </strong>was kinda weak (with super chaotic agenda changes), one of the reasons may have been the 1 to 2 day switch, or maybe no money or something like that&#8230;? The <strong>T-Shirts </strong>look bad (it&#8217;s quite possible that one might not recognise that it&#8217;s an JDD shirt at all&#8230;), and <strong>did cost extra</strong> money&#8230; ;-) And the booths were kinda poor. Comparing it to last year&#8217;s JDD, it was worse, in many aspects. I think that blowing it up into these 2 days was an bad idea and probably caused a lot of these problems. I believe that Javarsovia was an even bigger and more interesting conference (not even mentioning the uber-awesome GeeCON &#8211; I really mean it, the atmosphere and amount of people interaction and networking was much much greater there!) or other fun things like our JavaCamps or NYAC and other initiatives. The poster claimed that JDD is &#8220;Poland&#8217;s biggest Java Conference&#8221; &#8211; eeeee&#8230;.? <em><strong>No</strong></em>, no way. It&#8217;s not, just look at Javarsovia or GeeCON, now THAT are the BIG conferences! The good thing is surely that I&#8217;ve met some of my friends there and had some nice short talks about Japan and work (no, I didn&#8217;t go to the party as I had lot&#8217;s of work to be done). ;-)</p>
<p>I&#8217;m not entirely sure what to think about this year&#8217;s edition. I really loved the previous one, but this time it was kinda &#8220;meh&#8221; and mostly concerning a lot &#8220;<strong>basic</strong><strong>s</strong>&#8221; and &#8220;<strong>soft stuff</strong>&#8220;. This isn&#8217;t really what I&#8217;m paying for &#8211; I&#8217;d like some core, good, rock solid technical presentations. Ok, one might say that the agenda is public so I might just wait for it to be filled out ant then judge if it&#8217;s worth to go there &#8211; but there&#8217;s a catch here, the agenda was not final until the very last week before it (and that would cost me around 500-1000PLN &#8211; LOL). Ah well, it&#8217;s YAC&#8230;. ;-)</p>
<p>I&#8217;m kinda interested how <strong>Radek </strong>is enjoying his stay in<strong> Berlin at JUDCon, </strong>as it&#8217;s being held at the exact same time as JDD&#8230; ;-) In other news&#8230; I&#8217;m coding the GeeCON c4p app and I&#8217;m hoping you&#8217;ll like it when it&#8217;s done. Also&#8230; we&#8217;re starting out with <strong>a new series of JavaCamp meetings very soon</strong> &#8211; can&#8217;t wait to see you there!</p>
<p>Till then, Sayonara~</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/872/review-jdd-201/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>props2xls &#8211; GWT i18n Properties to Google Spreadsheet uploader</title>
		<link>http://www.blog.project13.pl/index.php/coding/808/props2xls-gwt-i18n-properties-to-google-spreadsheet-uploader/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/808/props2xls-gwt-i18n-properties-to-google-spreadsheet-uploader/#comments</comments>
		<pubDate>Sun, 12 Sep 2010 02:12:41 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=808</guid>
		<description><![CDATA[!UPDATED POST &#8211; see bellow! As I&#8217;ve been recently given a task to &#8220;copy &#38; paste&#8221; all our properties into an specific document on google docs &#8211; that the client wanted to use in order to translate these properties into other languages. Of course I decided NOT to do this by hand &#8211; but script [...]]]></description>
			<content:encoded><![CDATA[<p><strong>!UPDATED POST &#8211; see bellow!</strong></p>
<p>As I&#8217;ve been recently given a task to &#8220;copy &amp; paste&#8221; all our properties into an specific document on <strong>google docs</strong> &#8211; that the client wanted to use in order to translate these properties into other languages. Of course <strong>I decided NOT to do this by hand</strong> &#8211; but script it &#8211; and that&#8217;s how <strong>props2xls </strong>came to be.</p>
<p>It&#8217;s an Groovy + Java app that traverses an directory searching for *.properties files, and then matches their names together &#8211; and extracts their Locale from the filenames. Next, those strings are uploaded into an specified Google Spreadsheet. You can use any google account + password anc choose which spreadsheet/worksheet should be filled out with your data.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/RneIPxq9qLs?fs=1&amp;hl=en_US&amp;color1=0x2b405b&amp;color2=0x6b8ab6" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/RneIPxq9qLs?fs=1&amp;hl=en_US&amp;color1=0x2b405b&amp;color2=0x6b8ab6" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Note that the bottleneck here is the inserting into the Spreadsheet. <strong>This can be easily and very much improved as one may use Batch inserts. </strong>But as it&#8217;s just a proof-of-contept, I didn&#8217;t actually care for the time being ;-)<strong><br />
</strong></p>
<p>Here are some useful links if this post got you interested in this API:</p>
<ul>
<li><a href="http://code.google.com/p/gdata-java-client/" onclick="urchinTracker('/outgoing/code.google.com/p/gdata-java-client/?referer=');">http://code.google.com/p/gdata-java-client/</a></li>
<li><a href="http://code.google.com/apis/gdata/" onclick="urchinTracker('/outgoing/code.google.com/apis/gdata/?referer=');">http://code.google.com/apis/gdata/articles/java_client_lib.html#linux</a></li>
</ul>
<p>As all programmers&#8230; you&#8217;d also probably want to check out the source &#8211; <a href="http://github.com/ktoso/props2xls" onclick="urchinTracker('/outgoing/github.com/ktoso/props2xls?referer=');">so here (on github) it is</a>. But be warned, it&#8217;s very low quality as it&#8217;s just been hacked on for a few hours today at night (after midnight&#8230; ;-)).</p>
<p>&#8212;- the UPDATE &#8212;-</p>
<p>As you&#8217;ve probably noticed. In the first version I was using cell-by-cell updated. Each of them would fire an HttpRequest&#8230; And that is very expensive. So&#8230; I&#8217;ve rewritten some of the code to enable <strong>Batch updates</strong>. Goodle APIs support is quite well and I&#8217;m happy with the end result (as seen in the above movie).</p>
<p>There is a bug in the Java Client Library from 2.0 up though&#8230; When creating the SpreadsheetService use the following code, or you&#8217;ll <a href="//bug workaround! http://code.google.com/p/gdata-java-client/issues/detail?id=103">run into some weird bugs at runtime</a>:</p>
<div class="geshi no java">
<div class="head">//note line 3 here</div>
<ol>
<li class="li1">
<div class="de1">service = <span class="kw2">new</span> SpreadsheetService<span class="br0">&#40;</span><span class="st0">&quot;Props-2-Xls&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">service.<span class="me1">setUserCredentials</span><span class="br0">&#40;</span>username, password<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">//bug workaround! http://code.google.com/p/gdata-java-client/issues/detail?id=103</span></div>
</li>
<li class="li1">
<div class="de1">service.<span class="me1">setProtocolVersion</span><span class="br0">&#40;</span>SpreadsheetService.<span class="me1">Versions</span>.<span class="me1">V1</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>PS: One might call it an proof-of-concent, as the code is quite ugly but it was written in about 3-4hours. And will probably spare us a lot of time if some client wants to translate our properties once again&#8230; ;-)</p>
<p>PPS: Did you know that on the <em>netbeans.edu.pl</em> website, I used the <strong>Google Data API for Picasa</strong> to develop <a href="http://www.netbeans.edu.pl/gallery" onclick="urchinTracker('/outgoing/www.netbeans.edu.pl/gallery?referer=');">the gallery</a>?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/808/props2xls-gwt-i18n-properties-to-google-spreadsheet-uploader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Diff] context.getBean(); Spring 3.0 vs. 2.5.6</title>
		<link>http://www.blog.project13.pl/index.php/fun/819/diff-context-getbean-spring-3-0-vs-2-5-6/</link>
		<comments>http://www.blog.project13.pl/index.php/fun/819/diff-context-getbean-spring-3-0-vs-2-5-6/#comments</comments>
		<pubDate>Fri, 10 Sep 2010 17:34:10 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=819</guid>
		<description><![CDATA[I just found an nice thing in Spring 3.0. I was using it in one of mu current projects, but the client wanted us to use 2.5.6 as it would be provided on the server. Switching back was really easy, no problems there ;-) One interesting thing I found was that while in Spring 3.0 [...]]]></description>
			<content:encoded><![CDATA[<p>I just found an nice thing in Spring 3.0. I was using it in one of mu current projects, but the client wanted us to use 2.5.6 as it would be provided on the server. Switching back was really easy, no problems there ;-)</p>
<p>One interesting thing I found was that while in Spring 3.0 this is perfecly legal and quite nice:</p>
<div class="geshi no java">
<div class="head">//spring 3.0+</div>
<ol>
<li class="li1">
<div class="de1">ClassPathXmlApplicationContext context = <span class="kw2">new</span> ClassPathXmlApplicationContext<span class="br0">&#40;</span><span class="st0">&quot;/spring-config.xml&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">final</span> OperatorDao morphiaDao = context.<span class="me1">getBean</span><span class="br0">&#40;</span>OperatorDaoMorphiaImpl.<span class="kw2">class</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>You can&#8217;t do this in Spring 2.5.6.  So I basically &#8220;discovered&#8221; a feature of Spring 3 by seeing that Spring 2 doesn&#8217;t have it after doing an &#8220;downgrade&#8221;. I always thought such getBean implementation has been there &#8220;since always&#8221;&#8230; ;-) (The lack of explicit casting is always an welcome addition.)</p>
<p>Anyways, here is the plain old 2.5.6 version of getting a Bean:</p>
<div class="geshi no java">
<div class="head">// spring 2.5.6</div>
<ol>
<li class="li1">
<div class="de1"><span class="kw2">final</span> OperatorDao morphiaDao = <span class="br0">&#40;</span>OperatorDao<span class="br0">&#41;</span> context.<span class="me1">getBean</span><span class="br0">&#40;</span><span class="st0">&quot;operatorMorphiaDao&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>Btw: The above code was taken from some quickly written JUnit tests&#8230; I think I&#8217;ll post them soon, btw: <strong>Mongo = awesome; Morphia = awesome; Mongo + Moprhia = Uber Awesome :-)</strong><em></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/fun/819/diff-context-getbean-spring-3-0-vs-2-5-6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ip2cntry &#8211; ex-appengine app (mainly JAX-RS)</title>
		<link>http://www.blog.project13.pl/index.php/coding/727/ip2cntry-ex-appengine-app-mainly-jax-rs/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/727/ip2cntry-ex-appengine-app-mainly-jax-rs/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 15:13:04 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[appengine]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[web dev]]></category>
		<category><![CDATA[webdeveloper]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=727</guid>
		<description><![CDATA[I&#8217;ve been coding an simple RESTful &#8220;ip to country&#8221; conversion service. I&#8217;ve decided to put it up to appengine &#8211; so that everybody may use it freely even if I&#8217;d change my server etc&#8230; And if looked quite nice the first day &#8211; buw when I got to do some &#8220;real stuff&#8221; app engine started [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;"><img title="appengine and duke" src="http://api.ning.com/files/mDJ*r0VXJVM5*LNj5uct5fwBIDcQH99SKTN-zzCVyDf306EuzF6lbwkJW6cGVJOUNtAen43aPLTd9HtdVcYgFuxB-d8SufPD/dukeongae.jpg" alt="" width="151" height="138" /></div>
<p>I&#8217;ve been coding an simple RESTful &#8220;ip to country&#8221; conversion service. I&#8217;ve decided to put it up to appengine &#8211; so that everybody may use it freely even if I&#8217;d change my server etc&#8230; And if looked quite nice the first day &#8211; buw when I got to do some &#8220;real stuff&#8221; app engine started to get in my way, here&#8217;s a quick rundown of the problems I&#8217;ve found with appengine:</p>
<ol>
<li>I need to download and update the ip&lt;-&gt;country database every few days. I&#8217;d use an <strong>GZIPInputStream</strong> and <strong>BufferedReader</strong> to get the file I was interested in and update the database. Did appengine allow me to use such an simple aparoach?
<ol>
<li><strong style="color: #03c300;">pro:</strong> appengine provides a very nice cron-like mechanism. So I just had to create an <strong>cron.xml in WEB-INF</strong> and this part was ready to go! This was in fact easier and more fun than in classic <strong>Spring + Open Symphony Quartz</strong>.</li>
<li><strong style="color: #cb0007;">con:</strong>I checked if this tactic was OK with the JRE whilelist and checked the Quotas &#8211; <a href="http://code.google.com/appengine/docs/quotas.html#UrlFetch" onclick="urchinTracker('/outgoing/code.google.com/appengine/docs/quotas.html_UrlFetch?referer=');">http://code.google.com/appengine/docs/quotas.html#UrlFetch</a>, &#8220;seems ok&#8221; &#8211; I thought &#8211; &#8220;nothing about per connection limits, only daily quotas.&#8221;. After writing the code, I discovered that even though on the main quota page there was no word about per connection limits, in fact there are such quotas, but a little more hidden: <a href="http://code.google.com/appengine/docs/java/urlfetch/overview.html" onclick="urchinTracker('/outgoing/code.google.com/appengine/docs/java/urlfetch/overview.html?referer=');">http://code.google.com/appengine/docs/java/urlfetch/overview.html</a> Max request/response sizes are capped at exactly 1MB.<br />
As my gzipped file is around 1.1MB,<strong> appengine killed my simple idea&#8230;</strong> I&#8217;d have to split the file into separate ones &#8211; on another server, and then fetch the separated files onto appengine.</li>
<li><strong style="color: #cb0007;">con:</strong>The<strong> </strong>mentione CRON mechanism is quite funny. You don&#8217;t call<strong> methods </strong>but URLs &#8211; and they are normally called as if one would launch them from the browser &#8211; thus, traffic and &#8220;max time&#8221; quotas do count there as well. So rather than calling an method, as you&#8217;d do with OpenSymphony &#8211; you create an Servlet that does all the work. This may me both good, and bad&#8230; You cound do all the CRON stuff by hand if it got out of sync etc&#8230; I didn&#8217;t really like it, and as mentioned&#8230; <strong>When doing my &#8220;big batch database update&#8221; the servlet would simply timeout&#8230;</strong></li>
</ol>
</li>
<li>Let&#8217;s talk about the <strong>dataStore</strong>. As you all probably know&#8230; AppEngine does not provide and &#8220;database&#8221; per se. It&#8217;s not relational and has quite some limitations. BUT!<strong> That&#8217;s quite ok, as it&#8217;s very quick and very very scalable!</strong> And most of the time&#8230; Do you really need all those fancy relations? ;-) It was an ideal place to hold my super simple data: &#8220;ip region = country&#8221; mapping in a persistent way. &#8220;Another nice thing on appengine for this application I&#8217;m going to write.&#8221; &#8211; I thought. Was I right?
<ol>
<li><strong style="color: #03c300;">pro/con:</strong> Not really&#8230; I used JPA but JDO (which is prefered by appengine from what I&#8217;ve seen) also works nice on GAE. The setup did run quite ok while I was running tests on my local machine. Deployment is also an breeze and <strong>I didn&#8217;t have to use any complicated dependencies to get it running &#8211; &#8220;yay, no maven!&#8221;. </strong>You just have to enchance the classes you want to make persistent (just as hibernate does).</li>
<li><strong style="color: #cb0007;">con:</strong>The problems started when I wanted to <strong>clear my datastore.</strong> Nothing easier than that, right&#8230;? &#8220;delete from BlaBla&#8221; and we&#8217;re done. Yeah, but not on GAE. As even the &#8220;max rows a query touches&#8221; are limited &#8211; to 500. So there I am, with my 100.000 rows, and I have to delete them in 500 rows per query&#8230; Of course I can&#8217;t call this in an loop &#8211; as  the timeout quota would get in my way and kill the app.From what I&#8217;ve seen, people do solve this using a CRON task that calls this &#8220;clearDatabase&#8221; servlet until it&#8217;s  done &#8211; ugh, not a nice solution but I can&#8217;t think of any other solution :\</li>
<li><strong style="color: #cb0007;">con:</strong>The only query I need to do in this app is basically:
<pre>SELECT range FROM RemoteIpData as range
             WHERE range.ipFrom &lt;= ?1
               AND range.ipTo &gt;= ?2
<em>#and this would always return 1 entry!</em>
</pre>
<p>And guess what&#8230; <strong>AppEngine does not support multiple &#8220;less/more than&#8221; operands in one query!</strong> If you think hard about what BigTable is, it does make some sense. More information about &#8220;<strong>GQL</strong>&#8221; can be found here: <a href="http://code.google.com/appengine/docs/python/datastore/gqlreference.html" onclick="urchinTracker('/outgoing/code.google.com/appengine/docs/python/datastore/gqlreference.html?referer=');">http://code.google.com/appengine/docs/python/datastore/gqlreference.html</a> All the <a href="http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html" onclick="urchinTracker('/outgoing/code.google.com/appengine/docs/java/datastore/queriesandindexes.html?referer=');">restrictions about the Queries you can do are documented here</a> &#8211; some are really counter intuitive when you come from an RDBMS enviroment&#8230; Ah well ;-) Oh, and yet another <a href="http://blog.newsplore.com/2009/06/06/reviewing-google-appengine-for-java-part-2" onclick="urchinTracker('/outgoing/blog.newsplore.com/2009/06/06/reviewing-google-appengine-for-java-part-2?referer=');">great link about GAE limitations</a>.</p>
<p>Having this limitation, really sucks for my normally &#8220;super simple query&#8221;, and I&#8217;d have to change the data structure somehow or do some awful 2 queries and then combine them in Java (omg teh terrorr&#8230; :&lt;). So, while developing on appengine, keep in ming &#8211; simple things might turn out quite complicated due to the nature of BigTable. If you know all the limitations when designing the system and not while finishing it, you&#8217;ll be a happier man&#8230; ;-)</li>
<li><strong>neutral</strong>: Primary keys can&#8217;t be Integers etc, as AppEngine uses it&#8217;s own &#8220;Key&#8221; type. :-)</li>
</ol>
</li>
<li>Having that all said. Appengine&#8217;s administration panel is quite ok. And the not-so-newly-added log search etc are really fine tools. Something an plain old tomcat can not offer. On the other hand, the limitations can really be a deal breaker! My app was really fairly simple, and yet appengines quotas managed to really get in my way. Keep this in mind while thinking about using it. You may also try Amazon&#8217;s cloud or CloudForce from SalesForce etc&#8230; They all do offer a quite less restrictive enviroment.</li>
<li>If you&#8217;re interested, deployment does take about 5-7 minutes before the new version is visible on the web &#8211; so don&#8217;t panic if you&#8217;re still seeing the old version after deploying the new one.</li>
<li>My opinion about GAE&#8230;? <span style="text-size: xx-small;">(semi serious ;-))</span></li>
</ol>
<blockquote><p><em><strong>&#8220;Screw you clouds, I&#8217;m going /home!&#8221;</strong></em><br />
<span style="text-size: xx-small;">(<a href="http://www.youtube.com/watch?v=7oH5Qc2zTrs&amp;feature=related" onclick="urchinTracker('/outgoing/www.youtube.com/watch?v=7oH5Qc2zTrs_amp_feature=related&amp;referer=');">intended southpark pun</a>)</span><em><strong><br />
</strong></em></p></blockquote>
<p>I&#8217;ll finish this project using my ol&#8217; pal, <strong>Tomcat6</strong> which I&#8217;ve already got running for <a href="http://netbeans.edu.pl" onclick="urchinTracker('/outgoing/netbeans.edu.pl?referer=');">netbeans.edu.pl</a> (but that was an grails app).</p>
<p>I&#8217;ve also decided to use Spring, which I didn&#8217;t really need on appengine &#8211; as the only thing I was doing was so small that all the logic was around 10 lines in the servlets&#8230; But if using hibernate and all the other &#8220;real&#8221; JEE stuff, I felt I&#8217;d need to &#8220;do this right&#8221; so I&#8217;ve decided for Spring 3 and Maven2&#8230; I&#8217;ll try to build this project from gradle soon too!</p>
<p>ALSO! If interested in an more experienced programmers view on appengine (I&#8217;m still a novice), go and read <a href="http://art-of-software.blogspot.com/2010/04/goole-application-engine.html" onclick="urchinTracker('/outgoing/art-of-software.blogspot.com/2010/04/goole-application-engine.html?referer=');">this blog post about GAE on Sławek Sobótkas blog.</a> All in all we seem to agree that the limitations can be an pain in the a&#8230; ;-)</p>
<p>The source for the appengine version is on my github account. I&#8217;m porting it to an plain old tomcat environment and will post this version there too when it&#8217;s ready to run (<strong>tomcat deployment </strong>is somehow hell with such apps for me&#8230; Any tips are really welcome :-))</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/727/ip2cntry-ex-appengine-app-mainly-jax-rs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaCamp #3</title>
		<link>http://www.blog.project13.pl/index.php/review/537/javacamp-3/</link>
		<comments>http://www.blog.project13.pl/index.php/review/537/javacamp-3/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 08:29:13 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[polish]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[agh]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[JavaCamp]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[JUG]]></category>
		<category><![CDATA[meeting]]></category>
		<category><![CDATA[pjug]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/index.php/null/537/javacamp-3/</guid>
		<description><![CDATA[10 Kwietnia 2010, odbył się trzeci już, organizowany przez PJUG na terenie AGH, JavaCamp. Niestety tego samego dnia, około godziny 9:00 doszło do katastrofy polskiego samolutu z b. ważnymi osobami rządowymi i nie tylko Polski&#8230; Trudno jest sprawę opisać słowami i chyba każdy wie o czym mowa, także podobnie jak na JavaCampie, pozostawiam to w chwili ciszy [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.blog.project13.pl/wp-content/uploads/2010/04/pjug_logo.jpg"><img class="size-full wp-image-536 alignleft" title="pjug_logo" src="http://www.blog.project13.pl/wp-content/uploads/2010/04/pjug_logo.jpg" alt="Polish Java User Group" width="126" height="157" /></a>10 Kwietnia 2010, odbył się trzeci już, organizowany przez PJUG na terenie AGH, JavaCamp.</p>
<p>Niestety tego samego dnia, około godziny 9:00 doszło do katastrofy polskiego samolutu z b. ważnymi osobami rządowymi i nie tylko Polski&#8230; Trudno jest sprawę opisać słowami i chyba każdy wie o czym mowa, także podobnie jak na JavaCampie, pozostawiam to w chwili ciszy i kontynuuję z materiałem&#8230;</p>
<p>[...]</p>
<h2><strong>Piotr Jagielski</strong> &#8211; “Testowanie z użyciem  obiektów zastępczych”</h2>
<p>Świetna prezentacja na której w końcu zobaczyłem <a href="http://easymock.org/" onclick="urchinTracker('/outgoing/easymock.org/?referer=');">EasyMock</a> (okazało się że wcale nie jest taki Easy jakby nazwa sugerowała) <a href="http://mockito.org/" onclick="urchinTracker('/outgoing/mockito.org/?referer=');">Mockito</a> oraz <a href="http://code.google.com/p/powermock/" onclick="urchinTracker('/outgoing/code.google.com/p/powermock/?referer=');">PowerMock</a> w akcji. Jedyne co miałem dotychczas wspólnego z testowaniem przy wykorzystaniu Mock obiektów to ręcznie napisana <strong>MockCrosswordGenerator</strong> &#8211; <span style="text-decoration: underline;"><em>okazało się że jest to w pełni normalne i porządane czasami podejście</em></span> do mockowania &#8211; także ucieszyłem się że moja domorosła odpowiedź na pytanie <em>&#8220;jak to sensownie przetestować + słyszałem coś o mockowaniu ale franeworka to mu tutaj nie trzeba&#8221;</em> pod tytułem <em>&#8220;a napiszę klasę co implementuje ten interfejs i zwraca gotowce&#8221; <span style="font-style: normal;">okazała się być normalnym i słusznym w niektórych sytuacjach podejściem</span></em>.</p>
<p>Wracając do przedstawianych bibliotek -  Mockito wydaje się faktycznie przyjemny (no i był mocno reklamowanego podczas prezentacji), chyba że znajdę coś lepszego&#8230; <strong>Groovy </strong>wydaje się trochę fajniejszy do takich rzeczy &#8220;na szybko&#8221;, no ale może już dość pakowania go wszędzie gdzie się da hm hm&#8230; Mockito po przedstawionych możliwościach i przyjemności pisania testów w oparciu o niego, jest bardzo przyjemny.</p>
<p>Potem Piotr pokazał jeszcze armatę jaką jest <strong>PowerMock</strong>&#8230; Która po prostu potarfi mockować wszystko &#8211; magicznie. Bo jak wiemy niezbyt da się mockowanie zastosować przy metodach statycznych czy metodach/klasach finalnych. PowerMock trochę &#8220;czaruje&#8221; bytecode&#8217;em i nawet takie trudne sytuacje potrafi mockować&#8230; Co fajne &#8211; buduje on &#8220;na&#8221; tym co już mockito i easymock zdążyły stworzyć &#8211; nie jest to kolejne API które trzeba kuć absolutnie od zera :-)</p>
<p>Prezentacja była na prawdę świetna i chętnie posłuchałbym Piotra ponownie na jakimś innym spotkaniu.</p>
<h2><strong><a href="http://kaczanowscy.pl/tomek/2010-04/gradle-talk-java-camp-3-april-2010-slides-and-source-code" onclick="urchinTracker('/outgoing/kaczanowscy.pl/tomek/2010-04/gradle-talk-java-camp-3-april-2010-slides-and-source-code?referer=');">Tomasz Kaczanowski</a></strong> &#8211; “Gradle”</h2>
<p>Tą prezentację Tomek przedstawiał na <strong>tegorocznym <a href="http://www.sfi.org.pl/prelegenci#kaczanowski" onclick="urchinTracker('/outgoing/www.sfi.org.pl/prelegenci_kaczanowski?referer=');">Studenckim Festiwalu Informatycznym</a></strong> i akurat na niej miałem okazję być (oraz na prezentacji Jacka Laskowskiego oraz &#8220;warsztatach&#8221; z GWT&#8230; ale o tym post kiedy indziej). Także &#8220;nic nowego&#8221;, co nie zmienia faktu iż była zarówno wtedy jak i teraz porządnie przygotowana &#8211; co na prawdę było widać, oraz prowadzona &#8220;z sensem&#8221; &#8211; jakieś tezy, jakieś zestawienia, przykłady a następnie sprawdzenie co faktycznie Gradle nam daje a czego nie.</p>
<p>Na JavaCamp w przeciwieństwie do SFI było obecnych więcej prawdziwych programistów Java na codzień pracujących z Maven2, oraz będących dobrze poinformowanych o nowościach w Maven3. Dzięki temu prezentację często przerywano i dyskutowano na temat &#8220;czy gradle pozwala na XYZ&#8221; lub &#8220;w Maven też da się ABC&#8221; itp. Bardzo mi się to podobało, z dwóch powodów: prezentację już znałem więc powiew świeżości był mile widziany oraz &#8220;życiowe&#8221; spojrzenie na prezentowany materiał zawsze jest najważniejsze a na &#8220;wielkich konferencjach&#8221; często unika się takiego spojrzenia. Słowem? Kolejna bardzo dobra prezentacja z dużym zaangażowaniem publiczności.</p>
<h2><a href="http://09.jdd.org.pl/prelegenci/waldemar-kot" onclick="urchinTracker('/outgoing/09.jdd.org.pl/prelegenci/waldemar-kot?referer=');"><strong>Waldemar Kot</strong></a> &#8211; “Współbieżność w  aplikacjach Java EE”</h2>
<p>Bardzo bardzo podobną prezentację Waldemar prezentował <strong>Java Developers&#8217; Day 2009</strong>, gdzie<strong> </strong>również miałem okazję go posłuchać. Tam prezentacja nazywała się &#8220;<em>Asynchroniczność, współbieżność i rozproszone przetwarzanie w Java  EE<br />
- przykłady z użyciem technologii middleware Oracle: WebLogic Server,<br />
EclipseLink/TopLink JPA i Coherenc</em>e&#8221; i jak można zgadnąć po nazwie&#8230; było trochę &#8220;hmmm&#8221;. Tym razem, pod prostszą nazwą, i odświeżonym podejściem Waldemar skupił się na pokazaniu nam<strong> WorkManager API</strong> &#8211; de facto standardu w przetwarzaniu równoległym w JEE. Bardzo ganił dziwne podejście ludzi który twierdzą że współbieżności w<strong> JEE</strong> &#8220;się nie da&#8221; (pewnie że się da, ale po prostu nie Thread&#8217;em droga) lub &#8220;a jeśli musisz to użyj JMS&#8221; &#8211; dziwne podejścia, faktycznie &#8211; skoro WorkManager jest tak ładnym i banalnym API&#8230; Standaryzacji się niestety wątki w JEE nie doczekały, ale WM jest dobrym i sprawdzonyum rozwiązaniem. No i mamy również w springu: <a href="http://static.springsource.org/spring/docs/2.0.x/reference/scheduling.html" onclick="urchinTracker('/outgoing/static.springsource.org/spring/docs/2.0.x/reference/scheduling.html?referer=');">http://static.springsource.org/spring/docs/2.0.x/reference/scheduling.html</a> Więc w sumie zaskoczył mnie że spotykał się z takimi poglądami dot współbieżności a JEE&#8230;</p>
<p>Potem mała prezentacja tego co taka współbieżność w efekcie daje &#8211; przykładowe odpalanie wątków i zabawa ograniczaniem ThreadPoola z poziomu serwera aplikacyjnego &#8211; to samo było na <strong>JDD </strong>jeśli dobrze pamiętam.</p>
<p>Kolejne demko dotyczyło już <a href="http://www.oracle.com/technology/products/coherence/index.html" onclick="urchinTracker('/outgoing/www.oracle.com/technology/products/coherence/index.html?referer=');">Oracle<strong> Coherence</strong></a><strong>.</strong> Czyli witamy w świecie <strong>DataGrid</strong>. Jak to najprościej opisać? &#8220;Taka Map&#8230; rozproszona na 200 serwerów i samoczynnie replikująca się do baz danych z np. opóźnieniem &#8211; dramatycznie redukując ilość zapytań SQL.&#8221; Oczywiście to nie tylko tyle, ale również dostęp poprzez Java/C++/.NET do jednej i tej samej instancji serwera. Prezentacja była fajna i ciekawa &#8211; szkoda że takie cuda dopiero mają sens gdy ma się miliony zapytań dot. danych &#8211; ale technologia z pewnością jest bardzo ciekawa &#8211; a wydajność &#8220;widać&#8221;, skalowalność również ogromna&#8230; Cud miód i orzeszki. Na tym się coherence oczywiście nie kończy &#8211; pomysł wysyłania &#8220;kodu do wykonania&#8221; (uproszczona nazwa oczywiście&#8230;) zamiast pobierania danych, zmiany, i wysłania również jest fajnie wspierana. Zamiast na bazie danych i SQL po prostu pracujemy z API coherence, które pozwala nam tworzyć pewne zapytania &#8211; przedstawiony przykład był takim SELECT AVG(&#8230;) FROM, ale wykonanym na mapce coherence&#8230; Zwyczajne włączenie kolejnego serwera pozwalało drastycznie zmniejszać czas potrzebny na wykonanie takiej operacji &#8211; serwery same się dogadują i replikują między sobą dane aby potem wykonać 1 zapytanie (nic nie programujemy co by mówiło o jakiś serwerach) na wszystkich serwerkach <strong>na raz</strong> &#8211; ot takie podejście do współbieżności. Bardzo ciekawa technologia, no ale niestety <strong>wielka armata &#8211; chciałbym kiedyś z takich strzelać ;-)</strong></p>
<p><a href="http://2010.geecon.org/" onclick="urchinTracker('/outgoing/2010.geecon.org/?referer=');"><strong><img class="alignnone" title="GeeCON" src="http://www.netbeans.edu.pl/images/geecon.png" alt="" width="206" height="85" /></strong></a></p>
<p><strong>Informacja dla zainteresowanych UniversityDay na GeeCONie:</strong></p>
<p>Waldemar Kot będzie przeprowadzał na UniversityDay całodniowe szkolenie z Coherence &#8211; więc jeśli Cię to zainteresowało &#8211; zapraszamy.<br />
Inna z ścieżej najprawdopodobniej będzie dotyczyć Gradle, także jeśli interesuje cię gradle, miej oko na informacje publikowane na stronie domowej <a href="http://2010.geecon.org/site/schedule3" onclick="urchinTracker('/outgoing/2010.geecon.org/site/schedule3?referer=');">GeeCON</a>.</p>
<p>Pizza jak zawsze &#8211; dobra ;-)</p>
<p><em>Powyższy post napisano na nudnym wykładzie&#8230; ;-)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/review/537/javacamp-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kill only Tomcat</title>
		<link>http://www.blog.project13.pl/index.php/coding/422/easy-way-to-kill-tomcat/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/422/easy-way-to-kill-tomcat/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 22:14:47 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=422</guid>
		<description><![CDATA[There is sometimes the need to kill some JVM, I usually use &#8220;killall java&#8221; and that works fine as long as that&#8217;s in fact what I want &#8211; kill ALL. But let&#8217;s say i just want to kill Tomcat and not my IDE? The below method works quite well in such an situation: [ktoso@homunculus ~]$ [...]]]></description>
			<content:encoded><![CDATA[<p>There is sometimes the need to kill some JVM, I usually use &#8220;killall java&#8221; and that works fine as long as that&#8217;s in fact what I want &#8211; kill ALL. But let&#8217;s say i just want to kill Tomcat and not my IDE? The below method works quite well in such an situation:</p>
<div class="geshi no bash">
<div class="head">[ktoso@homunculus ~]$ sudo netstat -lpn | grep 8080</div>
<ol>
<li class="li1">
<div class="de1">tcp &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">0</span> &nbsp; &nbsp; &nbsp;<span class="nu0">0</span> :::<span class="nu0">8080</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :::<span class="sy0">*</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LISTEN &nbsp; &nbsp; &nbsp;<span class="nu0">18525</span><span class="sy0">/</span>java</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>ktoso<span class="sy0">@</span>homunculus ~<span class="br0">&#93;</span>$ <span class="kw2">kill</span> <span class="nu0">18525</span> <span class="co0"># you might need to add -9 here (SIGKILL)</span></div>
</li>
</ol>
</div>
<p>A quickly hacked up version of an simple shell script to kill this tomcat could look like (I still suck at awk&#8230;):</p>
<div class="geshi no bash">
<div class="head">#!/bin/sh</div>
<ol>
<li class="li1">
<div class="de1"><span class="kw2">kill</span> <span class="nu0">-9</span> `<span class="kw2">netstat</span> -lpn <span class="sy0">|</span> <span class="kw2">grep</span> <span class="nu0">8080</span> <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st0">&#39;{print $7}&#39;</span> <span class="sy0">|</span> <span class="kw2">awk</span> -F<span class="sy0">/</span> <span class="st0">&#39;{print $1}&#39;</span>`</div>
</li>
</ol>
</div>
<p>The above obviously sux, as we&#8217;re using two awk commands after another&#8230; Ans also in the above examples, I&#8217;ve assumed that tomcat is listening on 8080, this may not always be the case, since with mod_proxy_ajp, there is no need fot it to listen on it&#8217;s default port and just the one to communicate by AJP. Let&#8217;s use it&#8217;s name to find it&#8217;s PID, we&#8217;ll use ps and grep and awk &#8211; life is simple with them. :-)<br />
Here&#8217;s the final version of this command: </p>
<div class="geshi no bash">
<div class="head">#!/bin/sh</div>
<ol>
<li class="li1">
<div class="de1"><span class="kw2">kill</span> <span class="nu0">-9</span> `<span class="kw2">ps</span> aux <span class="sy0">|</span> <span class="kw2">grep</span> catalina <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st0">&#39;{print $2}&#39;</span>`</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/422/easy-way-to-kill-tomcat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaCamp #2</title>
		<link>http://www.blog.project13.pl/index.php/coding/405/javacamp-2/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/405/javacamp-2/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 02:10:34 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[agh]]></category>
		<category><![CDATA[JavaCamp]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[JUG]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[webdeveloper]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=405</guid>
		<description><![CDATA[Yup, it&#8217;s time for another JavaCamp &#8220;review&#8221;. This time I was able to attend the whole thing, and didn&#8217;t miss the pizza &#8211; well, I just got one slice since we were so busy talking about Google&#8217;s Android with other programmers&#8230; ;-) The agenda was shorter than last time, but it still &#8220;had it&#8217;s moments&#8221;: [...]]]></description>
			<content:encoded><![CDATA[<p>Yup, it&#8217;s time for another <a href="http://www.java.pl/?p=131" onclick="urchinTracker('/outgoing/www.java.pl/?p=131&amp;referer=');">JavaCamp</a> &#8220;review&#8221;.<br />
This time I was able to attend the whole thing, and didn&#8217;t miss the pizza &#8211; well, I just got one slice since we were so busy talking about Google&#8217;s Android with other programmers&#8230; ;-) The agenda was shorter than last time, but it still &#8220;had it&#8217;s moments&#8221;:</p>
<address style="text-align: center;"></address>
<h3><a href="http://www.lenart.org.pl/" onclick="urchinTracker('/outgoing/www.lenart.org.pl/?referer=');"><strong>Łukasz Lenart</strong></a> &#8211; “Google AppEngine &#8211; chmura na Ja(v)wie”</h3>
<p>Łukasz, from the Warsaw JUG, was talking about Google&#8217;s AppEngine &#8211; it&#8217;s baisically <em>Just Another Servlet Container</em> but since it&#8217;s in a Cloud, it&#8217;s (potentially) easy to scale an application deployed on it&#8230; But the biggest benefit of deploying to the AppEngine is in my opinion: free java hosting. If our app doesn&#8217;t exceed some <a href="http://code.google.com/intl/pl/appengine/docs/quotas.html" onclick="urchinTracker('/outgoing/code.google.com/intl/pl/appengine/docs/quotas.html?referer=');">specyfic quotas</a> (most importantly is smaller than 500MB &#8211; concerning the Data/Blob Stores) we don&#8217;t have to pay Google for the hosting. You could call this a free cloud for beginners, and if your app gets bigger, you&#8217;re kinda trapped in this clound, and then have to pay google some fees for the extra bandwidth etc.</p>
<p>Sadly not everything is &#8220;allowed&#8221; and we are restricted by a <a href="http://code.google.com/intl/pl/appengine/docs/java/jrewhitelist.html" onclick="urchinTracker('/outgoing/code.google.com/intl/pl/appengine/docs/java/jrewhitelist.html?referer=');">Java Class WhiteList</a>. Also, there is <strong>no </strong><strong>Relational Database</strong> available for us on the AppEngine &#8211; instead we can use the &#8220;DataStore&#8221; with <strong><abbr title="Google Query Language......">GQL</abbr></strong> (or JDO or <strong>JPA</strong>) and for files there is the (now in &#8220;beta&#8221; status) <strong>BlobStore</strong> &#8211; the name explaing everything I guess&#8230; ;-) Another <em>&#8220;restriction&#8221;</em> would be not being able to access the filesystem. I can only guess why, but it would seem that this would make the <strong>AppEngine</strong> easier to scale&#8230; (sadly I&#8217;m not an AppEngine Developer so that&#8217;s just my wild guess). Ok, but why did I put the word <em>&#8220;restriction&#8221;</em> in quotes? Because I don&#8217;t think this &#8220;restriction&#8221; is that much of a hurdle&#8230; We can always use resources from inside our WAR by using Class.getResource() <em>(I didn&#8217;t test this on the AE, but it sounds plausible and should work) </em>and for uploaded files there&#8217;s the BlobStore. There are some more &#8220;services&#8221; like simplified threading (normal java threads wouldn&#8217;t be easy to controll by the AppEngine I guess, so that&#8217;s why they introducet this option) and some more &#8211; there&#8217;s XMPP, Mailing support etc&#8230;</p>
<p>All in all, I wasn&#8217;t a big fan of cloud&#8217;s to begin with, and even though the AppEngine seems like a nice place to Deploy, I&#8217;m not really convinced to go with it. The presentation was all right and I did learn some thing&#8217;s about the AE I didn&#8217;t know before &#8211; and the &#8220;show what doesn&#8217;t work and not what does work out of the box&#8221; apparoch Łukasz took, was really nice much more interesting than just &#8220;click&#8230; yay it&#8217;s working&#8221; &#8211; as it doesn&#8217;t go like that IRL most of the time&#8230;<br />
That said, I&#8217;ll stick with a <strong>Tomcat</strong> server for my GWT-Crossword.</p>
<p>Oh, and the <a href="http://www.lenart.org.pl/pdf/WarszawaJUG-GoogleAppEngine.pdf" onclick="urchinTracker('/outgoing/www.lenart.org.pl/pdf/WarszawaJUG-GoogleAppEngine.pdf?referer=');">slides are available here</a> and the source code of the demo (&#8220;Struts2 on AppEngine&#8221;) he showed can be pulled from mercurial by:</p>
<pre>hg clone https://lukaszlenart-wjug.googlecode.com/hg/ gruuf-done</pre>
<h3><a href="http://miragemiko.wordpress.com/" onclick="urchinTracker('/outgoing/miragemiko.wordpress.com/?referer=');"><strong>Miroslav Kopecky</strong></a> &#8211; “Outlook to Android Application Development” <em>(yup, another Google product today)</em></h3>
<p>I own an Android powered (and there for Linux powered :-)) HTC Hero since two days, but am not &#8220;new&#8221; in the Android API as I&#8217;ve been reading quite a bit about it since it was announced alongside with the G1<em> (or was it announced before the phone..? hmm&#8230;)</em>. Mirek&#8217;s presentation was an introduction into the Android Platform, or as we noticed &#8220;Framework&#8221;, as coding Android apps feel&#8217;s very much like using an framework (yes, every API is more or less something like a framework, but the &#8220;feel&#8221; here is really framework-ish, with lot&#8217;s of method overriding etc.). After some introduction into an Android Apps structure, Mirek went on and showed 4 application demos. They were using simple layouting, Contact access and at the end event Google Maps. It may have been hard to follow for people not accustomed to Android and wasn&#8217;t all too in depth, but the overall idea most probably came through.</p>
<p>I&#8217;ll write some <strong>Android </strong>App for sure in some time &#8211; first I&#8217;ll have to quickly finish my GWT-Crossword&#8230; It&#8217;ll probably be a ContactMerger &#8211; something that&#8217;s clearly missing in all google apps and is constantly nagging me. That is, an app to easily merge contact duplicates into one contact. This could be really nicely automated, and when some conflicts are detected a normal 3-diff-like dialog would be enough to quickly merge a few contacts into one&#8230; Sadly my HTC Hero still has the uber-old Android 1.5 and the contact&#8217;s access API has significantly changed since then&#8230; I think that by the time I&#8217;m ready to code for android  the 2.1 ROM Upgrade for my Phone should be available&#8230; So I&#8217;m focusing just on the &#8220;Level 7&#8243; API (&#8220;level 7&#8243; means &#8220;android 2.1&#8243;, whereas &#8220;level 3&#8243; means &#8220;android 1.5&#8243;).</p>
<h3><a href="http://jdn.pl/blog/1" onclick="urchinTracker('/outgoing/jdn.pl/blog/1?referer=');"><strong>Piotr Maj</strong></a> &#8211; “Jak czerpać przyjemność z programowania w świecie krótkich terminów i parcia na słupki”</h3>
<p>This presentation really stood outfrom the rest, it was fun and while not really tech focused, quite interesting. Piotr started out with some awesome<span style="text-decoration: line-through;"> [plastelina]</span> figures that his wife made esspecially for this presentation: a &#8220;Garniturek&#8221; (Marketing Guy), an Programmer and an Evil Looking Tester. The figures were really hilarious&#8230; :-) Anyways, he started out with showing sources of <span style="text-decoration: line-through;">[depresion]</span> bad feelings in our day to day jobs, and pointing out that if we do something again and again, and still are doing it the same way &#8211; something&#8217;s not right, we don&#8217;t evolve if we code like that&#8230; Then he went on with introducing the Tester figure and some scenarios of a Tester humiliating Programmers. A few words about Selenium and then we were talking about how writing tests it both necessary and potentially really interesting. So in the end, we ended up talking about <strong>Unit/</strong><strong>Functional</strong> <strong>Testing</strong> and <strong>Test</strong> <strong>Coverage</strong> &#8211; who would have thought, by the title of the presentation I was expecting something else, but it was a really plesant presentation nonetheless, and the need of testing code can&#8217;t be stressed enough I guess &#8211; maybe I&#8217;ll start to have a major test coverage of my code thanks this constant nagging about them ;-)</p>
<h3><strong>Pizza Time</strong></h3>
<p>During the pizza-break we had a long talk with Miroslav, and people could play around with the Nexus One he brought especially for this presentation. It&#8217;s interesting to hear out other developers views on some API. I for example find the Android API quite nice. The &#8220;J2ME Hell&#8221; I have been coding some stuff for burns even fiercer now that I have the option to choose another Mobile Java Platform &#8211; at last with cool things like SQLite, Widgets and Easy Touch Responsiveness &#8211; oh an the BackGroundTasking is a great feature &#8211; something J2ME never had I think, on the other hand, what good stuff did basic J2ME have? Yeah there were some JSRs that made life not so painful on ME, but on most of my phones there always were problems with them &#8211; MMAPI for example, where you sometimes had to code something SE or NOKIA specific &#8211; so where is that &#8220;write once&#8221; gone on ME eh&#8230;? Later on we talked with Miroslav and it seems that he&#8217;ll be at our <a href="http://www.sfi.org.pl/" onclick="urchinTracker('/outgoing/www.sfi.org.pl/?referer=');">SFI</a> next month &#8211; yet another great conference&#8230; :-)</p>
<p>One of the developers had an Motorola DROID, which I have considered buying but decided for the HERO &#8211; for money reasons&#8230; The DROID&#8217;s (MILESTONE&#8217;s) phicical keyboard really sucks, by the way. That, plus the fact of how awesome the on-screen-keyboard of Android is made me not regret buying a phone without phisical keyboard&#8230; ;-)</p>
<h3><a href="http://javarsovia.mocna-kawa.com/index.php?option=com_content&amp;task=view&amp;id=96&amp;Itemid=65" onclick="urchinTracker('/outgoing/javarsovia.mocna-kawa.com/index.php?option=com_content_amp_task=view_amp_id=96_amp_Itemid=65&amp;referer=');"><strong>Marcin Kalas</strong></a> &#8211; “Java/JEE Performance Test Planning &#8211; How To Plan Successful Performance Tuning of Java/JEE applications”</h3>
<p>I had really high hopes for this presentation, as I&#8217;m currently doing JMeter Load Testing on MySQL engines at my University. Sadly this wasn&#8217;t a &#8220;practical&#8221; or &#8220;hands-on&#8221; presentation. Yeah, I understand that it&#8217;s really hard to show this kind of stuff in such a short period of time, nonetheless I hoped for some more &#8220;tricks and advices&#8221;. The some tips about the JVM and multiple GC Strategries were quite interesting, but that&#8217;s something I&#8217;ll need to lookup and read about when I&#8217;m going to need it as it&#8217;s clearly a very big topic.</p>
<p>Marcin surely has a lot of experience in <strong>performance tuning</strong> apps that&#8217;s clear and it was really interesting to see some people (Java Gurus) from the audience throw some interesting stuff into the presentation. Real JEE apps are really something amazing, I hope I&#8217;ll be able to code and work with such apps in my future, it&#8217;s an amazing world full of Gigantic DataCenters and Techniques no small app would ever find any use for&#8230; For now I&#8217;ll have to get good at the basic stuff I guess, I&#8217;ve still got some time. What I found very interesting were the Load/Stress &#8220;Patterns&#8221; Marcin displayed. For example if your application is always busy, or strangely idle &#8211; even with lots of request&#8217;s comming in etc. It&#8217;s something that really makes you think about the app/server and bottlenecks&#8230; Sadly I can&#8217;t seem to find anything similar about those online &#8211; maybe I&#8217;m just not searching well enough. I hope to see some of those behaviours while testing our databases, we don&#8217;t have multiple application layers in these tests and finding bottlenecks <em>should</em> be easy &#8211; it should be, right? ;-) Anyway, I hope to have some fun experiments with our mini-server.</p>
<h3><a href="http://2010.geecon.org/main/home" onclick="urchinTracker('/outgoing/2010.geecon.org/main/home?referer=');">GeeCON 2010</a></h3>
<p>The whole event was also a small GeeCON campain. People got some stickers and <span style="text-decoration: line-through;">[smycze]</span> with GeeCON branding. I&#8217;m planing to go there as it seems like an very amazing event&#8230; This year it&#8217;s in Poznań, and it&#8217;s being organized with cooperation of the Poznań and Polish JUGs. I&#8217;ll keep you up to date about upcomming Java Events &#8211; the next being SFI and then *something special* in April :-) Well then&#8230; <strong><span style="color: #f7d507;"><em>&#8220;Let&#8217;s move the Java World!&#8221;</em></span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/405/javacamp-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

