Browse Source

Expose Sets helper to tests outside org.eclipse.jgit.api

A later patch will make use of this class in a org.eclipse.jgit.lib
test.

Change-Id: I2b268e6a5dbf12174201f45259f9f007686708d2
Signed-off-by: Jonathan Nieder <jrn@google.com>
stable-4.1
Jonathan Nieder 10 years ago
parent
commit
adbcbc791b
  1. 1
      org.eclipse.jgit.test/pom.xml
  2. 6
      org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java
  3. 1
      org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java
  4. 1
      org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StatusCommandTest.java

1
org.eclipse.jgit.test/pom.xml

@ -102,6 +102,7 @@
</dependencies> </dependencies>
<build> <build>
<sourceDirectory>src/</sourceDirectory>
<testSourceDirectory>tst/</testSourceDirectory> <testSourceDirectory>tst/</testSourceDirectory>
<testResources> <testResources>

6
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/Sets.java → org.eclipse.jgit.test/src/org/eclipse/jgit/lib/Sets.java

@ -41,13 +41,13 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
package org.eclipse.jgit.api; package org.eclipse.jgit.lib;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
class Sets { public class Sets {
static <T> Set<T> of(T... elements) { public static <T> Set<T> of(T... elements) {
Set<T> ret = new HashSet<T>(); Set<T> ret = new HashSet<T>();
for (T element : elements) for (T element : elements)
ret.add(element); ret.add(element);

1
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java

@ -62,6 +62,7 @@ import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryState; import org.eclipse.jgit.lib.RepositoryState;
import org.eclipse.jgit.lib.Sets;
import org.eclipse.jgit.merge.MergeStrategy; import org.eclipse.jgit.merge.MergeStrategy;
import org.eclipse.jgit.merge.ResolveMerger.MergeFailureReason; import org.eclipse.jgit.merge.ResolveMerger.MergeFailureReason;
import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.revwalk.RevCommit;

1
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/StatusCommandTest.java

@ -53,6 +53,7 @@ import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.NoFilepatternException; import org.eclipse.jgit.api.errors.NoFilepatternException;
import org.eclipse.jgit.errors.NoWorkTreeException; import org.eclipse.jgit.errors.NoWorkTreeException;
import org.eclipse.jgit.junit.RepositoryTestCase; import org.eclipse.jgit.junit.RepositoryTestCase;
import org.eclipse.jgit.lib.Sets;
import org.junit.Test; import org.junit.Test;
public class StatusCommandTest extends RepositoryTestCase { public class StatusCommandTest extends RepositoryTestCase {

Loading…
Cancel
Save