Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Apr 16, 2024
2 parents c346bab + 8e0fb03 commit cbe9d8b
Show file tree
Hide file tree
Showing 31 changed files with 42 additions and 29 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ SOFTWARE.
<plugin>
<groupId>com.qulice</groupId>
<artifactId>qulice-maven-plugin</artifactId>
<version>0.22.0</version>
<version>0.22.2</version>
<configuration>
<license>file:${basedir}/LICENSE.txt</license>
<excludes>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/github/lombrozo/testnames/Complaint.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,24 @@ public interface Complaint {
* Text complaint.
* @since 0.2
*/
class Text implements Complaint {
final class Text implements Complaint {

/**
* Complaint message.
*/
private final String text;
private final String msg;

/**
* Main constructor.
* @param message Complaint message.
*/
public Text(final String message) {
this.text = message;
this.msg = message;
}

@Override
public String message() {
return this.text;
return this.msg;
}
}
}
5 changes: 3 additions & 2 deletions src/main/java/com/github/lombrozo/testnames/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public Collection<TestClass> testClasses() {
*
* @since 0.1.17
*/
class Combined implements Project {
final class Combined implements Project {

/**
* All projects.
Expand Down Expand Up @@ -170,7 +170,8 @@ public Collection<TestClass> testClasses() {
*
* @since 1.0.1
*/
class WithoutTests implements Project {
@SuppressWarnings("PMD.TestClassWithoutTestCases")
final class WithoutTests implements Project {

/**
* Original project.
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/github/lombrozo/testnames/TestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public interface TestCase {
* @since 0.1.0
*/
@Data
@SuppressWarnings("PMD.TestClassWithoutTestCases")
final class Fake implements TestCase {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public String parent() {
*/
@EqualsAndHashCode
@ToString
@SuppressWarnings("PMD.TestClassWithoutTestCases")
final class IntegrationTest implements TestClassCharacteristics {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
* @since 0.1.0
*/
@Data
@SuppressWarnings("PMD.TestClassWithoutTestCases")
final class JavaParserTestCase implements TestCase {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
*
* @since 0.1.15
*/
@SuppressWarnings("PMD.JUnit4TestShouldUseTestAnnotation")
@SuppressWarnings({
"PMD.JUnit4TestShouldUseTestAnnotation",
"PMD.JUnitTestsShouldIncludeAssert",
"PMD.TestClassWithoutTestCases"
})
final class TestsOnly implements Predicate<MethodDeclaration> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
*
* @since 0.1.0
*/
@SuppressWarnings("PMD.TestClassWithoutTestCases")
public final class RuleCorrectTestCase implements Rule {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
*
* @since 0.1.0
*/
@SuppressWarnings("PMD.TestClassWithoutTestCases")
public final class RuleCorrectTestCases implements Rule {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* The rule that checks a test class doesn't use inheritance.
* @since 1.2.0
*/
@SuppressWarnings("PMD.TestClassWithoutTestCases")
public final class RuleInheritanceInTests implements Rule {

/**
Expand All @@ -53,7 +54,7 @@ public RuleInheritanceInTests(final TestClass clazz) {
public Collection<Complaint> complaints() {
final Collection<Complaint> result;
final String parent = this.clazz.characteristics().parent();
if (parent.equals("java.lang.Object")) {
if ("java.lang.Object".equals(parent)) {
result = Collections.emptyList();
} else {
result = Collections.singleton(
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/github/lombrozo/testnames/CopTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*
* @since 0.2
*/
class CopTest {
final class CopTest {

@Test
void checksSuccessfully() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*
* @since 0.1.17
*/
class ProjectTest {
final class ProjectTest {

@Test
void createsCombinedProject() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*
* @since 0.1.17
*/
class ProjectWithoutJUnitExtensionsTest {
final class ProjectWithoutJUnitExtensionsTest {

@Test
void returnsProductionClassesFromOrigin() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
* @since 0.1.17
*/
class BytecodeProjectTest {
final class BytecodeProjectTest {

@Test
@SuppressWarnings("JTCOP.RuleNotContainsTestWord")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*
* @since 0.1.17
*/
class BytecodeTestClassTest {
final class BytecodeTestClassTest {

@Test
void checksIfBytecodeIsJUnitExtension(@TempDir final Path temp) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* Test cases for {@link ComplaintClass}.
* @since 0.2
*/
class ComplaintClassTest {
final class ComplaintClassTest {

@Test
void returnsSimpleMessageIfDoesNotHaveComplaints() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
* @since 0.2
*/
class ComplaintWrongTestNameTest {
final class ComplaintWrongTestNameTest {

@Test
void buildsMessage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*
* @since 0.1.15
*/
class AssertionOfHamcrestTest {
final class AssertionOfHamcrestTest {

@Test
void parsesAllHamcrestAssertions() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*
* @since 0.1.15
*/
class AssertionOfJUnitTest {
final class AssertionOfJUnitTest {

/**
* Method name for test with messages.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*
* @since 0.1.15
*/
class JavaParserAssertionTest {
final class JavaParserAssertionTest {

/**
* Expectation message for the tests that check the number of assertions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
* @since 0.2
*/
class JavaParserProductionClassTest {
final class JavaParserProductionClassTest {

@Test
void returnsName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
*
* @since 0.2
*/
class JavaParserTestCaseTest {
@SuppressWarnings("PMD.TooManyMethods")
final class JavaParserTestCaseTest {

@Test
void convertsToString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
*
* @since 0.1.0
*/
@SuppressWarnings("PMD.TooManyMethods")
final class JavaParserTestClassTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*
* @since 1.0.1
*/
class LineHitterRuleTest {
final class LineHitterRuleTest {

@Test
void checksClassWithoutHitterCorrectly() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*
* @since 0.1.15
*/
class RuleAssertionMessageTest {
final class RuleAssertionMessageTest {

@Test
void checksAssertionMessageWithoutComplaints() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*
* @since 0.1.17
*/
class RuleCorrectTestNameTest {
final class RuleCorrectTestNameTest {

@Test
void createsCorrectly() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* Test cases for {@link RuleInheritanceInTests}.
* @since 1.2
*/
class RuleInheritanceInTestsTest {
final class RuleInheritanceInTestsTest {

@Test
void doesNotFoundParents() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* Test for {@link RuleNotContainsTestWord}.
* @since 0.2.0
*/
class RuleNotContainsTestWordTest {
final class RuleNotContainsTestWordTest {

@ParameterizedTest
@MethodSource("cases")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*
* @since 0.1.19
*/
class RuleOnlyTestMethodsTest {
final class RuleOnlyTestMethodsTest {

@Test
void checksClassCorrectly() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* every-day development.
*/
@Disabled
class ModelSourceFileSystemTest {
final class ModelSourceFileSystemTest {

@Test
void loadsFromFileSystem(@TempDir final Path temp) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @since 0.10
*/
@Disabled
class RulePresentSimpleMlTest {
final class RulePresentSimpleMlTest {

/**
* Model for tests.
Expand Down

0 comments on commit cbe9d8b

Please sign in to comment.