@Override public Source getSource() { return getSource("master"); }
@Test public void hello() throws Exception { final GitHub gitHub = new GitHub(); final GitRepository repository = (GitRepository) gitHub.getRepository("salaboy/drools-workshop", new HashMap<String, String>() {{ put("out-dir", tempPath.getAbsolutePath()); }}); final Source source = repository.getSource("master"); assertNotNull(source); } }
final Optional<Source> source_ = Optional.ofNullable(gitRepository.getSource((gitConfig.getBranch() != null && !gitConfig.getBranch().isEmpty()) ? gitConfig.getBranch() : "master")); if (source_.isPresent()) { Source source = source_.get();
@Test public void sourceCloneTest() throws Exception { final URI uri = URI.create("git://tempx"); final FileSystem fs = FileSystems.newFileSystem(uri, new HashMap<String, Object>() {{ put("init", Boolean.TRUE); put("internal", Boolean.TRUE); put("out-dir", tempPath.getAbsolutePath()); }}); final UFLocal local = new UFLocal(); final GitRepository repository = (GitRepository) local.getRepository("tempx", Collections.emptyMap()); final Source source = repository.getSource("master"); assertNotNull(source); assertEquals(source.getPath().getFileSystem(), fs); } }
@Test public void sourceCloneTest() throws Exception { final URI uri = URI.create("git://tempx"); final FileSystem fs = FileSystems.newFileSystem(uri, new HashMap<String, Object>() {{ put("init", Boolean.TRUE); put("internal", Boolean.TRUE); put("out-dir", tempPath.getAbsolutePath()); }}); final UFLocal local = new UFLocal(); final GitRepository repository = (GitRepository) local.getRepository("tempx", Collections.emptyMap()); final Source source = repository.getSource("master"); assertNotNull(source); assertEquals(source.getPath().getFileSystem(), fs); } }
final Source source = repository.getSource("master");