@Test public void testMatches() throws SVNException { Info info = Mockito.mock(Info.class); Mockito.when(info.getRepositoryRootURL()).thenReturn(SVNURL.parseURIDecoded("http: SvnVcs spy = Mockito.spy(svnVcs); LightVirtualFile file = new LightVirtualFile(); Mockito.doReturn(info).when(spy).getInfo(file); Assert.assertFalse(subversionRevisionFactory.matches(new VcsRoot(spy, file), "location", "alias")); Assert.assertTrue(subversionRevisionFactory.matches(new VcsRoot(spy, file), "http: Assert.assertTrue(subversionRevisionFactory.matches(new VcsRoot(spy, file), "location", "http: }
@Override public boolean matches(VcsRoot vcsRoot, String location, String alias) { SvnVcs svnVcs = (SvnVcs) vcsRoot.getVcs(); String url = svnVcs.getInfo(vcsRoot.getPath()).getRepositoryRootURL().toString(); return url.equals(location) || url.equals(alias); }
SubversionRevisionFactory implements RevisionFactory { @Override public boolean matches(VcsRoot vcsRoot, String location, String alias) { SvnVcs svnVcs = (SvnVcs) vcsRoot.getVcs(); String url = svnVcs.getInfo(vcsRoot.getPath()).getRepositoryRootURL().toString(); return url.equals(location) || url.equals(alias); } }
SubversionRevisionFactory implements RevisionFactory { @Override public boolean matches(VcsRoot vcsRoot, String location, String alias) { SvnVcs svnVcs = (SvnVcs) vcsRoot.getVcs(); String url = svnVcs.getInfo(vcsRoot.getPath()).getRepositoryRootURL().toString(); return url.equals(location) || url.equals(alias); }  }
SubversionRevisionFactory implements RevisionFactory { @Override public boolean matches(VcsRoot vcsRoot, String location, String alias) { SvnVcs svnVcs = (SvnVcs) vcsRoot.getVcs(); String url = svnVcs.getInfo(vcsRoot.getPath()).getRepositoryRootURL().toString(); return url.equals(location) || url.equals(alias); }  @Override VcsRevisionNumber create(String revision); @Override boolean matches(VcsRoot vcsRoot, String location, String alias); @Override String getType(); }
SubversionRevisionFactory implements RevisionFactory { @Override public boolean matches(VcsRoot vcsRoot, String location, String alias) { SvnVcs svnVcs = (SvnVcs) vcsRoot.getVcs(); String url = svnVcs.getInfo(vcsRoot.getPath()).getRepositoryRootURL().toString(); return url.equals(location) || url.equals(alias); }  @Override VcsRevisionNumber create(String revision); @Override boolean matches(VcsRoot vcsRoot, String location, String alias); @Override String getType();  }