You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2019/06/07 06:48:13 UTC
[maven-shared-utils] branch MSHARED-826 updated (882e845 -> d67fb53)
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a change to branch MSHARED-826
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git.
from 882e845 Cleanup
new 31e8fd8 Require Java 7
new 71af096 Load SUT class a little later
new 7e64153 Cleanup
new 453ca44 Ensure no JVMs are reused to execute the tests
new d67fb53 Merge branch 'MSHARED-826' of https://gitbox.apache.org/repos/asf/maven-shared-utils into MSHARED-826
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
pom.xml | 7 +++++++
1 file changed, 7 insertions(+)
[maven-shared-utils] 02/05: Load SUT class a little later
Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch MSHARED-826
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git
commit 71af09677f715e7832ad44d0cc69feaa8205af82
Author: Maarten Mulders <m....@xs4all.nl>
AuthorDate: Thu Jun 6 13:32:09 2019 +0200
Load SUT class a little later
This way, we can first change the system props
and then interact with the SUT. This way, changing
the static class fields is no longer needed.
---
.../java/org/apache/maven/shared/utils/OsTest.java | 30 +---------------------
1 file changed, 1 insertion(+), 29 deletions(-)
diff --git a/src/test/java/org/apache/maven/shared/utils/OsTest.java b/src/test/java/org/apache/maven/shared/utils/OsTest.java
index 051a930..7c2fd1f 100644
--- a/src/test/java/org/apache/maven/shared/utils/OsTest.java
+++ b/src/test/java/org/apache/maven/shared/utils/OsTest.java
@@ -47,58 +47,30 @@ public class OsTest
@Before
public void setUp()
- throws Exception
{
origOsName = System.getProperty( "os.name" );
origOsArch = System.getProperty( "os.arch" );
origOsVersion = System.getProperty( "os.version" );
- origOsFamily = Os.OS_FAMILY;
// and now set some special settings ;)
System.setProperty( "os.name" , "os/2" );
System.setProperty( "os.arch" , "i386" );
System.setProperty( "os.version", "2.1.32" );
- // blow away the originally loaded values
- setStaticOsField( "OS_NAME", "os/2" );
- setStaticOsField( "OS_FAMILY", "os/2" );
- setStaticOsField( "OS_ARCH", "i386" );
- setStaticOsField( "OS_VERSION", "2.1.32" );
+ origOsFamily = Os.OS_FAMILY;
}
@After
public void tearDown()
- throws Exception
{
// set the original OS settings again
System.setProperty( "os.name" , origOsName );
System.setProperty( "os.arch" , origOsArch );
System.setProperty( "os.version", origOsVersion );
-
- // restore the originally loaded values
- setStaticOsField( "OS_NAME", origOsName );
- setStaticOsField( "OS_ARCH", origOsArch );
- setStaticOsField( "OS_VERSION", origOsVersion );
- setStaticOsField( "OS_FAMILY", origOsFamily );
}
- private void setStaticOsField( String variableName, Object value )
- throws NoSuchFieldException, IllegalAccessException
- {
- Field field = Os.class.getField( variableName );
-
- Field modifiersField = Field.class.getDeclaredField( "modifiers" );
- modifiersField.setAccessible( true );
- modifiersField.setInt( field, field.getModifiers() & ~Modifier.FINAL );
-
- field.setAccessible( true );
- field.set( null, value );
- }
-
-
@Test
public void testConstructor()
- throws Exception
{
Os os = new Os();
os.eval();
[maven-shared-utils] 03/05: Cleanup
Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch MSHARED-826
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git
commit 7e6415337ab36d940c90f1dab6549563ae1e3a34
Author: Maarten Mulders <m....@xs4all.nl>
AuthorDate: Thu Jun 6 14:08:10 2019 +0200
Cleanup
---
src/test/java/org/apache/maven/shared/utils/OsTest.java | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/test/java/org/apache/maven/shared/utils/OsTest.java b/src/test/java/org/apache/maven/shared/utils/OsTest.java
index 7c2fd1f..d5ea683 100644
--- a/src/test/java/org/apache/maven/shared/utils/OsTest.java
+++ b/src/test/java/org/apache/maven/shared/utils/OsTest.java
@@ -24,8 +24,6 @@ import org.junit.Before;
import org.junit.After;
import org.junit.Assert;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
import java.util.Set;
import static org.hamcrest.CoreMatchers.*;
@@ -40,7 +38,6 @@ public class OsTest
extends Assert
{
private String origOsName;
- private String origOsFamily;
private String origOsArch;
private String origOsVersion;
@@ -56,8 +53,6 @@ public class OsTest
System.setProperty( "os.name" , "os/2" );
System.setProperty( "os.arch" , "i386" );
System.setProperty( "os.version", "2.1.32" );
-
- origOsFamily = Os.OS_FAMILY;
}
@After
[maven-shared-utils] 01/05: Require Java 7
Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch MSHARED-826
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git
commit 31e8fd8dc22f412c2591b90d205b26845d26727f
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Wed Jun 5 19:01:54 2019 +0200
Require Java 7
---
pom.xml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 171f2f9..7886329 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-components</artifactId>
- <version>32</version>
+ <version>33</version>
<relativePath>../../pom/maven/maven-shared-components/pom.xml</relativePath>
</parent>
@@ -63,6 +63,7 @@
<properties>
<checkstyle.violation.ignore>RedundantThrows,NewlineAtEndOfFile,ParameterNumber,MethodLength,FileLength,ModifierOrder</checkstyle.violation.ignore>
+ <javaVersion>7</javaVersion>
<mavenVersion>3.0</mavenVersion>
</properties>
[maven-shared-utils] 05/05: Merge branch 'MSHARED-826' of
https://gitbox.apache.org/repos/asf/maven-shared-utils into MSHARED-826
Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch MSHARED-826
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git
commit d67fb5380c7f08a638c62776fd4077b87381ef81
Merge: 453ca44 882e845
Author: rfscholte <rf...@apache.org>
AuthorDate: Fri Jun 7 08:47:48 2019 +0200
Merge branch 'MSHARED-826' of https://gitbox.apache.org/repos/asf/maven-shared-utils into MSHARED-826
[maven-shared-utils] 04/05: Ensure no JVMs are reused to execute
the tests
Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch MSHARED-826
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git
commit 453ca444f62ed91b3a18b29d0a6368c9f08499e8
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Fri Jun 7 07:52:12 2019 +0200
Ensure no JVMs are reused to execute the tests
---
pom.xml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/pom.xml b/pom.xml
index 7886329..01763d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -145,6 +145,13 @@
</excludes>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <reuseForks>false</reuseForks>
+ </configuration>
+ </plugin>
</plugins>
</build>