Commit
…operties with prefix 'surefire' and 'failsafe').
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,7 @@ public abstract class DefaultForkConfiguration | |
@Nonnull private final Properties modelProperties; | ||
@Nullable private final String argLine; | ||
@Nonnull private final Map<String, String> environmentVariables; | ||
@Nonnull private final String[] excludedEnvironmentVariables; | ||
private final boolean debug; | ||
private final int forkCount; | ||
private final boolean reuseForks; | ||
|
@@ -73,6 +74,7 @@ protected DefaultForkConfiguration( @Nonnull Classpath booterClasspath, | |
@Nonnull Properties modelProperties, | ||
@Nullable String argLine, | ||
@Nonnull Map<String, String> environmentVariables, | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Tibor17
via email
Author
Contributor
|
||
@Nonnull String[] excludedEnvironmentVariables, | ||
boolean debug, | ||
int forkCount, | ||
boolean reuseForks, | ||
|
@@ -86,6 +88,7 @@ protected DefaultForkConfiguration( @Nonnull Classpath booterClasspath, | |
this.modelProperties = modelProperties; | ||
this.argLine = argLine; | ||
this.environmentVariables = toImmutable( environmentVariables ); | ||
this.excludedEnvironmentVariables = excludedEnvironmentVariables; | ||
this.debug = debug; | ||
this.forkCount = forkCount; | ||
this.reuseForks = reuseForks; | ||
|
@@ -119,7 +122,8 @@ public OutputStreamFlushableCommandline createCommandLine( @Nonnull StartupConfi | |
@Nonnull File dumpLogDirectory ) | ||
throws SurefireBooterForkException | ||
{ | ||
OutputStreamFlushableCommandline cli = new OutputStreamFlushableCommandline(); | ||
OutputStreamFlushableCommandline cli = | ||
new OutputStreamFlushableCommandline( getExcludedEnvironmentVariables() ); | ||
This comment has been minimized.
Sorry, something went wrong.
michael-o
Member
|
||
|
||
cli.setWorkingDirectory( getWorkingDirectory( forkNumber ).getAbsolutePath() ); | ||
|
||
|
@@ -289,6 +293,13 @@ protected Map<String, String> getEnvironmentVariables() | |
return environmentVariables; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
protected String[] getExcludedEnvironmentVariables() | ||
{ | ||
return excludedEnvironmentVariables; | ||
} | ||
|
||
@Override | ||
protected boolean isDebug() | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.apache.maven.plugin.surefire.booterclient.lazytestprovider; | ||
|
||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
|
||
/** | ||
* Facade flushing {@link OutputStream} and isolating the stream in client. | ||
*/ | ||
final class OutputStreamFlushReceiver | ||
implements FlushReceiver | ||
{ | ||
private final OutputStream outputStream; | ||
|
||
/** | ||
* Wraps an output stream in order to delegate a flush. | ||
*/ | ||
OutputStreamFlushReceiver( OutputStream outputStream ) | ||
{ | ||
this.outputStream = outputStream; | ||
} | ||
|
||
@Override | ||
public void flush() | ||
throws IOException | ||
{ | ||
outputStream.flush(); | ||
} | ||
} |
1 comment
on commit 065001b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tibor17 can you create a pull request for this environment variables branch ?
This looks like a bad design to me:
environmentVariables
should contain the effective environmentVariables, so there's no reason to passexcludedEnvironmentVariables
, the caller is responsible for that.