Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ under the License.

<version.slf4j>1.7.36</version.slf4j>
<version.plexus-utils>3.6.0</version.plexus-utils>
<version.maven-invoker-plugin>3.9.1</version.maven-invoker-plugin>
</properties>

<dependencies>
Expand Down
8 changes: 4 additions & 4 deletions src/it/MRESOURCES-18/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ under the License.

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>@versions.junit5@</version>
<type>jar</type>
<scope>test</scope>
</dependency>
Expand All @@ -57,7 +57,7 @@ under the License.
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
<version>@version.maven-surefire@</version>
<configuration>
<systemProperties>
<!-- pass this system property through to the tests -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,47 @@
* under the License.
*/


import junit.framework.TestCase;

import java.util.Properties;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class FilterTest
extends TestCase
{
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class FilterTest {
private String basedir;

private Properties properties;

protected void setUp()
throws Exception
{
basedir = System.getProperty( "basedir" );
@BeforeEach
void setUp() throws Exception {
basedir = System.getProperty("basedir");

properties = new Properties();

File testPropertiesFile = new File( basedir, "target/classes/test.properties" );
File testPropertiesFile = new File(basedir, "target/classes/test.properties");

assertTrue( testPropertiesFile.exists() );
assertTrue(testPropertiesFile.exists());

properties.load( new FileInputStream( testPropertiesFile ) );
properties.load(new FileInputStream(testPropertiesFile));
}

public void testSystemPropertyInterpolation()
throws IOException
{
assertEquals( "System property", System.getProperty( "java.version" ), properties.getProperty( "system.property" ) );
}

public void testCommandLineParameterInterpolation()
throws IOException
{
assertEquals( "CLI Parameter", "CLI", properties.getProperty( "cli.param" ) );
}
@Test
void testSystemPropertyInterpolation() throws IOException {
assertEquals(System.getProperty("java.version"), properties.getProperty("system.property"), "System property");
}

public void testPomPropertyInterpolation()
throws IOException
{
assertEquals( "Pom Property", "foo", properties.getProperty( "pom.property" ) );
}
@Test
void testCommandLineParameterInterpolation() throws IOException {
assertEquals("CLI", properties.getProperty("cli.param"), "CLI Parameter");
}

@Test
void testPomPropertyInterpolation() throws IOException {
assertEquals("foo", properties.getProperty("pom.property"), "Pom Property");
}
}
Loading