2 * Copyright 2000-2016 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.siyeh.ig.fixes.equality;
18 import com.siyeh.InspectionGadgetsBundle;
19 import com.siyeh.ig.IGQuickFixesTestCase;
20 import com.siyeh.ig.equality.EqualityOperatorComparesObjectsInspection;
23 * @see EqualityOperatorComparesObjectsInspection
24 * @author Bas Leijdekkers
26 public abstract class EqualityOperatorComparesObjectsInspectionTestBase extends IGQuickFixesTestCase {
28 public void testEnumComparison() { assertQuickfixNotAvailable(); }
29 public void testNullComparison() { assertQuickfixNotAvailable(); }
30 public void testPrimitiveComparison() { assertQuickfixNotAvailable(); }
31 public void testSimpleObjectComparison() { doTest(true, false); }
32 public void testNegatedObjectComparison() { doTest(false, false); }
33 public void testCompareThisInEqualsMethod() { assertQuickfixNotAvailable(); }
34 public void testCompareFieldInEqualsMethod() { doTest(true, false); }
37 protected void setUp() throws Exception {
39 myFixture.enableInspections(new EqualityOperatorComparesObjectsInspection());
40 myDefaultHint = "Replace";
41 myRelativePath = "equality/replace_equality_with_equals";
44 protected void doTest(boolean isEqual, boolean isSafe) {
45 doTest(InspectionGadgetsBundle.message(
46 isSafe ? "equality.operator.compares.objects.safe.quickfix" : "equality.operator.compares.objects.quickfix",
47 isEqual ? "==" : "!=",