Skip to content

Commit

Permalink
Merge pull request #41 from jenkinsci/cleanup
Browse files Browse the repository at this point in the history
Remove annotation-api dependency
  • Loading branch information
uhafner authored Oct 17, 2023
2 parents 67df345 + ee35a52 commit 5403caf
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 197 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ jobs:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
jdk: [17, 21]
include:
- platform: ubuntu-latest
jdk: 11
- platform: macos-latest
jdk: 11

runs-on: ${{ matrix.platform }}
name: on ${{ matrix.platform }} with JDK ${{ matrix.jdk }}
Expand All @@ -28,10 +23,14 @@ jobs:
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
distribution: 'temurin'
java-version: '${{ matrix.jdk }}'
check-latest: true
cache: 'maven'
- name: Set up Maven
uses: stCarolas/setup-maven@v4
with:
maven-version: 3.9.5
- name: Build with Maven
env:
BROWSER: chrome-container
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Dr. Ullrich Hafner
Copyright (c) 2023 Dr. Ullrich Hafner

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
File renamed without changes.
27 changes: 27 additions & 0 deletions doc/dependency-graph.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@startuml
skinparam defaultTextAlignment center
skinparam rectangle {
BackgroundColor<<optional>> beige
BackgroundColor<<test>> lightGreen
BackgroundColor<<runtime>> lightBlue
BackgroundColor<<provided>> lightGray
}
rectangle "spotbugs-annotations\n\n4.7.3" as com_github_spotbugs_spotbugs_annotations_jar
rectangle "jsr305\n\n3.0.2" as com_google_code_findbugs_jsr305_jar
rectangle "coverage-model\n\n0.28.0-SNAPSHOT" as edu_hm_hafner_coverage_model_jar
rectangle "error_prone_annotations\n\n2.22.0" as com_google_errorprone_error_prone_annotations_jar
rectangle "streamex\n\n0.8.2" as one_util_streamex_jar
rectangle "codingstyle\n\n3.24.0" as edu_hm_hafner_codingstyle_jar
rectangle "commons-lang3\n\n3.13.0" as org_apache_commons_commons_lang3_jar
rectangle "commons-io\n\n2.11.0" as commons_io_commons_io_jar
com_github_spotbugs_spotbugs_annotations_jar -[#000000]-> com_google_code_findbugs_jsr305_jar
edu_hm_hafner_coverage_model_jar -[#000000]-> com_github_spotbugs_spotbugs_annotations_jar
edu_hm_hafner_coverage_model_jar -[#000000]-> com_google_errorprone_error_prone_annotations_jar
edu_hm_hafner_coverage_model_jar -[#000000]-> one_util_streamex_jar
edu_hm_hafner_codingstyle_jar .[#D3D3D3].> com_github_spotbugs_spotbugs_annotations_jar
edu_hm_hafner_codingstyle_jar .[#D3D3D3].> com_google_errorprone_error_prone_annotations_jar
edu_hm_hafner_codingstyle_jar .[#D3D3D3].> org_apache_commons_commons_lang3_jar
edu_hm_hafner_codingstyle_jar -[#000000]-> commons_io_commons_io_jar
edu_hm_hafner_coverage_model_jar -[#000000]-> edu_hm_hafner_codingstyle_jar
edu_hm_hafner_coverage_model_jar -[#000000]-> org_apache_commons_commons_lang3_jar
@enduml
26 changes: 26 additions & 0 deletions etc/assertj-templates/assertion_class_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package ${package};
${imports}
/**
* {@link ${class_to_assert}} specific assertions - Generated by CustomAssertionGenerator.
*/
@edu.hm.hafner.util.Generated(value="assertj-assertions-generator")
public class ${custom_assertion_class} extends AbstractObjectAssert<${custom_assertion_class}, ${class_to_assert}> {

/**
* Creates a new <code>{@link ${custom_assertion_class}}</code> to make assertions on actual ${class_to_assert}.
* @param actual the ${class_to_assert} we want to make assertions on.
*/
public ${custom_assertion_class}(${class_to_assert} actual) {
super(actual, ${custom_assertion_class}.class);
}

/**
* An entry point for ${custom_assertion_class} to follow AssertJ standard <code>assertThat()</code> statements.<br>
* With a static import, one can write directly: <code>assertThat(my${class_to_assert})</code> and get specific assertion with code completion.
* @param actual the ${class_to_assert} we want to make assertions on.
* @return a new <code>{@link ${custom_assertion_class}}</code>
*/
@org.assertj.core.util.CheckReturnValue
public static ${custom_assertion_class} assertThat(${class_to_assert} actual) {
return new ${custom_assertion_class}(actual);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package ${package};
* type-specific assertion objects.
*/
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("NM")
@javax.annotation.Generated(value="assertj-assertions-generator")
@edu.hm.hafner.util.Generated(value="assertj-assertions-generator")
public class Assertions extends org.assertj.core.api.Assertions {
${all_assertions_entry_points}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package ${package};
* Entry point for soft assertions of different data types.
*/
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("NM")
@javax.annotation.Generated(value="assertj-assertions-generator")
@edu.hm.hafner.util.Generated(value="assertj-assertions-generator")
public class SoftAssertions extends org.assertj.core.api.AutoCloseableSoftAssertions {
${all_assertions_entry_points}
}
175 changes: 0 additions & 175 deletions etc/checkstyle-configuration.xml

This file was deleted.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>edu.hm.hafner</groupId>
<artifactId>codingstyle-pom</artifactId>
<version>3.29.0</version>
<version>3.32.0</version>
<relativePath />
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import org.junit.jupiter.api.Test;
import org.junitpioneer.jupiter.DefaultLocale;
import org.junitpioneer.jupiter.Issue;

import edu.hm.hafner.coverage.ClassNode;
import edu.hm.hafner.coverage.Coverage;
Expand Down Expand Up @@ -76,8 +77,8 @@ private void verifySmallTree(final Node duplicateMethods) {
.containsExactly("Enumerate()");
}

@Test
void shouldMergeCorrectly729() {
@Test @Issue("jenkinsci/code-coverage-api-plugin#729")
void shouldMergeCorrectly() {
var builder = new CoverageBuilder();

Node a = readReport("cobertura-merge-a.xml");
Expand Down Expand Up @@ -135,16 +136,16 @@ private void verifyMissedAndCoveredLines(final Node left) {
35, 36, 37, 38, 40, 41, 42, 45, 54, 60, 66, 71, 72));
}

@Test
void shouldCountCorrectly625() {
@Test @Issue("jenkinsci/code-coverage-api-plugin#625")
void shouldCountCorrectly() {
Node tree = readReport("cobertura-counter-aggregation.xml");

var expectedValue = new CoverageBuilder().setCovered(31).setMissed(1).setMetric(BRANCH).build();
assertThat(tree.getValue(BRANCH)).isPresent().contains(expectedValue);
}

@Test
void shouldReadCoberturaIssue610() {
@Test @Issue("jenkinsci/code-coverage-api-plugin#610")
void shouldReadCoberturaWithMissingSources() {
Node tree = readReport("coverage-missing-sources.xml");

assertThat(tree.getAll(MODULE)).hasSize(1).extracting(Node::getName).containsExactly("-");
Expand All @@ -154,8 +155,8 @@ void shouldReadCoberturaIssue610() {
"src/args.ts", "src/badge-result.ts", "src/colors.ts", "src/index.ts");
}

@Test
void shouldReadCoberturaIssue599() {
@Test @Issue("jenkinsci/code-coverage-api-plugin#599")
void shouldReadCoberturaAggregation() {
Node tree = readReport("cobertura-ts.xml");

assertThat(tree.getAll(MODULE)).hasSize(1).extracting(Node::getName).containsExactly("-");
Expand Down Expand Up @@ -227,8 +228,8 @@ void shouldReadCoberturaIssue599() {

}

@Test
void shouldReadCoberturaIssue473() {
@Test @Issue("jenkinsci/code-coverage-api-plugin#473")
void shouldReadCoberturaNpe() {
Node tree = readReport("cobertura-npe.xml");

assertThat(tree.getAll(MODULE)).hasSize(1).extracting(Node::getName).containsOnly("-");
Expand Down Expand Up @@ -256,8 +257,8 @@ void shouldReadCoberturaIssue473() {
new LinesOfCode(44 + 9));
}

@Test
void shouldReadCoberturaIssue551() {
@Test @Issue("jenkinsci/code-coverage-api-plugin#551")
void shouldReadCoberturaAbsolutePath() {
Node tree = readReport("cobertura-absolute-path.xml");

assertThat(tree.getAll(MODULE)).hasSize(1).extracting(Node::getName).containsOnly("-");
Expand Down

0 comments on commit 5403caf

Please sign in to comment.