target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void listTopClickStationsWithStream() { List<Station> stations = browser .listTopClickStations() .limit(256) .collect(Collectors.toList()); assertThat(stations, notNullValue()); assertThat(stations, is(not(Collections.emptyList()))); assertThat(stations.size(), is(256)); } | public List<Station> listTopClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topclick"); } | RadioBrowser { public List<Station> listTopClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topclick"); } } | RadioBrowser { public List<Station> listTopClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topclick"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); Ra... | RadioBrowser { public List<Station> listTopClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topclick"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); Ra... | RadioBrowser { public List<Station> listTopClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topclick"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); Ra... |
@Test public void listTopVoteStations() { List<Station> stations = browser.listTopVoteStations(FIVE); assertThat(stations, notNullValue()); assertThat(stations.size(), is(FIVE.getSize())); } | public List<Station> listTopVoteStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topvote"); } | RadioBrowser { public List<Station> listTopVoteStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topvote"); } } | RadioBrowser { public List<Station> listTopVoteStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topvote"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); Radi... | RadioBrowser { public List<Station> listTopVoteStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topvote"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); Radi... | RadioBrowser { public List<Station> listTopVoteStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topvote"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); Radi... |
@Test public void listTopVoteStationsWithStream() { List<Station> stations = browser .listTopVoteStations() .limit(256) .collect(Collectors.toList()); assertThat(stations, notNullValue()); assertThat(stations, is(not(Collections.emptyList()))); assertThat(stations.size(), is(256)); } | public List<Station> listTopVoteStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topvote"); } | RadioBrowser { public List<Station> listTopVoteStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topvote"); } } | RadioBrowser { public List<Station> listTopVoteStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topvote"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); Radi... | RadioBrowser { public List<Station> listTopVoteStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topvote"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); Radi... | RadioBrowser { public List<Station> listTopVoteStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topvote"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); Radi... |
@Test public void listLastClickStations() { List<Station> stations = browser.listLastClickStations(FIVE); assertThat(stations, notNullValue()); assertThat(stations.size(), is(FIVE.getSize())); } | public List<Station> listLastClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastclick"); } | RadioBrowser { public List<Station> listLastClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastclick"); } } | RadioBrowser { public List<Station> listLastClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastclick"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); ... | RadioBrowser { public List<Station> listLastClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastclick"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); ... | RadioBrowser { public List<Station> listLastClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastclick"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); ... |
@Test public void listLastClickStationsWithStream() { List<Station> stations = browser .listLastClickStations() .limit(256) .collect(Collectors.toList()); assertThat(stations, notNullValue()); assertThat(stations, is(not(Collections.emptyList()))); assertThat(stations.size(), is(256)); } | public List<Station> listLastClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastclick"); } | RadioBrowser { public List<Station> listLastClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastclick"); } } | RadioBrowser { public List<Station> listLastClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastclick"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); ... | RadioBrowser { public List<Station> listLastClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastclick"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); ... | RadioBrowser { public List<Station> listLastClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastclick"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); ... |
@Test public void listLastChangedStations() { List<Station> stations = browser.listLastChangedStations(FIVE); assertThat(stations, notNullValue()); assertThat(stations.size(), is(FIRST_FIVE.getLimit())); } | public List<Station> listLastChangedStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastchange"); } | RadioBrowser { public List<Station> listLastChangedStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastchange"); } } | RadioBrowser { public List<Station> listLastChangedStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastchange"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent)... | RadioBrowser { public List<Station> listLastChangedStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastchange"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent)... | RadioBrowser { public List<Station> listLastChangedStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastchange"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent)... |
@Test public void listLastChangedStationsWithStream() { List<Station> stations = browser .listLastChangedStations() .limit(256) .collect(Collectors.toList()); assertThat(stations, notNullValue()); assertThat(stations, is(not(Collections.emptyList()))); assertThat(stations.size(), is(256)); } | public List<Station> listLastChangedStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastchange"); } | RadioBrowser { public List<Station> listLastChangedStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastchange"); } } | RadioBrowser { public List<Station> listLastChangedStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastchange"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent)... | RadioBrowser { public List<Station> listLastChangedStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastchange"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent)... | RadioBrowser { public List<Station> listLastChangedStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/lastchange"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent)... |
@Test public void create() { ListParameter listParameter = ListParameter.create(); assertThat(listParameter, is(not(nullValue()))); } | public static ListParameter create() { return new ListParameter(); } | ListParameter { public static ListParameter create() { return new ListParameter(); } } | ListParameter { public static ListParameter create() { return new ListParameter(); } private ListParameter(); } | ListParameter { public static ListParameter create() { return new ListParameter(); } private ListParameter(); static ListParameter create(); ListParameter order(@NonNull final FieldName fieldName); ListParameter reverseOrder(final boolean reverse); } | ListParameter { public static ListParameter create() { return new ListParameter(); } private ListParameter(); static ListParameter create(); ListParameter order(@NonNull final FieldName fieldName); ListParameter reverseOrder(final boolean reverse); } |
@Test public void getStationByUUID() { List<Station> stations = browser.listStations(FIRST_FIVE); Station first = stations.get(0); Optional<Station> station = browser.getStationByUUID(first.getStationUUID()); assertThat(station.isPresent(), is(true)); assertThat(station.get(), is(first)); } | public Optional<Station> getStationByUUID(@NonNull final UUID uuid) { List<Station> stationList = listStationsBy( Paging.at(0, 1), SearchMode.BYUUID, uuid.toString()); if (stationList.isEmpty()) { return Optional.empty(); } else { return Optional.of(stationList.get(0)); } } | RadioBrowser { public Optional<Station> getStationByUUID(@NonNull final UUID uuid) { List<Station> stationList = listStationsBy( Paging.at(0, 1), SearchMode.BYUUID, uuid.toString()); if (stationList.isEmpty()) { return Optional.empty(); } else { return Optional.of(stationList.get(0)); } } } | RadioBrowser { public Optional<Station> getStationByUUID(@NonNull final UUID uuid) { List<Station> stationList = listStationsBy( Paging.at(0, 1), SearchMode.BYUUID, uuid.toString()); if (stationList.isEmpty()) { return Optional.empty(); } else { return Optional.of(stationList.get(0)); } } RadioBrowser(@NonNull final St... | RadioBrowser { public Optional<Station> getStationByUUID(@NonNull final UUID uuid) { List<Station> stationList = listStationsBy( Paging.at(0, 1), SearchMode.BYUUID, uuid.toString()); if (stationList.isEmpty()) { return Optional.empty(); } else { return Optional.of(stationList.get(0)); } } RadioBrowser(@NonNull final St... | RadioBrowser { public Optional<Station> getStationByUUID(@NonNull final UUID uuid) { List<Station> stationList = listStationsBy( Paging.at(0, 1), SearchMode.BYUUID, uuid.toString()); if (stationList.isEmpty()) { return Optional.empty(); } else { return Optional.of(stationList.get(0)); } } RadioBrowser(@NonNull final St... |
@Test public void listImprovableStations() { List<Station> stations = browser.listImprovableStations(FIVE); assertThat(stations, notNullValue()); assertThat(stations.size(), is(FIVE.getSize())); } | public List<Station> listImprovableStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/improvable"); } | RadioBrowser { public List<Station> listImprovableStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/improvable"); } } | RadioBrowser { public List<Station> listImprovableStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/improvable"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent);... | RadioBrowser { public List<Station> listImprovableStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/improvable"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent);... | RadioBrowser { public List<Station> listImprovableStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/improvable"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent);... |
@Test public void listImprovableStationsWithStream() { List<Station> stations = browser .listImprovableStations() .limit(256) .collect(Collectors.toList()); assertThat(stations, notNullValue()); assertThat(stations, is(not(Collections.emptyList()))); assertThat(stations.size(), is(256)); } | public List<Station> listImprovableStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/improvable"); } | RadioBrowser { public List<Station> listImprovableStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/improvable"); } } | RadioBrowser { public List<Station> listImprovableStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/improvable"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent);... | RadioBrowser { public List<Station> listImprovableStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/improvable"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent);... | RadioBrowser { public List<Station> listImprovableStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/improvable"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent);... |
@Test public void listStationsByWithName() { List<Station> stations = browser.listStationsBy(FIRST_FIVE, SearchMode.BYNAME, "synthradio"); assertThat(stations, notNullValue()); assertThat(stations.size(), is(1)); assertThat(stations.get(0).getUrl(), is("http: } | public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { MultivaluedMap<String, String> requestParams = new MultivaluedHashMap<>(); applyPaging(paging, requestParams); Arrays.stream(listParam).forEach(l -... | RadioBrowser { public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { MultivaluedMap<String, String> requestParams = new MultivaluedHashMap<>(); applyPaging(paging, requestParams); Arrays.stream(listPar... | RadioBrowser { public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { MultivaluedMap<String, String> requestParams = new MultivaluedHashMap<>(); applyPaging(paging, requestParams); Arrays.stream(listPar... | RadioBrowser { public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { MultivaluedMap<String, String> requestParams = new MultivaluedHashMap<>(); applyPaging(paging, requestParams); Arrays.stream(listPar... | RadioBrowser { public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { MultivaluedMap<String, String> requestParams = new MultivaluedHashMap<>(); applyPaging(paging, requestParams); Arrays.stream(listPar... |
@Test public void resolveStreamUrl() throws MalformedURLException { List<Station> stations = browser.listStationsBy(FIRST_FIVE, SearchMode.BYNAME, "synthradio"); URL response = browser.resolveStreamUrl(stations.get(0).getStationUUID()); assertThat(response, notNullValue()); assertThat(response, is(new URL("http: } | public URL resolveStreamUrl(@NonNull final UUID stationUUID) { Response response = null; try { response = builder(webTarget.path("v2/json/url") .path(stationUUID.toString())) .get(); checkResponseStatus(response); log.debug("URI is {}", webTarget.getUri()); try { UrlResponse urlResponse = response.readEntity( UrlRespon... | RadioBrowser { public URL resolveStreamUrl(@NonNull final UUID stationUUID) { Response response = null; try { response = builder(webTarget.path("v2/json/url") .path(stationUUID.toString())) .get(); checkResponseStatus(response); log.debug("URI is {}", webTarget.getUri()); try { UrlResponse urlResponse = response.readEn... | RadioBrowser { public URL resolveStreamUrl(@NonNull final UUID stationUUID) { Response response = null; try { response = builder(webTarget.path("v2/json/url") .path(stationUUID.toString())) .get(); checkResponseStatus(response); log.debug("URI is {}", webTarget.getUri()); try { UrlResponse urlResponse = response.readEn... | RadioBrowser { public URL resolveStreamUrl(@NonNull final UUID stationUUID) { Response response = null; try { response = builder(webTarget.path("v2/json/url") .path(stationUUID.toString())) .get(); checkResponseStatus(response); log.debug("URI is {}", webTarget.getUri()); try { UrlResponse urlResponse = response.readEn... | RadioBrowser { public URL resolveStreamUrl(@NonNull final UUID stationUUID) { Response response = null; try { response = builder(webTarget.path("v2/json/url") .path(stationUUID.toString())) .get(); checkResponseStatus(response); log.debug("URI is {}", webTarget.getUri()); try { UrlResponse urlResponse = response.readEn... |
@Test public void listStationsBy() { List<Station> stations = browser.listStationsBy(FIRST_FIVE, SearchMode.BYNAME, "ding"); assertThat(stations, notNullValue()); assertThat(stations.size(), is(FIRST_FIVE.getLimit())); assertThat(stations.get(0).getName().toLowerCase(), containsString("ding")); } | public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { MultivaluedMap<String, String> requestParams = new MultivaluedHashMap<>(); applyPaging(paging, requestParams); Arrays.stream(listParam).forEach(l -... | RadioBrowser { public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { MultivaluedMap<String, String> requestParams = new MultivaluedHashMap<>(); applyPaging(paging, requestParams); Arrays.stream(listPar... | RadioBrowser { public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { MultivaluedMap<String, String> requestParams = new MultivaluedHashMap<>(); applyPaging(paging, requestParams); Arrays.stream(listPar... | RadioBrowser { public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { MultivaluedMap<String, String> requestParams = new MultivaluedHashMap<>(); applyPaging(paging, requestParams); Arrays.stream(listPar... | RadioBrowser { public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { MultivaluedMap<String, String> requestParams = new MultivaluedHashMap<>(); applyPaging(paging, requestParams); Arrays.stream(listPar... |
@Test public void listStationsByWithStream() { List<Station> stations = browser .listStationsBy(SearchMode.BYNAME, "pop") .limit(256) .collect(Collectors.toList()); assertThat(stations, notNullValue()); assertThat(stations, is(not(Collections.emptyList()))); } | public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { MultivaluedMap<String, String> requestParams = new MultivaluedHashMap<>(); applyPaging(paging, requestParams); Arrays.stream(listParam).forEach(l -... | RadioBrowser { public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { MultivaluedMap<String, String> requestParams = new MultivaluedHashMap<>(); applyPaging(paging, requestParams); Arrays.stream(listPar... | RadioBrowser { public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { MultivaluedMap<String, String> requestParams = new MultivaluedHashMap<>(); applyPaging(paging, requestParams); Arrays.stream(listPar... | RadioBrowser { public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { MultivaluedMap<String, String> requestParams = new MultivaluedHashMap<>(); applyPaging(paging, requestParams); Arrays.stream(listPar... | RadioBrowser { public List<Station> listStationsBy(@NonNull final Paging paging, @NonNull final SearchMode searchMode, @NonNull final String searchTerm, final ListParameter...listParam) { MultivaluedMap<String, String> requestParams = new MultivaluedHashMap<>(); applyPaging(paging, requestParams); Arrays.stream(listPar... |
@Ignore @Test(expected = RadioBrowserException.class) public void postNewWithFail() { Station station = new Station(); station.setHomepage("https: station.setName(TEST_NAME); station.setFavicon("https: browser.postNewStation(station); } | public UUID postNewStation(@NonNull final Station station) { return postNewOrEditStation(station, "json/add"); } | RadioBrowser { public UUID postNewStation(@NonNull final Station station) { return postNewOrEditStation(station, "json/add"); } } | RadioBrowser { public UUID postNewStation(@NonNull final Station station) { return postNewOrEditStation(station, "json/add"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); RadioBrowser(final int timeout,
... | RadioBrowser { public UUID postNewStation(@NonNull final Station station) { return postNewOrEditStation(station, "json/add"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); RadioBrowser(final int timeout,
... | RadioBrowser { public UUID postNewStation(@NonNull final Station station) { return postNewOrEditStation(station, "json/add"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); RadioBrowser(final int timeout,
... |
@Test public void postNewWithSuccess() { Station station = new Station(); station.setUrl("https: station.setHomepage("https: station.setName(TEST_NAME); station.setFavicon("https: UUID id = browser.postNewStation(station); assertThat(id, is(not(nullValue()))); } | public UUID postNewStation(@NonNull final Station station) { return postNewOrEditStation(station, "json/add"); } | RadioBrowser { public UUID postNewStation(@NonNull final Station station) { return postNewOrEditStation(station, "json/add"); } } | RadioBrowser { public UUID postNewStation(@NonNull final Station station) { return postNewOrEditStation(station, "json/add"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); RadioBrowser(final int timeout,
... | RadioBrowser { public UUID postNewStation(@NonNull final Station station) { return postNewOrEditStation(station, "json/add"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); RadioBrowser(final int timeout,
... | RadioBrowser { public UUID postNewStation(@NonNull final Station station) { return postNewOrEditStation(station, "json/add"); } RadioBrowser(@NonNull final String apiUrl,
final int timeout,
@NonNull final String myUserAgent); RadioBrowser(final int timeout,
... |
@Test public void testPagingSpliterator() { PagingSpliterator<Integer> integerPagingSpliterator = new PagingSpliterator<>( paging -> { List<Integer> data; if (paging.getOffset() < 100) { data = IntStream.range(paging.getOffset(), paging.getOffset() + paging.getLimit()) .boxed() .collect(Collectors.toList()); if (data.s... | PagingSpliterator(final Function<Paging, List<T>> fetchPageFunction) { super(Long.MAX_VALUE, 0); currentPage = Paging.at(0, FETCH_SIZE_DEFAULT); this.fetchPage = fetchPageFunction; loadPage(); } | PagingSpliterator extends Spliterators.AbstractSpliterator<T> { PagingSpliterator(final Function<Paging, List<T>> fetchPageFunction) { super(Long.MAX_VALUE, 0); currentPage = Paging.at(0, FETCH_SIZE_DEFAULT); this.fetchPage = fetchPageFunction; loadPage(); } } | PagingSpliterator extends Spliterators.AbstractSpliterator<T> { PagingSpliterator(final Function<Paging, List<T>> fetchPageFunction) { super(Long.MAX_VALUE, 0); currentPage = Paging.at(0, FETCH_SIZE_DEFAULT); this.fetchPage = fetchPageFunction; loadPage(); } PagingSpliterator(final Function<Paging, List<T>> fetchPageFu... | PagingSpliterator extends Spliterators.AbstractSpliterator<T> { PagingSpliterator(final Function<Paging, List<T>> fetchPageFunction) { super(Long.MAX_VALUE, 0); currentPage = Paging.at(0, FETCH_SIZE_DEFAULT); this.fetchPage = fetchPageFunction; loadPage(); } PagingSpliterator(final Function<Paging, List<T>> fetchPageFu... | PagingSpliterator extends Spliterators.AbstractSpliterator<T> { PagingSpliterator(final Function<Paging, List<T>> fetchPageFunction) { super(Long.MAX_VALUE, 0); currentPage = Paging.at(0, FETCH_SIZE_DEFAULT); this.fetchPage = fetchPageFunction; loadPage(); } PagingSpliterator(final Function<Paging, List<T>> fetchPageFu... |
@Test public void at() { Paging paging = Paging.at(0, 1); assertThat(paging.getOffset(), is(0)); assertThat(paging.getLimit(), is(1)); } | public static Paging at(final int offset, final int limit) { return new Paging(offset, limit); } | Paging { public static Paging at(final int offset, final int limit) { return new Paging(offset, limit); } } | Paging { public static Paging at(final int offset, final int limit) { return new Paging(offset, limit); } private Paging(final int myOffset, final int myLimit); } | Paging { public static Paging at(final int offset, final int limit) { return new Paging(offset, limit); } private Paging(final int myOffset, final int myLimit); static Paging at(final int offset, final int limit); Paging previous(); Paging next(); } | Paging { public static Paging at(final int offset, final int limit) { return new Paging(offset, limit); } private Paging(final int myOffset, final int myLimit); static Paging at(final int offset, final int limit); Paging previous(); Paging next(); static final Paging DEFAULT_START; } |
@Test(expected = IllegalArgumentException.class) public void atWithZeroLimit() { Paging.at(0, 0); } | public static Paging at(final int offset, final int limit) { return new Paging(offset, limit); } | Paging { public static Paging at(final int offset, final int limit) { return new Paging(offset, limit); } } | Paging { public static Paging at(final int offset, final int limit) { return new Paging(offset, limit); } private Paging(final int myOffset, final int myLimit); } | Paging { public static Paging at(final int offset, final int limit) { return new Paging(offset, limit); } private Paging(final int myOffset, final int myLimit); static Paging at(final int offset, final int limit); Paging previous(); Paging next(); } | Paging { public static Paging at(final int offset, final int limit) { return new Paging(offset, limit); } private Paging(final int myOffset, final int myLimit); static Paging at(final int offset, final int limit); Paging previous(); Paging next(); static final Paging DEFAULT_START; } |
@Test(expected = IllegalArgumentException.class) public void atWithNegativeOffset() { Paging.at(-1, 1); } | public static Paging at(final int offset, final int limit) { return new Paging(offset, limit); } | Paging { public static Paging at(final int offset, final int limit) { return new Paging(offset, limit); } } | Paging { public static Paging at(final int offset, final int limit) { return new Paging(offset, limit); } private Paging(final int myOffset, final int myLimit); } | Paging { public static Paging at(final int offset, final int limit) { return new Paging(offset, limit); } private Paging(final int myOffset, final int myLimit); static Paging at(final int offset, final int limit); Paging previous(); Paging next(); } | Paging { public static Paging at(final int offset, final int limit) { return new Paging(offset, limit); } private Paging(final int myOffset, final int myLimit); static Paging at(final int offset, final int limit); Paging previous(); Paging next(); static final Paging DEFAULT_START; } |
@Test public void next() { Paging pagingFirst = Paging.at(0, 64); Paging next = pagingFirst.next(); assertThat(next.getOffset(), is(64)); assertThat(next.getLimit(), is(64)); } | public Paging next() { return new Paging(offset + limit, limit); } | Paging { public Paging next() { return new Paging(offset + limit, limit); } } | Paging { public Paging next() { return new Paging(offset + limit, limit); } private Paging(final int myOffset, final int myLimit); } | Paging { public Paging next() { return new Paging(offset + limit, limit); } private Paging(final int myOffset, final int myLimit); static Paging at(final int offset, final int limit); Paging previous(); Paging next(); } | Paging { public Paging next() { return new Paging(offset + limit, limit); } private Paging(final int myOffset, final int myLimit); static Paging at(final int offset, final int limit); Paging previous(); Paging next(); static final Paging DEFAULT_START; } |
@Test public void previous() { Paging pagingFirst = Paging.at(64, 32); Paging next = pagingFirst.previous(); assertThat(next.getOffset(), is(64 - 32 )); assertThat(next.getLimit(), is(32)); } | public Paging previous() { int newOffset = offset - limit; if (newOffset < 0) { newOffset = 0; } return new Paging(newOffset, limit); } | Paging { public Paging previous() { int newOffset = offset - limit; if (newOffset < 0) { newOffset = 0; } return new Paging(newOffset, limit); } } | Paging { public Paging previous() { int newOffset = offset - limit; if (newOffset < 0) { newOffset = 0; } return new Paging(newOffset, limit); } private Paging(final int myOffset, final int myLimit); } | Paging { public Paging previous() { int newOffset = offset - limit; if (newOffset < 0) { newOffset = 0; } return new Paging(newOffset, limit); } private Paging(final int myOffset, final int myLimit); static Paging at(final int offset, final int limit); Paging previous(); Paging next(); } | Paging { public Paging previous() { int newOffset = offset - limit; if (newOffset < 0) { newOffset = 0; } return new Paging(newOffset, limit); } private Paging(final int myOffset, final int myLimit); static Paging at(final int offset, final int limit); Paging previous(); Paging next(); static final Paging DEFAULT_STAR... |
@Test public void apiUrls(@Mocked InetAddress inetAddressMock) throws UnknownHostException { InetAddress[] inetAddresses = new InetAddress[1]; inetAddresses[0] = inetAddressMock; new Expectations() {{ InetAddress.getAllByName(EndpointDiscovery.DNS_API_ADDRESS); result = inetAddresses; inetAddressMock.getCanonicalHostNa... | List<String> apiUrls() throws UnknownHostException { InetAddress[] addresses = InetAddress.getAllByName(DNS_API_ADDRESS); List<String> fqdns = new ArrayList<>(); for (InetAddress inetAddress : addresses) { fqdns.add(inetAddress.getCanonicalHostName()); } return fqdns.stream() .map(s -> String.format("https: .collect(Co... | EndpointDiscovery { List<String> apiUrls() throws UnknownHostException { InetAddress[] addresses = InetAddress.getAllByName(DNS_API_ADDRESS); List<String> fqdns = new ArrayList<>(); for (InetAddress inetAddress : addresses) { fqdns.add(inetAddress.getCanonicalHostName()); } return fqdns.stream() .map(s -> String.format... | EndpointDiscovery { List<String> apiUrls() throws UnknownHostException { InetAddress[] addresses = InetAddress.getAllByName(DNS_API_ADDRESS); List<String> fqdns = new ArrayList<>(); for (InetAddress inetAddress : addresses) { fqdns.add(inetAddress.getCanonicalHostName()); } return fqdns.stream() .map(s -> String.format... | EndpointDiscovery { List<String> apiUrls() throws UnknownHostException { InetAddress[] addresses = InetAddress.getAllByName(DNS_API_ADDRESS); List<String> fqdns = new ArrayList<>(); for (InetAddress inetAddress : addresses) { fqdns.add(inetAddress.getCanonicalHostName()); } return fqdns.stream() .map(s -> String.format... | EndpointDiscovery { List<String> apiUrls() throws UnknownHostException { InetAddress[] addresses = InetAddress.getAllByName(DNS_API_ADDRESS); List<String> fqdns = new ArrayList<>(); for (InetAddress inetAddress : addresses) { fqdns.add(inetAddress.getCanonicalHostName()); } return fqdns.stream() .map(s -> String.format... |
@Test public void discoverApiUrls(@Mocked Client clientMock, @Mocked ClientBuilder clientBuilderMock, @Mocked WebTarget webTargetMock) { new Expectations() {{ ClientBuilder.newBuilder(); result = clientBuilderMock; clientBuilderMock.build(); result = clientMock; clientMock.target("https: }}; List<EndpointDiscovery.Disc... | List<DiscoveryResult> discoverApiUrls(final List<String> apiUrls) { ExecutorService executorService = Executors.newFixedThreadPool(DEFAULT_THREADS); try { List<Future<DiscoveryResult>> futureList = new ArrayList<>(); for (final String apiUrl : apiUrls) { Callable<DiscoveryResult> discoveryResultCallable = () -> { long ... | EndpointDiscovery { List<DiscoveryResult> discoverApiUrls(final List<String> apiUrls) { ExecutorService executorService = Executors.newFixedThreadPool(DEFAULT_THREADS); try { List<Future<DiscoveryResult>> futureList = new ArrayList<>(); for (final String apiUrl : apiUrls) { Callable<DiscoveryResult> discoveryResultCall... | EndpointDiscovery { List<DiscoveryResult> discoverApiUrls(final List<String> apiUrls) { ExecutorService executorService = Executors.newFixedThreadPool(DEFAULT_THREADS); try { List<Future<DiscoveryResult>> futureList = new ArrayList<>(); for (final String apiUrl : apiUrls) { Callable<DiscoveryResult> discoveryResultCall... | EndpointDiscovery { List<DiscoveryResult> discoverApiUrls(final List<String> apiUrls) { ExecutorService executorService = Executors.newFixedThreadPool(DEFAULT_THREADS); try { List<Future<DiscoveryResult>> futureList = new ArrayList<>(); for (final String apiUrl : apiUrls) { Callable<DiscoveryResult> discoveryResultCall... | EndpointDiscovery { List<DiscoveryResult> discoverApiUrls(final List<String> apiUrls) { ExecutorService executorService = Executors.newFixedThreadPool(DEFAULT_THREADS); try { List<Future<DiscoveryResult>> futureList = new ArrayList<>(); for (final String apiUrl : apiUrls) { Callable<DiscoveryResult> discoveryResultCall... |
@Test public void testRevisionNameSerializer() throws IOException { RevisionName value = null; try { serializer.serialize( value ); fail(); } catch ( Exception e ) { } value = new RevisionName( 1L, null ); byte[] result = serializer.serialize( value ); assertEquals( 12, result.length ); assertEquals( 1L, ( long ) LongS... | private RevisionNameSerializer() { super( RevisionNameComparator.INSTANCE ); } | RevisionNameSerializer extends AbstractElementSerializer<RevisionName> { private RevisionNameSerializer() { super( RevisionNameComparator.INSTANCE ); } } | RevisionNameSerializer extends AbstractElementSerializer<RevisionName> { private RevisionNameSerializer() { super( RevisionNameComparator.INSTANCE ); } private RevisionNameSerializer(); } | RevisionNameSerializer extends AbstractElementSerializer<RevisionName> { private RevisionNameSerializer() { super( RevisionNameComparator.INSTANCE ); } private RevisionNameSerializer(); RevisionName fromBytes( byte[] in ); RevisionName fromBytes( byte[] in, int start ); @Override byte[] serialize( RevisionName revisio... | RevisionNameSerializer extends AbstractElementSerializer<RevisionName> { private RevisionNameSerializer() { super( RevisionNameComparator.INSTANCE ); } private RevisionNameSerializer(); RevisionName fromBytes( byte[] in ); RevisionName fromBytes( byte[] in, int start ); @Override byte[] serialize( RevisionName revisio... |
@Test public void testPersistedBulkLoadComputeLeafLevel() throws IOException, KeyNotFoundException, BTreeAlreadyManagedException { Random random = new Random( System.currentTimeMillis() ); File file = File.createTempFile( "managedbtreebuilder", ".data" ); file.deleteOnExit(); try { RecordManager rm = new RecordManager(... | static <K, V> LevelInfo<K, V> computeLevel( BTree<K, V> btree, int nbElems, LevelEnum levelType ) { int pageSize = btree.getPageSize(); int incrementNode = 0; if ( levelType == LevelEnum.NODE ) { incrementNode = 1; } LevelInfo<K, V> level = new LevelInfo<K, V>(); level.setType( ( levelType == LevelEnum.NODE ) ); level.... | BulkLoader { static <K, V> LevelInfo<K, V> computeLevel( BTree<K, V> btree, int nbElems, LevelEnum levelType ) { int pageSize = btree.getPageSize(); int incrementNode = 0; if ( levelType == LevelEnum.NODE ) { incrementNode = 1; } LevelInfo<K, V> level = new LevelInfo<K, V>(); level.setType( ( levelType == LevelEnum.NOD... | BulkLoader { static <K, V> LevelInfo<K, V> computeLevel( BTree<K, V> btree, int nbElems, LevelEnum levelType ) { int pageSize = btree.getPageSize(); int incrementNode = 0; if ( levelType == LevelEnum.NODE ) { incrementNode = 1; } LevelInfo<K, V> level = new LevelInfo<K, V>(); level.setType( ( levelType == LevelEnum.NOD... | BulkLoader { static <K, V> LevelInfo<K, V> computeLevel( BTree<K, V> btree, int nbElems, LevelEnum levelType ) { int pageSize = btree.getPageSize(); int incrementNode = 0; if ( levelType == LevelEnum.NODE ) { incrementNode = 1; } LevelInfo<K, V> level = new LevelInfo<K, V>(); level.setType( ( levelType == LevelEnum.NOD... | BulkLoader { static <K, V> LevelInfo<K, V> computeLevel( BTree<K, V> btree, int nbElems, LevelEnum levelType ) { int pageSize = btree.getPageSize(); int incrementNode = 0; if ( levelType == LevelEnum.NODE ) { incrementNode = 1; } LevelInfo<K, V> level = new LevelInfo<K, V>(); level.setType( ( levelType == LevelEnum.NOD... |
@Test public void testPersistedBulkLoadComputeNodeLevel() throws IOException, KeyNotFoundException, BTreeAlreadyManagedException { Random random = new Random( System.currentTimeMillis() ); File file = File.createTempFile( "managedbtreebuilder", ".data" ); file.deleteOnExit(); try { RecordManager rm = new RecordManager(... | static <K, V> LevelInfo<K, V> computeLevel( BTree<K, V> btree, int nbElems, LevelEnum levelType ) { int pageSize = btree.getPageSize(); int incrementNode = 0; if ( levelType == LevelEnum.NODE ) { incrementNode = 1; } LevelInfo<K, V> level = new LevelInfo<K, V>(); level.setType( ( levelType == LevelEnum.NODE ) ); level.... | BulkLoader { static <K, V> LevelInfo<K, V> computeLevel( BTree<K, V> btree, int nbElems, LevelEnum levelType ) { int pageSize = btree.getPageSize(); int incrementNode = 0; if ( levelType == LevelEnum.NODE ) { incrementNode = 1; } LevelInfo<K, V> level = new LevelInfo<K, V>(); level.setType( ( levelType == LevelEnum.NOD... | BulkLoader { static <K, V> LevelInfo<K, V> computeLevel( BTree<K, V> btree, int nbElems, LevelEnum levelType ) { int pageSize = btree.getPageSize(); int incrementNode = 0; if ( levelType == LevelEnum.NODE ) { incrementNode = 1; } LevelInfo<K, V> level = new LevelInfo<K, V>(); level.setType( ( levelType == LevelEnum.NOD... | BulkLoader { static <K, V> LevelInfo<K, V> computeLevel( BTree<K, V> btree, int nbElems, LevelEnum levelType ) { int pageSize = btree.getPageSize(); int incrementNode = 0; if ( levelType == LevelEnum.NODE ) { incrementNode = 1; } LevelInfo<K, V> level = new LevelInfo<K, V>(); level.setType( ( levelType == LevelEnum.NOD... | BulkLoader { static <K, V> LevelInfo<K, V> computeLevel( BTree<K, V> btree, int nbElems, LevelEnum levelType ) { int pageSize = btree.getPageSize(); int incrementNode = 0; if ( levelType == LevelEnum.NODE ) { incrementNode = 1; } LevelInfo<K, V> level = new LevelInfo<K, V>(); level.setType( ( levelType == LevelEnum.NOD... |
@Test public void testPersistedBulkLoadComputeLevels() throws IOException, KeyNotFoundException, BTreeAlreadyManagedException { Random random = new Random( System.currentTimeMillis() ); File file = File.createTempFile( "managedbtreebuilder", ".data" ); file.deleteOnExit(); try { RecordManager rm = new RecordManager( fi... | static <K, V> List<LevelInfo<K, V>> computeLevels( BTree<K, V> btree, int nbElems ) { List<LevelInfo<K, V>> levelList = new ArrayList<LevelInfo<K, V>>(); LevelInfo<K, V> leafLevel = computeLevel( btree, nbElems, LevelEnum.LEAF ); levelList.add( leafLevel ); int nbPages = leafLevel.getNbPages(); int levelNumber = 1; whi... | BulkLoader { static <K, V> List<LevelInfo<K, V>> computeLevels( BTree<K, V> btree, int nbElems ) { List<LevelInfo<K, V>> levelList = new ArrayList<LevelInfo<K, V>>(); LevelInfo<K, V> leafLevel = computeLevel( btree, nbElems, LevelEnum.LEAF ); levelList.add( leafLevel ); int nbPages = leafLevel.getNbPages(); int levelNu... | BulkLoader { static <K, V> List<LevelInfo<K, V>> computeLevels( BTree<K, V> btree, int nbElems ) { List<LevelInfo<K, V>> levelList = new ArrayList<LevelInfo<K, V>>(); LevelInfo<K, V> leafLevel = computeLevel( btree, nbElems, LevelEnum.LEAF ); levelList.add( leafLevel ); int nbPages = leafLevel.getNbPages(); int levelNu... | BulkLoader { static <K, V> List<LevelInfo<K, V>> computeLevels( BTree<K, V> btree, int nbElems ) { List<LevelInfo<K, V>> levelList = new ArrayList<LevelInfo<K, V>>(); LevelInfo<K, V> leafLevel = computeLevel( btree, nbElems, LevelEnum.LEAF ); levelList.add( leafLevel ); int nbPages = leafLevel.getNbPages(); int levelNu... | BulkLoader { static <K, V> List<LevelInfo<K, V>> computeLevels( BTree<K, V> btree, int nbElems ) { List<LevelInfo<K, V>> levelList = new ArrayList<LevelInfo<K, V>>(); LevelInfo<K, V> leafLevel = computeLevel( btree, nbElems, LevelEnum.LEAF ); levelList.add( leafLevel ); int nbPages = leafLevel.getNbPages(); int levelNu... |
@Test public void testPersistedBulkLoad1000ElementsMultipleValues() throws IOException, KeyNotFoundException, BTreeAlreadyManagedException { for ( int i = 1; i < 1001; i++ ) { Random random = new Random( System.currentTimeMillis() ); File file = File.createTempFile( "managedbtreebuilder", ".data" ); file.deleteOnExit()... | public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new ArrayList<File... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... |
@Test public void testPersistedBulkLoad1000ElementsMultipleValuesDebug() throws IOException, KeyNotFoundException, BTreeAlreadyManagedException { Random random = new Random( System.currentTimeMillis() ); File file = File.createTempFile( "managedbtreebuilder", ".data" ); file.deleteOnExit(); try { RecordManager rm = new... | public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new ArrayList<File... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... |
@Test public void testDebug() throws IOException { final List<Tuple<Long, String>> listTuples = new ArrayList<Tuple<Long, String>>(); listTuples.add( new Tuple<Long, String>( 0L, "V0" ) ); listTuples.add( new Tuple<Long, String>( -14L, "V1" ) ); listTuples.add( new Tuple<Long, String>( 7L, "V2" ) ); listTuples.add( new... | public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new ArrayList<File... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... |
@Test public void testDeleteFromEmptyLeaf() throws IOException { InMemoryLeaf<Long, String> leaf = new InMemoryLeaf<Long, String>( btree ); DeleteResult<Long, String> result = leaf.delete( 1L, null, 1L, null, -1 ); assertEquals( NotPresentResult.NOT_PRESENT, result ); } | @SuppressWarnings("unchecked") DeleteResult<K, V> delete( K key, V value, long revision, Page<K, V> parent, int parentPos ) throws IOException { if ( nbElems == 0 ) { return NotPresentResult.NOT_PRESENT; } int pos = findPos( key ); if ( pos >= 0 ) { return NotPresentResult.NOT_PRESENT; } Tuple<K, V> removedElement = nu... | InMemoryLeaf extends AbstractPage<K, V> { @SuppressWarnings("unchecked") DeleteResult<K, V> delete( K key, V value, long revision, Page<K, V> parent, int parentPos ) throws IOException { if ( nbElems == 0 ) { return NotPresentResult.NOT_PRESENT; } int pos = findPos( key ); if ( pos >= 0 ) { return NotPresentResult.NOT_... | InMemoryLeaf extends AbstractPage<K, V> { @SuppressWarnings("unchecked") DeleteResult<K, V> delete( K key, V value, long revision, Page<K, V> parent, int parentPos ) throws IOException { if ( nbElems == 0 ) { return NotPresentResult.NOT_PRESENT; } int pos = findPos( key ); if ( pos >= 0 ) { return NotPresentResult.NOT_... | InMemoryLeaf extends AbstractPage<K, V> { @SuppressWarnings("unchecked") DeleteResult<K, V> delete( K key, V value, long revision, Page<K, V> parent, int parentPos ) throws IOException { if ( nbElems == 0 ) { return NotPresentResult.NOT_PRESENT; } int pos = findPos( key ); if ( pos >= 0 ) { return NotPresentResult.NOT_... | InMemoryLeaf extends AbstractPage<K, V> { @SuppressWarnings("unchecked") DeleteResult<K, V> delete( K key, V value, long revision, Page<K, V> parent, int parentPos ) throws IOException { if ( nbElems == 0 ) { return NotPresentResult.NOT_PRESENT; } int pos = findPos( key ); if ( pos >= 0 ) { return NotPresentResult.NOT_... |
@Test public void testFindPos() throws Exception { InMemoryLeaf<Long, String> leaf = new InMemoryLeaf<Long, String>( btree ); for ( long i = 0; i < 8; i++ ) { long value = i + i + 1; leaf = ( InMemoryLeaf<Long, String> ) ( ( ModifyResult<Long, String> ) leaf.insert( value, "V" + value, 0L ) ) .getModifiedPage(); } for ... | public InsertResult<K, V> insert( K key, V value, long revision ) throws IOException { int pos = findPos( key ); if ( pos < 0 ) { int index = -( pos + 1 ); InsertResult<K, V> result = replaceElement( revision, key, value, index ); return result; } if ( nbElems < btree.getPageSize() ) { Page<K, V> modifiedPage = addElem... | InMemoryLeaf extends AbstractPage<K, V> { public InsertResult<K, V> insert( K key, V value, long revision ) throws IOException { int pos = findPos( key ); if ( pos < 0 ) { int index = -( pos + 1 ); InsertResult<K, V> result = replaceElement( revision, key, value, index ); return result; } if ( nbElems < btree.getPageSi... | InMemoryLeaf extends AbstractPage<K, V> { public InsertResult<K, V> insert( K key, V value, long revision ) throws IOException { int pos = findPos( key ); if ( pos < 0 ) { int index = -( pos + 1 ); InsertResult<K, V> result = replaceElement( revision, key, value, index ); return result; } if ( nbElems < btree.getPageSi... | InMemoryLeaf extends AbstractPage<K, V> { public InsertResult<K, V> insert( K key, V value, long revision ) throws IOException { int pos = findPos( key ); if ( pos < 0 ) { int index = -( pos + 1 ); InsertResult<K, V> result = replaceElement( revision, key, value, index ); return result; } if ( nbElems < btree.getPageSi... | InMemoryLeaf extends AbstractPage<K, V> { public InsertResult<K, V> insert( K key, V value, long revision ) throws IOException { int pos = findPos( key ); if ( pos < 0 ) { int index = -( pos + 1 ); InsertResult<K, V> result = replaceElement( revision, key, value, index ); return result; } if ( nbElems < btree.getPageSi... |
@Test public void testLongSerializer() throws IOException { long value = 0x0000000000000000L; byte[] result = LongSerializer.serialize( value ); assertEquals( ( byte ) 0x00, result[7] ); assertEquals( ( byte ) 0x00, result[6] ); assertEquals( ( byte ) 0x00, result[5] ); assertEquals( ( byte ) 0x00, result[4] ); assertE... | private LongSerializer() { super( LongComparator.INSTANCE ); } | LongSerializer extends AbstractElementSerializer<Long> { private LongSerializer() { super( LongComparator.INSTANCE ); } } | LongSerializer extends AbstractElementSerializer<Long> { private LongSerializer() { super( LongComparator.INSTANCE ); } private LongSerializer(); } | LongSerializer extends AbstractElementSerializer<Long> { private LongSerializer() { super( LongComparator.INSTANCE ); } private LongSerializer(); byte[] serialize( Long element ); static byte[] serialize( long value ); static byte[] serialize( byte[] buffer, int start, long value ); static Long deserialize( byte[] in ... | LongSerializer extends AbstractElementSerializer<Long> { private LongSerializer() { super( LongComparator.INSTANCE ); } private LongSerializer(); byte[] serialize( Long element ); static byte[] serialize( long value ); static byte[] serialize( byte[] buffer, int start, long value ); static Long deserialize( byte[] in ... |
@Test public void testCharSerializer() throws IOException { char value = 0x0000; byte[] result = CharSerializer.serialize( value ); assertEquals( ( byte ) 0x00, result[1] ); assertEquals( ( byte ) 0x00, result[0] ); assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).charValue() ); value = 0x0001... | private CharSerializer() { super( CharComparator.INSTANCE ); } | CharSerializer extends AbstractElementSerializer<Character> { private CharSerializer() { super( CharComparator.INSTANCE ); } } | CharSerializer extends AbstractElementSerializer<Character> { private CharSerializer() { super( CharComparator.INSTANCE ); } private CharSerializer(); } | CharSerializer extends AbstractElementSerializer<Character> { private CharSerializer() { super( CharComparator.INSTANCE ); } private CharSerializer(); byte[] serialize( Character element ); static byte[] serialize( char value ); static byte[] serialize( byte[] buffer, int start, char value ); static Character deserial... | CharSerializer extends AbstractElementSerializer<Character> { private CharSerializer() { super( CharComparator.INSTANCE ); } private CharSerializer(); byte[] serialize( Character element ); static byte[] serialize( char value ); static byte[] serialize( byte[] buffer, int start, char value ); static Character deserial... |
@Test public void testInMemoryBulkLoadNoElement() throws IOException, KeyNotFoundException { BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", LongSerializer.INSTANCE, StringSerializer.INSTANCE ); btree.setPageSize( 4 ); BTree<Long, String> newBtree = ( BTree<Long, String> ) BulkLoader.compact( btre... | public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... |
@Test public void testShortSerializer() throws IOException { short value = 0x0000; byte[] result = ShortSerializer.serialize( value ); assertEquals( ( byte ) 0x00, result[1] ); assertEquals( ( byte ) 0x00, result[0] ); assertEquals( value, ShortSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).shortValue()... | private ShortSerializer() { super( ShortComparator.INSTANCE ); } | ShortSerializer extends AbstractElementSerializer<Short> { private ShortSerializer() { super( ShortComparator.INSTANCE ); } } | ShortSerializer extends AbstractElementSerializer<Short> { private ShortSerializer() { super( ShortComparator.INSTANCE ); } private ShortSerializer(); } | ShortSerializer extends AbstractElementSerializer<Short> { private ShortSerializer() { super( ShortComparator.INSTANCE ); } private ShortSerializer(); byte[] serialize( Short element ); static byte[] serialize( short value ); static byte[] serialize( byte[] buffer, int start, short value ); static Short deserialize( b... | ShortSerializer extends AbstractElementSerializer<Short> { private ShortSerializer() { super( ShortComparator.INSTANCE ); } private ShortSerializer(); byte[] serialize( Short element ); static byte[] serialize( short value ); static byte[] serialize( byte[] buffer, int start, short value ); static Short deserialize( b... |
@Test public void testBooleanSerializer() throws IOException { boolean value = true; byte[] result = BooleanSerializer.serialize( value ); assertEquals( ( byte ) 0x01, result[0] ); assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).booleanValue() ); value = false; result = BooleanSerializer.seri... | private BooleanSerializer() { super( BooleanComparator.INSTANCE ); } | BooleanSerializer extends AbstractElementSerializer<Boolean> { private BooleanSerializer() { super( BooleanComparator.INSTANCE ); } } | BooleanSerializer extends AbstractElementSerializer<Boolean> { private BooleanSerializer() { super( BooleanComparator.INSTANCE ); } private BooleanSerializer(); } | BooleanSerializer extends AbstractElementSerializer<Boolean> { private BooleanSerializer() { super( BooleanComparator.INSTANCE ); } private BooleanSerializer(); byte[] serialize( Boolean element ); static byte[] serialize( boolean element ); static byte[] serialize( byte[] buffer, int start, boolean element ); static ... | BooleanSerializer extends AbstractElementSerializer<Boolean> { private BooleanSerializer() { super( BooleanComparator.INSTANCE ); } private BooleanSerializer(); byte[] serialize( Boolean element ); static byte[] serialize( boolean element ); static byte[] serialize( byte[] buffer, int start, boolean element ); static ... |
@Test public void testStringSerializer() throws IOException { String value = null; byte[] result = serializer.serialize( value ); assertEquals( 4, result.length ); assertEquals( ( byte ) 0xFF, result[0] ); assertEquals( ( byte ) 0xFF, result[1] ); assertEquals( ( byte ) 0xFF, result[2] ); assertEquals( ( byte ) 0xFF, r... | private StringSerializer() { super( StringComparator.INSTANCE ); } | StringSerializer extends AbstractElementSerializer<String> { private StringSerializer() { super( StringComparator.INSTANCE ); } } | StringSerializer extends AbstractElementSerializer<String> { private StringSerializer() { super( StringComparator.INSTANCE ); } private StringSerializer(); StringSerializer( Comparator<String> comparator ); } | StringSerializer extends AbstractElementSerializer<String> { private StringSerializer() { super( StringComparator.INSTANCE ); } private StringSerializer(); StringSerializer( Comparator<String> comparator ); static String deserialize( byte[] in ); static String deserialize( byte[] in, int start ); String fromBytes( by... | StringSerializer extends AbstractElementSerializer<String> { private StringSerializer() { super( StringComparator.INSTANCE ); } private StringSerializer(); StringSerializer( Comparator<String> comparator ); static String deserialize( byte[] in ); static String deserialize( byte[] in, int start ); String fromBytes( by... |
@Test @Ignore public void testLongArraySerializer() throws IOException { long[] value = null; byte[] result = longArraySerializer.serialize( value ); int pos = 0; assertEquals( 4, result.length ); assertEquals( ( byte ) 0xFF, result[pos++] ); assertEquals( ( byte ) 0xFF, result[pos++] ); assertEquals( ( byte ) 0xFF, re... | private LongArraySerializer() { super( LongArrayComparator.INSTANCE ); } | LongArraySerializer extends AbstractElementSerializer<long[]> { private LongArraySerializer() { super( LongArrayComparator.INSTANCE ); } } | LongArraySerializer extends AbstractElementSerializer<long[]> { private LongArraySerializer() { super( LongArrayComparator.INSTANCE ); } private LongArraySerializer(); } | LongArraySerializer extends AbstractElementSerializer<long[]> { private LongArraySerializer() { super( LongArrayComparator.INSTANCE ); } private LongArraySerializer(); byte[] serialize( long[] element ); long[] deserialize( BufferHandler bufferHandler ); long[] deserialize( ByteBuffer buffer ); @Override int compare( ... | LongArraySerializer extends AbstractElementSerializer<long[]> { private LongArraySerializer() { super( LongArrayComparator.INSTANCE ); } private LongArraySerializer(); byte[] serialize( long[] element ); long[] deserialize( BufferHandler bufferHandler ); long[] deserialize( ByteBuffer buffer ); @Override int compare( ... |
@Test public void testIntSerializer() throws IOException { int value = 0x00000000; byte[] result = IntSerializer.serialize( value ); assertEquals( ( byte ) 0x00, result[3] ); assertEquals( ( byte ) 0x00, result[2] ); assertEquals( ( byte ) 0x00, result[1] ); assertEquals( ( byte ) 0x00, result[0] ); assertEquals( value... | private IntSerializer() { super( IntComparator.INSTANCE ); } | IntSerializer extends AbstractElementSerializer<Integer> { private IntSerializer() { super( IntComparator.INSTANCE ); } } | IntSerializer extends AbstractElementSerializer<Integer> { private IntSerializer() { super( IntComparator.INSTANCE ); } private IntSerializer(); } | IntSerializer extends AbstractElementSerializer<Integer> { private IntSerializer() { super( IntComparator.INSTANCE ); } private IntSerializer(); static Integer deserialize( byte[] in ); static Integer deserialize( byte[] in, int start ); Integer fromBytes( byte[] in ); Integer fromBytes( byte[] in, int start ); Intege... | IntSerializer extends AbstractElementSerializer<Integer> { private IntSerializer() { super( IntComparator.INSTANCE ); } private IntSerializer(); static Integer deserialize( byte[] in ); static Integer deserialize( byte[] in, int start ); Integer fromBytes( byte[] in ); Integer fromBytes( byte[] in, int start ); Intege... |
@Test public void testByteSerializer() throws IOException { byte value = 0x00; byte[] result = ByteSerializer.serialize( value ); assertEquals( ( byte ) 0x00, result[0] ); assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).byteValue() ); value = 0x01; result = ByteSerializer.serialize( value ); ... | private ByteSerializer() { super( ByteComparator.INSTANCE ); } | ByteSerializer extends AbstractElementSerializer<Byte> { private ByteSerializer() { super( ByteComparator.INSTANCE ); } } | ByteSerializer extends AbstractElementSerializer<Byte> { private ByteSerializer() { super( ByteComparator.INSTANCE ); } private ByteSerializer(); } | ByteSerializer extends AbstractElementSerializer<Byte> { private ByteSerializer() { super( ByteComparator.INSTANCE ); } private ByteSerializer(); byte[] serialize( Byte element ); static byte[] serialize( byte value ); static byte[] serialize( byte[] buffer, int start, byte value ); static Byte deserialize( byte[] in ... | ByteSerializer extends AbstractElementSerializer<Byte> { private ByteSerializer() { super( ByteComparator.INSTANCE ); } private ByteSerializer(); byte[] serialize( Byte element ); static byte[] serialize( byte value ); static byte[] serialize( byte[] buffer, int start, byte value ); static Byte deserialize( byte[] in ... |
@Test public void testRevisionNameComparator() { RevisionNameComparator comparator = RevisionNameComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( new RevisionName( 0L, "test" ), new RevisionName( 0L, "test" ) ) ); assertEquals( 1, comparator.compare( new Rev... | private RevisionNameComparator() { } | RevisionNameComparator implements Comparator<RevisionName> { private RevisionNameComparator() { } } | RevisionNameComparator implements Comparator<RevisionName> { private RevisionNameComparator() { } private RevisionNameComparator(); } | RevisionNameComparator implements Comparator<RevisionName> { private RevisionNameComparator() { } private RevisionNameComparator(); int compare( RevisionName rn1, RevisionName rn2 ); } | RevisionNameComparator implements Comparator<RevisionName> { private RevisionNameComparator() { } private RevisionNameComparator(); int compare( RevisionName rn1, RevisionName rn2 ); static final RevisionNameComparator INSTANCE; } |
@Test public void testBrowseEmptyTree() throws Exception { BTree<Integer, String> btree = BTreeFactory.createInMemoryBTree( "test", IntSerializer.INSTANCE, StringSerializer.INSTANCE ); btree.setPageSize( 8 ); TupleCursor<Integer, String> cursor = btree.browse(); assertFalse( cursor.hasNext() ); assertFalse( cursor.hasP... | public void close() throws IOException { if ( getType() == BTreeTypeEnum.BACKED_ON_DISK ) { flush(); journalChannel.close(); } } | InMemoryBTree extends AbstractBTree<K, V> implements Closeable { public void close() throws IOException { if ( getType() == BTreeTypeEnum.BACKED_ON_DISK ) { flush(); journalChannel.close(); } } } | InMemoryBTree extends AbstractBTree<K, V> implements Closeable { public void close() throws IOException { if ( getType() == BTreeTypeEnum.BACKED_ON_DISK ) { flush(); journalChannel.close(); } } InMemoryBTree(); InMemoryBTree( InMemoryBTreeConfiguration<K, V> configuration ); } | InMemoryBTree extends AbstractBTree<K, V> implements Closeable { public void close() throws IOException { if ( getType() == BTreeTypeEnum.BACKED_ON_DISK ) { flush(); journalChannel.close(); } } InMemoryBTree(); InMemoryBTree( InMemoryBTreeConfiguration<K, V> configuration ); void close(); void flush( File file ); voi... | InMemoryBTree extends AbstractBTree<K, V> implements Closeable { public void close() throws IOException { if ( getType() == BTreeTypeEnum.BACKED_ON_DISK ) { flush(); journalChannel.close(); } } InMemoryBTree(); InMemoryBTree( InMemoryBTreeConfiguration<K, V> configuration ); void close(); void flush( File file ); voi... |
@Test public void testExist() throws IOException, KeyNotFoundException { BTree<Integer, String> btree = createTwoLevelBTreeFullLeaves(); for ( int i = 1; i < 21; i++ ) { assertTrue( btree.hasKey( 5 ) ); } assertFalse( btree.hasKey( 0 ) ); assertFalse( btree.hasKey( 21 ) ); btree.close(); } | public void close() throws IOException { if ( getType() == BTreeTypeEnum.BACKED_ON_DISK ) { flush(); journalChannel.close(); } } | InMemoryBTree extends AbstractBTree<K, V> implements Closeable { public void close() throws IOException { if ( getType() == BTreeTypeEnum.BACKED_ON_DISK ) { flush(); journalChannel.close(); } } } | InMemoryBTree extends AbstractBTree<K, V> implements Closeable { public void close() throws IOException { if ( getType() == BTreeTypeEnum.BACKED_ON_DISK ) { flush(); journalChannel.close(); } } InMemoryBTree(); InMemoryBTree( InMemoryBTreeConfiguration<K, V> configuration ); } | InMemoryBTree extends AbstractBTree<K, V> implements Closeable { public void close() throws IOException { if ( getType() == BTreeTypeEnum.BACKED_ON_DISK ) { flush(); journalChannel.close(); } } InMemoryBTree(); InMemoryBTree( InMemoryBTreeConfiguration<K, V> configuration ); void close(); void flush( File file ); voi... | InMemoryBTree extends AbstractBTree<K, V> implements Closeable { public void close() throws IOException { if ( getType() == BTreeTypeEnum.BACKED_ON_DISK ) { flush(); journalChannel.close(); } } InMemoryBTree(); InMemoryBTree( InMemoryBTreeConfiguration<K, V> configuration ); void close(); void flush( File file ); voi... |
@Test public void testByteArrayComparator() { ByteArrayComparator comparator = ByteArrayComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( new byte[] {}, new byte[] {} ) ); assertEquals( 0, comparator.compare( new byte[] { 0x01, 0x02 }, new byte[] { 0x01, 0x02... | private ByteArrayComparator() { } | ByteArrayComparator implements Comparator<byte[]> { private ByteArrayComparator() { } } | ByteArrayComparator implements Comparator<byte[]> { private ByteArrayComparator() { } private ByteArrayComparator(); } | ByteArrayComparator implements Comparator<byte[]> { private ByteArrayComparator() { } private ByteArrayComparator(); int compare( byte[] byteArray1, byte[] byteArray2 ); } | ByteArrayComparator implements Comparator<byte[]> { private ByteArrayComparator() { } private ByteArrayComparator(); int compare( byte[] byteArray1, byte[] byteArray2 ); static final ByteArrayComparator INSTANCE; } |
@Ignore @Test public void testInMemoryBulkLoad3Elements() throws IOException, KeyNotFoundException { BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", LongSerializer.INSTANCE, StringSerializer.INSTANCE ); btree.setPageSize( 4 ); for ( Long i = 0L; i < 3L; i++ ) { String value = "V" + i; btree.insert... | public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... |
@Test public void testShortArrayComparator() { ShortArrayComparator comparator = ShortArrayComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( new short[] {}, new short[] {} ) ); assertEquals( 0, comparator.compare( new short[] { ( short ) 1, ( short ) 2 }, new... | private ShortArrayComparator() { } | ShortArrayComparator implements Comparator<short[]> { private ShortArrayComparator() { } } | ShortArrayComparator implements Comparator<short[]> { private ShortArrayComparator() { } private ShortArrayComparator(); } | ShortArrayComparator implements Comparator<short[]> { private ShortArrayComparator() { } private ShortArrayComparator(); int compare( short[] shortArray1, short[] shortArray2 ); } | ShortArrayComparator implements Comparator<short[]> { private ShortArrayComparator() { } private ShortArrayComparator(); int compare( short[] shortArray1, short[] shortArray2 ); static final ShortArrayComparator INSTANCE; } |
@Test public void testCharComparator() { CharComparator comparator = CharComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( 'a', 'a' ) ); assertEquals( 0, comparator.compare( '\u00e9', '\u00e9' ) ); assertEquals( 1, comparator.compare( 'a', null ) ); assertEqu... | private CharComparator() { } | CharComparator implements Comparator<Character> { private CharComparator() { } } | CharComparator implements Comparator<Character> { private CharComparator() { } private CharComparator(); } | CharComparator implements Comparator<Character> { private CharComparator() { } private CharComparator(); int compare( Character char1, Character char2 ); } | CharComparator implements Comparator<Character> { private CharComparator() { } private CharComparator(); int compare( Character char1, Character char2 ); static final CharComparator INSTANCE; } |
@Test public void testShortComparator() { ShortComparator comparator = ShortComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( ( short ) 1, ( short ) 1 ) ); assertEquals( 0, comparator.compare( ( short ) -1, ( short ) -1 ) ); assertEquals( 1, comparator.compar... | private ShortComparator() { } | ShortComparator implements Comparator<Short> { private ShortComparator() { } } | ShortComparator implements Comparator<Short> { private ShortComparator() { } private ShortComparator(); } | ShortComparator implements Comparator<Short> { private ShortComparator() { } private ShortComparator(); int compare( Short short1, Short short2 ); } | ShortComparator implements Comparator<Short> { private ShortComparator() { } private ShortComparator(); int compare( Short short1, Short short2 ); static final ShortComparator INSTANCE; } |
@Test public void testBooleanArrayComparator() { BooleanArrayComparator comparator = BooleanArrayComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); boolean[] b1 = new boolean[] { true, true, true }; boolean[] b2 = new boolean[] { true, true, false }; boolean[] b3 = new boolean[] { true, false, tr... | private BooleanArrayComparator() { } | BooleanArrayComparator implements Comparator<boolean[]> { private BooleanArrayComparator() { } } | BooleanArrayComparator implements Comparator<boolean[]> { private BooleanArrayComparator() { } private BooleanArrayComparator(); } | BooleanArrayComparator implements Comparator<boolean[]> { private BooleanArrayComparator() { } private BooleanArrayComparator(); int compare( boolean[] booleanArray1, boolean[] booleanArray2 ); } | BooleanArrayComparator implements Comparator<boolean[]> { private BooleanArrayComparator() { } private BooleanArrayComparator(); int compare( boolean[] booleanArray1, boolean[] booleanArray2 ); static final BooleanArrayComparator INSTANCE; } |
@Test public void testCharArrayComparator() { CharArrayComparator comparator = CharArrayComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( new char[] {}, new char[] {} ) ); assertEquals( 0, comparator.compare( new char[] { 'a', 'b' }, new char[] { 'a', 'b' } )... | private CharArrayComparator() { } | CharArrayComparator implements Comparator<char[]> { private CharArrayComparator() { } } | CharArrayComparator implements Comparator<char[]> { private CharArrayComparator() { } private CharArrayComparator(); } | CharArrayComparator implements Comparator<char[]> { private CharArrayComparator() { } private CharArrayComparator(); int compare( char[] charArray1, char[] charArray2 ); } | CharArrayComparator implements Comparator<char[]> { private CharArrayComparator() { } private CharArrayComparator(); int compare( char[] charArray1, char[] charArray2 ); static final CharArrayComparator INSTANCE; } |
@Test public void testByteComparator() { ByteComparator comparator = ByteComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( ( byte ) 0x00, ( byte ) 0x00 ) ); assertEquals( 0, comparator.compare( ( byte ) 0xFE, ( byte ) 0xFE ) ); assertEquals( 1, comparator.com... | private ByteComparator() { } | ByteComparator implements Comparator<Byte> { private ByteComparator() { } } | ByteComparator implements Comparator<Byte> { private ByteComparator() { } private ByteComparator(); } | ByteComparator implements Comparator<Byte> { private ByteComparator() { } private ByteComparator(); int compare( Byte byte1, Byte byte2 ); } | ByteComparator implements Comparator<Byte> { private ByteComparator() { } private ByteComparator(); int compare( Byte byte1, Byte byte2 ); static final ByteComparator INSTANCE; } |
@Test public void testLongArrayComparator() { LongArrayComparator comparator = LongArrayComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( new long[] {}, new long[] {} ) ); assertEquals( 0, comparator.compare( new long[] { 1L, 2L }, new long[] { 1L, 2L } ) ); ... | private LongArrayComparator() { } | LongArrayComparator implements Comparator<long[]> { private LongArrayComparator() { } } | LongArrayComparator implements Comparator<long[]> { private LongArrayComparator() { } private LongArrayComparator(); } | LongArrayComparator implements Comparator<long[]> { private LongArrayComparator() { } private LongArrayComparator(); int compare( long[] longArray1, long[] longArray2 ); } | LongArrayComparator implements Comparator<long[]> { private LongArrayComparator() { } private LongArrayComparator(); int compare( long[] longArray1, long[] longArray2 ); static final LongArrayComparator INSTANCE; } |
@Test public void testLongComparator() { LongComparator comparator = LongComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( 1L, 1L ) ); assertEquals( 0, comparator.compare( -1L, -1L ) ); assertEquals( 1, comparator.compare( 1L, null ) ); assertEquals( 1, compa... | private LongComparator() { } | LongComparator implements Comparator<Long> { private LongComparator() { } } | LongComparator implements Comparator<Long> { private LongComparator() { } private LongComparator(); } | LongComparator implements Comparator<Long> { private LongComparator() { } private LongComparator(); int compare( Long long1, Long long2 ); } | LongComparator implements Comparator<Long> { private LongComparator() { } private LongComparator(); int compare( Long long1, Long long2 ); static final LongComparator INSTANCE; } |
@Test public void testIntComparator() { IntComparator comparator = IntComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( 1, 1 ) ); assertEquals( 0, comparator.compare( -1, -1 ) ); assertEquals( 1, comparator.compare( 1, null ) ); assertEquals( 1, comparator.co... | private IntComparator() { } | IntComparator implements Comparator<Integer> { private IntComparator() { } } | IntComparator implements Comparator<Integer> { private IntComparator() { } private IntComparator(); } | IntComparator implements Comparator<Integer> { private IntComparator() { } private IntComparator(); int compare( Integer integer1, Integer integer2 ); } | IntComparator implements Comparator<Integer> { private IntComparator() { } private IntComparator(); int compare( Integer integer1, Integer integer2 ); static final IntComparator INSTANCE; } |
@Test public void testBooleanComparator() { BooleanComparator comparator = BooleanComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( true, true ) ); assertEquals( 0, comparator.compare( false, false ) ); assertEquals( 1, comparator.compare( false, null ) ); as... | private BooleanComparator() { } | BooleanComparator implements Comparator<Boolean> { private BooleanComparator() { } } | BooleanComparator implements Comparator<Boolean> { private BooleanComparator() { } private BooleanComparator(); } | BooleanComparator implements Comparator<Boolean> { private BooleanComparator() { } private BooleanComparator(); int compare( Boolean boolean1, Boolean boolean2 ); } | BooleanComparator implements Comparator<Boolean> { private BooleanComparator() { } private BooleanComparator(); int compare( Boolean boolean1, Boolean boolean2 ); static final BooleanComparator INSTANCE; } |
@Ignore @Test public void testInMemoryBulkLoad8Elements() throws IOException, KeyNotFoundException { BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", LongSerializer.INSTANCE, StringSerializer.INSTANCE ); btree.setPageSize( 4 ); for ( Long i = 0L; i < 8L; i++ ) { String value = "V" + i; btree.insert... | public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... |
@Test public void testStringComparator() { StringComparator comparator = StringComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( "", "" ) ); assertEquals( 0, comparator.compare( "abc", "abc" ) ); assertEquals( 1, comparator.compare( "", null ) ); assertEquals... | private StringComparator() { } | StringComparator implements Comparator<String> { private StringComparator() { } } | StringComparator implements Comparator<String> { private StringComparator() { } private StringComparator(); } | StringComparator implements Comparator<String> { private StringComparator() { } private StringComparator(); int compare( String string1, String string2 ); } | StringComparator implements Comparator<String> { private StringComparator() { } private StringComparator(); int compare( String string1, String string2 ); static final StringComparator INSTANCE; } |
@Test public void testIntArrayComparator() { IntArrayComparator comparator = IntArrayComparator.INSTANCE; assertEquals( 0, comparator.compare( null, null ) ); assertEquals( 0, comparator.compare( new int[] {}, new int[] {} ) ); assertEquals( 0, comparator.compare( new int[] { 1, 2 }, new int[] { 1, 2 } ) ); assertEqual... | private IntArrayComparator() { } | IntArrayComparator implements Comparator<int[]> { private IntArrayComparator() { } } | IntArrayComparator implements Comparator<int[]> { private IntArrayComparator() { } private IntArrayComparator(); } | IntArrayComparator implements Comparator<int[]> { private IntArrayComparator() { } private IntArrayComparator(); int compare( int[] intArray1, int[] intArray2 ); } | IntArrayComparator implements Comparator<int[]> { private IntArrayComparator() { } private IntArrayComparator(); int compare( int[] intArray1, int[] intArray2 ); static final IntArrayComparator INSTANCE; } |
@Test @Ignore public void testRecordManager() throws IOException, BTreeAlreadyManagedException { assertEquals( 1, recordManager.getNbManagedTrees() ); Set<String> managedBTrees = recordManager.getManagedTrees(); assertEquals( 1, managedBTrees.size() ); assertTrue( managedBTrees.contains( "test" ) ); BTree<Long, String>... | public RecordManager( String fileName ) { this( fileName, DEFAULT_PAGE_SIZE ); } | RecordManager extends AbstractTransactionManager { public RecordManager( String fileName ) { this( fileName, DEFAULT_PAGE_SIZE ); } } | RecordManager extends AbstractTransactionManager { public RecordManager( String fileName ) { this( fileName, DEFAULT_PAGE_SIZE ); } RecordManager( String fileName ); RecordManager( String fileName, int pageSize ); } | RecordManager extends AbstractTransactionManager { public RecordManager( String fileName ) { this( fileName, DEFAULT_PAGE_SIZE ); } RecordManager( String fileName ); RecordManager( String fileName, int pageSize ); void beginTransaction(); void commit(); boolean isContextOk(); void rollback(); Page<K, V> deserialize( B... | RecordManager extends AbstractTransactionManager { public RecordManager( String fileName ) { this( fileName, DEFAULT_PAGE_SIZE ); } RecordManager( String fileName ); RecordManager( String fileName, int pageSize ); void beginTransaction(); void commit(); boolean isContextOk(); void rollback(); Page<K, V> deserialize( B... |
@Test public void testManagedBTreeBuilding() throws Exception { List<Tuple<Integer, Integer>> sortedTuple = new ArrayList<Tuple<Integer, Integer>>(); for ( int i = 1; i < 8; i++ ) { Tuple<Integer, Integer> t = new Tuple<Integer, Integer>( i, i ); sortedTuple.add( t ); } File file = File.createTempFile( "managedbtreebui... | @SuppressWarnings("unchecked") public BTree<K, V> build( Iterator<Tuple<K, V>> sortedTupleItr ) throws Exception { BTree<K, V> btree = BTreeFactory.createPersistedBTree( name, keySerializer, valueSerializer ); rm.manage( btree ); List<Page<K, V>> lstLeaves = new ArrayList<Page<K, V>>(); int totalTupleCount = 0; Persist... | PersistedBTreeBuilder { @SuppressWarnings("unchecked") public BTree<K, V> build( Iterator<Tuple<K, V>> sortedTupleItr ) throws Exception { BTree<K, V> btree = BTreeFactory.createPersistedBTree( name, keySerializer, valueSerializer ); rm.manage( btree ); List<Page<K, V>> lstLeaves = new ArrayList<Page<K, V>>(); int tota... | PersistedBTreeBuilder { @SuppressWarnings("unchecked") public BTree<K, V> build( Iterator<Tuple<K, V>> sortedTupleItr ) throws Exception { BTree<K, V> btree = BTreeFactory.createPersistedBTree( name, keySerializer, valueSerializer ); rm.manage( btree ); List<Page<K, V>> lstLeaves = new ArrayList<Page<K, V>>(); int tota... | PersistedBTreeBuilder { @SuppressWarnings("unchecked") public BTree<K, V> build( Iterator<Tuple<K, V>> sortedTupleItr ) throws Exception { BTree<K, V> btree = BTreeFactory.createPersistedBTree( name, keySerializer, valueSerializer ); rm.manage( btree ); List<Page<K, V>> lstLeaves = new ArrayList<Page<K, V>>(); int tota... | PersistedBTreeBuilder { @SuppressWarnings("unchecked") public BTree<K, V> build( Iterator<Tuple<K, V>> sortedTupleItr ) throws Exception { BTree<K, V> btree = BTreeFactory.createPersistedBTree( name, keySerializer, valueSerializer ); rm.manage( btree ); List<Page<K, V>> lstLeaves = new ArrayList<Page<K, V>>(); int tota... |
@Test public void testPersistedBulkLoad1000Elements() throws IOException, KeyNotFoundException, BTreeAlreadyManagedException { for ( int i = 1000000; i < 1000001; i++ ) { Random random = new Random( System.currentTimeMillis() ); File file = File.createTempFile( "managedbtreebuilder", ".data" ); file.deleteOnExit(); try... | public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new ArrayList<File... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... | BulkLoader { public static <K, V> BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ) throws IOException { if ( btree == null ) { throw new RuntimeException( "Invalid BTree : it's null" ); } if ( iterator == null ) { return null; } boolean inMemory = true; List<File> sortedFiles = new A... |
@Test public void testInMemoryBulkLoad20Elements() throws IOException, KeyNotFoundException { BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", LongSerializer.INSTANCE, StringSerializer.INSTANCE ); btree.setPageSize( 4 ); for ( Long i = 0L; i < 20L; i++ ) { String value = "V" + i; btree.insert( i, v... | public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... |
@Ignore @Test public void testInMemoryBulkLoad40Elements() throws IOException, KeyNotFoundException { BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", LongSerializer.INSTANCE, StringSerializer.INSTANCE ); btree.setPageSize( 4 ); for ( Long i = 0L; i < 40L; i++ ) { String value = "V" + i; btree.inse... | public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... |
@Test public void testInMemoryBulkLoad100Elements() throws IOException, KeyNotFoundException { BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", LongSerializer.INSTANCE, StringSerializer.INSTANCE ); btree.setPageSize( 4 ); for ( Long i = 0L; i < 100L; i++ ) { String value = "V" + i; btree.insert( i,... | public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... |
@Ignore @Test public void testInMemoryBulkLoadN() throws IOException, KeyNotFoundException { Random random = new Random( System.nanoTime() ); long t0 = System.currentTimeMillis(); for ( long n = 0L; n < 2500L; n++ ) { BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", LongSerializer.INSTANCE, StringS... | public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... |
@Ignore @Test public void testInMemoryBulkLoad21() throws IOException, KeyNotFoundException { Random random = new Random( System.nanoTime() ); long t0 = System.currentTimeMillis(); BTree<Long, String> btree = BTreeFactory.createInMemoryBTree( "test", LongSerializer.INSTANCE, StringSerializer.INSTANCE ); btree.setPageSi... | public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); } | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... | BulkLoader { public static void compact( RecordManager recordManager, BTree<?, ?> btree ) { } private BulkLoader(); static BTree<K, V> load( BTree<K, V> btree, Iterator<Tuple<K, V>> iterator, int chunkSize ); static void compact( RecordManager recordManager, BTree<?, ?> btree ); static BTree<?, ?> compact( BTree<?, ?>... |
@Test public void and() throws Exception { HandlerFunction<ServerResponse> handlerFunction = request -> ServerResponse.ok().build(); RouterFunction<ServerResponse> routerFunction1 = request -> Mono.empty(); RouterFunction<ServerResponse> routerFunction2 = request -> Mono.just(handlerFunction); RouterFunction<ServerResp... | public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predicate, handlerFuncti... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... |
@Test public void andOther() throws Exception { HandlerFunction<ServerResponse> handlerFunction = request -> ServerResponse.ok().body(fromObject("42")); RouterFunction<?> routerFunction1 = request -> Mono.empty(); RouterFunction<ServerResponse> routerFunction2 = request -> Mono.just(handlerFunction); RouterFunction<?> ... | public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predicate, handlerFuncti... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... |
@Test public void andRoute() throws Exception { RouterFunction<ServerResponse> routerFunction1 = request -> Mono.empty(); RequestPredicate requestPredicate = request -> true; RouterFunction<ServerResponse> result = routerFunction1.andRoute(requestPredicate, this::handlerMethod); assertNotNull(result); MockServerRequest... | public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predicate, handlerFuncti... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... |
@Test public void filter() throws Exception { Mono<String> stringMono = Mono.just("42"); HandlerFunction<EntityResponse<Mono<String>>> handlerFunction = request -> EntityResponse.fromPublisher(stringMono, String.class).build(); RouterFunction<EntityResponse<Mono<String>>> routerFunction = request -> Mono.just(handlerFu... | public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predicate, handlerFuncti... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... | RouterFunctions { public static <T extends ServerResponse> RouterFunction<T> route(RequestPredicate predicate, HandlerFunction<T> handlerFunction) { Assert.notNull(predicate, "'predicate' must not be null"); Assert.notNull(handlerFunction, "'handlerFunction' must not be null"); return new DefaultRouterFunction<>(predic... |
@Test public void should_know_if_a_failing_build_has_been_claimed() throws Exception { String ourPotentialHero = "Adam", theReason = "I broke it, sorry, fixing now"; job = a(jobView().which(new CanBeClaimed()).of( a(job().whereTheLast(build().finishedWith(FAILURE).and().wasClaimedBy(ourPotentialHero, theReason))))); as... | @Override public CanBeClaimed of(JobView jobView) { this.job = jobView; return this; } | CanBeClaimed implements Feature { @Override public CanBeClaimed of(JobView jobView) { this.job = jobView; return this; } } | CanBeClaimed implements Feature { @Override public CanBeClaimed of(JobView jobView) { this.job = jobView; return this; } } | CanBeClaimed implements Feature { @Override public CanBeClaimed of(JobView jobView) { this.job = jobView; return this; } @Override CanBeClaimed of(JobView jobView); @Override Claim asJson(); } | CanBeClaimed implements Feature { @Override public CanBeClaimed of(JobView jobView) { this.job = jobView; return this; } @Override CanBeClaimed of(JobView jobView); @Override Claim asJson(); } |
@Test public void should_know_the_url_of_the_last_build() { view = a(jobView().which(new KnowsLastCompletedBuildDetails()).of( a(job().whereTheLast(build().hasNumber(22)))) .with(locatedAt("job/project-name"))); assertThat(lastCompletedBuildOf(view).url(), is("job/project-name/22/")); } | @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } } | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } KnowsLastCompletedBuildDetails(/* config */); } | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } KnowsLastCompletedBuildDetails(/* config */); @Override KnowsLastCompletedBuildDetails of(JobView jobView); @Ove... | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } KnowsLastCompletedBuildDetails(/* config */); @Override KnowsLastCompletedBuildDetails of(JobView jobView); @Ove... |
@Test public void should_know_how_long_the_last_build_took_once_its_finished() throws Exception { view = a(jobView().which(new KnowsLastCompletedBuildDetails()).of( a(job().whereTheLast(build().finishedWith(SUCCESS).and().took(3))))); assertThat(lastCompletedBuildOf(view).duration(), is("3m 0s")); } | @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } } | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } KnowsLastCompletedBuildDetails(/* config */); } | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } KnowsLastCompletedBuildDetails(/* config */); @Override KnowsLastCompletedBuildDetails of(JobView jobView); @Ove... | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } KnowsLastCompletedBuildDetails(/* config */); @Override KnowsLastCompletedBuildDetails of(JobView jobView); @Ove... |
@Test public void should_know_how_long_since_the_last_build_happened() throws Exception { String tenMinutesInMilliseconds = String.format("%d", 10 * 60 * 1000); view = a(jobView().which(new KnowsLastCompletedBuildDetails()).of( a(job().whereTheLast(build().startedAt("18:05:00").and().took(5)))) .assuming(currentTime().... | @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } } | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } KnowsLastCompletedBuildDetails(/* config */); } | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } KnowsLastCompletedBuildDetails(/* config */); @Override KnowsLastCompletedBuildDetails of(JobView jobView); @Ove... | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } KnowsLastCompletedBuildDetails(/* config */); @Override KnowsLastCompletedBuildDetails of(JobView jobView); @Ove... |
@Test public void should_support_job_without_badges() throws Exception { job = a(jobView().which(new HasBadgesBadgePlugin()).of( a(job()))); assertThat(serialisedBadgesDetailsOf(job), is(nullValue())); } | @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesBadgePlugin of(JobView jobView); @Override Badges asJson(); } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesBadgePlugin of(JobView jobView); @Override Badges asJson(); } |
@Test public void should_convert_badges_to_json() throws Exception { job = a(jobView().which(new HasBadgesBadgePlugin()).of( a(job().whereTheLast(build().hasBadgesBadgePlugin(badgePluginBadge().withText("badge1"), badgePluginBadge().withText("badge2")))))); assertThat(serialisedBadgesDetailsOf(job).value(), hasSize(2))... | @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesBadgePlugin of(JobView jobView); @Override Badges asJson(); } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesBadgePlugin of(JobView jobView); @Override Badges asJson(); } |
@Test public void should_ignore_badges_with_icon() throws Exception { job = a(jobView().which(new HasBadgesBadgePlugin()).of( a(job().whereTheLast(build().hasBadgesBadgePlugin(badgePluginBadge().withIcon("icon.gif", "badge1"), badgePluginBadge().withText("badge2")))))); assertThat(serialisedBadgesDetailsOf(job).value()... | @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesBadgePlugin of(JobView jobView); @Override Badges asJson(); } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesBadgePlugin of(JobView jobView); @Override Badges asJson(); } |
@Test public void should_report_badges_from_latest_build() throws Exception { job = a(jobView().which(new HasBadgesBadgePlugin()).of( a(job().whereTheLast(build().isStillBuilding().hasBadgesBadgePlugin(badgePluginBadge().withText("badge1"))) .andThePrevious(build().hasBadgesBadgePlugin(badgePluginBadge().withText("badg... | @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesBadgePlugin of(JobView jobView); @Override Badges asJson(); } | HasBadgesBadgePlugin implements Feature<HasBadgesBadgePlugin.Badges> { @Override public HasBadgesBadgePlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesBadgePlugin of(JobView jobView); @Override Badges asJson(); } |
@Test public void should_know_current_build_number() { view = a(jobView().which(new KnowsCurrentBuildsDetails()).of( a(job().whereTheLast(build().isStillBuilding().and().hasNumber(5))))); assertThat(currentBuildsOf(view).get(0).name(), is("#5")); } | @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } } | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } KnowsCurrentBuildsDetails(/* config */); } | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } KnowsCurrentBuildsDetails(/* config */); @Override KnowsCurrentBuildsDetails of(JobView jobView); @Override CurrentBuilds asJson(); ... | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } KnowsCurrentBuildsDetails(/* config */); @Override KnowsCurrentBuildsDetails of(JobView jobView); @Override CurrentBuilds asJson(); ... |
@Test public void should_use_build_name_if_its_known() { view = a(jobView().which(new KnowsCurrentBuildsDetails()).of( a(job().whereTheLast(build().isStillBuilding().and().hasName("1.3.4+build.15"))))); assertThat(currentBuildsOf(view).get(0).name(), is("1.3.4+build.15")); } | @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } } | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } KnowsCurrentBuildsDetails(/* config */); } | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } KnowsCurrentBuildsDetails(/* config */); @Override KnowsCurrentBuildsDetails of(JobView jobView); @Override CurrentBuilds asJson(); ... | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } KnowsCurrentBuildsDetails(/* config */); @Override KnowsCurrentBuildsDetails of(JobView jobView); @Override CurrentBuilds asJson(); ... |
@Test public void should_know_the_url_of_the_last_build() { view = a(jobView().which(new KnowsCurrentBuildsDetails()).of( a(job().whereTheLast(build().isStillBuilding().and().hasNumber(22)))) .with(locatedAt("job/project-name"))); assertThat(currentBuildsOf(view).get(0).url(), is("job/project-name/22/")); } | @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } } | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } KnowsCurrentBuildsDetails(/* config */); } | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } KnowsCurrentBuildsDetails(/* config */); @Override KnowsCurrentBuildsDetails of(JobView jobView); @Override CurrentBuilds asJson(); ... | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } KnowsCurrentBuildsDetails(/* config */); @Override KnowsCurrentBuildsDetails of(JobView jobView); @Override CurrentBuilds asJson(); ... |
@Test public void should_know_if_a_failing_build_has_not_been_claimed() throws Exception { job = a(jobView().which(new CanBeClaimed()).of( a(job().whereTheLast(build().finishedWith(FAILURE))))); assertThat(serialisedClaimOf(job), is(nullValue())); } | @Override public CanBeClaimed of(JobView jobView) { this.job = jobView; return this; } | CanBeClaimed implements Feature { @Override public CanBeClaimed of(JobView jobView) { this.job = jobView; return this; } } | CanBeClaimed implements Feature { @Override public CanBeClaimed of(JobView jobView) { this.job = jobView; return this; } } | CanBeClaimed implements Feature { @Override public CanBeClaimed of(JobView jobView) { this.job = jobView; return this; } @Override CanBeClaimed of(JobView jobView); @Override Claim asJson(); } | CanBeClaimed implements Feature { @Override public CanBeClaimed of(JobView jobView) { this.job = jobView; return this; } @Override CanBeClaimed of(JobView jobView); @Override Claim asJson(); } |
@Test public void should_know_how_long_a_build_has_been_running_for() throws Exception { String startTime = "13:10:00", sixSecondsLater = "13:10:06", twoAndHalfMinutesLater = "13:12:30", anHourAndHalfLater = "14:40:00"; Date currentTime = currentTime().is(startTime); view = a(jobView().which(new KnowsCurrentBuildsDetai... | @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } } | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } KnowsCurrentBuildsDetails(/* config */); } | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } KnowsCurrentBuildsDetails(/* config */); @Override KnowsCurrentBuildsDetails of(JobView jobView); @Override CurrentBuilds asJson(); ... | KnowsCurrentBuildsDetails implements Feature<KnowsCurrentBuildsDetails.CurrentBuilds> { @Override public KnowsCurrentBuildsDetails of(JobView jobView) { this.job = jobView; return this; } KnowsCurrentBuildsDetails(/* config */); @Override KnowsCurrentBuildsDetails of(JobView jobView); @Override CurrentBuilds asJson(); ... |
@Test public void isWorkflowRun() { Assert.assertTrue(PipelineHelper.isWorkflowRun(workflowRun, new StaticJenkinsAPIs())); } | public static boolean isWorkflowRun(Run<?, ?> build, StaticJenkinsAPIs staticJenkinsAPIs) { if (hasWorkflowClass == null) { if (!staticJenkinsAPIs.hasPlugin(PIPELINE_PLUGIN)) { hasWorkflowClass = false; return false; } try { workflowRunClass = Class.forName(WORKFLOW_RUN_CLASS_NAME); hasWorkflowClass = true; } catch (Cl... | PipelineHelper { public static boolean isWorkflowRun(Run<?, ?> build, StaticJenkinsAPIs staticJenkinsAPIs) { if (hasWorkflowClass == null) { if (!staticJenkinsAPIs.hasPlugin(PIPELINE_PLUGIN)) { hasWorkflowClass = false; return false; } try { workflowRunClass = Class.forName(WORKFLOW_RUN_CLASS_NAME); hasWorkflowClass = ... | PipelineHelper { public static boolean isWorkflowRun(Run<?, ?> build, StaticJenkinsAPIs staticJenkinsAPIs) { if (hasWorkflowClass == null) { if (!staticJenkinsAPIs.hasPlugin(PIPELINE_PLUGIN)) { hasWorkflowClass = false; return false; } try { workflowRunClass = Class.forName(WORKFLOW_RUN_CLASS_NAME); hasWorkflowClass = ... | PipelineHelper { public static boolean isWorkflowRun(Run<?, ?> build, StaticJenkinsAPIs staticJenkinsAPIs) { if (hasWorkflowClass == null) { if (!staticJenkinsAPIs.hasPlugin(PIPELINE_PLUGIN)) { hasWorkflowClass = false; return false; } try { workflowRunClass = Class.forName(WORKFLOW_RUN_CLASS_NAME); hasWorkflowClass = ... | PipelineHelper { public static boolean isWorkflowRun(Run<?, ?> build, StaticJenkinsAPIs staticJenkinsAPIs) { if (hasWorkflowClass == null) { if (!staticJenkinsAPIs.hasPlugin(PIPELINE_PLUGIN)) { hasWorkflowClass = false; return false; } try { workflowRunClass = Class.forName(WORKFLOW_RUN_CLASS_NAME); hasWorkflowClass = ... |
@Test public void isNotWorkflowRun() { Assert.assertFalse(PipelineHelper.isWorkflowRun(abstractBuild, new StaticJenkinsAPIs())); } | public static boolean isWorkflowRun(Run<?, ?> build, StaticJenkinsAPIs staticJenkinsAPIs) { if (hasWorkflowClass == null) { if (!staticJenkinsAPIs.hasPlugin(PIPELINE_PLUGIN)) { hasWorkflowClass = false; return false; } try { workflowRunClass = Class.forName(WORKFLOW_RUN_CLASS_NAME); hasWorkflowClass = true; } catch (Cl... | PipelineHelper { public static boolean isWorkflowRun(Run<?, ?> build, StaticJenkinsAPIs staticJenkinsAPIs) { if (hasWorkflowClass == null) { if (!staticJenkinsAPIs.hasPlugin(PIPELINE_PLUGIN)) { hasWorkflowClass = false; return false; } try { workflowRunClass = Class.forName(WORKFLOW_RUN_CLASS_NAME); hasWorkflowClass = ... | PipelineHelper { public static boolean isWorkflowRun(Run<?, ?> build, StaticJenkinsAPIs staticJenkinsAPIs) { if (hasWorkflowClass == null) { if (!staticJenkinsAPIs.hasPlugin(PIPELINE_PLUGIN)) { hasWorkflowClass = false; return false; } try { workflowRunClass = Class.forName(WORKFLOW_RUN_CLASS_NAME); hasWorkflowClass = ... | PipelineHelper { public static boolean isWorkflowRun(Run<?, ?> build, StaticJenkinsAPIs staticJenkinsAPIs) { if (hasWorkflowClass == null) { if (!staticJenkinsAPIs.hasPlugin(PIPELINE_PLUGIN)) { hasWorkflowClass = false; return false; } try { workflowRunClass = Class.forName(WORKFLOW_RUN_CLASS_NAME); hasWorkflowClass = ... | PipelineHelper { public static boolean isWorkflowRun(Run<?, ?> build, StaticJenkinsAPIs staticJenkinsAPIs) { if (hasWorkflowClass == null) { if (!staticJenkinsAPIs.hasPlugin(PIPELINE_PLUGIN)) { hasWorkflowClass = false; return false; } try { workflowRunClass = Class.forName(WORKFLOW_RUN_CLASS_NAME); hasWorkflowClass = ... |
@Test public void helps_to_avoid_duplicated_stats_and_keep_jenkins_instance_anonymous() throws Exception { BuildMonitorInstallation installation = new BuildMonitorInstallation(withPublicKey(PUBLIC_KEY)); assertThat(installation.anonymousCorrelationId(), is(not(PUBLIC_KEY))); assertThat(installation.anonymousCorrelation... | public String anonymousCorrelationId() { if (UNKNOWN.equalsIgnoreCase(anonymousCorrelationId)) { anonymousCorrelationId = sha256().hashString(jenkins.encodedPublicKey(), UTF_8).toString(); } return anonymousCorrelationId; } | BuildMonitorInstallation { public String anonymousCorrelationId() { if (UNKNOWN.equalsIgnoreCase(anonymousCorrelationId)) { anonymousCorrelationId = sha256().hashString(jenkins.encodedPublicKey(), UTF_8).toString(); } return anonymousCorrelationId; } } | BuildMonitorInstallation { public String anonymousCorrelationId() { if (UNKNOWN.equalsIgnoreCase(anonymousCorrelationId)) { anonymousCorrelationId = sha256().hashString(jenkins.encodedPublicKey(), UTF_8).toString(); } return anonymousCorrelationId; } BuildMonitorInstallation(); BuildMonitorInstallation(StaticJenkinsAP... | BuildMonitorInstallation { public String anonymousCorrelationId() { if (UNKNOWN.equalsIgnoreCase(anonymousCorrelationId)) { anonymousCorrelationId = sha256().hashString(jenkins.encodedPublicKey(), UTF_8).toString(); } return anonymousCorrelationId; } BuildMonitorInstallation(); BuildMonitorInstallation(StaticJenkinsAP... | BuildMonitorInstallation { public String anonymousCorrelationId() { if (UNKNOWN.equalsIgnoreCase(anonymousCorrelationId)) { anonymousCorrelationId = sha256().hashString(jenkins.encodedPublicKey(), UTF_8).toString(); } return anonymousCorrelationId; } BuildMonitorInstallation(); BuildMonitorInstallation(StaticJenkinsAP... |
@Test public void only_calculates_the_correlation_hash_once() throws Exception { StaticJenkinsAPIs jenkinsAPIs = withPublicKey(PUBLIC_KEY); BuildMonitorInstallation installation = new BuildMonitorInstallation(jenkinsAPIs); installation.anonymousCorrelationId(); installation.anonymousCorrelationId(); verify(jenkinsAPIs,... | public String anonymousCorrelationId() { if (UNKNOWN.equalsIgnoreCase(anonymousCorrelationId)) { anonymousCorrelationId = sha256().hashString(jenkins.encodedPublicKey(), UTF_8).toString(); } return anonymousCorrelationId; } | BuildMonitorInstallation { public String anonymousCorrelationId() { if (UNKNOWN.equalsIgnoreCase(anonymousCorrelationId)) { anonymousCorrelationId = sha256().hashString(jenkins.encodedPublicKey(), UTF_8).toString(); } return anonymousCorrelationId; } } | BuildMonitorInstallation { public String anonymousCorrelationId() { if (UNKNOWN.equalsIgnoreCase(anonymousCorrelationId)) { anonymousCorrelationId = sha256().hashString(jenkins.encodedPublicKey(), UTF_8).toString(); } return anonymousCorrelationId; } BuildMonitorInstallation(); BuildMonitorInstallation(StaticJenkinsAP... | BuildMonitorInstallation { public String anonymousCorrelationId() { if (UNKNOWN.equalsIgnoreCase(anonymousCorrelationId)) { anonymousCorrelationId = sha256().hashString(jenkins.encodedPublicKey(), UTF_8).toString(); } return anonymousCorrelationId; } BuildMonitorInstallation(); BuildMonitorInstallation(StaticJenkinsAP... | BuildMonitorInstallation { public String anonymousCorrelationId() { if (UNKNOWN.equalsIgnoreCase(anonymousCorrelationId)) { anonymousCorrelationId = sha256().hashString(jenkins.encodedPublicKey(), UTF_8).toString(); } return anonymousCorrelationId; } BuildMonitorInstallation(); BuildMonitorInstallation(StaticJenkinsAP... |
@Test public void form_validator_should_allow_valid_reg_ex_specifying_what_jobs_to_include() throws Exception { for (String regex : asFollows(null, "", ".*", "myproject-.*")) { assertThat(itShouldAllow(regex), validator.doCheckIncludeRegex(regex).kind, is(OK)); } } | public FormValidation doCheckIncludeRegex(@QueryParameter String value) { String v = Util.fixEmpty(value); if (v != null) { try { Pattern.compile(v); } catch (PatternSyntaxException pse) { return FormValidation.error(pse.getMessage()); } } return FormValidation.ok(); } | BuildMonitorDescriptor extends ViewDescriptor { public FormValidation doCheckIncludeRegex(@QueryParameter String value) { String v = Util.fixEmpty(value); if (v != null) { try { Pattern.compile(v); } catch (PatternSyntaxException pse) { return FormValidation.error(pse.getMessage()); } } return FormValidation.ok(); } } | BuildMonitorDescriptor extends ViewDescriptor { public FormValidation doCheckIncludeRegex(@QueryParameter String value) { String v = Util.fixEmpty(value); if (v != null) { try { Pattern.compile(v); } catch (PatternSyntaxException pse) { return FormValidation.error(pse.getMessage()); } } return FormValidation.ok(); } Bu... | BuildMonitorDescriptor extends ViewDescriptor { public FormValidation doCheckIncludeRegex(@QueryParameter String value) { String v = Util.fixEmpty(value); if (v != null) { try { Pattern.compile(v); } catch (PatternSyntaxException pse) { return FormValidation.error(pse.getMessage()); } } return FormValidation.ok(); } Bu... | BuildMonitorDescriptor extends ViewDescriptor { public FormValidation doCheckIncludeRegex(@QueryParameter String value) { String v = Util.fixEmpty(value); if (v != null) { try { Pattern.compile(v); } catch (PatternSyntaxException pse) { return FormValidation.error(pse.getMessage()); } } return FormValidation.ok(); } Bu... |
@Test public void form_validator_should_advise_how_a_regex_could_be_improved() throws Exception { FormValidation result = validator.doCheckIncludeRegex(")"); assertThat(result.kind, is(ERROR)); assertThat(htmlDecoded(result.getMessage()), containsString("Unmatched closing ')'")); } | public FormValidation doCheckIncludeRegex(@QueryParameter String value) { String v = Util.fixEmpty(value); if (v != null) { try { Pattern.compile(v); } catch (PatternSyntaxException pse) { return FormValidation.error(pse.getMessage()); } } return FormValidation.ok(); } | BuildMonitorDescriptor extends ViewDescriptor { public FormValidation doCheckIncludeRegex(@QueryParameter String value) { String v = Util.fixEmpty(value); if (v != null) { try { Pattern.compile(v); } catch (PatternSyntaxException pse) { return FormValidation.error(pse.getMessage()); } } return FormValidation.ok(); } } | BuildMonitorDescriptor extends ViewDescriptor { public FormValidation doCheckIncludeRegex(@QueryParameter String value) { String v = Util.fixEmpty(value); if (v != null) { try { Pattern.compile(v); } catch (PatternSyntaxException pse) { return FormValidation.error(pse.getMessage()); } } return FormValidation.ok(); } Bu... | BuildMonitorDescriptor extends ViewDescriptor { public FormValidation doCheckIncludeRegex(@QueryParameter String value) { String v = Util.fixEmpty(value); if (v != null) { try { Pattern.compile(v); } catch (PatternSyntaxException pse) { return FormValidation.error(pse.getMessage()); } } return FormValidation.ok(); } Bu... | BuildMonitorDescriptor extends ViewDescriptor { public FormValidation doCheckIncludeRegex(@QueryParameter String value) { String v = Util.fixEmpty(value); if (v != null) { try { Pattern.compile(v); } catch (PatternSyntaxException pse) { return FormValidation.error(pse.getMessage()); } } return FormValidation.ok(); } Bu... |
@Test public void should_complain_if_the_build_was_not_claimable() throws Exception { job = a(jobView().of( a(job().withName("my-project").whereTheLast(build().finishedWith(FAILURE))))); thrown.expectMessage("CanBeClaimed is not a feature of this project: 'my-project'"); job.which(CanBeClaimed.class); } | @Override public CanBeClaimed of(JobView jobView) { this.job = jobView; return this; } | CanBeClaimed implements Feature { @Override public CanBeClaimed of(JobView jobView) { this.job = jobView; return this; } } | CanBeClaimed implements Feature { @Override public CanBeClaimed of(JobView jobView) { this.job = jobView; return this; } } | CanBeClaimed implements Feature { @Override public CanBeClaimed of(JobView jobView) { this.job = jobView; return this; } @Override CanBeClaimed of(JobView jobView); @Override Claim asJson(); } | CanBeClaimed implements Feature { @Override public CanBeClaimed of(JobView jobView) { this.job = jobView; return this; } @Override CanBeClaimed of(JobView jobView); @Override Claim asJson(); } |
@Test public void should_support_job_without_badges() throws Exception { job = a(jobView().which(new HasBadgesGroovyPostbuildPlugin()).of( a(job()))); assertThat(serialisedBadgesDetailsOf(job), is(nullValue())); } | @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesGroovyPostbuildPlugin of(JobView jobView); @Override Badges asJson(); } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesGroovyPostbuildPlugin of(JobView jobView); @Override Badges asJson(); } |
@Test public void should_convert_badges_to_json() throws Exception { job = a(jobView().which(new HasBadgesGroovyPostbuildPlugin()).of( a(job().whereTheLast(build().hasBadgesGroovyPostbuildPlugin(groovyPostbuildBadge().withText("badge1"), groovyPostbuildBadge().withText("badge2")))))); assertThat(serialisedBadgesDetails... | @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesGroovyPostbuildPlugin of(JobView jobView); @Override Badges asJson(); } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesGroovyPostbuildPlugin of(JobView jobView); @Override Badges asJson(); } |
@Test public void should_ignore_badges_with_icon() throws Exception { job = a(jobView().which(new HasBadgesGroovyPostbuildPlugin()).of( a(job().whereTheLast(build().hasBadgesGroovyPostbuildPlugin(groovyPostbuildBadge().withIcon("icon.gif", "badge1"), groovyPostbuildBadge().withText("badge2")))))); assertThat(serialised... | @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesGroovyPostbuildPlugin of(JobView jobView); @Override Badges asJson(); } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesGroovyPostbuildPlugin of(JobView jobView); @Override Badges asJson(); } |
@Test public void should_report_badges_from_latest_build() throws Exception { job = a(jobView().which(new HasBadgesGroovyPostbuildPlugin()).of( a(job().whereTheLast(build().isStillBuilding().hasBadgesGroovyPostbuildPlugin(groovyPostbuildBadge().withText("badge1"))) .andThePrevious(build().hasBadgesGroovyPostbuildPlugin... | @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesGroovyPostbuildPlugin of(JobView jobView); @Override Badges asJson(); } | HasBadgesGroovyPostbuildPlugin implements Feature<HasBadgesGroovyPostbuildPlugin.Badges> { @Override public HasBadgesGroovyPostbuildPlugin of(JobView jobView) { this.job = jobView; return this; } @Override HasBadgesGroovyPostbuildPlugin of(JobView jobView); @Override Badges asJson(); } |
@Test public void should_describe_known_problems() { String rogueAi = "Pod bay doors didn't open"; job = a(jobView().which(new CanBeDiagnosedForProblems(BuildFailureAnalyzerDisplayedField.Name)).of( a(job().whereTheLast(build().finishedWith(FAILURE).and().knownProblems(rogueAi))))); assertThat(diagnosedFailuresOf(job).... | @Override public CanBeDiagnosedForProblems of(JobView jobView) { this.job = jobView; return this; } | CanBeDiagnosedForProblems implements Feature<CanBeDiagnosedForProblems.Problems> { @Override public CanBeDiagnosedForProblems of(JobView jobView) { this.job = jobView; return this; } } | CanBeDiagnosedForProblems implements Feature<CanBeDiagnosedForProblems.Problems> { @Override public CanBeDiagnosedForProblems of(JobView jobView) { this.job = jobView; return this; } CanBeDiagnosedForProblems(BuildFailureAnalyzerDisplayedField displayedField); } | CanBeDiagnosedForProblems implements Feature<CanBeDiagnosedForProblems.Problems> { @Override public CanBeDiagnosedForProblems of(JobView jobView) { this.job = jobView; return this; } CanBeDiagnosedForProblems(BuildFailureAnalyzerDisplayedField displayedField); @Override CanBeDiagnosedForProblems of(JobView jobView); @O... | CanBeDiagnosedForProblems implements Feature<CanBeDiagnosedForProblems.Problems> { @Override public CanBeDiagnosedForProblems of(JobView jobView) { this.job = jobView; return this; } CanBeDiagnosedForProblems(BuildFailureAnalyzerDisplayedField displayedField); @Override CanBeDiagnosedForProblems of(JobView jobView); @O... |
@Test public void should_know_current_build_number() { view = a(jobView().which(new KnowsLastCompletedBuildDetails()).of( a(job().whereTheLast(build().hasNumber(5))))); assertThat(lastCompletedBuildOf(view).name(), is("#5")); } | @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } } | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } KnowsLastCompletedBuildDetails(/* config */); } | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } KnowsLastCompletedBuildDetails(/* config */); @Override KnowsLastCompletedBuildDetails of(JobView jobView); @Ove... | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } KnowsLastCompletedBuildDetails(/* config */); @Override KnowsLastCompletedBuildDetails of(JobView jobView); @Ove... |
@Test public void should_use_build_name_if_its_known() { view = a(jobView().which(new KnowsLastCompletedBuildDetails()).of( a(job().whereTheLast(build().hasName("1.3.4+build.15"))))); assertThat(lastCompletedBuildOf(view).name(), is("1.3.4+build.15")); } | @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } } | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } KnowsLastCompletedBuildDetails(/* config */); } | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } KnowsLastCompletedBuildDetails(/* config */); @Override KnowsLastCompletedBuildDetails of(JobView jobView); @Ove... | KnowsLastCompletedBuildDetails implements Feature<KnowsLastCompletedBuildDetails.LastCompletedBuild> { @Override public KnowsLastCompletedBuildDetails of(JobView jobView) { this.job = jobView; return this; } KnowsLastCompletedBuildDetails(/* config */); @Override KnowsLastCompletedBuildDetails of(JobView jobView); @Ove... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.