-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Treat annotations on inner classes as if on outer (#278)
This was the behaviour before 8c5954b, and is a behaviour we want to preserve (at least until we have a way of expressing desires more explicitly here). Concretely, this means that things like `-java-annotation-to-attribute=com.example.annotation.FlakyTest=flaky=True` will allow inner annotated classes to affect the generation of targets, rather than ignoring their annotations.
- Loading branch information
1 parent
f6b2319
commit 0bef82e
Showing
6 changed files
with
85 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
java/gazelle/testdata/attribute_setting/src/test/com/example/myproject/FlakyInnerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.example.myproject; | ||
|
||
import com.example.annotation.FlakyTest; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.Random; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class FlakyInnerTest { | ||
@FlakyTest | ||
public static class Nested { | ||
@Test | ||
public void unreliableTest() { | ||
Random random = new Random(); | ||
int r = random.nextInt(2); | ||
assertEquals(r, 0); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters