diff --git a/src/main/java/de/mediathekview/mserver/base/config/Log4JConfigurationFactory.java b/src/main/java/de/mediathekview/mserver/base/config/Log4JConfigurationFactory.java index 69b38219fe5e5a2ca392c3a077618d023baa2942..8fed8a279e8821d57c8ed9be69d27a471a0eaa85 100644 --- a/src/main/java/de/mediathekview/mserver/base/config/Log4JConfigurationFactory.java +++ b/src/main/java/de/mediathekview/mserver/base/config/Log4JConfigurationFactory.java @@ -81,7 +81,7 @@ public class Log4JConfigurationFactory extends ConfigurationFactory { final AppenderComponentBuilder appenderBuilder; - if (logSettings.getLogActivateRollingFileAppend()) { + if (Boolean.TRUE.equals(logSettings.getLogActivateRollingFileAppend())) { appenderBuilder = aBuilder.newAppender(APPENDER_NAME_ROLLING_FILE, APPENDER_ROLLING_FILE); appenderBuilder diff --git a/src/main/java/de/mediathekview/mserver/crawler/CrawlerManager.java b/src/main/java/de/mediathekview/mserver/crawler/CrawlerManager.java index 2c01f5566c9da42a36ae0887b38d34561e0e8505..02c64b6015c1e091e4a595efa99230810b73582f 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/CrawlerManager.java +++ b/src/main/java/de/mediathekview/mserver/crawler/CrawlerManager.java @@ -414,7 +414,7 @@ public class CrawlerManager extends AbstractManager { } public void writeHashFile() { - if (config.getWriteFilmlistHashFileEnabled()) { + if (Boolean.TRUE.equals(config.getWriteFilmlistHashFileEnabled())) { final Path hashFilePath = filterPath(Paths.get(config.getFilmlistHashFilePath())).toAbsolutePath(); if (!Files.exists(hashFilePath.getParent()) @@ -426,7 +426,7 @@ public class CrawlerManager extends AbstractManager { } public void writeIdFile() { - if (config.getWriteFilmlistIdFileEnabled()) { + if (Boolean.TRUE.equals(config.getWriteFilmlistIdFileEnabled())) { final Path idFilePath = filterPath(Paths.get(config.getFilmlistIdFilePath())).toAbsolutePath(); if (!Files.exists(idFilePath.getParent()) diff --git a/src/main/java/de/mediathekview/mserver/crawler/ard/json/ArdFilmDeserializer.java b/src/main/java/de/mediathekview/mserver/crawler/ard/json/ArdFilmDeserializer.java index ba62cffd1dfc4ff1bcf0048fae3c7dbd622c66d0..e1078dd94926ab887417fe82e525a2fa8de98dda 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/ard/json/ArdFilmDeserializer.java +++ b/src/main/java/de/mediathekview/mserver/crawler/ard/json/ArdFilmDeserializer.java @@ -83,7 +83,7 @@ public class ArdFilmDeserializer implements JsonDeserializer<List<ArdFilmDto>> { } // remove time in topic if (topic.isPresent() && topic.get().contains("MDR aktuell")) { - return Optional.of(topic.get().replaceAll("[0-9][0-9]:[0-9][0-9] Uhr$", "").trim()); + return Optional.of(topic.get().replaceAll("\\d{2}:\\\\d{2} Uhr$", "").trim()); } return topic; diff --git a/src/main/java/de/mediathekview/mserver/crawler/ard/json/ArdVideoInfoJsonDeserializer.java b/src/main/java/de/mediathekview/mserver/crawler/ard/json/ArdVideoInfoJsonDeserializer.java index 02ca38a5fdc2a5ef37efa024f5979cc35e71da83..e419ab82ffdcf63f5d671770bf5e714f8df1d501 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/ard/json/ArdVideoInfoJsonDeserializer.java +++ b/src/main/java/de/mediathekview/mserver/crawler/ard/json/ArdVideoInfoJsonDeserializer.java @@ -89,7 +89,11 @@ public class ArdVideoInfoJsonDeserializer implements JsonDeserializer<ArdVideoIn if (m3u8Content.isPresent()) { final String url = m3u8File.toString(); - String baseUrl = url.replaceAll(UrlUtils.getFileName(url).get(), ""); + final Optional<String> filename = UrlUtils.getFileName(url); + if (filename.isEmpty()) { + return; + } + String baseUrl = url.replaceAll(filename.get(), ""); final M3U8Parser parser = new M3U8Parser(); final List<M3U8Dto> m3u8Data = parser.parse(m3u8Content.get()); diff --git a/src/main/java/de/mediathekview/mserver/crawler/arte/ArteCrawler.java b/src/main/java/de/mediathekview/mserver/crawler/arte/ArteCrawler.java index 0337b17ab0b7d2b8c96ebbf64836ca1aad11425b..0eb1b3235088cde80e9099cebe3dfc0e785500de 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/arte/ArteCrawler.java +++ b/src/main/java/de/mediathekview/mserver/crawler/arte/ArteCrawler.java @@ -161,9 +161,11 @@ public class ArteCrawler extends AbstractCrawler { updateProgress(); return new ArteFilmTask( this, new ConcurrentLinkedQueue<>(shows), getSender(), LocalDateTime.now()); - } catch (final InterruptedException | ExecutionException ex) { - LOG.fatal("Exception in ARTE crawler.", ex); + } catch (final InterruptedException ex) { + LOG.debug("{} crawler interrupted.", getSender().getName(), ex); Thread.currentThread().interrupt(); + } catch (final ExecutionException ex) { + LOG.fatal("Exception in {} crawler.", getSender().getName(), ex); } return null; } diff --git a/src/main/java/de/mediathekview/mserver/crawler/arte/json/ArteFilmDeserializer.java b/src/main/java/de/mediathekview/mserver/crawler/arte/json/ArteFilmDeserializer.java index e57cb8b92c239954b2f6d1e10b22b602498357a6..d7c3e649feeb2adfa31cc06ce58c2a4e57a34e42 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/arte/json/ArteFilmDeserializer.java +++ b/src/main/java/de/mediathekview/mserver/crawler/arte/json/ArteFilmDeserializer.java @@ -94,7 +94,7 @@ public class ArteFilmDeserializer implements JsonDeserializer<Optional<Film>> { try { film.setWebsite(new URL(urlWeb)); } catch (MalformedURLException e) { - LOG.error("Invalid url: " + urlWeb); + LOG.error("Invalid url: {}", urlWeb); } GeoLocations geoLocation = getGeoLocation(programElement); @@ -183,7 +183,7 @@ public class ArteFilmDeserializer implements JsonDeserializer<Optional<Film>> { geo = GeoLocations.GEO_NONE; break; default: - LOG.debug("New ARTE GeoLocation: " + code); + LOG.debug("New ARTE GeoLocation: {}", code); } } } diff --git a/src/main/java/de/mediathekview/mserver/crawler/arte/tasks/ArteSubcategoryVideosTask.java b/src/main/java/de/mediathekview/mserver/crawler/arte/tasks/ArteSubcategoryVideosTask.java index 5912e63149f453bd5cec980054a2c294374a1c2f..c2a8f50cbafa6a319f58658b67f9afc9e90550d7 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/arte/tasks/ArteSubcategoryVideosTask.java +++ b/src/main/java/de/mediathekview/mserver/crawler/arte/tasks/ArteSubcategoryVideosTask.java @@ -19,6 +19,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.lang.reflect.Type; +import java.util.Optional; import java.util.Queue; import java.util.Set; import java.util.concurrent.ConcurrentLinkedQueue; @@ -53,7 +54,10 @@ public class ArteSubcategoryVideosTask extends ArteTaskBase<ArteFilmUrlDto, Topi // int nextPageId = 0; try { - nextPageId = Integer.parseInt(UrlUtils.getUrlParameterValue(aDTO.getUrl(),"page").get()); + Optional<String> urlParameterPage = UrlUtils.getUrlParameterValue(aDTO.getUrl(),"page"); + if (urlParameterPage.isPresent()) { + nextPageId = Integer.parseInt(urlParameterPage.get()); + } } catch (UrlParseException|NumberFormatException e) { LOG.error("Failed to parse page from url {} error {}",aDTO.getUrl(), e.getMessage()); } diff --git a/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractCrawler.java b/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractCrawler.java index 16a59bf5cd49ac7b4d86a450ebcd561f498851d3..226a122add90a6865a96d23567dbe4df8fdd6538 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractCrawler.java +++ b/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractCrawler.java @@ -42,7 +42,7 @@ public abstract class AbstractCrawler implements Callable<Set<Film>> { private LocalDateTime startTime; protected JsoupConnection jsoupConnection; - public AbstractCrawler( + protected AbstractCrawler( final ForkJoinPool aForkJoinPool, final Collection<MessageListener> aMessageListeners, final Collection<SenderProgressListener> aProgressListeners, diff --git a/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractDocumentTask.java b/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractDocumentTask.java index ed6ee7b99577cd74d8c4dc8f70845fd039f21116..6f54d2fb4a6c8b4d0b44f958634061b13e3736dc 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractDocumentTask.java +++ b/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractDocumentTask.java @@ -33,7 +33,7 @@ public abstract class AbstractDocumentTask<T, D extends CrawlerUrlDTO> private Level httpErrorLogLevel; - public AbstractDocumentTask( + protected AbstractDocumentTask( final AbstractCrawler aCrawler, final Queue<D> urlToCrawlDTOs) { super(aCrawler, urlToCrawlDTOs); diff --git a/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractRecursiveConverterTask.java b/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractRecursiveConverterTask.java index fa146357748b4dd4e1943f029e3f6734cf579e81..df2c6c1588bfdaffb7f22ad2b4e9f565b8ad4619 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractRecursiveConverterTask.java +++ b/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractRecursiveConverterTask.java @@ -33,7 +33,7 @@ public abstract class AbstractRecursiveConverterTask<T, D> extends RecursiveTask /** The set of results. This set will be returned at the end of the task. */ protected transient Set<T> taskResults; - public AbstractRecursiveConverterTask( + protected AbstractRecursiveConverterTask( final AbstractCrawler aCrawler, final Queue<D> aUrlToCrawlDTOs) { crawler = aCrawler; elementsToProcess = aUrlToCrawlDTOs; diff --git a/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractRestTask.java b/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractRestTask.java index 8ce63fd0e54ce68c6d0b45a287ae4597f7d1796d..6c3ac42482183a5b3d80bfe6152d73340140f1dc 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractRestTask.java +++ b/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractRestTask.java @@ -34,7 +34,7 @@ public abstract class AbstractRestTask<T, D extends CrawlerUrlDTO> extends Abstr private final transient String authKey; private final transient Client client; - public AbstractRestTask( + protected AbstractRestTask( final AbstractCrawler aCrawler, final Queue<D> aUrlToCrawlDTOs, @Nullable final String aAuthKey) { diff --git a/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractUrlTask.java b/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractUrlTask.java index 5ed359bbebb2493bb81a839a7d4e69f4c47bf669..64f5f3b5a130e931297dfd083d7dc326b53fa7f1 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractUrlTask.java +++ b/src/main/java/de/mediathekview/mserver/crawler/basic/AbstractUrlTask.java @@ -16,7 +16,7 @@ public abstract class AbstractUrlTask<T, D extends CrawlerUrlDTO> extends AbstractRecursiveConverterTask<T, D> { private static final long serialVersionUID = -4077156510484515410L; - public AbstractUrlTask(final AbstractCrawler aCrawler, final Queue<D> aUrlToCrawlDTOs) { + protected AbstractUrlTask(final AbstractCrawler aCrawler, final Queue<D> aUrlToCrawlDTOs) { super(aCrawler, aUrlToCrawlDTOs); } diff --git a/src/main/java/de/mediathekview/mserver/crawler/basic/PagedElementListDTO.java b/src/main/java/de/mediathekview/mserver/crawler/basic/PagedElementListDTO.java index e6d421115046b82c37524d00bd6549e98fb0c5ff..ce1671fbc4182b145de75d3ca5666646c64ce111 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/basic/PagedElementListDTO.java +++ b/src/main/java/de/mediathekview/mserver/crawler/basic/PagedElementListDTO.java @@ -7,13 +7,11 @@ import java.util.Set; /** A simple Data-Transfer-Object to get the elements and the optionally found next page link. */ public class PagedElementListDTO<T> { - private final Set<T> elements; - private Optional<String> nextPage; + private final Set<T> elements = new HashSet<>(); + private Optional<String> nextPage = Optional.empty(); public PagedElementListDTO() { super(); - elements = new HashSet<>(); - nextPage = Optional.empty(); } public boolean addElements(final Collection<T> elements) { @@ -37,18 +35,10 @@ public class PagedElementListDTO<T> { return false; } final PagedElementListDTO other = (PagedElementListDTO) obj; - if (elements == null) { - if (other.elements != null) { - return false; - } - } else if (!elements.equals(other.elements)) { + if (!elements.equals(other.elements)) { return false; } - if (nextPage == null) { - return other.nextPage == null; - } else { - return nextPage.equals(other.nextPage); - } + return nextPage.equals(other.nextPage); } public Set<T> getElements() { @@ -72,8 +62,8 @@ public class PagedElementListDTO<T> { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + (elements == null ? 0 : elements.hashCode()); - result = prime * result + (nextPage == null ? 0 : nextPage.hashCode()); + result = prime * result + (elements.isEmpty() ? 0 : elements.hashCode()); + result = prime * result + (nextPage.isEmpty() ? 0 : nextPage.hashCode()); return result; } diff --git a/src/main/java/de/mediathekview/mserver/crawler/basic/TimeoutTask.java b/src/main/java/de/mediathekview/mserver/crawler/basic/TimeoutTask.java index 8ed6301d1a95ced6a3cb115e5f83e4b9efd89e7b..5e3340906c40af2e856945e1fa9cd58388a61612 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/basic/TimeoutTask.java +++ b/src/main/java/de/mediathekview/mserver/crawler/basic/TimeoutTask.java @@ -7,7 +7,7 @@ public abstract class TimeoutTask extends Thread { private final long maxTime; private boolean isRun; - public TimeoutTask(final long aMaxTime) { + protected TimeoutTask(final long aMaxTime) { isRun = true; maxTime = aMaxTime; } diff --git a/src/main/java/de/mediathekview/mserver/crawler/br/BrCrawler.java b/src/main/java/de/mediathekview/mserver/crawler/br/BrCrawler.java index 3bb54593b5d8d1daf890ad049b162e4a06da0034..f615c5d29e1827eb66d03d277124c30919d0cdc0 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/br/BrCrawler.java +++ b/src/main/java/de/mediathekview/mserver/crawler/br/BrCrawler.java @@ -54,10 +54,11 @@ public class BrCrawler extends AbstractCrawler { incrementMaxCountBySizeAndGetNewSize(idList.size()); printMessage( ServerMessages.DEBUG_MSSING_SENDUNGFOLGEN_COUNT, getSender().getName(), idList.size()); - } catch (final InterruptedException | ExecutionException exception) { - LOG.fatal("Something went terrible wrong collecting the clip details"); - exception.printStackTrace(); - printErrorMessage(); + } catch (final InterruptedException ex) { + LOG.debug("{} crawler interrupted.", getSender().getName(), ex); + Thread.currentThread().interrupt(); + } catch (final ExecutionException ex) { + LOG.fatal("Exception in {} crawler.", getSender().getName(), ex); } return new BrGetClipDetailsTask(this, idList); diff --git a/src/main/java/de/mediathekview/mserver/crawler/dw/DWTaskBase.java b/src/main/java/de/mediathekview/mserver/crawler/dw/DWTaskBase.java index 96805be840579c7dcfcf6fbd3d205b8a900e661d..3a57e66fdfec55e1c6bb6d583c0dbe867729c9ea 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/dw/DWTaskBase.java +++ b/src/main/java/de/mediathekview/mserver/crawler/dw/DWTaskBase.java @@ -3,6 +3,8 @@ package de.mediathekview.mserver.crawler.dw; import com.google.common.util.concurrent.RateLimiter; import com.google.gson.Gson; import com.google.gson.GsonBuilder; + +import de.mediathekview.mlib.daten.Sender; import de.mediathekview.mserver.base.config.MServerConfigManager; import de.mediathekview.mserver.crawler.basic.AbstractCrawler; import de.mediathekview.mserver.crawler.basic.AbstractRestTask; @@ -23,7 +25,9 @@ import java.util.Queue; public abstract class DWTaskBase<T, D extends CrawlerUrlDTO> extends AbstractRestTask<T, D> { private static final Logger LOG = LogManager.getLogger(DWTaskBase.class); - private transient RateLimiter limiter = null; + private static final RateLimiter limiter = + RateLimiter.create( + new MServerConfigManager().getSenderConfig(Sender.DW).getMaximumRequestsPerSecond()); private final transient GsonBuilder gsonBuilder; @@ -31,8 +35,6 @@ public abstract class DWTaskBase<T, D extends CrawlerUrlDTO> extends AbstractRes final AbstractCrawler aCrawler, final Queue<D> aUrlToCrawlDtos, final String authKey) { super(aCrawler, aUrlToCrawlDtos, authKey); gsonBuilder = new GsonBuilder();aCrawler.getSender(); - limiter = RateLimiter.create( - new MServerConfigManager().getSenderConfig(aCrawler.getSender()).getMaximumRequestsPerSecond()); } protected void registerJsonDeserializer(final Type aType, final Object aDeserializer) { diff --git a/src/main/java/de/mediathekview/mserver/crawler/dw/DwCrawler.java b/src/main/java/de/mediathekview/mserver/crawler/dw/DwCrawler.java index cc6f018f730de01556ab3d499507564b41ad4dbf..6d40161b162b927e1fd843548319da0e9c282062 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/dw/DwCrawler.java +++ b/src/main/java/de/mediathekview/mserver/crawler/dw/DwCrawler.java @@ -50,11 +50,11 @@ public class DwCrawler extends AbstractCrawler { return new DwFilmDetailTask(this,shows); - } catch (final ExecutionException executionException) { - LOG.fatal("Exception in DW crawler.", executionException); - } catch (final InterruptedException interruptedException) { - LOG.fatal("Exception in DW crawler.", interruptedException); + } catch (final InterruptedException ex) { + LOG.debug("{} crawler interrupted.", getSender().getName(), ex); Thread.currentThread().interrupt(); + } catch (final ExecutionException ex) { + LOG.fatal("Exception in {} crawler.", getSender().getName(), ex); } return null; } diff --git a/src/main/java/de/mediathekview/mserver/crawler/funk/FunkCrawler.java b/src/main/java/de/mediathekview/mserver/crawler/funk/FunkCrawler.java index 2ff065d02dd3e0a8b166a0e0ce178969ea3a1343..7174bc33815a3c807184b7548189972acc8e50c4 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/funk/FunkCrawler.java +++ b/src/main/java/de/mediathekview/mserver/crawler/funk/FunkCrawler.java @@ -67,14 +67,11 @@ public class FunkCrawler extends AbstractCrawler { getAndSetMaxCount(filmInfos.size()); return new FunkVideosToFilmsTask(this, filmInfos, channels, null); - } catch (final InterruptedException interruptedException) { - printErrorMessage(); - LOG.debug("Funk got interrupted.", interruptedException); + } catch (final InterruptedException ex) { + LOG.debug("{} crawler interrupted.", getSender().getName(), ex); Thread.currentThread().interrupt(); - } catch (final ExecutionException executionException) { - printErrorMessage(); - LOG.fatal( - "Something really bad happened while gathering the Funk channels.", executionException); + } catch (final ExecutionException ex) { + LOG.fatal("Exception in {} crawler.", getSender().getName(), ex); } return null; diff --git a/src/main/java/de/mediathekview/mserver/crawler/orf/OrfCrawler.java b/src/main/java/de/mediathekview/mserver/crawler/orf/OrfCrawler.java index 746a7477436a47f8166442e0ba6f6b0f328d2de8..10d3dd2f107532533d640a4edbcc5ac74ce5b573 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/orf/OrfCrawler.java +++ b/src/main/java/de/mediathekview/mserver/crawler/orf/OrfCrawler.java @@ -114,8 +114,11 @@ public class OrfCrawler extends AbstractCrawler { getAndSetMaxCount(shows.size()); return new OrfFilmDetailTask(this, shows); - } catch (final InterruptedException | ExecutionException ex) { - LOG.fatal("Exception in ORF crawler.", ex); + } catch (final InterruptedException ex) { + LOG.debug("{} crawler interrupted.", getSender().getName(), ex); + Thread.currentThread().interrupt(); + } catch (final ExecutionException ex) { + LOG.fatal("Exception in {} crawler.", getSender().getName(), ex); } return null; } diff --git a/src/main/java/de/mediathekview/mserver/crawler/orf/OrfVideoInfoDTO.java b/src/main/java/de/mediathekview/mserver/crawler/orf/OrfVideoInfoDTO.java index 70360812f313739dd55af9d77f13c7f4236b8f8a..596fa9393dd77c4bbddf77901701b02651695089 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/orf/OrfVideoInfoDTO.java +++ b/src/main/java/de/mediathekview/mserver/crawler/orf/OrfVideoInfoDTO.java @@ -6,7 +6,7 @@ import de.mediathekview.mlib.daten.Resolution; public class OrfVideoInfoDTO { - private static final String FILTER_JUGENDSCHUTZ = ".*/Jugendschutz[0-9][0-9][0-9][0-9]b[0-9][0-9][0-9][0-9]_.*"; + private static final String FILTER_JUGENDSCHUTZ = ".*/Jugendschutz\\d{4}b\\d{4}_.*"; private final Map<Resolution, String> videoUrls; private String subtitleUrl; diff --git a/src/main/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTask.java b/src/main/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTask.java index 67f77d95fd6e177bd3b9f5ada994f47c0a4729b5..370c7330883888c4e6851272b8867643c25819e4 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTask.java +++ b/src/main/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTask.java @@ -66,7 +66,7 @@ public class OrfFilmDetailTask extends AbstractDocumentTask<Film, TopicUrlDTO> { final LocalDateTime localDate = LocalDateTime.parse(dateValue, DATE_TIME_FORMATTER); return Optional.of(localDate); } catch (final DateTimeParseException e) { - LOG.debug("OrfFilmDetailTask: unknown date format: " + date.get()); + LOG.debug("OrfFilmDetailTask: unknown date format: {}", date.get()); } } @@ -82,13 +82,13 @@ public class OrfFilmDetailTask extends AbstractDocumentTask<Film, TopicUrlDTO> { final Optional<ChronoUnit> unit = determineChronoUnit(duration.get()); if (!unit.isPresent()) { - LOG.debug("OrfFilmDetailTask: unknown duration type: " + duration.get()); + LOG.debug("OrfFilmDetailTask: unknown duration type: {}", duration.get()); return Optional.empty(); } final String[] parts = duration.get().split(" ")[0].trim().split(":"); if (parts.length != 2) { - LOG.debug("OrfFilmDetailTask: unknown duration part count: " + duration.get()); + LOG.debug("OrfFilmDetailTask: unknown duration part count: {}", duration.get()); return Optional.empty(); } @@ -126,7 +126,7 @@ public class OrfFilmDetailTask extends AbstractDocumentTask<Film, TopicUrlDTO> { final List<OrfEpisodeInfoDTO> episodes = parseEpisodes(aDocument); if (episodes.size() > 1) { - crawler.incrementMaxCountBySizeAndGetNewSize(episodes.size() - 1); + crawler.incrementMaxCountBySizeAndGetNewSize(episodes.size() - 1L); crawler.updateProgress(); } @@ -192,7 +192,7 @@ public class OrfFilmDetailTask extends AbstractDocumentTask<Film, TopicUrlDTO> { crawler.incrementAndGetActualCount(); crawler.updateProgress(); } else { - LOG.error("OrfFilmDetailTask: no title or video found for url " + aUrlDto.getUrl()); + LOG.error("OrfFilmDetailTask: no title or video found for url {}", aUrlDto.getUrl()); crawler.incrementAndGetErrorCount(); crawler.updateProgress(); } diff --git a/src/main/java/de/mediathekview/mserver/crawler/orf/tasks/OrfHelper.java b/src/main/java/de/mediathekview/mserver/crawler/orf/tasks/OrfHelper.java index e2b8196f0581443a112a810acf8c2762c11e25ec..900e37f464ca562618bfe18756dd716bf24c4237 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/orf/tasks/OrfHelper.java +++ b/src/main/java/de/mediathekview/mserver/crawler/orf/tasks/OrfHelper.java @@ -22,7 +22,7 @@ class OrfHelper { } static String parseTheme(final String theme) { - final String result = theme.replaceAll("[0-9]{1,2}:[0-9][0-9]$", "").trim(); + final String result = theme.replaceAll("\\d{1,2}:\\d{2}$", "").trim(); // Thema steht vor Doppelpunkt // Ausnahmen // - ZIB-Sendungen mit Uhrzeit diff --git a/src/main/java/de/mediathekview/mserver/crawler/sr/SrCrawler.java b/src/main/java/de/mediathekview/mserver/crawler/sr/SrCrawler.java index 55bda97edb0d25fefa4a4dc64d80b1e82a8ca667..aeb2ab41f21ad9c7113c6404e975142adcab934a 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/sr/SrCrawler.java +++ b/src/main/java/de/mediathekview/mserver/crawler/sr/SrCrawler.java @@ -59,8 +59,11 @@ public class SrCrawler extends AbstractCrawler { getAndSetMaxCount(filmDtos.size()); return new SrFilmDetailTask(this, filmDtos); - } catch (final InterruptedException | ExecutionException ex) { - LOG.fatal("Exception in SR crawler.", ex); + } catch (final InterruptedException ex) { + LOG.debug("{} crawler interrupted.", getSender().getName(), ex); + Thread.currentThread().interrupt(); + } catch (final ExecutionException ex) { + LOG.fatal("Exception in {} crawler.", getSender().getName(), ex); } return null; } diff --git a/src/main/java/de/mediathekview/mserver/crawler/sr/tasks/SrTopicsOverviewPageTask.java b/src/main/java/de/mediathekview/mserver/crawler/sr/tasks/SrTopicsOverviewPageTask.java index b9a64aca1fb2d3b30074c90976b115a9795f49c3..6f9a9036b05ac8f5f34c5fb286fc49249173772d 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/sr/tasks/SrTopicsOverviewPageTask.java +++ b/src/main/java/de/mediathekview/mserver/crawler/sr/tasks/SrTopicsOverviewPageTask.java @@ -59,7 +59,7 @@ public class SrTopicsOverviewPageTask implements Callable<Queue<SrTopicUrlDTO>> final Document subpageDocument = crawler.requestBodyAsHtmlDocument(url); results.addAll(parseOverviewPage(subpageDocument)); } catch (final IOException ex) { - LOG.fatal("SrTopicsOverviewPageTask: error parsing url " + url, ex); + LOG.fatal("SrTopicsOverviewPageTask: error parsing url {}", url, ex); } }); diff --git a/src/main/java/de/mediathekview/mserver/crawler/srf/SrfCrawler.java b/src/main/java/de/mediathekview/mserver/crawler/srf/SrfCrawler.java index 10fe67462ef5c929185662372e8d5feaba997c04..4bbc762dd36a8576a7f86ed3d2ed476d6e4454e9 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/srf/SrfCrawler.java +++ b/src/main/java/de/mediathekview/mserver/crawler/srf/SrfCrawler.java @@ -50,7 +50,7 @@ public class SrfCrawler extends AbstractCrawler { @Override protected RecursiveTask<Set<Film>> createCrawlerTask() { try { - final Set<CrawlerUrlDTO> dtos = new HashSet<CrawlerUrlDTO>(); + final Set<CrawlerUrlDTO> dtos = new HashSet<>(); // final Queue<CrawlerUrlDTO> schedulePageUrls = createScheduleUrls(); final SrfScheduleOverviewTask schedulePageTask = new SrfScheduleOverviewTask(this, schedulePageUrls); @@ -81,9 +81,11 @@ public class SrfCrawler extends AbstractCrawler { return new SrfFilmDetailTask(this, new ConcurrentLinkedQueue<>(dtos)); - } catch (final InterruptedException | ExecutionException ex) { - LOG.fatal("Exception in SRF crawler.", ex); + } catch (final InterruptedException ex) { + LOG.debug("{} crawler interrupted.", getSender().getName(), ex); Thread.currentThread().interrupt(); + } catch (final ExecutionException ex) { + LOG.fatal("Exception in {} crawler.", getSender().getName(), ex); } return null; } diff --git a/src/main/java/de/mediathekview/mserver/crawler/srf/parser/SrfFilmJsonDeserializer.java b/src/main/java/de/mediathekview/mserver/crawler/srf/parser/SrfFilmJsonDeserializer.java index 38e561168938dc704ec6efa8b52fab396db83b4e..60f4b693a0c6ecbfa7e4b30697403b9eba6dbf07 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/srf/parser/SrfFilmJsonDeserializer.java +++ b/src/main/java/de/mediathekview/mserver/crawler/srf/parser/SrfFilmJsonDeserializer.java @@ -338,11 +338,11 @@ public class SrfFilmJsonDeserializer implements JsonDeserializer<Optional<Film>> try { content = Optional.of(crawler.requestBodyAsString(optimizedUrl)); - if (content.isEmpty() || content.get().length() == 0) { + if (content.get().length() == 0) { content = Optional.of(crawler.requestBodyAsString(aM3U8Url)); } - if (content.isPresent() && content.get().length() > 0) { + if (content.get().length() > 0) { final M3U8Parser parser = new M3U8Parser(); final List<M3U8Dto> m3u8Data = parser.parse(content.get()); m3u8Data.forEach( diff --git a/src/main/java/de/mediathekview/mserver/crawler/zdf/AbstractZdfCrawler.java b/src/main/java/de/mediathekview/mserver/crawler/zdf/AbstractZdfCrawler.java index 4777d8752875fc0360004c4907c5ffaf4e88cfb3..db2220ead8070247056a7dc54efe50e0fa0abcfe 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/zdf/AbstractZdfCrawler.java +++ b/src/main/java/de/mediathekview/mserver/crawler/zdf/AbstractZdfCrawler.java @@ -30,7 +30,7 @@ public abstract class AbstractZdfCrawler extends AbstractCrawler { private static final Logger LOG = LogManager.getLogger(AbstractZdfCrawler.class); - public AbstractZdfCrawler( + protected AbstractZdfCrawler( final ForkJoinPool aForkJoinPool, final Collection<MessageListener> aMessageListeners, final Collection<SenderProgressListener> aProgressListeners, diff --git a/src/main/java/de/mediathekview/mserver/crawler/zdf/json/DownloadDto.java b/src/main/java/de/mediathekview/mserver/crawler/zdf/json/DownloadDto.java index 943fd5216ca9e4636d1914e961c7da5360122b03..c967d42f0ecef0902fcca996106401219fde719c 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/zdf/json/DownloadDto.java +++ b/src/main/java/de/mediathekview/mserver/crawler/zdf/json/DownloadDto.java @@ -22,12 +22,7 @@ public class DownloadDto { } public void addUrl(final String language, final Resolution quality, final String url) { - if (!downloadUrls.containsKey(language)) { - downloadUrls.put(language, new EnumMap<>(Resolution.class)); - } - - Map<Resolution, String> urlMap = downloadUrls.get(language); - urlMap.put(quality, url); + downloadUrls.computeIfAbsent(language, k -> (new EnumMap<>(Resolution.class))).put(quality, url); } public Map<Resolution, String> getDownloadUrls(final String language) { diff --git a/src/main/java/de/mediathekview/mserver/crawler/zdf/tasks/ZdfIndexPageTask.java b/src/main/java/de/mediathekview/mserver/crawler/zdf/tasks/ZdfIndexPageTask.java index b2a5e1e892a285675eaf03bc7e7b8331d720694e..8af14219a27c6d1158b58153a2058b2525d0acc1 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/zdf/tasks/ZdfIndexPageTask.java +++ b/src/main/java/de/mediathekview/mserver/crawler/zdf/tasks/ZdfIndexPageTask.java @@ -98,7 +98,7 @@ public class ZdfIndexPageTask implements Callable<ZdfConfiguration> { final Document document = crawler.requestBodyAsHtmlDocument(url); return Optional.of(document); } catch (final IOException ex) { - LOG.fatal("ZdfIndexPageTask: error loading url " + url, ex); + LOG.fatal("ZdfIndexPageTask: error loading url {}", url, ex); } return Optional.empty(); diff --git a/src/main/java/de/mediathekview/mserver/crawler/zdf/tasks/ZdfTaskBase.java b/src/main/java/de/mediathekview/mserver/crawler/zdf/tasks/ZdfTaskBase.java index 0e6cbaf4efff1fcdd0dbe3b67f12791d4a1938bd..6c03163249700135efe408dfad3260b859a1a9ed 100644 --- a/src/main/java/de/mediathekview/mserver/crawler/zdf/tasks/ZdfTaskBase.java +++ b/src/main/java/de/mediathekview/mserver/crawler/zdf/tasks/ZdfTaskBase.java @@ -28,7 +28,7 @@ public abstract class ZdfTaskBase<T, D extends CrawlerUrlDTO> extends AbstractRe private final GsonBuilder gsonBuilder; - public ZdfTaskBase( + protected ZdfTaskBase( final AbstractCrawler aCrawler, final Queue<D> aUrlToCrawlDtos, final String authKey) { super(aCrawler, aUrlToCrawlDtos, authKey); gsonBuilder = new GsonBuilder(); diff --git a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestAddDomainIfMissing.java b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsAddDomainIfMissingTest.java similarity index 91% rename from src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestAddDomainIfMissing.java rename to src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsAddDomainIfMissingTest.java index 2a060df51cfc2e49bdbe498e3de4e1b514b352c9..e12b812a78e28f9758db71101b1e468605b29b84 100644 --- a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestAddDomainIfMissing.java +++ b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsAddDomainIfMissingTest.java @@ -11,12 +11,12 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; @RunWith(Parameterized.class) -public class UrlUtilsTestAddDomainIfMissing { +public class UrlUtilsAddDomainIfMissingTest { private static final String DOMAIN = "https://mydomain.de"; private final String inputUrl; private final String expectedBaseUrl; - public UrlUtilsTestAddDomainIfMissing(final String aInputUrl, final String aExpectedBaseUrl) { + public UrlUtilsAddDomainIfMissingTest(final String aInputUrl, final String aExpectedBaseUrl) { inputUrl = aInputUrl; expectedBaseUrl = aExpectedBaseUrl; } diff --git a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestAddProtocolIfMissing.java b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsAddProtocolIfMissingTest.java similarity index 92% rename from src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestAddProtocolIfMissing.java rename to src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsAddProtocolIfMissingTest.java index e04b4e21b872e4a6095b3e3a899004e454089fac..db2078816b2194257d7193d60ea91a61f6fb1f30 100644 --- a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestAddProtocolIfMissing.java +++ b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsAddProtocolIfMissingTest.java @@ -11,13 +11,13 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; @RunWith(Parameterized.class) -public class UrlUtilsTestAddProtocolIfMissing { +public class UrlUtilsAddProtocolIfMissingTest { private static final String PROTOCOL = "https:"; private final String inputUrl; private final String expectedBaseUrl; - public UrlUtilsTestAddProtocolIfMissing(final String aInputUrl, final String aExpectedBaseUrl) { + public UrlUtilsAddProtocolIfMissingTest(final String aInputUrl, final String aExpectedBaseUrl) { inputUrl = aInputUrl; expectedBaseUrl = aExpectedBaseUrl; } diff --git a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestExistsUrl.java b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsExistsUrlTest.java similarity index 94% rename from src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestExistsUrl.java rename to src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsExistsUrlTest.java index b29561766f82844496718dfa4c7cec4770983280..d168f9ce21744895337d57fe2cb540a1f3845f78 100644 --- a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestExistsUrl.java +++ b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsExistsUrlTest.java @@ -6,7 +6,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; -public class UrlUtilsTestExistsUrl extends WireMockTestBase { +public class UrlUtilsExistsUrlTest extends WireMockTestBase { @Test public void existsUrlTestNull() { diff --git a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetBaseUrl.java b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetBaseUrlTest.java similarity index 91% rename from src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetBaseUrl.java rename to src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetBaseUrlTest.java index fd9e7557c4c4a3fda87b50eb2ff352469b428ef1..50572170733b781f2e1d5e8327c75c66419ea39a 100644 --- a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetBaseUrl.java +++ b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetBaseUrlTest.java @@ -11,11 +11,11 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; @RunWith(Parameterized.class) -public class UrlUtilsTestGetBaseUrl { +public class UrlUtilsGetBaseUrlTest { private final String inputUrl; private final String expectedBaseUrl; - public UrlUtilsTestGetBaseUrl(final String aInputUrl, final String aExpectedBaseUrl) { + public UrlUtilsGetBaseUrlTest(final String aInputUrl, final String aExpectedBaseUrl) { inputUrl = aInputUrl; expectedBaseUrl = aExpectedBaseUrl; } diff --git a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetFileName.java b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetFileNameTest.java similarity index 93% rename from src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetFileName.java rename to src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetFileNameTest.java index 3ae59d53c3a2c61abd66b91f8eb7923e9cff6a08..68996a58caf2c2397ea1d9f6be149e915531d53d 100644 --- a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetFileName.java +++ b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetFileNameTest.java @@ -12,12 +12,12 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; @RunWith(Parameterized.class) -public class UrlUtilsTestGetFileName { +public class UrlUtilsGetFileNameTest { private final String inputUrl; private final Optional<String> expectedFileType; - public UrlUtilsTestGetFileName(final String aInputUrl, final Optional<String> aExpectedFileType) { + public UrlUtilsGetFileNameTest(final String aInputUrl, final Optional<String> aExpectedFileType) { inputUrl = aInputUrl; expectedFileType = aExpectedFileType; } diff --git a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetFileType.java b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetFileTypeTest.java similarity index 94% rename from src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetFileType.java rename to src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetFileTypeTest.java index 911da970f7f316c4fbcec9b65b550263ca3e207f..4fb0201601785f2da4fc39ebd023c1c8fa5993db 100644 --- a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetFileType.java +++ b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetFileTypeTest.java @@ -12,12 +12,12 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; @RunWith(Parameterized.class) -public class UrlUtilsTestGetFileType { +public class UrlUtilsGetFileTypeTest { private final String inputUrl; private final Optional<String> expectedFileType; - public UrlUtilsTestGetFileType(final String aInputUrl, final Optional<String> aExpectedFileType) { + public UrlUtilsGetFileTypeTest(final String aInputUrl, final Optional<String> aExpectedFileType) { inputUrl = aInputUrl; expectedFileType = aExpectedFileType; } diff --git a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetLastSegment.java b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetLastSegmentTest.java similarity index 92% rename from src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetLastSegment.java rename to src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetLastSegmentTest.java index c4a6deda78baa2c9c65048e9a6df25a51e373dc2..255ff7d4dd07927735a230d5c975707a488128e9 100644 --- a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetLastSegment.java +++ b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetLastSegmentTest.java @@ -12,12 +12,12 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; @RunWith(Parameterized.class) -public class UrlUtilsTestGetLastSegment { +public class UrlUtilsGetLastSegmentTest { private final String inputUrl; private final Optional<String> expectedResult; - public UrlUtilsTestGetLastSegment(final String inputUrl, final Optional<String> expectedResult) { + public UrlUtilsGetLastSegmentTest(final String inputUrl, final Optional<String> expectedResult) { this.inputUrl = inputUrl; this.expectedResult = expectedResult; } diff --git a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetProtocol.java b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetProtocolTest.java similarity index 91% rename from src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetProtocol.java rename to src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetProtocolTest.java index 94a55e177b84bdf327f16591c83b54a4c779bc04..8329f8fd17e9e08a59aca814775a7a86ca3a5284 100644 --- a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetProtocol.java +++ b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetProtocolTest.java @@ -12,11 +12,11 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; @RunWith(Parameterized.class) -public class UrlUtilsTestGetProtocol { +public class UrlUtilsGetProtocolTest { private final String inputUrl; private final Optional<String> expectedProtocol; - public UrlUtilsTestGetProtocol(final String aInputUrl, final Optional<String> aExpectedProtocol) { + public UrlUtilsGetProtocolTest(final String aInputUrl, final Optional<String> aExpectedProtocol) { inputUrl = aInputUrl; expectedProtocol = aExpectedProtocol; } diff --git a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetUrlParameterValue.java b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetUrlParameterValueTest.java similarity index 94% rename from src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetUrlParameterValue.java rename to src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetUrlParameterValueTest.java index e5ef69dd9a70c8839a78d6dd6ea7e8a12f9506d4..19c1575f8e402bf30428d22d9281dc25eb368b24 100644 --- a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestGetUrlParameterValue.java +++ b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsGetUrlParameterValueTest.java @@ -12,12 +12,12 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; @RunWith(Parameterized.class) -public class UrlUtilsTestGetUrlParameterValue { +public class UrlUtilsGetUrlParameterValueTest { private final String inputUrl; private final String parameterName; private final Optional<String> expectedParameterValue; - public UrlUtilsTestGetUrlParameterValue( + public UrlUtilsGetUrlParameterValueTest( final String aInputUrl, final String aParameterName, final Optional<String> aExpectedParameterValue) { inputUrl = aInputUrl; parameterName = aParameterName; diff --git a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestRemoveParameters.java b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsRemoveParametersTest.java similarity index 91% rename from src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestRemoveParameters.java rename to src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsRemoveParametersTest.java index 92f6c2cc51c4f9c06cef6b2e20a7d475e6b3b5cc..59b5e152e6eebbd0450c0806cd98bc308c15a598 100644 --- a/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsTestRemoveParameters.java +++ b/src/test/java/de/mediathekview/mserver/base/utils/UrlUtilsRemoveParametersTest.java @@ -11,11 +11,11 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; @RunWith(Parameterized.class) -public class UrlUtilsTestRemoveParameters { +public class UrlUtilsRemoveParametersTest { private final String inputUrl; private final String expectedUrl; - public UrlUtilsTestRemoveParameters(final String aInputUrl, final String aExpectedUrl) { + public UrlUtilsRemoveParametersTest(final String aInputUrl, final String aExpectedUrl) { inputUrl = aInputUrl; expectedUrl = aExpectedUrl; } diff --git a/src/test/java/de/mediathekview/mserver/crawler/basic/M3U8DtoTestGetResolution.java b/src/test/java/de/mediathekview/mserver/crawler/basic/M3U8DtoGetResolutionTest.java similarity index 96% rename from src/test/java/de/mediathekview/mserver/crawler/basic/M3U8DtoTestGetResolution.java rename to src/test/java/de/mediathekview/mserver/crawler/basic/M3U8DtoGetResolutionTest.java index d798a8e7d2e21a30c2f3c84acfb5763aba4400c5..c66f4b2b7531c930191ee46ae43d278fbc43e1cb 100644 --- a/src/test/java/de/mediathekview/mserver/crawler/basic/M3U8DtoTestGetResolution.java +++ b/src/test/java/de/mediathekview/mserver/crawler/basic/M3U8DtoGetResolutionTest.java @@ -13,11 +13,11 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; @RunWith(Parameterized.class) -public class M3U8DtoTestGetResolution { +public class M3U8DtoGetResolutionTest { private final Optional<Resolution> expectedResolution; private final M3U8Dto target; - public M3U8DtoTestGetResolution( + public M3U8DtoGetResolutionTest( final String aUrl, final String aCodec, final String aResolution, diff --git a/src/test/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTaskTestWithEpisodes.java b/src/test/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTaskWithEpisodesTest.java similarity index 99% rename from src/test/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTaskTestWithEpisodes.java rename to src/test/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTaskWithEpisodesTest.java index 8b66f121084d7788d7b98e5415b2495ab990f7e9..1ba587b01ae65eae0852d2a571b4d17185c0a177 100644 --- a/src/test/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTaskTestWithEpisodes.java +++ b/src/test/java/de/mediathekview/mserver/crawler/orf/tasks/OrfFilmDetailTaskWithEpisodesTest.java @@ -24,7 +24,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; -public class OrfFilmDetailTaskTestWithEpisodes extends OrfFilmDetailTaskTestBase { +public class OrfFilmDetailTaskWithEpisodesTest extends OrfFilmDetailTaskTestBase { private static final String REQUEST_URL = "https://tvthek.orf.at/profile/ZIB-900/71256/ZIB-900/14007767"; diff --git a/src/test/java/de/mediathekview/mserver/crawler/phoenix/parser/PhoenixFilmDetailDeserializerTestError.java b/src/test/java/de/mediathekview/mserver/crawler/phoenix/parser/PhoenixFilmDetailDeserializerErrorTest.java similarity index 93% rename from src/test/java/de/mediathekview/mserver/crawler/phoenix/parser/PhoenixFilmDetailDeserializerTestError.java rename to src/test/java/de/mediathekview/mserver/crawler/phoenix/parser/PhoenixFilmDetailDeserializerErrorTest.java index 1384d061d2fc6a79d15e9f345d0bf209073b1995..306a6aa0353affcb6a6f805bf61d2cbc3659172b 100644 --- a/src/test/java/de/mediathekview/mserver/crawler/phoenix/parser/PhoenixFilmDetailDeserializerTestError.java +++ b/src/test/java/de/mediathekview/mserver/crawler/phoenix/parser/PhoenixFilmDetailDeserializerErrorTest.java @@ -9,7 +9,7 @@ import java.util.Optional; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -public class PhoenixFilmDetailDeserializerTestError { +public class PhoenixFilmDetailDeserializerErrorTest { @Test public void testNullInAbsatzArray() { diff --git a/src/test/java/de/mediathekview/mserver/crawler/sr/tasks/SrFilmDetailTaskTestNoFilm.java b/src/test/java/de/mediathekview/mserver/crawler/sr/tasks/SrFilmDetailTaskNoFilmTest.java similarity index 96% rename from src/test/java/de/mediathekview/mserver/crawler/sr/tasks/SrFilmDetailTaskTestNoFilm.java rename to src/test/java/de/mediathekview/mserver/crawler/sr/tasks/SrFilmDetailTaskNoFilmTest.java index 0f33e903b47a74b0e45b13dcb530d289e2cd9dcc..79758c4b741f33e7ccd4f1ee26f0d9f95b2d6ab4 100644 --- a/src/test/java/de/mediathekview/mserver/crawler/sr/tasks/SrFilmDetailTaskTestNoFilm.java +++ b/src/test/java/de/mediathekview/mserver/crawler/sr/tasks/SrFilmDetailTaskNoFilmTest.java @@ -21,7 +21,7 @@ import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; @RunWith(Parameterized.class) -public class SrFilmDetailTaskTestNoFilm extends SrTaskTestBase { +public class SrFilmDetailTaskNoFilmTest extends SrTaskTestBase { private final String requestUrl; private final String filmPageFile; @@ -36,7 +36,7 @@ public class SrFilmDetailTaskTestNoFilm extends SrTaskTestBase { MockitoAnnotations.openMocks(this); } - public SrFilmDetailTaskTestNoFilm( + public SrFilmDetailTaskNoFilmTest( final String aRequestUrl, final String aFilmPageFile, final String aTheme, diff --git a/src/test/java/de/mediathekview/mserver/crawler/srf/parser/SrfFilmJsonDeserializerTestError.java b/src/test/java/de/mediathekview/mserver/crawler/srf/parser/SrfFilmJsonDeserializerErrorTest.java similarity index 96% rename from src/test/java/de/mediathekview/mserver/crawler/srf/parser/SrfFilmJsonDeserializerTestError.java rename to src/test/java/de/mediathekview/mserver/crawler/srf/parser/SrfFilmJsonDeserializerErrorTest.java index b01b641017ce3477d3d24e0ee899ddff73659db5..5b456056aec8f57f004c4733274c64a3535197da 100644 --- a/src/test/java/de/mediathekview/mserver/crawler/srf/parser/SrfFilmJsonDeserializerTestError.java +++ b/src/test/java/de/mediathekview/mserver/crawler/srf/parser/SrfFilmJsonDeserializerErrorTest.java @@ -12,7 +12,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; /** Tests error scenarios of SrfFilmJsonDeserializer */ -public class SrfFilmJsonDeserializerTestError extends SrfTaskTestBase { +public class SrfFilmJsonDeserializerErrorTest extends SrfTaskTestBase { @Test public void testDrmUrl() {