[test framework] exception transparency in LightQuickFixTestCase

Restores diff view on org.junit.ComparisonFailure
This commit is contained in:
Roman Shevchenko
2018-05-17 16:16:30 +02:00
parent 129091c478
commit 3909ca508b
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInsight.daemon.quickFix;
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
@@ -34,11 +20,9 @@ import com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl;
import com.intellij.util.IncorrectOperationException;
import com.intellij.util.ObjectUtils;
import com.intellij.util.ui.UIUtil;
import junit.framework.ComparisonFailure;
import one.util.streamex.StreamEx;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.junit.Assert;
import java.io.File;
import java.util.List;
@@ -81,12 +65,11 @@ public abstract class LightQuickFixTestCase extends LightDaemonAnalyzerTestCase
quickFixTestCase.afterActionCompleted(testName, contents);
}
}
catch (ComparisonFailure e) {
catch (RuntimeException | Error e) {
throw e;
}
catch (Throwable e) {
e.printStackTrace();
Assert.fail(testName + " failed");
throw new AssertionError(testName + " failed", e);
}
}, "", "");
}