Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDariusz Luksza2011-02-21 18:24:17 -0500
committerDariusz Luksza2011-02-23 10:56:44 -0500
commited2bf5517b9f40c78fbe8b66b74f847ddab46f0f (patch)
treec218cf3a64217da0be52ae0448ccb14dd13ac890 /org.eclipse.egit.ui.test/src/org/eclipse/jgit
parent73c0e3f89bf24a7407abb92492df28957a3a73c1 (diff)
downloadegit-ed2bf5517b9f40c78fbe8b66b74f847ddab46f0f.tar.gz
egit-ed2bf5517b9f40c78fbe8b66b74f847ddab46f0f.tar.xz
egit-ed2bf5517b9f40c78fbe8b66b74f847ddab46f0f.zip
[sync] Add tests for GitChangeSetSorter
This change adds tests for GitChangeSetSorter. It also fixes minor issues in this class that were found during writing tests. GitChangeSetSorterTest is fully independent from Eclipse RCP therefore it can be launched as pure JUnit4 test case. MockRevCommit class is added to be able to set commit time without setting up a full git repository, therefore GitChangeSetSorter.shouldOrderCommitsByCommitDate() will fail with ClassNotFoundException when this tests is launched as a plug-in test. Adds proper configurations for launching JUnit tests from maven build. Change-Id: I6b5ca33c042c935bd299a956858528d0bea2989a Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org/eclipse/jgit')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/jgit/revwalk/MockRevCommit.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/jgit/revwalk/MockRevCommit.java b/org.eclipse.egit.ui.test/src/org/eclipse/jgit/revwalk/MockRevCommit.java
new file mode 100644
index 000000000..9ca88faac
--- /dev/null
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/jgit/revwalk/MockRevCommit.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (C) 2011, Dariusz Luksza <dariusz@luksza.org>
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.jgit.revwalk;
+
+import org.eclipse.egit.ui.internal.synchronize.mapping.GitChangeSetSorterTest;
+import org.eclipse.egit.ui.internal.synchronize.model.GitModelCommit;
+
+/**
+ * The only reason of this class existence is to tests {@link GitModelCommit}
+ * ordering in {@link GitChangeSetSorterTest}
+ *
+ * DO NOT USE IT ELSEWERE!
+ */
+public class MockRevCommit extends RevCommit {
+
+ public MockRevCommit(int commitTime) {
+ super(zeroId());
+ this.commitTime = commitTime;
+ }
+
+}

Back to the top