Fix deprecation warnings on junit.framework.Assert
Use org.junit.Assert instead everywhere. Also fix some other minor warnings
This commit is contained in:
+4
-5
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.jetbrains.jet.compiler;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -25,6 +24,7 @@ import org.jetbrains.jet.compiler.ant.AntRunner;
|
||||
import org.jetbrains.jet.compiler.download.SDKDownloader;
|
||||
import org.jetbrains.jet.compiler.emulator.Emulator;
|
||||
import org.jetbrains.jet.compiler.run.PermissionManager;
|
||||
import org.junit.Assert;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
@@ -32,7 +32,6 @@ import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
public class CodegenTestsOnAndroidRunner {
|
||||
private static final Pattern ERROR_IN_TEST_OUTPUT_PATTERN =
|
||||
Pattern.compile("([\\s]+at .*| Caused .*| java.lang.RuntimeException: File: .*|[\\s]+\\.\\.\\. .* more| Error in .*)");
|
||||
@@ -121,7 +120,7 @@ public class CodegenTestsOnAndroidRunner {
|
||||
[exec] ...............
|
||||
[exec] Error in testKt529:
|
||||
*/
|
||||
private Map<String, String> parseOutputForFailedTests(@NotNull String output) {
|
||||
private static Map<String, String> parseOutputForFailedTests(@NotNull String output) {
|
||||
Map<String, String> result = new HashMap<String, String>();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
String failedTestNamePrefix = " Error in ";
|
||||
@@ -147,7 +146,7 @@ public class CodegenTestsOnAndroidRunner {
|
||||
|
||||
//[exec] Tests run: 225, Failures: 0, Errors: 2
|
||||
@Nullable
|
||||
private Statistics parseOutputForTestsNumberIfThereIsFailedTests(String output) {
|
||||
private static Statistics parseOutputForTestsNumberIfThereIsFailedTests(String output) {
|
||||
Matcher matcher = NUMBER_OF_TESTS_IF_FAILED.matcher(output);
|
||||
if (matcher.find()) {
|
||||
return new Statistics(Integer.parseInt(matcher.group(1)), Integer.parseInt(matcher.group(2)),
|
||||
@@ -158,7 +157,7 @@ public class CodegenTestsOnAndroidRunner {
|
||||
|
||||
//[exec] OK (223 tests)
|
||||
@Nullable
|
||||
private Statistics parseOutputForTestsNumberIfTestsPassed(String output) {
|
||||
private static Statistics parseOutputForTestsNumberIfTestsPassed(String output) {
|
||||
Matcher matcher = NUMBER_OF_TESTS_OK.matcher(output);
|
||||
if (matcher.find()) {
|
||||
return new Statistics(Integer.parseInt(matcher.group(1)), 0, 0);
|
||||
|
||||
+5
-3
@@ -20,7 +20,6 @@ import com.google.common.collect.Lists;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.testFramework.UsefulTestCase;
|
||||
import junit.framework.Assert;
|
||||
import org.jetbrains.jet.ConfigurationKind;
|
||||
import org.jetbrains.jet.JetTestUtils;
|
||||
import org.jetbrains.jet.OutputFileCollection;
|
||||
@@ -32,6 +31,7 @@ import org.jetbrains.jet.compiler.PathManager;
|
||||
import org.jetbrains.jet.generators.tests.generator.TestGeneratorUtil;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.utils.Printer;
|
||||
import org.junit.Assert;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -49,8 +49,10 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
|
||||
private static final String baseTestClassName = "AbstractCodegenTestCaseOnAndroid";
|
||||
private static final String generatorName = "CodegenTestsOnAndroidGenerator";
|
||||
|
||||
private JetCoreEnvironment environmentWithMockJdk = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, ConfigurationKind.JDK_AND_ANNOTATIONS);
|
||||
private JetCoreEnvironment environmentWithFullJdk = JetTestUtils.createEnvironmentWithFullJdk(myTestRootDisposable);
|
||||
private final JetCoreEnvironment environmentWithMockJdk =
|
||||
JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, ConfigurationKind.JDK_AND_ANNOTATIONS);
|
||||
private final JetCoreEnvironment environmentWithFullJdk =
|
||||
JetTestUtils.createEnvironmentWithFullJdk(myTestRootDisposable);
|
||||
|
||||
private final Pattern packagePattern = Pattern.compile("package (.*)");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user