Adds more tests for api

This commit is contained in:
Guillaume Tâche
2024-08-25 20:45:27 +02:00
parent e93a47f4e2
commit bf68d0a206
13 changed files with 307 additions and 47 deletions

View File

@@ -0,0 +1,27 @@
package com.github.gtache.autosubtitle.archive.client;
import com.github.gtache.autosubtitle.archive.Archiver;
import java.io.IOException;
import java.nio.file.Path;
import java.util.List;
/**
* {@link Archiver} using a remote API
*/
public class RemoteArchiver implements Archiver {
@Override
public void compress(final List<Path> files, final Path destination) throws IOException {
throw new UnsupportedOperationException();
}
@Override
public void decompress(final Path archive, final Path destination) throws IOException {
throw new UnsupportedOperationException();
}
@Override
public String archiveExtension() {
throw new UnsupportedOperationException();
}
}

View File

@@ -0,0 +1,40 @@
package com.github.gtache.autosubtitle.client;
import com.github.gtache.autosubtitle.Audio;
import com.github.gtache.autosubtitle.Video;
import com.github.gtache.autosubtitle.VideoConverter;
import com.github.gtache.autosubtitle.subtitle.SubtitleCollection;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Collection;
/**
* {@link VideoConverter} using a remote API
*/
public class RemoteVideoConverter implements VideoConverter {
@Override
public Video addSoftSubtitles(final Video video, final Collection<? extends SubtitleCollection<?>> subtitles) throws IOException {
throw new UnsupportedOperationException();
}
@Override
public void addSoftSubtitles(final Video video, final Collection<? extends SubtitleCollection<?>> subtitles, final Path path) throws IOException {
throw new UnsupportedOperationException();
}
@Override
public Video addHardSubtitles(final Video video, final SubtitleCollection<?> subtitles) throws IOException {
throw new UnsupportedOperationException();
}
@Override
public void addHardSubtitles(final Video video, final SubtitleCollection<?> subtitles, final Path path) throws IOException {
throw new UnsupportedOperationException();
}
@Override
public Audio getAudio(final Video video) throws IOException {
throw new UnsupportedOperationException();
}
}

View File

@@ -0,0 +1,17 @@
package com.github.gtache.autosubtitle.client;
import com.github.gtache.autosubtitle.Video;
import com.github.gtache.autosubtitle.VideoLoader;
import java.io.IOException;
import java.nio.file.Path;
/**
* {@link VideoLoader} using a remote API
*/
public class RemoteVideoLoader implements VideoLoader {
@Override
public Video loadVideo(final Path path) throws IOException {
throw new UnsupportedOperationException();
}
}

View File

@@ -0,0 +1,29 @@
package com.github.gtache.autosubtitle.subtitle.converter.client;
import com.github.gtache.autosubtitle.VideoInfo;
import com.github.gtache.autosubtitle.subtitle.Subtitle;
import com.github.gtache.autosubtitle.subtitle.SubtitleCollection;
import com.github.gtache.autosubtitle.subtitle.converter.ParseException;
import com.github.gtache.autosubtitle.subtitle.converter.SubtitleConverter;
/**
* {@link SubtitleConverter} using a remote API
*
* @param <T> the type of subtitle
*/
public class RemoteSubtitleConverter<T extends Subtitle> implements SubtitleConverter<T> {
@Override
public String format(final SubtitleCollection<?> collection, final VideoInfo videoInfo) {
throw new UnsupportedOperationException();
}
@Override
public SubtitleCollection<T> parse(final String content) throws ParseException {
throw new UnsupportedOperationException();
}
@Override
public String formatName() {
throw new UnsupportedOperationException();
}
}

View File

@@ -0,0 +1,26 @@
package com.github.gtache.autosubtitle.subtitle.extractor.client;
import com.github.gtache.autosubtitle.Audio;
import com.github.gtache.autosubtitle.Language;
import com.github.gtache.autosubtitle.Video;
import com.github.gtache.autosubtitle.subtitle.SubtitleCollection;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractException;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractionModel;
import com.github.gtache.autosubtitle.subtitle.extractor.SubtitleExtractor;
import com.github.gtache.autosubtitle.subtitle.extractor.impl.AbstractSubtitleExtractor;
/**
* {@link SubtitleExtractor} using a remote API
*/
public class RemoteSubtitleExtractor extends AbstractSubtitleExtractor {
@Override
public SubtitleCollection extract(final Video video, final Language language, final ExtractionModel model) throws ExtractException {
throw new UnsupportedOperationException();
}
@Override
public SubtitleCollection extract(final Audio audio, final Language language, final ExtractionModel model) throws ExtractException {
throw new UnsupportedOperationException();
}
}

View File

@@ -0,0 +1,34 @@
package com.github.gtache.autosubtitle.translation.client;
import com.github.gtache.autosubtitle.Language;
import com.github.gtache.autosubtitle.subtitle.Subtitle;
import com.github.gtache.autosubtitle.subtitle.SubtitleCollection;
import com.github.gtache.autosubtitle.translation.TranslationException;
import com.github.gtache.autosubtitle.translation.Translator;
/**
* {@link Translator} using a remote API
*
* @param <T> the type of subtitle
*/
public class RemoteTranslator<T extends Subtitle> implements Translator<T> {
@Override
public Language getLanguage(final String text) {
throw new UnsupportedOperationException();
}
@Override
public String translate(final String text, final Language from, final Language to) throws TranslationException {
throw new UnsupportedOperationException();
}
@Override
public T translate(final Subtitle subtitle, final Language from, final Language to) throws TranslationException {
throw new UnsupportedOperationException();
}
@Override
public SubtitleCollection<T> translate(final SubtitleCollection<?> collection, final Language from, final Language to) throws TranslationException {
throw new UnsupportedOperationException();
}
}