<?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>Software on a smoking barrel &#187; Eclipse</title>
	<atom:link href="http://www.margelatu.org/category/technical/eclipse/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.margelatu.org</link>
	<description></description>
	<lastBuildDate>Thu, 06 Oct 2011 14:01:54 +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>Migrating to Eclipse Galileo and the Flash Builder 4 plug-in</title>
		<link>http://www.margelatu.org/2009/06/30/migrating-to-eclipse-galileo-and-the-flash-builder-4-plug-in/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=migrating-to-eclipse-galileo-and-the-flash-builder-4-plug-in</link>
		<comments>http://www.margelatu.org/2009/06/30/migrating-to-eclipse-galileo-and-the-flash-builder-4-plug-in/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 09:19:55 +0000</pubDate>
		<dc:creator>Ionut-Maxim Margelatu</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[eclipse galileo]]></category>
		<category><![CDATA[flash builder 4]]></category>
		<category><![CDATA[flash builder 4 plug-in]]></category>

		<guid isPermaLink="false">http://margelatu.org/?p=72</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.margelatu.org/2009/06/30/migrating-to-eclipse-galileo-and-the-flash-builder-4-plug-in/' addthis:title='Migrating to Eclipse Galileo and the Flash Builder 4 plug-in '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>For some time now, I&#8217;ve been using Eclipse with the Flex Builder plug-in to code my Java/Flex projects. Recently I&#8217;ve decided to switch from Flex Builder 3 to Flash Builder 4. And since Eclipse Galileo had just been released, I just had to add it to the migration stack and let go of good ol&#8217; [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.margelatu.org/2009/06/30/migrating-to-eclipse-galileo-and-the-flash-builder-4-plug-in/' addthis:title='Migrating to Eclipse Galileo and the Flash Builder 4 plug-in ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.margelatu.org/2009/06/30/migrating-to-eclipse-galileo-and-the-flash-builder-4-plug-in/' addthis:title='Migrating to Eclipse Galileo and the Flash Builder 4 plug-in '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>For some time now, I&#8217;ve been using Eclipse with the Flex Builder plug-in to code my Java/Flex projects. Recently I&#8217;ve decided to switch from Flex Builder 3 to Flash Builder 4. And since <a href="http://www.eclipse.org/org/press-release/20090624_galileo.php" target="_blank">Eclipse Galileo had just been released</a>, I just <strong>had</strong> to add it to the migration stack and let go of good ol&#8217; Ganymede.</p>
