mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix @Delegate tests
This commit is contained in:
-14
@@ -731,20 +731,6 @@ new Base() {
|
||||
''')
|
||||
}
|
||||
|
||||
void testDelegateWithDeprecated() {
|
||||
testHighlighting('''\
|
||||
interface Foo {
|
||||
@Deprecated
|
||||
void foo()
|
||||
}
|
||||
|
||||
|
||||
<error descr="Method 'foo' is not implemented">class FooImpl implements Foo</error> {
|
||||
@Delegate(deprecated = false) Foo delegate
|
||||
}
|
||||
''')
|
||||
}
|
||||
|
||||
void testAbstractMethodWithBody() {
|
||||
testHighlighting('''\
|
||||
interface A {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
''')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user