<?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>MaccaSoft</title>
	<atom:link href="http://www.maccasoft.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maccasoft.com</link>
	<description>Consulting, Design and Software Development</description>
	<lastBuildDate>Tue, 18 Oct 2011 16:55:49 +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>Experimenting with GIT and Subversion</title>
		<link>http://www.maccasoft.com/2011/10/18/experimenting-with-git-and-subversion/</link>
		<comments>http://www.maccasoft.com/2011/10/18/experimenting-with-git-and-subversion/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 16:54:14 +0000</pubDate>
		<dc:creator>Marco Maccaferri</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://www.maccasoft.com/?p=92</guid>
		<description><![CDATA[In the past few weeks I have experimented with a new workflow based on GIT and Subversion. All our projects are using subversion as version control system, we think that at this time a centralized version control system better suits our needs, however some GIT features maybe very useful to individual developers so I started [...]]]></description>
			<content:encoded><![CDATA[<p>In the past few weeks I have experimented with a new workflow based on GIT and Subversion. All our projects are using subversion as version control system, we think that at this time a centralized version control system better suits our needs, however some GIT features maybe very useful to individual developers so I started to investigate on how to take the best of both worlds and integrate GIT in our Subversion-based workflow.</p>
<p>GIT is a distributed version control system, this means that each developer receives a full copy of the repository, so the first think to do is to create a clone of our repository with GIT. Looking around with Google I found that this is a very simple operation:</p>
<pre>[marco@bridge git] git svn init -s &lt;svn.repository.url&gt;
[marco@bridge git] git svn fetch</pre>
<p>The first command creates a local GIT repository in the current directory and links it to the remote Subversion repository. The second command clones the Subversion repository in the local GIT repository. It may take from few minutes to several hours, depending on the size of the remote repository, but at the end we&#8217;ll have a full copy stored in the GIT repository with branches and tags:</p>
<pre>[marco@bridge git] git branch -a
* master
  remotes/rel_1_00
  remotes/refactorings
  remotes/tags/pre_rel_1_00
  remotes/trunk</pre>
<p>The master branch is the one linked with the remote Subversion trunk folder. Each commit done on the master branch will be sent to Subversion with:</p>
<pre>[marco@bridge git] git svn dcommit</pre>
<p>From time to time you also need to get the latest changes from Subversion and update your local GIT repository. Again this is a very simple operation:</p>
<pre>[marco@bridge git] git svn rebase</pre>
<p>Make sure you are on the master branch and that it is clean, without uncommitted changes, otherwise rebase will not work. The git stash command is very useful in this case, it allows to temporarily move away the current changes without creating a new commit.</p>
<p>Working on the master branch is not different than working directly on a Subversion working-copy, except you have one additional step (dcommit) to do before your changes are sent to the centralized repository. This may actually be an advantage since you can review your commits and use those nice GIT tricks like interactive rebase and amending to clean the commit history.</p>
<p>The main advantage to use GIT however comes with local branches, so I changed my workflow to create a local branch off of master whenever I start working on a feature, commit changes as needed to keep track of progresses, test the code, commit fixes, etc. Then when I&#8217;m satisfied I&#8217;ll merge the branch back to master and send the changes to Subversion with dcommit. Merging is where GIT shows its usefulness. A simple merge will replicate all commits from the local branch to master and consequently on Subversion, polluting the remote history with all local commits, however a merge squash will replicate all changes from the local branch without committing, this allows to do a final review of the changes, fix issues due to merging with more recent code, and commit everything as a single commit. The remote Subversion history will then be clean of all local commits and will show just a single changeset with all changes done on the local branch.</p>
<p>The workflow then is:</p>
<ol>
<li>Create a local branch</li>
<li>Work on the local branch committing as needed</li>
<li>Switch back to master, update from remote Subversion and merge squash from the local branch</li>
<li>Review code, commit and send to Subversion</li>
</ol>
<p>So far this GIT-Subversion workflow works fine. The development tools supporting GIT however doesn&#8217;t support the Subversion integration, so the command line tools are needed most of the times. EGit, the Eclipse GIT integration, is useful to manage the local repository but it is still immature and doesn&#8217;t offer all the options available from the command line tools. Hopefully it will offer a more complete integration in the future.</p>
<p>Links:</p>
<ul>
<li>GIT &#8211; <a href="http://git-scm.com/">http://git-scm.com/</a></li>
<li>Subversion &#8211; <a href="http://subversion.apache.org/">http://subversion.apache.org/</a></li>
<li>EGit &#8211; <a href="http://www.eclipse.org/egit/">http://www.eclipse.org/egit/</a></li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maccasoft.com/2011/10/18/experimenting-with-git-and-subversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JUnit Tests with Eclipse Databinding</title>
		<link>http://www.maccasoft.com/2011/07/14/junit-tests-with-eclipse-databinding/</link>
		<comments>http://www.maccasoft.com/2011/07/14/junit-tests-with-eclipse-databinding/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 09:58:51 +0000</pubDate>
		<dc:creator>Marco Maccaferri</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Databinding]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[JUnit]]></category>

		<guid isPermaLink="false">http://www.maccasoft.com/?p=74</guid>
		<description><![CDATA[When we started to use Eclipse Databinding framework we faced the problem of running JUnit tests against databinding-enabled classes. Databinding requires a default Realm to be defined and all classes must be run from within this realm. The Eclipse framework automatically initializes the default realm at application startup with a code that looks like the [...]]]></description>
			<content:encoded><![CDATA[<p>When we started to use Eclipse Databinding framework we faced the problem of running JUnit tests against databinding-enabled classes. Databinding requires a default Realm to be defined and all classes must be run from within this realm. The Eclipse framework automatically initializes the default realm at application startup with a code that looks like the following (from Workbench.createAndRunWorkbench):</p>
<pre>    Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
        public void run() {
            ULocale.setDefault(new ULocale(Platform.getNL()
                    + Platform.getNLExtensions()));
            // create the workbench instance
            Workbench workbench = new Workbench(display, advisor);
            // run the workbench event loop
            returnCode[0] = workbench.runUI();
        }
    });</pre>
