Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.kohsuke.args4j.Option;

/** Driver for {@link CommitGraphCollector}. */
public class CommitIngester {
public class Main {
@Argument(required = true, metaVar = "NAME", usage = "Uniquely identifies this repository within the workspace", index = 0)
public String name;

Expand Down Expand Up @@ -60,10 +60,10 @@ public class CommitIngester {

@VisibleForTesting String launchableToken = null;

public CommitIngester() throws CmdLineException, MalformedURLException {}
public Main() throws CmdLineException, MalformedURLException {}

public static void main(String[] args) throws Exception {
CommitIngester ingester = new CommitIngester();
Main ingester = new Main();
CmdLineParser parser = new CmdLineParser(ingester);
try {
parser.parseArgument(args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@RunWith(Suite.class)
@SuiteClasses({
CommitGraphCollectorTest.class,
CommitIngesterTest.class,
MainTest.class,
FileChunkStreamerTest.class,
SSLBypassTest.class,
ProgressReportingConsumerTest.class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.mockserver.junit.MockServerRule;

@RunWith(JUnit4.class)
public class CommitIngesterTest {
public class MainTest {
@Rule public TemporaryFolder tmp = new TemporaryFolder();
@Rule public MockServerRule mockServerRule = new MockServerRule(this);
private MockServerClient mockServerClient;
Expand Down Expand Up @@ -63,14 +63,14 @@ public void specifySubmodule() throws Exception {
return response().withBody("OK");
});

CommitIngester commitIngester = new CommitIngester();
Main main = new Main();
InetSocketAddress addr = mockServerClient.remoteAddress();
// Specify submodule as the repository. JGit cannot open this directly, so the code should open
// the main repository first, then open the submodule.
commitIngester.repo = new File(mainrepoDir, "sub");
commitIngester.url =
main.repo = new File(mainrepoDir, "sub");
main.url =
new URL(String.format("http://%s:%s/intake/", addr.getHostString(), addr.getPort()));
commitIngester.launchableToken = "v1:testorg/testws:dummy-token";
commitIngester.run();
main.launchableToken = "v1:testorg/testws:dummy-token";
main.run();
}
}
Loading