From f3d7b5ea2affb1c0a44a68d1a33082aaee471f39 Mon Sep 17 00:00:00 2001 From: Max Medvedev Date: Wed, 14 Nov 2012 15:19:44 +0400 Subject: [PATCH] fix @Delegate tests --- .../GroovyHighlightingTest.groovy | 14 ------------ .../groovy/lang/resolve/DelegateTest.groovy | 22 +++++++++++++++++-- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GroovyHighlightingTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GroovyHighlightingTest.groovy index 844685ed4197..fd8ce92b19e9 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GroovyHighlightingTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/highlighting/GroovyHighlightingTest.groovy @@ -731,20 +731,6 @@ new Base() { ''') } - void testDelegateWithDeprecated() { - testHighlighting('''\ -interface Foo { - @Deprecated - void foo() -} - - -class FooImpl implements Foo { - @Delegate(deprecated = false) Foo delegate -} -''') - } - void testAbstractMethodWithBody() { testHighlighting('''\ interface A { diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/DelegateTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/DelegateTest.groovy index d8c7701e0fda..47a771532ca9 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/DelegateTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/DelegateTest.groovy @@ -241,16 +241,34 @@ public abstract class Bar implements Foo { public class FooBar extends Bar implements Foo { } ''') - def file = myFixture.configureByText('Baz.groovy', '''\ + assertAllMethodsImplemented('Baz.groovy', '''\ class Baz { @Delegate(deprecated = true) FooBar bare } -''') as GroovyFile +''') + } + + private void assertAllMethodsImplemented(String fileName, String text) { + def file = myFixture.configureByText(fileName, text) as GroovyFile assertNotNull(file) final clazz = file.classes[0] assertNotNull(clazz) assertEmpty OverrideImplementUtil.getMethodSignaturesToImplement(clazz) } + + void testDeprecatedFalse() { + myFixture.addFileToProject('Foo.groovy', '''\ +interface Foo { + @Deprecated + void foo() +} +''') + assertAllMethodsImplemented('text.groovy', '''\ +class FooImpl implements Foo { + @Delegate(deprecated = false) Foo delegate +} +''') + } }