@Test(expected = SoftwareNotFoundException.class) public void should_throw_exception_if_there_is_no_properties_page() throws Exception { Object resourceCall = client.resource(anyString(), any(Class.class), eq(APPLICATION_XML_TYPE)); when(resourceCall).thenThrow(new ResourceNotFoundException("not found")); 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();  }