Completed test migration to junit4, easymock updated to version 3.2

Change-Id: I6381045b3dae7133cc3589c5dd20ed977118a83d
This commit is contained in:
alex.ryazantsev
2013-11-07 22:29:27 +04:00
committed by Shawn Pearce
parent c8cffc8e92
commit d215908bae
46 changed files with 486 additions and 123 deletions

View File

@@ -14,19 +14,24 @@
package com.google.gerrit.httpd;
import junit.framework.TestCase;
import org.junit.Test;
public class GitWebConfigTest extends TestCase {
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class GitWebConfigTest {
private static final String VALID_CHARACTERS = "*()";
private static final String SOME_INVALID_CHARACTERS = "09AZaz$-_.+!',";
@Test
public void testValidPathSeparator() {
for(char c : VALID_CHARACTERS.toCharArray()) {
assertTrue("valid character rejected: " + c, GitWebConfig.isValidPathSeparator(c));
}
}
@Test
public void testInalidPathSeparator() {
for(char c : SOME_INVALID_CHARACTERS.toCharArray()) {
assertFalse("invalid character accepted: " + c, GitWebConfig.isValidPathSeparator(c));

View File

@@ -21,9 +21,11 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import junit.framework.TestCase;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class ParameterParserTest extends TestCase {
public class ParameterParserTest {
@Test
public void testConvertFormToJson() throws BadRequestException {
JsonObject obj = ParameterParser.formToJson(
ImmutableMap.of(