mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-27 07:44:20 +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:
@@ -1,15 +1,17 @@
|
|||||||
package com.rarchives.ripme.tst;
|
package com.rarchives.ripme.tst;
|
||||||
|
|
||||||
import com.rarchives.ripme.ripper.AbstractRipper;
|
import com.rarchives.ripme.ripper.AbstractRipper;
|
||||||
import junit.framework.TestCase;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
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 {
|
public void testGetFileName() throws IOException {
|
||||||
String fileName = AbstractRipper.getFileName(new URL("http://www.tsumino.com/Image/Object?name=U1EieteEGwm6N1dGszqCpA%3D%3D"), "test", "test");
|
String fileName = AbstractRipper.getFileName(new URL("http://www.tsumino.com/Image/Object?name=U1EieteEGwm6N1dGszqCpA%3D%3D"), "test", "test");
|
||||||
assertEquals("test.test", fileName);
|
assertEquals("test.test", fileName);
|
||||||
|
@@ -1,10 +1,13 @@
|
|||||||
package com.rarchives.ripme.tst;
|
package com.rarchives.ripme.tst;
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
|
||||||
import com.rarchives.ripme.utils.Base64;
|
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() {
|
public void testDecode() {
|
||||||
assertEquals("test", new String(Base64.decode("dGVzdA==")));
|
assertEquals("test", new String(Base64.decode("dGVzdA==")));
|
||||||
}
|
}
|
||||||
|
@@ -4,14 +4,16 @@ import java.io.IOException;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import com.rarchives.ripme.utils.Proxy;
|
import com.rarchives.ripme.utils.Proxy;
|
||||||
import com.rarchives.ripme.utils.Utils;
|
import com.rarchives.ripme.utils.Utils;
|
||||||
import junit.framework.TestCase;
|
|
||||||
import com.rarchives.ripme.utils.Http;
|
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
|
// This test will only run on machines where the user has added a entry for proxy.socks
|
||||||
|
@Test
|
||||||
public void testSocksProxy() throws IOException {
|
public void testSocksProxy() throws IOException {
|
||||||
// Unset proxy before testing
|
// Unset proxy before testing
|
||||||
System.setProperty("http.proxyHost", "");
|
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
|
// This test will only run on machines where the user has added a entry for proxy.http
|
||||||
|
@Test
|
||||||
public void testHTTPProxy() throws IOException {
|
public void testHTTPProxy() throws IOException {
|
||||||
// Unset proxy before testing
|
// Unset proxy before testing
|
||||||
System.setProperty("http.proxyHost", "");
|
System.setProperty("http.proxyHost", "");
|
||||||
|
Reference in New Issue
Block a user