@Test(expected = SoftwareNotFoundException.class) public void should_throw_exception_if_url_is_not_sonar() throws Exception { when(client.exist(anyString(), any(Class.class))).thenReturn(false); URL url = new URL("http: sonar.getSoftwareId(url, properties); }
@Override public SoftwareId getSoftwareId(URL url, Map<String, String> properties) throws SoftwareNotFoundException { checkNotNull(url, "url is mandatory"); if (sonarDetector.isSonarPropertiesPage(url)) { return createSoftwareIdFromProperties(url); } else if (sonarDetector.isSonarWelcomePage(url)) { return createSoftwareIdFromWelcomePage(url); } throw new SoftwareNotFoundException("Url " + url.toString() + " is not compatible with Sonar"); }
SonarPlugin implements VisuwallPlugin<SonarConnection> { @Override public SoftwareId getSoftwareId(URL url, Map<String, String> properties) throws SoftwareNotFoundException { checkNotNull(url, "url is mandatory"); if (sonarDetector.isSonarPropertiesPage(url)) { return createSoftwareIdFromProperties(url); } else if (sonarDetector.isSonarWelcomePage(url)) { return createSoftwareIdFromWelcomePage(url); } throw new SoftwareNotFoundException("Url " + url.toString() + " is not compatible with Sonar"); } }
SonarPlugin implements VisuwallPlugin<SonarConnection> { @Override public SoftwareId getSoftwareId(URL url, Map<String, String> properties) throws SoftwareNotFoundException { checkNotNull(url, "url is mandatory"); if (sonarDetector.isSonarPropertiesPage(url)) { return createSoftwareIdFromProperties(url); } else if (sonarDetector.isSonarWelcomePage(url)) { return createSoftwareIdFromWelcomePage(url); } throw new SoftwareNotFoundException("Url " + url.toString() + " is not compatible with Sonar"); } SonarPlugin(); }
SonarPlugin implements VisuwallPlugin<SonarConnection> { @Override public SoftwareId getSoftwareId(URL url, Map<String, String> properties) throws SoftwareNotFoundException { checkNotNull(url, "url is mandatory"); if (sonarDetector.isSonarPropertiesPage(url)) { return createSoftwareIdFromProperties(url); } else if (sonarDetector.isSonarWelcomePage(url)) { return createSoftwareIdFromWelcomePage(url); } throw new SoftwareNotFoundException("Url " + url.toString() + " is not compatible with Sonar"); } SonarPlugin(); @Override SonarConnection getConnection(URL url, Map<String, String> properties); @Override Class<SonarConnection> getConnectionClass(); @Override String getName(); @Override float getVersion(); @Override SoftwareId getSoftwareId(URL url, Map<String, String> properties); @Override String toString(); @Override Map<String, String> getPropertiesWithDefaultValue(); }
SonarPlugin implements VisuwallPlugin<SonarConnection> { @Override public SoftwareId getSoftwareId(URL url, Map<String, String> properties) throws SoftwareNotFoundException { checkNotNull(url, "url is mandatory"); if (sonarDetector.isSonarPropertiesPage(url)) { return createSoftwareIdFromProperties(url); } else if (sonarDetector.isSonarWelcomePage(url)) { return createSoftwareIdFromWelcomePage(url); } throw new SoftwareNotFoundException("Url " + url.toString() + " is not compatible with Sonar"); } SonarPlugin(); @Override SonarConnection getConnection(URL url, Map<String, String> properties); @Override Class<SonarConnection> getConnectionClass(); @Override String getName(); @Override float getVersion(); @Override SoftwareId getSoftwareId(URL url, Map<String, String> properties); @Override String toString(); @Override Map<String, String> getPropertiesWithDefaultValue();  }