Skip to content

Commit

Permalink
Merge pull request #13 from Bernardo-MG/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
Bernardo-MG committed Jul 7, 2022
2 parents 26226f5 + 5845494 commit c492798
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 97 deletions.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.bernardomg.maven</groupId>
<artifactId>base-pom</artifactId>
<version>1.5.0</version>
<version>1.5.1</version>
</parent>

<!-- ********************************************** -->
Expand All @@ -20,7 +20,7 @@

<groupId>com.bernardomg.velocity</groupId>
<artifactId>velocity-config-tool</artifactId>
<version>1.2.4</version>
<version>1.2.5</version>
<packaging>jar</packaging>

<name>Velocity config tool</name>
Expand Down Expand Up @@ -188,18 +188,18 @@
<!-- ============================================== -->
<!-- =========== DEPENDENCIES VERSIONS ============ -->
<!-- ============================================== -->
<commons.beanUtils.version>1.9.4</commons.beanUtils.version>
<commons.beanUtils.version>1.9.3</commons.beanUtils.version>
<commons.collections.version>3.2.2</commons.collections.version>
<commons.logging.version>1.2</commons.logging.version>
<doxia.decoration.version>1.9.2</doxia.decoration.version>
<junit.jupiter.version>5.8.2</junit.jupiter.version>
<mockito.version>4.3.1</mockito.version>
<mockito.version>4.6.1</mockito.version>
<plexus.version>3.3.0</plexus.version>
<velocity.tools.version>2.0</velocity.tools.version>
<!-- ============================================== -->
<!-- ================= MAVEN SITE ================= -->
<!-- ============================================== -->
<site.skin.version>2.2.5</site.skin.version>
<site.skin.version>2.2.6</site.skin.version>
<mavenURL>http://mvnrepository.com/artifact/com.bernardomg.velocity/velocity-config-tool</mavenURL>
</properties>

Expand Down
7 changes: 6 additions & 1 deletion src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
Updated deployment config.
</action>
</release>
<release version="1.2.4" date="2022-02-07" description="">
<release version="1.2.4" date="2022-02-07" description="Updated dependencies">
<action dev="bmg" type="update">
Updated dependencies.
</action>
Expand All @@ -60,5 +60,10 @@
Updated CI scripts.
</action>
</release>
<release version="1.2.5" date="2022-07-07" description="Updated dependencies">
<action dev="bmg" type="update">
Updated dependencies.
</action>
</release>
</body>
</document>
4 changes: 2 additions & 2 deletions src/config/checkstyle/checkstyle-rules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
<property name="eachLine" value="true" />
</module>