<h3>Installing Eclipse Galileo</h3>
<p>As usual, installing Eclipse is a breeze. Go to <a href="http://www.eclipse.org/downloads/" target="_blank">the downloads page</a>, select the package that suits you best, download it, then decompress it. I&#8217;ve taken the Java EE package for Mac OS X (Carbon), since it suits best my needs and the platform I&#8217;m running on (Mac OS X Leopard 10.5.7).</p>
<h3>Installing Flash Builder 4</h3>
<p>Download it from <a href="http://labs.adobe.com/technologies/flashbuilder4/" target="_blank">the Flash Builder 4 page</a> from Adobe Labs.</p>
<div id="attachment_77" class="wp-caption aligncenter" style="width: 700px"><img src="http://margelatu.org/wp-content/uploads/2009/06/flash_builder_installation.png" alt="Installing Flash Builder 4" title="Installing Flash Builder 4" width="690" height="505" class="size-full wp-image-77" /><p class="wp-caption-text">Installing Flash Builder 4</p></div>
<p>Everything went smooth and after the installation was done, I was able to create my first FB4 project :</p>
<div id="attachment_78" class="wp-caption aligncenter" style="width: 1034px"><img src="http://margelatu.org/wp-content/uploads/2009/06/flash_builder_app_project-1024x644.png" alt="My first FB4 project" title="My first FB4 project" width="1024" height="644" class="size-large wp-image-78" /><p class="wp-caption-text">My first FB4 project</p></div>
<h3>Other plug-ins</h3>
<p>After FB4, I did install other plug-ins that I use in my daily work : <a href="http://www.perforce.com/perforce/products/p4wsad.html" target="_blank">the Perforce plug-in</a>, <a href="http://m2eclipse.codehaus.org/" target="_blank">M2Eclipse</a>, <a href="http://testng.org/doc/eclipse.html" target="_blank">the TestNG plug-in</a>, <a href="http://www.jboss.org/tools" target="_blank">JBoss Tools</a>, <a href="http://www.eclemma.org/" target="_blank">EclEmma</a>, <a href="http://pmd.sourceforge.net/integrations.html#eclipse" target="_blank">the PMD plug-in</a>, <a href="http://eclipse-cs.sourceforge.net/" target="_blank">the Checkstyle plug-in</a> and <a href="http://sourceforge.net/projects/flexformatter/" target="_blank">Flex Formatter</a>.</p>
<p>Everything works fine, just as before, and I&#8217;m very pleased about it.</p>
<h3>Migrating the workspace</h3>
<p>The real test for my new IDE stack was migrating the workspaces I use. After everything was in place, I opened my latest workspace with my new Eclipse and it turned out to be OK. I didn&#8217;t experience any issues with the Java projects or the plug-ins. </p>
<h4>Migrating Flex projects</h4>
<p>Everything worked out smoothly, except for the Flex projects. When building the Flex projects from my workspace, I kept running into an error with a message like this : </p>
<blockquote><p>Attempted to beginRule: R/, does not match outer scope rule: P/my.project</p></blockquote>
<p>This error would pop up during each project build, so I had to do something about. I did a bit of googling and it turned out that this message is common to multiple issues to Eclipse, most of them who got fixed, so that didn&#8217;t help me much. I tried out a couple of workarounds and in the end I managed to fix the problem by deleting the Flex projects from the workspace (but not the project contents) and then using the <em>Import</em> wizard to recreate them :</p>
<div id="attachment_82" class="wp-caption aligncenter" style="width: 615px"><img src="http://margelatu.org/wp-content/uploads/2009/06/flash_builder_reimport_flex_project.png" alt="Import the Flex project as an existing project" title="Import the Flex project as an existing project" width="605" height="630" class="size-full wp-image-82" /><p class="wp-caption-text">Import the Flex project as an existing project</p></div>
<p>After I did this I didn&#8217;t receive any more errors when building the projects. However, I did change the default Flex SDK to be Flex SDK 3.4, instead of 4.0 as Flash Builder defaults to. This was the last configuration I had to do before I could work as smoothly as I did before with the Eclipse Ganymede/Flex Builder 3 stack.<!-- PHP 5.x --></p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.margelatu.org/2009/06/30/migrating-to-eclipse-galileo-and-the-flash-builder-4-plug-in/' addthis:title='Migrating to Eclipse Galileo and the Flash Builder 4 plug-in ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.margelatu.org/2009/06/30/migrating-to-eclipse-galileo-and-the-flash-builder-4-plug-in/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Java code coverage reports in Eclipse</title>
		<link>http://www.margelatu.org/2009/06/25/java-code-coverage-reports-in-eclipse/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=java-code-coverage-reports-in-eclipse</link>
		<comments>http://www.margelatu.org/2009/06/25/java-code-coverage-reports-in-eclipse/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 11:38:35 +0000</pubDate>
		<dc:creator>Ionut-Maxim Margelatu</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[code coverage]]></category>
		<category><![CDATA[eclemma]]></category>
		<category><![CDATA[TestNG]]></category>

		<guid isPermaLink="false">http://margelatu.org/?p=52</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.margelatu.org/2009/06/25/java-code-coverage-reports-in-eclipse/' addthis:title='Java code coverage reports in Eclipse '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>A part of our team&#8217;s &#8220;definition of done&#8221; is having unit-tests in place and, unofficially, a minimum of 80% code coverage. Our Maven-based build process runs the tests and then creates code coverage reports in HTML format, that we can then consult in the documentation that Maven generates. Along with other reports, this helps us [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.margelatu.org/2009/06/25/java-code-coverage-reports-in-eclipse/' addthis:title='Java code coverage reports in Eclipse ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.margelatu.org/2009/06/25/java-code-coverage-reports-in-eclipse/' addthis:title='Java code coverage reports in Eclipse '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>A part of our team&#8217;s &#8220;definition of done&#8221; is having unit-tests in place and, unofficially, a minimum of 80% code coverage. Our Maven-based build process runs the tests and then creates code coverage reports in HTML format, that we can then consult in the documentation that Maven generates. Along with other reports, this helps us get a clear picture of where our code is in terms of stability and quality.</p>
