From fa9481704aa8ba4d74f3d9cacbaa7ef9522de6b9 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 31 May 2018 23:17:12 +0100 Subject: [PATCH] temp comment out classes not referred to in unit tests --- src/main/java/net/kemitix/gitdb/Author.java | 28 +++++------ src/main/java/net/kemitix/gitdb/Branch.java | 20 ++++---- src/main/java/net/kemitix/gitdb/Document.java | 30 ++++++------ src/main/java/net/kemitix/gitdb/GitDB.java | 47 +++++++++---------- .../java/net/kemitix/gitdb/GitDBLocal.java | 35 +++++--------- src/main/java/net/kemitix/gitdb/Key.java | 20 ++++---- src/main/java/net/kemitix/gitdb/Message.java | 18 +++---- .../java/net/kemitix/gitdb/Reference.java | 12 ++--- .../java/net/kemitix/gitdb/Transaction.java | 12 ++--- .../java/net/kemitix/gitdb/GitDBTest.java | 9 ++-- 10 files changed, 110 insertions(+), 121 deletions(-) diff --git a/src/main/java/net/kemitix/gitdb/Author.java b/src/main/java/net/kemitix/gitdb/Author.java index 74dc987..87f05a9 100644 --- a/src/main/java/net/kemitix/gitdb/Author.java +++ b/src/main/java/net/kemitix/gitdb/Author.java @@ -1,17 +1,17 @@ package net.kemitix.gitdb; -import lombok.Getter; -import lombok.RequiredArgsConstructor; +//import lombok.Getter; +//import lombok.RequiredArgsConstructor; -@RequiredArgsConstructor -public class Author { - - @Getter - private final String name; - @Getter - private final String email; - - public static Author name(final String name, final String email) { - return new Author(name, email); - } -} +//@RequiredArgsConstructor +//public class Author { +// +// @Getter +// private final String name; +// @Getter +// private final String email; +// +// public static Author name(final String name, final String email) { +// return new Author(name, email); +// } +//} diff --git a/src/main/java/net/kemitix/gitdb/Branch.java b/src/main/java/net/kemitix/gitdb/Branch.java index 094ef6a..f12ea29 100644 --- a/src/main/java/net/kemitix/gitdb/Branch.java +++ b/src/main/java/net/kemitix/gitdb/Branch.java @@ -1,13 +1,13 @@ package net.kemitix.gitdb; -import net.kemitix.mon.TypeAlias; +//import net.kemitix.mon.TypeAlias; -public class Branch extends TypeAlias { - protected Branch(final String value) { - super(value); - } - - static Branch name(final String name) { - return new Branch(name); - } -} +//public class Branch extends TypeAlias { +// protected Branch(final String value) { +// super(value); +// } +// +// static Branch name(final String name) { +// return new Branch(name); +// } +//} diff --git a/src/main/java/net/kemitix/gitdb/Document.java b/src/main/java/net/kemitix/gitdb/Document.java index 348a66a..6b64c1e 100644 --- a/src/main/java/net/kemitix/gitdb/Document.java +++ b/src/main/java/net/kemitix/gitdb/Document.java @@ -1,18 +1,18 @@ package net.kemitix.gitdb; -import lombok.Getter; -import lombok.RequiredArgsConstructor; +//import lombok.Getter; +//import lombok.RequiredArgsConstructor; -@RequiredArgsConstructor -public class Document { - - public static Document create(Key key, T value) { - return new Document<>(key, value); - } - - @Getter - private final Key key; - - @Getter - private final T value; -} +//@RequiredArgsConstructor +//public class Document { +// +// public static Document create(Key key, T value) { +// return new Document<>(key, value); +// } +// +// @Getter +// private final Key key; +// +// @Getter +// private final T value; +//} diff --git a/src/main/java/net/kemitix/gitdb/GitDB.java b/src/main/java/net/kemitix/gitdb/GitDB.java index 03137b6..dbf1394 100644 --- a/src/main/java/net/kemitix/gitdb/GitDB.java +++ b/src/main/java/net/kemitix/gitdb/GitDB.java @@ -3,22 +3,11 @@ package net.kemitix.gitdb; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.errors.GitAPIException; -import java.io.Closeable; -import java.io.IOException; import java.nio.file.Path; -import java.util.stream.Stream; -public interface GitDB extends Closeable { - - /** - * Open an existing local gitdb. - * - * @param dbDir the path to the local repo - * @return a GitDB instance for the local gitdb - */ - static GitDB local(final Path dbDir) throws IOException { - return new GitDBLocal(Git.open(dbDir.toFile())); - } +public interface GitDB +// extends Closeable +{ /** * Initialise a new local gitdb. @@ -33,15 +22,25 @@ public interface GitDB extends Closeable { .call()); } - /** - * Select a branch. - * - * @param branch the branch to select - * @return a branch within the gitdb - */ - GitDbBranch branch(Branch branch); +// /** +// * Open an existing local gitdb. +// * +// * @param dbDir the path to the local repo +// * @return a GitDB instance for the local gitdb +// */ +// static GitDB local(final Path dbDir) throws IOException { +// return new GitDBLocal(Git.open(dbDir.toFile())); +// } - interface GitDbBranch { +// /** +// * Select a branch. +// * +// * @param branch the branch to select +// * @return a branch within the gitdb +// */ +// GitDbBranch branch(Branch branch); + +// interface GitDbBranch { // String get(Key key); // @@ -57,8 +56,8 @@ public interface GitDB extends Closeable { // // GitDbBranch fork(Branch branch); - } +// } - Stream allBranches(); +// Stream allBranches(); } diff --git a/src/main/java/net/kemitix/gitdb/GitDBLocal.java b/src/main/java/net/kemitix/gitdb/GitDBLocal.java index 9a71689..84a1b2f 100644 --- a/src/main/java/net/kemitix/gitdb/GitDBLocal.java +++ b/src/main/java/net/kemitix/gitdb/GitDBLocal.java @@ -1,36 +1,27 @@ package net.kemitix.gitdb; import lombok.RequiredArgsConstructor; -import lombok.SneakyThrows; import org.eclipse.jgit.api.Git; -import org.eclipse.jgit.api.errors.GitAPIException; -import org.eclipse.jgit.lib.*; -import org.eclipse.jgit.storage.file.FileRepositoryBuilder; - -import java.io.*; -import java.nio.file.Path; -import java.util.Optional; -import java.util.stream.Stream; @RequiredArgsConstructor class GitDBLocal implements GitDB { private final Git git; - @Override - public void close() { - git.close(); - } +// @Override +// public void close() { +// git.close(); +// } - @Override - public GitDbBranch branch(Branch branch) { - return null; - } - - @Override - public Stream allBranches() { - return null; - } +// @Override +// public GitDbBranch branch(Branch branch) { +// return null; +// } +// +// @Override +// public Stream allBranches() { +// return null; +// } // @Override // public String get(Branch branch, Key key) { diff --git a/src/main/java/net/kemitix/gitdb/Key.java b/src/main/java/net/kemitix/gitdb/Key.java index 2aca0f5..6226892 100644 --- a/src/main/java/net/kemitix/gitdb/Key.java +++ b/src/main/java/net/kemitix/gitdb/Key.java @@ -1,13 +1,13 @@ package net.kemitix.gitdb; -import net.kemitix.mon.TypeAlias; +//import net.kemitix.mon.TypeAlias; -public class Key extends TypeAlias { - protected Key(final String value) { - super(value); - } - - public static Key name(final String name) { - return new Key(name); - } -} +//public class Key extends TypeAlias { +// protected Key(final String value) { +// super(value); +// } +// +// public static Key name(final String name) { +// return new Key(name); +// } +//} diff --git a/src/main/java/net/kemitix/gitdb/Message.java b/src/main/java/net/kemitix/gitdb/Message.java index 22902da..116d2cb 100644 --- a/src/main/java/net/kemitix/gitdb/Message.java +++ b/src/main/java/net/kemitix/gitdb/Message.java @@ -1,12 +1,12 @@ package net.kemitix.gitdb; -import net.kemitix.mon.TypeAlias; +//import net.kemitix.mon.TypeAlias; -public class Message extends TypeAlias { - protected Message(final String value) { - super(value); - } - public static Message message(final String message) { - return new Message(message); - } -} +//public class Message extends TypeAlias { +// protected Message(final String value) { +// super(value); +// } +// public static Message message(final String message) { +// return new Message(message); +// } +//} diff --git a/src/main/java/net/kemitix/gitdb/Reference.java b/src/main/java/net/kemitix/gitdb/Reference.java index fb84c69..8c0c726 100644 --- a/src/main/java/net/kemitix/gitdb/Reference.java +++ b/src/main/java/net/kemitix/gitdb/Reference.java @@ -1,9 +1,9 @@ package net.kemitix.gitdb; -import net.kemitix.mon.TypeAlias; +//import net.kemitix.mon.TypeAlias; -public class Reference extends TypeAlias { - protected Reference(String value) { - super(value); - } -} +//public class Reference extends TypeAlias { +// protected Reference(String value) { +// super(value); +// } +//} diff --git a/src/main/java/net/kemitix/gitdb/Transaction.java b/src/main/java/net/kemitix/gitdb/Transaction.java index c396875..375cf80 100644 --- a/src/main/java/net/kemitix/gitdb/Transaction.java +++ b/src/main/java/net/kemitix/gitdb/Transaction.java @@ -1,9 +1,9 @@ package net.kemitix.gitdb; -import net.kemitix.mon.TypeAlias; +//import net.kemitix.mon.TypeAlias; -public class Transaction extends TypeAlias { - protected Transaction(String value) { - super(value); - } -} +//public class Transaction extends TypeAlias { +// protected Transaction(String value) { +// super(value); +// } +//} diff --git a/src/test/java/net/kemitix/gitdb/GitDBTest.java b/src/test/java/net/kemitix/gitdb/GitDBTest.java index 2cb0848..75e1abd 100644 --- a/src/test/java/net/kemitix/gitdb/GitDBTest.java +++ b/src/test/java/net/kemitix/gitdb/GitDBTest.java @@ -8,16 +8,15 @@ import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; -import java.util.UUID; import static org.assertj.core.api.Assertions.assertThat; class GitDBTest { - private final Branch master = Branch.name("master"); - private final Message message = Message.message(UUID.randomUUID().toString()); - private final Key key = Key.name(UUID.randomUUID().toString()); - private final Author author = Author.name("junit", "gitdb@kemitix.net"); +// private final Branch master = Branch.name("master"); +// private final Message message = Message.message(UUID.randomUUID().toString()); +// private final Key key = Key.name(UUID.randomUUID().toString()); +// private final Author author = Author.name("junit", "gitdb@kemitix.net"); // When initialising a repo in a dir that doesn't exist then a bare repo is created @Test