Skip to content

Commit

Permalink
WICKET-7072 Fix the ApacheLicenceHeaderTest for wicket-core
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
  • Loading branch information
martin-g committed Oct 12, 2023
1 parent 70a45d0 commit ceacaf2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
package org.apache.wicket.core.util.license;


import java.io.File;

import org.apache.wicket.util.license.ApacheLicenseHeaderTestCase;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

/**
* Test that the license headers are in place in this project. The tests are run from
Expand All @@ -32,7 +36,7 @@ class ApacheLicenceHeaderTest extends ApacheLicenseHeaderTestCase
*/
ApacheLicenceHeaderTest()
{
// addHeaders = true;
// addHeaders = true;

/*
* See NOTICE.txt
Expand Down Expand Up @@ -108,4 +112,41 @@ class ApacheLicenceHeaderTest extends ApacheLicenseHeaderTestCase
javaScriptIgnore.add("src/test/js/amd/require.js");
javaScriptIgnore.add("src/test/js/data/ajax/nonWicketResponse.json"); // no way to add licence in JSON
}

@BeforeEach
@Override
public void before()
{
super.before();
}

/**
* Checks the license headers of wicket-core-tests.
*/
@Test
@Override
public void licenseHeaders()
{
super.licenseHeaders();
}

/**
* Checks the license headers of wicket-core.
*/
@Test
public void checkWicketCoreLicenseHeaders()
{
final String propertyName = "basedir";
final String basedir = System.getProperty(propertyName);
try
{
System.setProperty(propertyName, "../wicket-core");
super.before();
super.licenseHeaders();
}
finally
{
System.setProperty(propertyName, basedir);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public ApacheLicenseHeaderTestCase()
/**
*
*/
//@BeforeEach
protected void before()
{
// setup the base directory for when running inside maven (building a release
Expand All @@ -108,7 +107,6 @@ protected void before()
/**
* Test all the files in the project which has an associated {@link ILicenseHeaderHandler}.
*/
//@Test
protected void licenseHeaders()
{
licenseHeaderHandlers = new ILicenseHeaderHandler[] {
Expand Down

0 comments on commit ceacaf2

Please sign in to comment.