<p>This is all great ; but when you&#8217;re in the middle of a task and you write unit-tests, it&#8217;s quite tedious to run the build and then open the HTML coverage report just to monitor your code coverage. I spend about 80% of my time for a task in Eclipse : opening and activating tasks with Mylyn, coding, writing unit-tests, running unit-tests and so on. This is why for me it made sense to seek out a way to monitor the code coverage in Eclipse.</p>
<p>After a bit of googling, I found a Java code coverage plug-in for Eclipse : <a href="http://www.eclemma.org/" target="_blank">EclEmma</a>. As you can see from its name, it&#8217;s based on the EMMA Java code coverage tool. Here&#8217;s a list with its main features :</p>
<ul>
<li>a <em>coverage</em> mode in which applications launched or unit tests are instrumented and measured</li>
<li>coverage overview : a coverage view containing a report on the source code coverage values at project-level, package-level and class-level</li>
<li>source highlighting in the Java code editor using customizable colors</li>
<li>customizable coverage counters</li>
<li>multiple coverage sessions and session merging</li>
<li>importing EMMA coverage data files</li>
<li>exporting to EMMA coverage data, XML and HTML</li>
</ul>
<p>The easiest way to install it is through the update site : <a href="http://update.eclemma.org/" target="_blank">http://update.eclemma.org</a>. After the installation, you will notice a new launch mode appearing in the Eclipse toolbar, called <em><strong>Coverage</strong></em>, similar to the <em><strong>Run</strong></em> and <em><strong>Debug</strong></em> modes. This new mode allows you to run coverage reports on applications or unit-tests just like you would before run those applications or unit-tests.</p>
<p>In a project I&#8217;m currently working on, our server-side unit tests are written using TestNG. From Eclipse, I can run one or multiple TestNG units using the Eclipse TestNG plug-in, so I can easily verify that my code passes the unit tests. I have defined a launch configuration for each server-side project which runs all of the unit-tests. To check out the code coverage for those tests, all I have to do is create a coverage configuration and make sure that I select the source code folders to be instrumented.</p>
<p>I created a sample Java-Maven-TestNG project and added to it a simple class called <strong><em>ShoppingCartImpl</em></strong> along with a TestNG test class. Here&#8217;s how it looks :</p>
<div id="attachment_55" class="wp-caption aligncenter" style="width: 1034px"><img src="http://margelatu.org/wp-content/uploads/2009/06/eclemma_sample_cart_source_code-1024x587.png" alt="Source code of a very basic shopping cart" title="Source code of a very basic shopping cart" width="1024" height="587" class="size-large wp-image-55" /><p class="wp-caption-text">Source code of a very basic shopping cart</p></div>
<p>As you can see, this is a very basic class. Now on to configuring the coverage settings ; this is a simple matter of clicking on the <strong>Coverage</strong> button in Eclipse&#8217;s toolbar and selecting the menu option <strong>Coverage Configurations&#8230;</strong>. This opens up the coverage configuration window, as seen below :</p>
<div id="attachment_56" class="wp-caption aligncenter" style="width: 956px"><img src="http://margelatu.org/wp-content/uploads/2009/06/eclemma_sample_coverage_configuration.png" alt="Creating a new EclEmma coverage configuration" title="Creating a new EclEmma coverage configuration" width="946" height="808" class="size-full wp-image-56" /><p class="wp-caption-text">Creating a new EclEmma coverage configuration</p></div>
<p>All I have to do is select the TestNG test suite that I want to run and check the source folders that are relevant to code coverage. I&#8217;m using Maven and all my source code is in <em>src/main/java</em> so I only select that folder. I click <strong>Apply</strong> and then I can finally run the coverage report. I click on the <strong>Coverage</strong> button and theTestNG configuration is executed and the coverage report is available :</p>
<div id="attachment_57" class="wp-caption aligncenter" style="width: 1034px"><img src="http://margelatu.org/wp-content/uploads/2009/06/eclemma_sample_coverage_after_first_run-1024x587.png" alt="Code coverage report after a first run" title="Code coverage report after a first run" width="1024" height="587" class="size-large wp-image-57" /><p class="wp-caption-text">Code coverage report after a first run</p></div>
<p>In the bottom of the Eclipse window, you get a clear picture of the code coverage. As you can see, the are reports at project, package and class level, which also show up in the package explorer, in the left. To enable the decorators in the package explorer, go to the Eclipse menu and select <em>Preferences</em> -&gt; <em>General</em> -&gt; <em>Appearance</em> -&gt; <em>Label decorations</em>, then make sure that the <strong><em>Java Code Coverage</em></strong> label decoration option is checked.</p>
<p>Another interesting feature of EclEmma is that after the code coverage instrumentation you can actually see the coverage in the source code. As you can see, each line relevant to the coverage report is marked with a color. Green is for 100% branch coverage, yellow is for some branch coverage and red for no coverage at all. The shopping cart has quite a low code coverage so I did shape it up. After a bit of fiddling with the code, I get a 100% code coverage and a very nice report :</p>
<p><div id="attachment_58" class="wp-caption aligncenter" style="width: 1034px"><img src="http://margelatu.org/wp-content/uploads/2009/06/eclemma_sample_full_coverage-1024x587.png" alt="The ShoppingCart class with 100% code coverage" title="The ShoppingCart class with 100% code coverage" width="1024" height="587" class="size-large wp-image-58" /><p class="wp-caption-text">The ShoppingCart class with 100% code coverage</p></div> <!-- PHP 5.x --></p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.margelatu.org/2009/06/25/java-code-coverage-reports-in-eclipse/' addthis:title='Java code coverage reports in Eclipse ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.margelatu.org/2009/06/25/java-code-coverage-reports-in-eclipse/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>A Flex formatter</title>
		<link>http://www.margelatu.org/2009/02/04/a-flex-formatter/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-flex-formatter</link>
		<comments>http://www.margelatu.org/2009/02/04/a-flex-formatter/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 00:51:01 +0000</pubDate>
		<dc:creator>Ionut-Maxim Margelatu</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex formatting]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://margelatu.org/?p=14</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.margelatu.org/2009/02/04/a-flex-formatter/' addthis:title='A Flex formatter '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>I use the Flex Builder plug-in on top of Eclipse for Flex development . When it comes to coding in Flex, I often find myself missing all of those subtle but priceless options that Eclipse&#8217;s Java editor has, like the code formatting, code templates, commenting style or the all-mighty &#8220;Save Actions&#8221; option which automatically performs [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.margelatu.org/2009/02/04/a-flex-formatter/' addthis:title='A Flex formatter ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://www.margelatu.org/2009/02/04/a-flex-formatter/' addthis:title='A Flex formatter '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>I use the Flex Builder plug-in on top of Eclipse for Flex development . When it comes to coding in Flex, I often find myself missing all of those subtle but priceless options that Eclipse&#8217;s Java editor has, like the code formatting, code templates, commenting style or the all-mighty &#8220;Save Actions&#8221; option which automatically performs specific actions whenever you save your code.</p>
