I’ve built a working Eclipse RCP plugin for Conflict. I’ll demonstrate it by telling a tale of two developers, Josh and Ola. Along way, we’ll fix a "huge" bug in an otherwise perfect testing framework, TestNG.
Once upon a time, Josh was busy producing working software when he noticed a bug in the test reports. Apparently someone on TestNG had typed "Hover the method name" when they really meant "Hover over the method name".
As any other responsible member of the community would do, he checked out the source and submitted a patch.
Index: src/main/org/testng/reporters/SuiteHTMLReporter.java
===================================================================
--- src/main/org/testng/reporters/SuiteHTMLReporter.java (revision 497)
+++ src/main/org/testng/reporters/SuiteHTMLReporter.java (working copy)
@@ -342,7 +342,7 @@
long startDate = -1;
Map<Long, StringBuffer> tables = new HashMap<Long, StringBuffer>();
sb.append("<br/><em>").append(suite.getName()).append("</em><p/>");
- sb.append("<small><i>(Hover the method name to see the test class name)</i></small><p/>\n");
+ sb.append("<small><i>(Hover over the method name to see the test class name)</i></small><p/>\n");
Collection<ITestNGMethod> invokedMethods = suite.getInvokedMethods();
if (alphabetical) {
There was only one problem. One of Josh’s colleagues, Ola, had also checked out the TestNG source and began working hard to fix this bug.
Although neither of these two developers face the chances of a merge (that would a committer), and it's only one line of code - this demonstrates a problem that every developer is familiar with.
Conflict will prevent The Merge
After installing the Conflict RCP plugin (release is soon), go to Window | Show View | Other

In the 'Show View' Dialog box, select "Conflict" under the "Other" node.

You should now see the Conflict view in your Eclipse perspective.

Configuring Conflict preferences is pretty straight forward.

Josh only gets feedback once Ola begins using Conflict as well. Once Josh and Ola's Conflict clients begin communicating via the Conflict server, both can "fail fast" - being notified of the other's conflict before a commit.


0 comments:
Post a Comment