Fix DraftPublished and ChangeMerged -> Replication

The Draft Published event is now handled correctly by ensuring that
Gerrit Trigger does not wait for a replicaton event from the slave.

The Change Merged event is now handled correctly by ensuring that we
wait for the replication event for the included patchset on the slave.

These use cases were covered:
- The user merges his/her change to master and there is no change in SHA1
  -- The replication has already occurred.
- The user merges his/her change to master and there is a change in SHA1
since there already other changes merged after the patchset was created.
  -- a new replication takes place and must be waited for.

[FIXED JENKINS-25047]
Merge pull request #185 from scoheb/replication-fixes

Fix DraftPublished and ChangeMerged -> Replication
Wait for expected build number instead the number of build
Migrate HudsonTestCase to JenkinsRule

In the latest release of Jenkins, HudsonTestCase is already deprecated.
Seems some extended tests don't work with the latest Jenkins.

This patch migrates HudsonTestCase to JenkinsRule.
Merge pull request #187 from rinrinne/jenkins-rule

Migrate HudsonTestCase to JenkinsRule