-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # client/src/main/java/org/mvndaemon/mvnd/client/DefaultClient.java
- Loading branch information
Showing
3 changed files
with
120 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
integration-tests/src/test/java/org/mvndaemon/mvnd/it/ThreadOptionNativeIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Copyright 2019-2021 the original author or authors. | ||
* | ||
* Licensed 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. | ||
*/ | ||
package org.mvndaemon.mvnd.it; | ||
|
||
import java.io.IOException; | ||
import javax.inject.Inject; | ||
import org.junit.jupiter.api.Test; | ||
import org.mvndaemon.mvnd.assertj.TestClientOutput; | ||
import org.mvndaemon.mvnd.client.Client; | ||
import org.mvndaemon.mvnd.client.DaemonParameters; | ||
import org.mvndaemon.mvnd.junit.MvndNativeTest; | ||
|
||
@MvndNativeTest(projectDir = "src/test/projects/multi-module") | ||
public class ThreadOptionNativeIT { | ||
|
||
@Inject | ||
Client client; | ||
|
||
@Inject | ||
DaemonParameters parameters; | ||
|
||
@Test | ||
void minusTSpace2() throws IOException, InterruptedException { | ||
final TestClientOutput output = new TestClientOutput(); | ||
|
||
client.execute(output, "-T", "2", "verify").assertSuccess(); | ||
|
||
output.assertContainsMatchingSubsequence("Using the SmartBuilder implementation with a thread count of 2"); | ||
} | ||
|
||
@Test | ||
void minusT2() throws IOException, InterruptedException { | ||
final TestClientOutput output = new TestClientOutput(); | ||
|
||
client.execute(output, "-T2", "verify").assertSuccess(); | ||
|
||
output.assertContainsMatchingSubsequence("Using the SmartBuilder implementation with a thread count of 2"); | ||
} | ||
|
||
@Test | ||
void minusThreadsSpace2() throws IOException, InterruptedException { | ||
final TestClientOutput output = new TestClientOutput(); | ||
|
||
client.execute(output, "--threads", "2", "verify").assertSuccess(); | ||
|
||
output.assertContainsMatchingSubsequence("Using the SmartBuilder implementation with a thread count of 2"); | ||
} | ||
|
||
@Test | ||
void minusThreads2() throws IOException, InterruptedException { | ||
final TestClientOutput output = new TestClientOutput(); | ||
|
||
client.execute(output, "--threads=2", "verify").assertSuccess(); | ||
|
||
output.assertContainsMatchingSubsequence("Using the SmartBuilder implementation with a thread count of 2"); | ||
} | ||
|
||
@Test | ||
void mvndThreads() throws IOException, InterruptedException { | ||
final TestClientOutput output = new TestClientOutput(); | ||
|
||
client.execute(output, "-Dmvnd.threads=2", "verify").assertSuccess(); | ||
|
||
output.assertContainsMatchingSubsequence("Using the SmartBuilder implementation with a thread count of 2"); | ||
} | ||
|
||
protected boolean isNative() { | ||
return true; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
integration-tests/src/test/java/org/mvndaemon/mvnd/it/ThreadOptionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2019-2021 the original author or authors. | ||
* | ||
* Licensed 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. | ||
*/ | ||
package org.mvndaemon.mvnd.it; | ||
|
||
import org.mvndaemon.mvnd.junit.MvndTest; | ||
|
||
@MvndTest(projectDir = "src/test/projects/multi-module") | ||
public class ThreadOptionTest extends ThreadOptionNativeIT { | ||
|
||
protected boolean isNative() { | ||
return false; | ||
} | ||
} |