Skip to content

Commit

Permalink
add unit-test
Browse files Browse the repository at this point in the history
  • Loading branch information
XenoAmess committed Aug 20, 2020
1 parent 71fb290 commit 78873e4
Show file tree
Hide file tree
Showing 5 changed files with 219 additions and 2 deletions.
Expand Up @@ -25,6 +25,7 @@
* @author <a href="mailto:vsiveton@apache.org">vsiveton@apache.org</a>
* @version $Id: $
*/
@SuppressWarnings("SameReturnValue")
public class ClassWithJavadoc
implements InterfaceWithJavadoc
{
Expand All @@ -44,6 +45,25 @@ public ClassWithJavadoc( String aString )
{
}

/**
* public constructor with annotation
*
* @param b a {@link java.lang.Boolean} object.
* @since 1.1
*/
@SuppressWarnings("SameReturnValue")
public ClassWithJavadoc( Boolean b )
{
}

/**
* private constructor with annotation
*/
@SuppressWarnings("SameReturnValue")
private ClassWithJavadoc( Integer i )
{
}

/**
* Spaces in tags.
*
Expand Down Expand Up @@ -298,4 +318,52 @@ public static class MyRuntimeException
extends RuntimeException
{
}

/**
* private method with annotation
* @see java.io.Serializable
*/
@SuppressWarnings("SameReturnValue")
private void t000() {
return;
}

/**
* private method with annotation
* @see java.io.Serializable
*/
//test comment
private void t001() {
return;
}

/**
* public method with annotation
*
* @see java.io.Serializable
* @since 1.1
*/
@SuppressWarnings("SameReturnValue")
public void t010() {
return;
}

/**
* public method with annotation
*
* @see java.io.Serializable
* @since 1.1
*/
//test comment
public void t011() {
return;
}
}

/**
* To test package class
*/
@SuppressWarnings("SameReturnValue")
class PrivateTestClassWithJavadoc
{
}
Expand Up @@ -27,6 +27,7 @@
* @author <a href="mailto:vsiveton@apache.org">vsiveton@apache.org</a>
* @version $Id: $
*/
@SuppressWarnings("SameReturnValue")
public class ClassWithNoJavadoc
implements InterfaceWithNoJavadoc
{
Expand Down Expand Up @@ -69,6 +70,22 @@ public ClassWithNoJavadoc( String aString )
{
}

@SuppressWarnings("SameReturnValue")
/**
* <p>Constructor for ClassWithNoJavadoc.</p>
*
* @param b a {@link java.lang.Boolean} object.
* @since 1.1
*/
public ClassWithNoJavadoc( Boolean b )
{
}

@SuppressWarnings("SameReturnValue")
private ClassWithNoJavadoc( Integer i )
{
}

// take care of primitive
/**
* <p>missingJavadocTagsForPrimitives.</p>
Expand Down Expand Up @@ -154,4 +171,39 @@ public void nothing()
{
}
}

@SuppressWarnings("SameReturnValue")
private void t000() {
return;
}

//test comment
private void t001() {
return;
}

/**
* <p>t010.</p>
*
* @since 1.1
*/
@SuppressWarnings("SameReturnValue")
public void t010() {
return;
}

//test comment
/**
* <p>t011.</p>
*
* @since 1.1
*/
public void t011() {
return;
}
}

@SuppressWarnings("SameReturnValue")
class PrivateTestClassWithNoJavadoc
{
}
4 changes: 2 additions & 2 deletions src/test/resources/unit/fix-test/pom.xml
Expand Up @@ -27,8 +27,8 @@
<packaging>jar</packaging>

<properties>
<maven.compiler.source>1.4</maven.compiler.source>
<maven.compiler.target>1.4</maven.compiler.target>
<maven.compiler.source>1.5</maven.compiler.source>
<maven.compiler.target>1.5</maven.compiler.target>
</properties>

<build>
Expand Down
Expand Up @@ -22,6 +22,7 @@
/**
* To add default class tags.
*/
@SuppressWarnings("SameReturnValue")
public class ClassWithJavadoc
implements InterfaceWithJavadoc
{
Expand All @@ -39,6 +40,22 @@ public ClassWithJavadoc( String aString )
{
}

/**
* public constructor with annotation
*/
@SuppressWarnings("SameReturnValue")
public ClassWithJavadoc( Boolean b )
{
}

/**
* private constructor with annotation
*/
@SuppressWarnings("SameReturnValue")
private ClassWithJavadoc( Integer i )
{
}

/**
* Spaces in tags.
*
Expand Down Expand Up @@ -282,4 +299,48 @@ public static class MyRuntimeException
extends RuntimeException
{
}

/**
* private method with annotation
* @see java.io.Serializable
*/
@SuppressWarnings("SameReturnValue")
private void t000() {
return;
}

/**
* private method with annotation
* @see java.io.Serializable
*/
//test comment
private void t001() {
return;
}

/**
* public method with annotation
* @see java.io.Serializable
*/
@SuppressWarnings("SameReturnValue")
public void t010() {
return;
}

/**
* public method with annotation
* @see java.io.Serializable
*/
//test comment
public void t011() {
return;
}
}

/**
* To test package class
*/
@SuppressWarnings("SameReturnValue")
class PrivateTestClassWithJavadoc
{
}
Expand Up @@ -21,6 +21,7 @@

import java.util.Map;

@SuppressWarnings("SameReturnValue")
public class ClassWithNoJavadoc
implements InterfaceWithNoJavadoc
{
Expand Down Expand Up @@ -49,6 +50,16 @@ public ClassWithNoJavadoc( String aString )
{
}

@SuppressWarnings("SameReturnValue")
public ClassWithNoJavadoc( Boolean b )
{
}

@SuppressWarnings("SameReturnValue")
private ClassWithNoJavadoc( Integer i )
{
}

// take care of primitive
public void missingJavadocTagsForPrimitives( int i, byte b, float f, char c, short s, long l, double d, boolean bb )
{
Expand Down Expand Up @@ -106,4 +117,29 @@ public void nothing()
{
}
}

@SuppressWarnings("SameReturnValue")
private void t000() {
return;
}

//test comment
private void t001() {
return;
}

@SuppressWarnings("SameReturnValue")
public void t010() {
return;
}

//test comment
public void t011() {
return;
}
}

@SuppressWarnings("SameReturnValue")
class PrivateTestClassWithNoJavadoc
{
}

0 comments on commit 78873e4

Please sign in to comment.