<p>I&#8217;ve recently started working on a project with an existing codebase, out of which 90% is Flex code. Facing the possibility of applying our team&#8217;s coding guidelines to countless lines of Flex code that I would have to modify, I turned to my browser and began a frantic search for something that would help. I came across a small project aiming to provide exactly what I needed : Flex formatting options. The project is called <strong>Flex Formatter</strong> and it can be found at  <a title="http://sourceforge.net/projects/flexformatter" href="http://sourceforge.net/projects/flexformatter" target="_blank">http://sourceforge.net/projects/flexformatter/</a> on good ol&#8217; Sourceforge. It provides a set of formatting options for ActionScript and MXML code which may cover some of the common needs of any Flex developer out there.</p>
<p>To install it, I downloaded the latest version (0.6.7 at the time of this writing) from Sourceforge, in the form of a jar file. I copied the jar in Eclipse&#8217;s <em>plugins</em> folder and restarted Eclipse.</p>
<p>After restarting Eclipse, a new item called <em>Flex Formatting</em> appeared in Eclipse&#8217;s <em>Preferences</em> window, with options for ActionScript and MXML indenting and code formatting. I found particularly useful the indentation and the text wrapping options. Once I decided on the rules I wanted, I clicked &#8216;Apply&#8217; to save my changes. Back in Eclipse&#8217;s main toolbar, 2 new buttons have appeared : <em>Format Flex code (selected lines)</em> and <em>Indent Flex code (selected lines)</em>. The first will apply the rules you have specified on any Flex code selection (including indentation), while the second button will only properly indent the Flex code selection.</p>
<p>Another interesting option of this small tool is the possibility to export the rules to a file and import them later. This can be done from the same <em>Flex Formatting</em> item in Eclipse&#8217;s <em>Preferences</em> window. Exporting &amp; importing make it easier for team members to share their coding style options. One team member could create the rules, export them to a file and put the file on a versioning server. The rest of the team could then retrieve the file from the versioning server and import it in Eclipse.</p>
<p>The formatter is far from complete. In its current version (0.6.7), it lacks some options like performing the formatting on save and it could also do with a more fine-grained set of formatting options. However, after just a couple of days of using it, this tool has saved me a lot of time and energy and I think it is definitely worth using it and I would recommend it to any Flex developer. Just try it, it won&#8217;t bite. It just flexes.<!-- PHP 5.x --></p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.margelatu.org/2009/02/04/a-flex-formatter/' addthis:title='A Flex formatter ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.margelatu.org/2009/02/04/a-flex-formatter/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Object Caching 546/597 objects using disk: basic

Served from: www.margelatu.org @ 2011-10-17 03:38:03 -->
