1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-26 23:34:53 +02:00

com.rarchives.ripme.tst from junit3 to junit5

AppTest is not migrated as it only does true=true, otherwise it is not
clear what this should be.
This commit is contained in:
soloturn
2020-07-26 11:34:20 +02:00
parent d2947e9e4a
commit 2e221e5713
3 changed files with 14 additions and 6 deletions

View File

@@ -1,15 +1,17 @@
package com.rarchives.ripme.tst;
import com.rarchives.ripme.ripper.AbstractRipper;
import junit.framework.TestCase;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.net.URL;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class AbstractRipperTest extends TestCase {
public class AbstractRipperTest {
@Test
public void testGetFileName() throws IOException {
String fileName = AbstractRipper.getFileName(new URL("http://www.tsumino.com/Image/Object?name=U1EieteEGwm6N1dGszqCpA%3D%3D"), "test", "test");
assertEquals("test.test", fileName);

View File

@@ -1,10 +1,13 @@
package com.rarchives.ripme.tst;
import junit.framework.TestCase;
import com.rarchives.ripme.utils.Base64;
import org.junit.jupiter.api.Test;
public class Base64Test extends TestCase {
import static org.junit.jupiter.api.Assertions.assertEquals;
public class Base64Test {
@Test
public void testDecode() {
assertEquals("test", new String(Base64.decode("dGVzdA==")));
}

View File

@@ -4,14 +4,16 @@ import java.io.IOException;
import java.net.URL;
import com.rarchives.ripme.utils.Proxy;
import com.rarchives.ripme.utils.Utils;
import junit.framework.TestCase;
import com.rarchives.ripme.utils.Http;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertFalse;
public class proxyTest extends TestCase {
public class proxyTest {
// This test will only run on machines where the user has added a entry for proxy.socks
@Test
public void testSocksProxy() throws IOException {
// Unset proxy before testing
System.setProperty("http.proxyHost", "");
@@ -31,6 +33,7 @@ public class proxyTest extends TestCase {
}
// This test will only run on machines where the user has added a entry for proxy.http
@Test
public void testHTTPProxy() throws IOException {
// Unset proxy before testing
System.setProperty("http.proxyHost", "");