<!-- Checks line lenght -->
<!-- Checks line length -->
<module name="LineLength">
<property name="max" value="100" />
<property name="max" value="120" />
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://" />
</module>

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/bernardomg/velocity/tool/ConfigTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* Utilities class to ease using custom Maven Site configuration values through
* Velocity.
* <p>
* The configuration values should be in the site.xml file, inside a {@code
* The configuration values should be in the site.xml file, inside a {@code
* <skinConfig>}, itself inside the {@code <custom>} element, like this:
*
* <pre>
Expand Down
2 changes: 0 additions & 2 deletions src/site/markdown/reports.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
|[SpotBugs][spotbugs]|Generates a source code report with the SpotBugs Library.|
|[PMD][pmd]|Verification of coding rules.|
|[CPD][cpd]|Duplicate code detection.|
|[JDepend][jdepend]|Quality metrics for the project.|
|[Tag list][taglist]|List of warning tags found on the code.|

## Dependencies
Expand All @@ -41,7 +40,6 @@
[dependency-analysis]: ./dependency-analysis.html
[failsafe]: ./failsafe-report.html
[jacoco]: ./jacoco/index.html
[jdepend]: ./jdepend-report.html
[pmd]: ./pmd.html
[plugins]: ./plugins.html
[plugins-manage]: ./plugin-management.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,13 @@

import org.apache.maven.doxia.site.decoration.DecorationModel;
import org.apache.velocity.tools.ToolContext;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.runner.RunWith;

import com.bernardomg.velocity.tool.ConfigTool;
import com.bernardomg.velocity.tool.ConfigToolConstants;

/**
* Unit tests for {@link ConfigTool}, testing the {@code configure} method to
* make sure it can support various mostly invalid configurations.
* <p>
* These are just smoke tests to verify the class does not break in these cases.
*
* @author Bernardo Mart&iacute;nez Garrido
* @see ConfigTool
*/
@RunWith(JUnitPlatform.class)
@DisplayName("Setting configuration")
public final class TestConfigToolConfigure {

/**
Expand All @@ -55,10 +45,8 @@ public TestConfigToolConfigure() {
super();
}

/**
* Tests that the configuration method supports an empty velocity context.
*/
@Test
@DisplayName("Accepts empty context")
public final void test_EmptyContext() {
final ConfigTool util; // Utilities class to test
final Map<Object, Object> map; // Configuration map
Expand All @@ -74,10 +62,8 @@ public final void test_EmptyContext() {
util.configure(map);
}

/**
* Tests that the configuration method supports an empty decoration.
*/
@Test
@DisplayName("Accepts empty decoration")
public final void test_EmptyDecoration() {
final ConfigTool util; // Utilities class to test
final Map<Object, Object> map; // Configuration map
Expand All @@ -97,10 +83,8 @@ public final void test_EmptyDecoration() {
util.configure(map);
}

/**
* Tests that the configuration method supports an empty map.
*/
@Test
@DisplayName("Accepts empty map")
public final void test_EmptyMap() {
final ConfigTool util; // Utilities class to test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,14 @@
import org.apache.velocity.tools.ToolContext;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.junit.Assert;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.runner.RunWith;
import org.mockito.Mockito;

import com.bernardomg.velocity.tool.ConfigTool;
import com.bernardomg.velocity.tool.ConfigToolConstants;

/**
* Unit tests for {@link ConfigTool}, testing the {@code get} method.
*
* @author Bernardo Mart&iacute;nez Garrido
* @see ConfigTool
*/
@RunWith(JUnitPlatform.class)
@DisplayName("Getting configuration")
public final class TestConfigToolGet {

/**
Expand All @@ -55,10 +48,8 @@ public TestConfigToolGet() {
super();
}

/**
* Tests that the get method returns a node with the the expected key.
*/
@Test
@DisplayName("Returns the expected key")
public final void testGet_ExpectedKey() {
final ConfigTool util; // Utilities class to test

Expand All @@ -67,10 +58,8 @@ public final void testGet_ExpectedKey() {
Assert.assertEquals(util.get("key").getName(), "key");
}

/**
* Tests that the get method returns a node with the the expected value.
*/
@Test
@DisplayName("Returns the expected value")
public final void testGet_ExpectedValue() {
final ConfigTool util; // Utilities class to test

Expand All @@ -79,10 +68,8 @@ public final void testGet_ExpectedValue() {
Assert.assertEquals(util.get("key").getValue(), "value");
}

/**
* Tests that the get method returns a null for not existing values.
*/
@Test
@DisplayName("When no data exists for the key a null is returned")
public final void testGet_NotExisting_ReturnsNull() {
final ConfigTool util; // Utilities class to test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,13 @@

import org.apache.velocity.tools.ToolContext;
import org.junit.Assert;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.runner.RunWith;

import com.bernardomg.velocity.tool.ConfigTool;
import com.bernardomg.velocity.tool.ConfigToolConstants;

/**
* Unit tests for {@link ConfigTool}, testing the {@code getFileId} method.
*
* @author Bernardo Mart&iacute;nez Garrido
* @see ConfigTool
*/
@RunWith(JUnitPlatform.class)
@DisplayName("Get file ID")
public final class TestConfigToolGetFileId {

/**
Expand All @@ -52,10 +45,8 @@ public TestConfigToolGetFileId() {
super();
}

/**
* Tests that a file with consecutive points gives a slugged file id.
*/
@Test
@DisplayName("Consecutive points are transformed when slugging")
public final void testGetFileId_ConsecutivePoints_Slugged() {
final ConfigTool util; // Utilities class to test

Expand All @@ -64,10 +55,8 @@ public final void testGetFileId_ConsecutivePoints_Slugged() {
Assert.assertEquals(util.getFileId(), "path-to-file-name-something");
}

/**
* Tests that an empty file gives an empty file id.
*/
@Test
@DisplayName("An empty file gives an empty slug")
public final void testGetFileId_EmptyFile_EmptyId() {
final ConfigTool util; // Utilities class to test

Expand All @@ -76,10 +65,8 @@ public final void testGetFileId_EmptyFile_EmptyId() {
Assert.assertEquals(util.getFileId(), "");
}

/**
* Tests that a file with multiple points gives a slugged file id.
*/
@Test
@DisplayName("Points are transformed when slugging")
public final void testGetFileId_MultiplePoints_Slugged() {
final ConfigTool util; // Utilities class to test

Expand All @@ -88,10 +75,8 @@ public final void testGetFileId_MultiplePoints_Slugged() {
Assert.assertEquals(util.getFileId(), "path-to-file-name-something");
}

/**
* Tests that a file with multiple line separators gives a slugged file id.
*/
@Test
@DisplayName("Consecutive separators are transformed when slugging")
public final void testGetFileId_MultipleSeparators_Slugged() {
final ConfigTool util; // Utilities class to test

Expand All @@ -100,10 +85,8 @@ public final void testGetFileId_MultipleSeparators_Slugged() {
Assert.assertEquals(util.getFileId(), "path-to-file-name-something");
}

/**
* Tests that a file without extension gives a slugged file id.
*/
@Test
@DisplayName("Files with no extension are slugged")
public final void testGetFileId_NoExtension_Slugged() {
final ConfigTool util; // Utilities class to test

Expand All @@ -112,10 +95,8 @@ public final void testGetFileId_NoExtension_Slugged() {
Assert.assertEquals(util.getFileId(), "path-to-file-name");
}

/**
* Tests that a null file gives an empty file id.
*/
@Test
@DisplayName("A null file gives an empty slug")
public final void testGetFileId_NullFile_EmptyId() {
final ConfigTool util; // Utilities class to test

Expand All @@ -124,10 +105,8 @@ public final void testGetFileId_NullFile_EmptyId() {
Assert.assertEquals(util.getFileId(), "");
}

/**
* Tests that a file with only an extension gives an empty id.
*/
@Test
@DisplayName("A file with only an extension gives an empty slug")
public final void testGetFileId_OnlyExtension_Empty() {
final ConfigTool util; // Utilities class to test

Expand All @@ -136,10 +115,8 @@ public final void testGetFileId_OnlyExtension_Empty() {
Assert.assertEquals(util.getFileId(), "");
}

/**
* Tests that a valid file gives a slugged file id.
*/
@Test
@DisplayName("A valid file gives a slugged file ID")
public final void testGetFileId_ValidFile_Slugged() {
final ConfigTool util; // Utilities class to test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,14 @@
import org.apache.velocity.tools.ToolContext;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.junit.Assert;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.runner.RunWith;
import org.mockito.Mockito;

import com.bernardomg.velocity.tool.ConfigTool;
import com.bernardomg.velocity.tool.ConfigToolConstants;

/**
* Unit tests for {@link ConfigTool}, testing the {@code get} method.
* <p>
* These test use an invalid context, missing part of the required data.
*
* @author Bernardo Mart&iacute;nez Garrido
* @see ConfigTool
*/
@RunWith(JUnitPlatform.class)
@DisplayName("Getting configuration with missing data")
public final class TestConfigToolGetMissingData {

/**
Expand All @@ -57,10 +48,8 @@ public TestConfigToolGetMissingData() {
super();
}

/**
* Tests that the get method returns a null for not existing values.
*/
@Test
@DisplayName("When missing skin configuration no data is returned")
public final void testGet_NoSkinConfig_ReturnsNull() {
final ConfigTool util; // Utilities class to test

Expand Down

0 comments on commit c492798

Please sign in to comment.