1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-01-16 20:28:15 +01:00

AbstractRipperTest.java - format, organize imports

This commit is contained in:
MetaPrime 2025-01-06 00:24:09 -08:00
parent 92579d6179
commit b32406042f

View File

@ -1,33 +1,39 @@
package com.rarchives.ripme.tst;
import com.rarchives.ripme.ripper.AbstractRipper;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
import com.rarchives.ripme.ripper.AbstractRipper;
public class AbstractRipperTest {
@Test
public void testGetFileName() throws IOException, URISyntaxException {
String fileName = AbstractRipper.getFileName(new URI("http://www.tsumino.com/Image/Object?name=U1EieteEGwm6N1dGszqCpA%3D%3D").toURL(),null, "test", "test");
assertEquals("test.test", fileName);
public void testGetFileName() throws IOException, URISyntaxException {
String fileName = AbstractRipper.getFileName(
new URI("http://www.tsumino.com/Image/Object?name=U1EieteEGwm6N1dGszqCpA%3D%3D").toURL(),
null, "test", "test");
assertEquals("test.test", fileName);
fileName = AbstractRipper.getFileName(new URI("http://www.tsumino.com/Image/Object?name=U1EieteEGwm6N1dGszqCpA%3D%3D").toURL(), null,"test", null);
assertEquals("test", fileName);
fileName = AbstractRipper.getFileName(
new URI("http://www.tsumino.com/Image/Object?name=U1EieteEGwm6N1dGszqCpA%3D%3D").toURL(),
null, "test", null);
assertEquals("test", fileName);
fileName = AbstractRipper.getFileName(new URI("http://www.tsumino.com/Image/Object?name=U1EieteEGwm6N1dGszqCpA%3D%3D").toURL(), null,null, null);
assertEquals("Object", fileName);
fileName = AbstractRipper.getFileName(
new URI("http://www.tsumino.com/Image/Object?name=U1EieteEGwm6N1dGszqCpA%3D%3D").toURL(),
null, null, null);
assertEquals("Object", fileName);
fileName = AbstractRipper.getFileName(new URI("http://www.test.com/file.png").toURL(), null,null, null);
assertEquals("file.png", fileName);
fileName = AbstractRipper.getFileName(new URI("http://www.test.com/file.").toURL(), null,null, null);
assertEquals("file.", fileName);
}
fileName = AbstractRipper.getFileName(new URI("http://www.test.com/file.png").toURL(),
null, null, null);
assertEquals("file.png", fileName);
fileName = AbstractRipper.getFileName(new URI("http://www.test.com/file.").toURL(),
null, null, null);
assertEquals("file.", fileName);
}
}