temp comment out classes not referred to in unit tests

This commit is contained in:
Paul Campbell 2018-05-31 23:17:12 +01:00
parent f6aeb1fbb6
commit fa9481704a
10 changed files with 110 additions and 121 deletions

View file

@ -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);
// }
//}

View file

@ -1,13 +1,13 @@
package net.kemitix.gitdb;
import net.kemitix.mon.TypeAlias;
//import net.kemitix.mon.TypeAlias;
public class Branch extends TypeAlias<String> {
protected Branch(final String value) {
super(value);
}
static Branch name(final String name) {
return new Branch(name);
}
}
//public class Branch extends TypeAlias<String> {
// protected Branch(final String value) {
// super(value);
// }
//
// static Branch name(final String name) {
// return new Branch(name);
// }
//}

View file

@ -1,18 +1,18 @@
package net.kemitix.gitdb;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
//import lombok.Getter;
//import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class Document<T> {
public static <T> Document<T> create(Key key, T value) {
return new Document<>(key, value);
}
@Getter
private final Key key;
@Getter
private final T value;
}
//@RequiredArgsConstructor
//public class Document<T> {
//
// public static <T> Document<T> create(Key key, T value) {
// return new Document<>(key, value);
// }
//
// @Getter
// private final Key key;
//
// @Getter
// private final T value;
//}

View file

@ -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<Branch> allBranches();
// Stream<Branch> allBranches();
}

View file

@ -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<Branch> allBranches() {
return null;
}
// @Override
// public GitDbBranch branch(Branch branch) {
// return null;
// }
//
// @Override
// public Stream<Branch> allBranches() {
// return null;
// }
// @Override
// public String get(Branch branch, Key key) {

View file

@ -1,13 +1,13 @@
package net.kemitix.gitdb;
import net.kemitix.mon.TypeAlias;
//import net.kemitix.mon.TypeAlias;
public class Key extends TypeAlias<String> {
protected Key(final String value) {
super(value);
}
public static Key name(final String name) {
return new Key(name);
}
}
//public class Key extends TypeAlias<String> {
// protected Key(final String value) {
// super(value);
// }
//
// public static Key name(final String name) {
// return new Key(name);
// }
//}

View file

@ -1,12 +1,12 @@
package net.kemitix.gitdb;
import net.kemitix.mon.TypeAlias;
//import net.kemitix.mon.TypeAlias;
public class Message extends TypeAlias<String> {
protected Message(final String value) {
super(value);
}
public static Message message(final String message) {
return new Message(message);
}
}
//public class Message extends TypeAlias<String> {
// protected Message(final String value) {
// super(value);
// }
// public static Message message(final String message) {
// return new Message(message);
// }
//}

View file

@ -1,9 +1,9 @@
package net.kemitix.gitdb;
import net.kemitix.mon.TypeAlias;
//import net.kemitix.mon.TypeAlias;
public class Reference extends TypeAlias<String> {
protected Reference(String value) {
super(value);
}
}
//public class Reference extends TypeAlias<String> {
// protected Reference(String value) {
// super(value);
// }
//}

View file

@ -1,9 +1,9 @@
package net.kemitix.gitdb;
import net.kemitix.mon.TypeAlias;
//import net.kemitix.mon.TypeAlias;
public class Transaction extends TypeAlias<String> {
protected Transaction(String value) {
super(value);
}
}
//public class Transaction extends TypeAlias<String> {
// protected Transaction(String value) {
// super(value);
// }
//}

View file

@ -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