-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nikolay.Pianikov
authored and
Nikolay.Pianikov
committed
Nov 21, 2016
1 parent
bdc2e4a
commit 3604d3b
Showing
13 changed files
with
158 additions
and
100 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
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
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
69 changes: 0 additions & 69 deletions
69
runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsShGenerator.java
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/ShGenerator.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,19 @@ | ||
package jetbrains.buildServer.runAs.agent; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import jetbrains.buildServer.dotNet.buildRunner.agent.ResourceGenerator; | ||
import jetbrains.buildServer.messages.serviceMessages.Message; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class ShGenerator implements ResourceGenerator<Params> { | ||
|
||
@NotNull | ||
@Override | ||
public String create(@NotNull final Params settings) { | ||
final StringBuilder sb = new StringBuilder(); | ||
sb.append(settings.getCommandLine()); | ||
return sb.toString(); | ||
} | ||
} |
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
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
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
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
37 changes: 37 additions & 0 deletions
37
runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/ShGeneratorTest.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,37 @@ | ||
package jetbrains.buildServer.runAs.agent; | ||
|
||
import jetbrains.buildServer.dotNet.buildRunner.agent.ResourceGenerator; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.testng.annotations.DataProvider; | ||
import org.testng.annotations.Test; | ||
|
||
import static org.assertj.core.api.BDDAssertions.then; | ||
|
||
public class ShGeneratorTest { | ||
private static final String LINE_SEPARATOR = System.getProperty("line.separator"); | ||
|
||
@DataProvider(name = "cmdLinesCases") | ||
public Object[][] getCmdLinesCases() { | ||
return new Object[][] { | ||
{ "cmd line", "cmd line" }, | ||
}; | ||
} | ||
|
||
@Test(dataProvider = "cmdLinesCases") | ||
public void shouldGenerateContent(@NotNull final String cmdLine, @NotNull final String cmdLineInMessage) { | ||
// Given | ||
final ResourceGenerator<Params> instance = createInstance(); | ||
|
||
// When | ||
final String content = instance.create(new Params(cmdLine)); | ||
|
||
// Then | ||
then(content).isEqualTo(cmdLine); | ||
} | ||
|
||
@NotNull | ||
private ResourceGenerator<Params> createInstance() | ||
{ | ||
return new ShGenerator(); | ||
} | ||
} |
Oops, something went wrong.