/plugins/groovy/test/org/jetbrains/plugins/groovy/inspections/secondUnsafeCall/SecondUnsafeCallTest.java

https://bitbucket.org/nbargnesi/idea · Java · 53 lines · 25 code · 9 blank · 19 comment · 0 complexity · 83b65151bb26c702d207d64a426e874b MD5 · raw file

  1. /*
  2. * Copyright 2000-2007 JetBrains s.r.o.
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. *
  15. */
  16. package org.jetbrains.plugins.groovy.inspections.secondUnsafeCall;
  17. import com.intellij.codeInsight.intention.IntentionAction;
  18. import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
  19. import org.jetbrains.plugins.groovy.codeInspection.secondUnsafeCall.SecondUnsafeCallInspection;
  20. import org.jetbrains.plugins.groovy.util.TestUtils;
  21. import java.util.List;
  22. /**
  23. * User: Dmitry.Krasilschikov
  24. * Date: 15.11.2007
  25. */
  26. public class SecondUnsafeCallTest extends LightCodeInsightFixtureTestCase {
  27. @Override
  28. protected String getBasePath() {
  29. return TestUtils.getTestDataPath() + "groovy/inspections/secondUnsafeCall";
  30. }
  31. public void doTest() throws Exception {
  32. final List<String> data = TestUtils.readInput(getTestDataPath() + "/" + getTestName(true) + ".test");
  33. myFixture.configureByText("a.groovy", data.get(0));
  34. myFixture.enableInspections(new SecondUnsafeCallInspection());
  35. final IntentionAction action = myFixture.findSingleIntention("Second unsafe call");
  36. myFixture.launchAction(action);
  37. myFixture.checkResult(data.get(1));
  38. }
  39. public void test4Calls() throws Throwable { doTest(); }
  40. public void testMethodCall() throws Throwable { doTest(); }
  41. public void testMethodsCalls() throws Throwable { doTest(); }
  42. public void testSecondUnsafeCall1() throws Throwable { doTest(); }
  43. public void testVarInit() throws Throwable { doTest(); }
  44. }