<p>&nbsp;</p>
<p>JUnit allows to override the method used to run all tests defined in a class allowing us to add the code to initialize the default Realm like the above. Following are the two classes we are using to run JUnit tests against databinding-enabled classes.</p>
<p>&nbsp;</p>
<p><strong>JUnit 3</strong></p>
<p>We wrote a DatabindingTestCase class derived from the original TestCase and overrode the run method to add the code to wrap the default realm, test case classes are then derived from DatabindingTestCase instead of TestCase.</p>
<pre>import junit.framework.TestCase;
import junit.framework.TestResult;

import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.swt.widgets.Display;

public class DatabindingTestCase extends TestCase {

    public DatabindingTestCase() {
    }

    public DatabindingTestCase(String name) {
        super(name);
    }

    @Override
    public void run(final TestResult result) {
        Display display = Display.getDefault();
        Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {

            @Override
            public void run() {
                DatabindingTestCase.super.run(result);
            }
        });
    }

    public void testEmpty() throws Exception {
        // To keep JUnit happy
    }
}</pre>
<p>&nbsp;</p>
<p><strong>JUnit 4</strong></p>
<p>A bit more complicated because it uses annotations and test cases aren&#8217;t derived from a base class. In this case we wrote a replacement class runner DatabindingClassRunner  and overrode the run method, just like we did for JUnit 3, test case classes are then annotated with @RunWith(DatabindingClassRunner.class).</p>
<pre>import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.swt.widgets.Display;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.InitializationError;

public class DatabindingClassRunner extends BlockJUnit4ClassRunner {

    public DatabindingClassRunner(Class&lt;?&gt; klass) throws InitializationError {
        super(klass);
    }

    @Override
    public void run(final RunNotifier notifier) {
        Display display = Display.getDefault();
        Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {

            @Override
            public void run() {
                DatabindingClassRunner.super.run(notifier);
            }
        });
    }
}</pre>
<p>&nbsp;</p>
<p>Links:</p>
<p><a title="Eclipse Databinding" href="http://wiki.eclipse.org/index.php/JFace_Data_Binding">http://wiki.eclipse.org/index.php/JFace_Data_Binding</a></p>
<p><a title="JUnit" href="http://www.junit.org/">http://www.junit.org/</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maccasoft.com/2011/07/14/junit-tests-with-eclipse-databinding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse 3.7 Indigo released today</title>
		<link>http://www.maccasoft.com/2011/06/22/eclipse-3-7-indigo-released-today/</link>
		<comments>http://www.maccasoft.com/2011/06/22/eclipse-3-7-indigo-released-today/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 14:12:46 +0000</pubDate>
		<dc:creator>Marco Maccaferri</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.maccasoft.com/?p=63</guid>
		<description><![CDATA[The 3.7 Indigo release of Eclipse projects is now available. This year 62 projects are part of the annual release train, an amazing 23 more projects than past year&#8217;s release Helios. Here are few highlight of the new features found in this release: Jubula provides automated functional GUI testing for Java and HTML WindowBuilder, a [...]]]></description>
			<content:encoded><![CDATA[<p>The 3.7 Indigo release of Eclipse projects is now available. This year 62 projects are part of the annual release train, an amazing 23 more projects than past year&#8217;s release Helios.</p>
<p>Here are few highlight of the new features found in this release:</p>
<ul>
<li><a href="http://www.eclipse.org/jubula">Jubula</a> provides automated functional GUI testing for Java and HTML</li>
<li><a href="http://www.eclipse.org/windowbuilder">WindowBuilder</a>, a popular GUI builder for Eclipse developers, is now open source and part of Indigo</li>
<li><a href="http://www.eclipse.org/egit">EGit 1.0</a> provides tight integration with the Git version control system</li>
<li>Better integration with <a href="http://www.eclipse.org/m2e/">Maven</a>, including starting Maven builds and maintaining pom files</li>
</ul>
<p>We are very excited about this release and we are ready to develop products based on the new SDK.</p>
<p>More informations and downloads:</p>
<p><a title="Eclipse.org" href="http://www.eclipse.org">www.eclipse.org</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maccasoft.com/2011/06/22/eclipse-3-7-indigo-released-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome to our new blog</title>
		<link>http://www.maccasoft.com/2011/06/13/welcome-to-our-new-blog/</link>
		<comments>http://www.maccasoft.com/2011/06/13/welcome-to-our-new-blog/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 13:33:16 +0000</pubDate>
		<dc:creator>Marco Maccaferri</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.maccasoft.com/?p=45</guid>
		<description><![CDATA[We are pleased to welcome you on our new blog. The purpose of this blog is to publish articles about our activities and the technologies we use to develop our products, tips and tricks to make the best use of programming languages, frameworks, working tools, and various other things. Enjoy.]]></description>
			<content:encoded><![CDATA[<p>We are pleased to welcome you on our new blog.</p>
<p>The purpose of this blog is to publish articles about our activities and the technologies we use to develop our products, tips and tricks to make the best use of programming languages, frameworks, working tools, and various other things.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maccasoft.com/2011/06/13/welcome-to-our-new-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

