use of org.eclipse.sw360.cvesearch.datasource.CveSearchData in project sw360portal by sw360.
the class CveSearchWrapperTest method testLargeData.
@Ignore
@Test
public void testLargeData() throws IOException {
Release release = new ReleaseBuilder().setName("server").get();
Optional<List<CveSearchData>> resultWrapped = cveSearchWrapper.searchForRelease(release);
assert (resultWrapped.isPresent());
assert (resultWrapped.get() != null);
}
use of org.eclipse.sw360.cvesearch.datasource.CveSearchData in project sw360portal by sw360.
the class CveSearchWrapperTest method compareToSearchByCPE.
@Test
public void compareToSearchByCPE() throws IOException {
Release release = new ReleaseBuilder().setName("blindstring").setVendorFullname("blindstring").setVendorShortname("blindstring").setCpe(CPE).get();
List<CveSearchData> resultDirect = cveSearchApi.cvefor(CPE);
Optional<List<CveSearchData>> resultWrapped = cveSearchWrapper.searchForRelease(release);
assert (resultWrapped.isPresent());
assert (resultWrapped.get() != null);
assert (isEquivalent(resultDirect, resultWrapped.get()));
}
use of org.eclipse.sw360.cvesearch.datasource.CveSearchData in project sw360portal by sw360.
the class CveSearchWrapperTest method compareToWithoutWrapper.
@Ignore("meanwhile cveSearchWrapper implementation changed, test maybe suitable for later use")
@Test
public void compareToWithoutWrapper() throws IOException {
Release release = new ReleaseBuilder().setName(PRODUCTNAME).setVendorFullname(VENDORNAME).get();
List<CveSearchData> resultDirect = cveSearchApi.search(VENDORNAME, PRODUCTNAME);
Optional<List<CveSearchData>> resultWrapped = cveSearchWrapper.searchForRelease(release);
assert (resultWrapped.isPresent());
assert (resultWrapped.get() != null);
assert (resultWrapped.get().size() > 0);
assert (isEquivalent(resultDirect, resultWrapped.get()));
}
use of org.eclipse.sw360.cvesearch.datasource.CveSearchData in project sw360portal by sw360.
the class CveSearchDataTranslator method apply.
@Override
public VulnerabilityWithRelation apply(CveSearchData cveSearchData) {
Vulnerability vulnerability = new CveSearchDataToVulnerabilityTranslator().apply(cveSearchData);
ReleaseVulnerabilityRelation relation = new CveSearchDataToReleaseVulnerabilityRelationTranslator().apply(cveSearchData);
return new VulnerabilityWithRelation(vulnerability, relation);
}
use of org.eclipse.sw360.cvesearch.datasource.CveSearchData in project sw360portal by sw360.
the class CveSearchJsonParserTest method singleEmpty.
@Test
public void singleEmpty() {
Object resultO = cveSearchJsonParserSingle.apply(toBufferedReader(SEARCH_RESULT_EMPTY));
CveSearchData result = (CveSearchData) resultO;
}
Aggregations