Skip to content

Commit c96ccf2

Browse files
committed
🚀 1.0 release
1 parent db38756 commit c96ccf2

File tree

8 files changed

+115
-2
lines changed

8 files changed

+115
-2
lines changed

.github/workflows/buildProject.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
7+
8+
name: Java CI with Gradle
9+
10+
on:
11+
push:
12+
branches: [ master ]
13+
pull_request:
14+
branches: [ master ]
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Set up JDK 11
24+
uses: actions/setup-java@v2
25+
with:
26+
java-version: '11'
27+
distribution: 'temurin'
28+
- name: Build with Gradle
29+
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
30+
with:
31+
arguments: build

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Martin Wittlinger
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Readme.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## GithubIssue
2+
3+
`GithubIssue` provides a simple way to mark test cases with open issue.
4+
`@GitHubIssue(issueNumber = <your issue number>, fixed = boolean)` is used to mark test cases with open issue.
5+
If a test case has this annotation and `fixed = false` it must fail. If it doesn't fail it will be marked as failed.
6+
Any test case with this annotation and `fixed = true` behaves like a normal unit test.
7+
We use JUnit 5 annotation composition feature(https://junit.org/junit5/docs/current/user-guide/#writing-tests-meta-annotations), so you only need to add this annotation to your test method.
8+
9+
## Example
10+
```java
11+
@GitHubIssue(issueNumber = 4218, fixed = false)
12+
void testSniperDoesNotPrintTheDeletedAnnotation() {
13+
Consumer<CtType<?>> deleteAnnotation = type -> {
14+
type.getAnnotations().forEach(CtAnnotation::delete);
15+
};
16+
BiConsumer<CtType<?>, String> assertDoesNotContainAnnotation = (type, result) ->
17+
assertThat(result, not(containsString("@abc.def.xyz")));
18+
testSniper("sniperPrinter.DeleteAnnotation", deleteAnnotation, assertDoesNotContainAnnotation);
19+
}
20+
```
21+
Internal `@GitHubIssue` combines `@Test` and `@ExtendWith` annotation with an extension enforcing the specified behavior.
22+
23+
## Original Idea
24+
25+
The original idea and implementation is from Spoon(https://github.com/INRIA/spoon) and discussed in this issue https://github.com/INRIA/spoon/issues/3001.
26+
The code is copied with permission from Spoon.

lib/build.gradle build.gradle

+17-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@ plugins {
22
// Apply the java-library plugin for API and implementation separation.
33
id 'java-library'
44
id "com.diffplug.spotless" version "6.2.2"
5+
id 'maven-publish'
6+
id "com.vanniktech.maven.publish" version "0.18.0"
7+
id "signing"
58
}
69

10+
group = 'io.github.martinwitt'
11+
version = '1.0'
712
repositories {
813
// Use Maven Central for resolving dependencies.
14+
mavenLocal()
915
mavenCentral()
16+
gradlePluginPortal()
17+
}
18+
19+
tasks.withType(JavaCompile) {
20+
options.encoding = 'UTF-8'
1021
}
1122

1223
dependencies {
@@ -34,11 +45,16 @@ spotless {
3445
endWithNewline()
3546
}
3647
java {
37-
3848
palantirJavaFormat()
3949
}
4050
groovyGradle {
4151
target '*.gradle' // default target of groovyGradle
4252
greclipse()
4353
}
4454
}
55+
56+
plugins.withId("com.vanniktech.maven.publish") {
57+
mavenPublish {
58+
sonatypeHost = "S01"
59+
}
60+
}

gradle.properties

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
GROUP=io.github.martinwitt
2+
POM_ARTIFACT_ID=GithubIssue
3+
VERSION_NAME=1.0
4+
5+
POM_NAME=GithubIssue
6+
POM_DESCRIPTION=GithubIssue provides a simple way to enforce failing test cases.
7+
POM_INCEPTION_YEAR=2022
8+
POM_URL=https://github.com/MartinWitt/GithubIssue
9+
10+
POM_LICENSE_NAME=MIT LICENSE
11+
POM_LICENSE_URL=https://opensource.org/licenses/MIT
12+
POM_LICENSE_DIST=repo
13+
14+
POM_SCM_URL=https://github.com/MartinWitt/GithubIssue
15+
POM_SCM_CONNECTION=scm:git:git://github.com/MartinWitt/GithubIssue.git
16+
POM_SCM_DEV_CONNECTION=scm:git:ssh://github.com/MartinWitt/GithubIssue.git
17+
18+
POM_DEVELOPER_ID=martinWitt
19+
POM_DEVELOPER_NAME=Martin Wittlinger
20+
POM_DEVELOPER_URL=https://github.com/martinWitt/

gradlew

100644100755
File mode changed.

settings.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@
88
*/
99

1010
rootProject.name = 'GithubIssue'
11-
include('lib')

0 commit comments

Comments
 (0)