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,17 +14,19 @@
package com.google.gerrit.server.config;
import org.junit.Test;
import static java.util.concurrent.TimeUnit.DAYS;
import static java.util.concurrent.TimeUnit.HOURS;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.MINUTES;
import static java.util.concurrent.TimeUnit.SECONDS;
import junit.framework.TestCase;
import static org.junit.Assert.assertEquals;
import java.util.concurrent.TimeUnit;
public class ConfigUtilTest extends TestCase {
public class ConfigUtilTest {
@Test
public void testTimeUnit() {
assertEquals(ms(0, MILLISECONDS), parse("0"));
assertEquals(ms(2, MILLISECONDS), parse("2ms"));

View File

@@ -14,15 +14,23 @@
package com.google.gerrit.server.config;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import com.google.gerrit.server.util.HostPlatform;
import junit.framework.TestCase;
import org.junit.Test;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
public class SitePathsTest extends TestCase {
public class SitePathsTest {
@Test
public void testCreate_NotExisting() throws IOException {
final File root = random();
final SitePaths site = new SitePaths(root);
@@ -31,6 +39,7 @@ public class SitePathsTest extends TestCase {
assertEquals(new File(root, "etc"), site.etc_dir);
}
@Test
public void testCreate_Empty() throws IOException {
final File root = random();
try {
@@ -44,6 +53,7 @@ public class SitePathsTest extends TestCase {
}
}
@Test
public void testCreate_NonEmpty() throws IOException {
final File root = random();
final File txt = new File(root, "test.txt");
@@ -60,6 +70,7 @@ public class SitePathsTest extends TestCase {
}
}
@Test
public void testCreate_NotDirectory() throws IOException {
final File root = random();
try {
@@ -75,6 +86,7 @@ public class SitePathsTest extends TestCase {
}
}
@Test
public void testResolve() throws IOException {
final File root = random();
final SitePaths site = new SitePaths(root);