Fixed many warnings

This commit is contained in:
Ziver Koc 2018-05-27 01:23:21 +02:00
parent c570847f3a
commit ccecc067b2
160 changed files with 951 additions and 1151 deletions

View file

@ -7,8 +7,7 @@ import java.io.IOException;
import java.util.Iterator;
import static junit.framework.TestCase.assertFalse;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
/**
* JUnit test for MultipartParser class
@ -41,8 +40,8 @@ public class MultipartParserTest {
assertEquals("bar", stringField.getValue());
assertFalse(it.hasNext());
assertEquals(null, it.next());
assertEquals(null, it.next());
assertNull(it.next());
assertNull(it.next());
}
@Test

View file

@ -37,7 +37,7 @@ public class HttpDigestAuthPageTest {
HttpHeader rspHeader = HttpTestUtil.makeRequest(page);
assertEquals(401, rspHeader.getHTTPCode());
assertTrue(rspHeader.getHeader("WWW-Authenticate") != null);
assertNotNull(rspHeader.getHeader("WWW-Authenticate"));
assertEquals("Digest", parseAuthType(rspHeader));
Map<String,String> authHeader = parseAuthHeader(rspHeader);
assertTrue(authHeader.containsKey("realm"));

View file

@ -46,7 +46,7 @@ public class HttpGuessTheNumber implements HttpPage {
private static final String COOKIE_KEY_HIGH = "high";
public static void main(String[] args) throws IOException{
public static void main(String[] args) {
LogUtil.setGlobalLevel(Level.ALL);
LogUtil.setGlobalFormatter(new CompactLogFormatter());

View file

@ -37,7 +37,7 @@ import java.security.NoSuchAlgorithmException;
@SuppressWarnings("unused")
public class NetworkClientTest {
public static void main(String[] args) throws NoSuchAlgorithmException, InterruptedException {
public static void main(String[] args) throws InterruptedException {
try {
//LogUtil.setGlobalLevel(Level.ALL);
LogUtil.setGlobalFormatter(new CompactLogFormatter());

View file

@ -34,7 +34,7 @@ import java.security.NoSuchAlgorithmException;
@SuppressWarnings("unused")
public class NetworkServerTest {
public static void main(String[] args) throws NoSuchAlgorithmException, InterruptedException {
public static void main(String[] args) throws InterruptedException {
try {
//LogUtil.setGlobalLevel(Level.ALL);
LogUtil.setGlobalFormatter(new CompactLogFormatter());

View file

@ -9,7 +9,7 @@ import java.util.logging.Level;
/**
* Sends a test email with SmtpClient class.
*
* @See <a href="https://nilhcem.github.io/FakeSMTP/">Fake SMTP Server</a>
* @see <a href="https://nilhcem.github.io/FakeSMTP/">Fake SMTP Server</a>
*/
public class SmtpClientTest {

View file

@ -36,7 +36,7 @@ import java.util.logging.Level;
// TODO: COnvert to JUnit
public class SOAPClientTest {
public static void main(String[] args) throws InstantiationException, IllegalAccessException, MalformedURLException {
public static void main(String[] args) throws MalformedURLException {
LogUtil.setGlobalLevel(Level.ALL);
LogUtil.setFormatter("", new CompactLogFormatter());
@ -47,9 +47,9 @@ public class SOAPClientTest {
public interface TestClient extends WSInterface{
public void m();
void m();
public void c();
void c();
}
}

View file

@ -116,7 +116,7 @@ public class SOAPTest {
@WSReturnName("stringArray")
@WSParamDocumentation("Documentation of stringArrayMethod()")
public String[][] stringArrayMethod (
@WSParamName("StringName") String str) throws Exception{
@WSParamName("StringName") String str) {
System.out.println("Executing method: stringArrayMethod(String str='"+str+"')");
return new String[][]{{"test","test2"},{"test3","test4"}};
}
@ -124,7 +124,7 @@ public class SOAPTest {
@WSReturnName("specialReturnClass")
@WSParamDocumentation("Documentation of specialReturnMethod()")
public SpecialReturnClass[] specialReturnMethod (
@WSParamName("StringName2") String str) throws Exception{
@WSParamName("StringName2") String str) {
System.out.println("Executing method: specialReturnMethod(String str='"+str+"')");
return new SpecialReturnClass[]{new SpecialReturnClass(), new SpecialReturnClass()};
}
@ -132,7 +132,7 @@ public class SOAPTest {
@WSReturnName("SimpleReturnClass")
@WSParamDocumentation("null is the kala")
public SimpleReturnClass simpleReturnClassMethod (
@WSParamName("byte") String lol) throws Exception{
@WSParamName("byte") String lol) {
System.out.println("Executing method: simpleReturnClassMethod()");
SimpleReturnClass tmp = new SimpleReturnClass();
tmp.param1 = "newParam1";