Skip to content

Commit

Permalink
[SUREFIRE-2025] Updated abstractions which helps associating systemPr…
Browse files Browse the repository at this point in the history
…operties() with a test
  • Loading branch information
Tibor17 committed Feb 24, 2022
1 parent fdf0228 commit adbbc82
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void shouldHaveSystemProperty() throws Exception
WritableBufferedByteChannel wChannel = newBufferedChannel( out );
EventChannelEncoder encoder = new EventChannelEncoder( wChannel );
Map<String, String> props = ObjectUtils.systemProps();
encoder.systemProperties( props );
encoder.systemProperties( props, NORMAL_RUN, 1L );
wChannel.close();

ForkedProcessEventNotifier notifier = new ForkedProcessEventNotifier();
Expand Down Expand Up @@ -805,7 +805,7 @@ public void shouldCountSameNumberOfSystemProperties() throws Exception
final Stream out = Stream.newStream();
WritableBufferedByteChannel wChannel = newBufferedChannel( out );
EventChannelEncoder encoder = new EventChannelEncoder( wChannel );
encoder.systemProperties( ObjectUtils.systemProps() );
encoder.systemProperties( ObjectUtils.systemProps(), NORMAL_RUN, 1L );
wChannel.close();

ReadableByteChannel channel = newChannel( new ByteArrayInputStream( out.toByteArray() ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void testSetStarting( TestSetReportEntry report )
@Override
public void testSetCompleted( TestSetReportEntry report )
{
target.systemProperties( report.getSystemProperties() );
target.systemProperties( report.getSystemProperties(), null, null );
target.testSetCompleted( report, trim );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

import org.apache.maven.surefire.api.report.ReportEntry;
import org.apache.maven.surefire.api.report.RunMode;
import org.apache.maven.surefire.api.report.StackTraceWriter;
import org.apache.maven.surefire.api.report.TestOutputReportEntry;

Expand All @@ -37,7 +38,7 @@ public interface MasterProcessChannelEncoder

void onJvmExit();

void systemProperties( Map<String, String> sysProps );
void systemProperties( Map<String, String> sysProps, RunMode runMode, Long testRunId );

void testSetStarting( ReportEntry reportEntry, boolean trimStackTraces );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void onJvmExit()
}

@Override
public void systemProperties( Map<String, String> sysProps )
public void systemProperties( Map<String, String> sysProps, RunMode rm, Long testRunId )
{
CharsetEncoder encoder = newCharsetEncoder();
ByteBuffer result = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ public void shouldCountSameNumberOfSystemProperties() throws IOException
EventChannelEncoder encoder = new EventChannelEncoder( channel );

Map<String, String> sysProps = ObjectUtils.systemProps();
encoder.systemProperties( sysProps );
encoder.systemProperties( sysProps, NORMAL_RUN, 1L );
channel.close();

for ( Entry<String, String> entry : sysProps.entrySet() )
Expand Down

0 comments on commit adbbc82

Please sign in to comment.