Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
28,700
void () { doTest(new SimpleInfo("l", 1, null, null, "List<T>[]"), new SimpleInfo(0)); }
testReplaceVarargWithArray
28,701
void () { doTest(new SimpleInfo("l", 1, null, null, "Map<T, E>[]"), new SimpleInfo(0)); }
testReplaceVarargWithArray2
28,702
void () { doTest(new SimpleInfo(0), new SimpleInfo("a", -1, "1", null, PsiTypes.intType())); }
testConstructorCall
28,703
void () { doTest(); }
testNoArgInCommandCall
28,704
void () { doTest(new SimpleInfo(0)); }
testClosureArgs
28,705
void () { doTest(); }
testRemoveSingleClosureArgument
28,706
void () { doTest(); }
testNewExpr
28,707
void () { doTest(new SimpleInfo("newName", 0), new SimpleInfo(1)); }
testChangeJavaDoc
28,708
void () { doTest(new SimpleInfo("p", -1, "", "1", "")); }
testDefaultInitializerInJava
28,709
void () { doTest(PsiModifier.PUBLIC, "foo", "List<String>", new ArrayList<>(), new ArrayList<>(), false); }
testChangeType
28,710
void () { doTest(new SimpleInfo("newName", 0)); }
testDifferentParamNameInOverriden
28,711
void () { doTest(new SimpleInfo("lucky", -1, "defValue", "defInit", "java.lang.String", true)); }
testFeelLucky
28,712
void () { doTest(new SimpleInfo(0)); }
testParamsWithGenerics
28,713
void () { doTest(PsiModifier.PUBLIC, "doSmthElse", null, new ArrayList<>(), new ArrayList<>(), true); }
testGenerateDelegateWithOtherName
28,714
void () { try { doTest(new SimpleInfo("optional", -1, null, "1", "int")); } catch (BaseRefactoringProcessor.ConflictsInTestsException e) { TestCase.assertEquals("Method foo(int) is already defined in the class <b><code>Test</code></b>", e.getMessage()); return; } TestCase.fail("conflicts are not detected!"); }
testFailBecauseOfOptionalParam
28,715
void () { doTest(null, "a bc", null, new ArrayList<>(), new ArrayList<>(), false); }
testRenameToLiteral
28,716
void () { doTest(null, "a'bc", null, new ArrayList<>(), new ArrayList<>(), false); }
testRenameToLiteral2
28,717
void () { doTest(new SimpleInfo(1)); }
testLineFeedInCommandArgs
28,718
void () { doTest(null, null, null, new ArrayList<>(Arrays.asList(new SimpleInfo("a", -1))), new ArrayList<>(), false); }
testTraitMethod
28,719
PsiType (String typeText) { return JavaPsiFacade.getElementFactory(getProject()).createTypeByFQClassName(typeText, GlobalSearchScope.allScope(getProject())); }
createType
28,720
void (String newReturnType, boolean generateDelegate, SimpleInfo... parameterInfos) { doTest(PsiModifier.PUBLIC, null, newReturnType, DefaultGroovyMethods.asType(parameterInfos, List.class), new ArrayList<>(), generateDelegate); }
doTest
28,721
void (String newReturnType, SimpleInfo... parameterInfos) { doTest(newReturnType, false, parameterInfos); }
doTest
28,722
void (SimpleInfo... parameterInfos) { doTest(null, false, parameterInfos); }
doTest
28,723
void (@Nullable @PsiModifier.ModifierConstant String newVisibility, @Nullable String newName, @Nullable String newReturnType, @NotNull List<SimpleInfo> parameterInfo, @NotNull List<ThrownExceptionInfo> exceptionInfo, final boolean generateDelegate) { final String javaTestName = getTestName(false) + ".java"; final String groovyTestName = getTestName(false) + ".groovy"; final File javaSrc = new File(getTestDataPath() + "/" + javaTestName); if (javaSrc.exists()) { myFixture.copyFileToProject(javaTestName); } myFixture.configureByFile(groovyTestName); executeRefactoring(newVisibility, newName, newReturnType, new SimpleParameterGen(parameterInfo, getProject()), new SimpleExceptionsGen(exceptionInfo), generateDelegate); if (javaSrc.exists()) { myFixture.checkResultByFile(javaTestName, getTestName(false) + "_after.java", true); } myFixture.checkResultByFile(groovyTestName, getTestName(false) + "_after.groovy", true); }
doTest
28,724
String () { return basePath; }
getBasePath
28,725
void () { doTest("1 + 1", "1 + 1"); }
testSimpleExpression1
28,726
void () { doTest("foo(bar)", "foo(bar)"); }
testSimpleExpression2
28,727
void () { doTest("@A", "@A"); }
testSimpleAnnotation1
28,728
void () { doTest("@A()", "@A"); }
testSimpleAnnotation2
28,729
void () { doTest("@A(1, value = 2)", "@A(1,value=2)"); }
testSimpleAnnotation3
28,730
void () { doTest("@A({1, 2, 3})", "@A([1,2,3])"); }
testAnnotationInitializer
28,731
void () { doTest("new int[]{1, 2, 3}", "([1,2,3] as int[])"); }
testArrayInitializer
28,732
void (@NotNull String java, @NotNull String expectedGroovy) { myFixture.configureByText(JavaFileType.INSTANCE, "@A(" + java + ") class Clazz{}"); PsiJavaFile file = DefaultGroovyMethods.asType(myFixture.getFile(), PsiJavaFile.class); PsiAnnotationMemberValue value = file.getClasses()[0].getModifierList().getAnnotations()[0].getParameterList().getAttributes()[0].getValue(); GrAnnotationMemberValue result = new AnnotationArgConverter().convert(value); TestCase.assertEquals(expectedGroovy, result.getText()); }
doTest
28,733
void () { final String testName = getTestName(true); final PsiFile file = myFixture.configureByFile(testName + ".groovy"); UsefulTestCase.assertInstanceOf(file, GroovyFile.class); GrTopStatement[] statements = ((GroovyFile)file).getTopStatements(); final StringBuilder builder = new StringBuilder(); CodeBlockGenerator generator = new CodeBlockGenerator(builder, new ExpressionContext(getProject(), GroovyFile.EMPTY_ARRAY)); for (GrTopStatement statement : statements) { statement.accept(generator); builder.append("\n"); } final PsiFile result = createLightFile(testName + ".java", JavaLanguage.INSTANCE, builder.toString()); PostprocessReformattingAspect.getInstance(getProject()).doPostponedFormatting(); final String text = result.getText(); UsefulTestCase.assertSameLinesWithFile(Path.of(getTestDataPath(), testName + ".java").toString(), text); }
doTest
28,734
PsiFile (String text) { return myFixture.addFileToProject("Bar.groovy", text); }
addFile
28,735
String () { return basePath; }
getBasePath
28,736
void () { final String testName = getTestName(true); final PsiFile file = myFixture.configureByFile(testName + ".groovy"); UsefulTestCase.assertInstanceOf(file, GroovyFile.class); new ConvertToJavaProcessor(getProject(), (GroovyFile)file).run(); myFixture.checkResultByFile(testName + ".java"); }
doTest
28,737
void () { doTest(); }
testForLoops
28,738
void () { doTest(); }
testLiterals
28,739
void () { doTest(); }
testIncrementAndDecrement
28,740
void () { doTest(); }
testPlusPlus
28,741
void () { doTest(); }
testEnum
28,742
void () { doTest(); }
testGrScript
28,743
void () { doTest(); }
testConstructor
28,744
void () { doTest(); }
testReturns
28,745
void () { doTest(); }
testReturn2
28,746
void () { doTest(); }
testGenericTypes
28,747
void () { doTest(); }
testStaticProperty
28,748
void () { doTest(); }
testResolveMethodInsideClosure
28,749
void () { doTest(); }
testAnno
28,750
void () { doTest(); }
testAnno1
28,751
void () { doTest(); }
testUseAnno
28,752
void () { doTest(); }
testRemoveTransformAnno
28,753
void () { boolean registryValue = Registry.is(MethodParameterAugmenter.GROOVY_COLLECT_METHOD_CALLS_FOR_INFERENCE); Registry.get(MethodParameterAugmenter.GROOVY_COLLECT_METHOD_CALLS_FOR_INFERENCE).setValue(true); try { doTest(); } finally { Registry.get(MethodParameterAugmenter.GROOVY_COLLECT_METHOD_CALLS_FOR_INFERENCE).setValue(registryValue); } }
testConcurency
28,754
void () { doTest(); }
testHash
28,755
void () { doTest(); }
testAnonymous
28,756
void () { doTest(); }
testAnonymous2
28,757
void () { doTest(); }
testRefInAnonymous
28,758
void () { doTest(); }
testRefInClosureInMethod
28,759
void () { doTest(); }
testRefInClosureInScript
28,760
void () { doTest(); }
testMethodParamsInClosures
28,761
void () { doTest(); }
testClosureParamInInnerClosure
28,762
void () { doTest(); }
testMethodParamInClosureImplicitReturn
28,763
void () { doTest(); }
testField
28,764
void () { doTest(); }
testIntPropAssignment
28,765
void () { doTest(); }
testPropAssignment
28,766
void () { doTest(); }
testStaticPropAssignment
28,767
void () { doTest(); }
testArrayAccess
28,768
void () { doTest(); }
testClosureInUse
28,769
void () { doTest(); }
testDynamicPropertiesAccess
28,770
void () { doTest(); }
testDynamicMethodsAccess
28,771
void () { doTest(); }
_testArg
28,772
void () { doTest(); }
testCasts
28,773
void () { myFixture.addClass(""" package foo; public enum A { Const }"""); doTest(); }
testReferenceExpressionsToClass
28,774
void () {doTest(); }
testTupleInReturn
28,775
void () { doTest(); }
testStaticMethods
28,776
void () { doTest(); }
testImplementGroovyObject
28,777
void () { doTest(); }
testFinalMethodParameterUsedInAnonymous
28,778
void () { doTest(); }
testMethodWithUntypedParameterInitializedWithNull
28,779
void () { doTest(); }
testGroovyDoc
28,780
void () { doTest(); }
testReflectedMethodWithEllipsis
28,781
void () { doTest(); }
testMapAccess2
28,782
void () { doTest(); }
testMutualCasts
28,783
void () { doTest(); }
testNonJavaIdentifiers
28,784
String () { return basePath; }
getBasePath
28,785
LightProjectDescriptor () { // text blocks are not yet supported there return JAVA_14; }
getProjectDescriptor
28,786
void () { doTest(); }
testMultilineStringOldJava
28,787
void () { doTest(); }
testSwitch1
28,788
void () { doTest(); }
testSwitch2
28,789
void () { doTest(); }
testSwitch3
28,790
void () { doTest(); }
testSwitch4
28,791
void () { doTest(); }
testSwitch5
28,792
void () { doTest(); }
testSwitch6
28,793
void () { doTest(); }
_testWhile1
28,794
void () { doTest(); }
_testWhile2
28,795
void () { doTest(); }
_testWhile3
28,796
void () { myFixture.addFileToProject("Bar.groovy", """ class Bar { def foo = 2 def getBar() {3} } class MyCat { static getAbc(Bar b) { return 4 } } """); doTest(); }
testRefExpr
28,797
void () { doTest(); }
testMemberPointer
28,798
void () { addFile(""" class Bar { def compareTo(def other) {1} }"""); }
testCompareMethods
28,799
void () { addFile(""" class Bar { def next() { new Bar(state:state+1) } } class Upper { private test=new Test() def getTest(){println "getTest"; test} } class Test { public state = new Bar() def getBar() {println "get"; state} void setBar(def bar) {println "set";state = bar} } """); doTest(); }
testPrefixInc