From 3604d3bd80f9ff9f675ea1e2b8714b8e6b72fab2 Mon Sep 17 00:00:00 2001 From: "Nikolay.Pianikov" Date: Mon, 21 Nov 2016 15:43:55 +0300 Subject: [PATCH] #6 - Support Unix OS - add tests --- ...nAsCmdGenerator.java => CmdGenerator.java} | 4 +- .../{RunAsCmdSettings.java => Params.java} | 6 +- .../RunAsPlatformSpecificSetupBuilder.java | 8 +-- .../runAs/agent/RunAsShGenerator.java | 69 ------------------- .../buildServer/runAs/agent/ShGenerator.java | 19 +++++ .../META-INF/build-agent-plugin-runAs.xml | 8 +-- ...neratorTest.java => CmdGeneratorTest.java} | 11 +-- .../agent/ExecutableFilePublisherTest.java | 27 +++++++- ...RunAsPlatformSpecificSetupBuilderTest.java | 11 +-- .../runAs/agent/ShGeneratorTest.java | 37 ++++++++++ .../agent/UnixSettingsGeneratorTest.java | 45 ++++++++++++ ...java => WindowsSettingsGeneratorTest.java} | 7 +- .../src/test/resources/testng-runAs.xml | 6 +- 13 files changed, 158 insertions(+), 100 deletions(-) rename runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/{RunAsCmdGenerator.java => CmdGenerator.java} (93%) rename runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/{RunAsCmdSettings.java => Params.java} (83%) delete mode 100644 runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsShGenerator.java create mode 100644 runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/ShGenerator.java rename runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/{RunAsCmdGeneratorTest.java => CmdGeneratorTest.java} (82%) create mode 100644 runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/ShGeneratorTest.java create mode 100644 runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/UnixSettingsGeneratorTest.java rename runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/{WindowsWindowsSettingsGeneratorTest.java => WindowsSettingsGeneratorTest.java} (84%) diff --git a/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsCmdGenerator.java b/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/CmdGenerator.java similarity index 93% rename from runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsCmdGenerator.java rename to runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/CmdGenerator.java index f51050a..731f692 100644 --- a/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsCmdGenerator.java +++ b/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/CmdGenerator.java @@ -7,7 +7,7 @@ import jetbrains.buildServer.messages.serviceMessages.Message; import org.jetbrains.annotations.NotNull; -public class RunAsCmdGenerator implements ResourceGenerator { +public class CmdGenerator implements ResourceGenerator { private static final String LINE_SEPARATOR = System.getProperty("line.separator"); private static final String NORMAL_STATUS = "NORMAL"; private static final List OurReplacements = Collections.unmodifiableList(Arrays.asList( @@ -21,7 +21,7 @@ public class RunAsCmdGenerator implements ResourceGenerator { @NotNull @Override - public String create(@NotNull final RunAsCmdSettings settings) { + public String create(@NotNull final Params settings) { final StringBuilder sb = new StringBuilder(); sb.append("@ECHO OFF"); diff --git a/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsCmdSettings.java b/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/Params.java similarity index 83% rename from runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsCmdSettings.java rename to runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/Params.java index 4f3d477..36cc071 100644 --- a/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsCmdSettings.java +++ b/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/Params.java @@ -2,10 +2,10 @@ import org.jetbrains.annotations.NotNull; -public class RunAsCmdSettings { +public class Params { private final String myCommandLine; - public RunAsCmdSettings( + public Params( @NotNull final String commandLine) { myCommandLine = commandLine; } @@ -20,7 +20,7 @@ public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; - final RunAsCmdSettings that = (RunAsCmdSettings)o; + final Params that = (Params)o; return getCommandLine().equals(that.getCommandLine()); diff --git a/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsPlatformSpecificSetupBuilder.java b/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsPlatformSpecificSetupBuilder.java index 5b6e647..96351d7 100644 --- a/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsPlatformSpecificSetupBuilder.java +++ b/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsPlatformSpecificSetupBuilder.java @@ -18,7 +18,7 @@ public class RunAsPlatformSpecificSetupBuilder implements CommandLineSetupBuilde private final ResourcePublisher myBeforeBuildPublisher; private final ResourcePublisher myExecutableFilePublisher; private final ResourceGenerator mySettingsGenerator; - private final ResourceGenerator myRunAsCmdGenerator; + private final ResourceGenerator myRunAsCmdGenerator; private final CommandLineArgumentsService myCommandLineArgumentsService; private final FileAccessService myFileAccessService; private final String myCommandFileExtension; @@ -30,7 +30,7 @@ public RunAsPlatformSpecificSetupBuilder( @NotNull final ResourcePublisher beforeBuildPublisher, @NotNull final ResourcePublisher executableFilePublisher, @NotNull final ResourceGenerator settingsGenerator, - @NotNull final ResourceGenerator runAsCmdGenerator, + @NotNull final ResourceGenerator runAsCmdGenerator, @NotNull final CommandLineArgumentsService commandLineArgumentsService, @NotNull final FileAccessService fileAccessService, @NotNull final String commandFileExtension) { @@ -68,10 +68,10 @@ public Iterable build(@NotNull final CommandLineSetup commandL cmdLineArgs.add(new CommandLineArgument(commandLineSetup.getToolPath(), CommandLineArgument.Type.PARAMETER)); cmdLineArgs.addAll(commandLineSetup.getArgs()); - final RunAsCmdSettings runAsCmdSettings = new RunAsCmdSettings(myCommandLineArgumentsService.createCommandLineString(cmdLineArgs)); + final Params params = new Params(myCommandLineArgumentsService.createCommandLineString(cmdLineArgs)); final File commandFile = myFileService.getTempFileName(myCommandFileExtension); - resources.add(new CommandLineFile(myExecutableFilePublisher, commandFile.getAbsoluteFile(), myRunAsCmdGenerator.create(runAsCmdSettings))); + resources.add(new CommandLineFile(myExecutableFilePublisher, commandFile.getAbsoluteFile(), myRunAsCmdGenerator.create(params))); return Collections.singleton( new CommandLineSetup( diff --git a/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsShGenerator.java b/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsShGenerator.java deleted file mode 100644 index c50e5dc..0000000 --- a/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/RunAsShGenerator.java +++ /dev/null @@ -1,69 +0,0 @@ -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 RunAsShGenerator implements ResourceGenerator { - private static final String LINE_SEPARATOR = System.getProperty("line.separator"); - private static final String NORMAL_STATUS = "NORMAL"; - private static final List OurReplacements = Collections.unmodifiableList(Arrays.asList( - new Replacement("^", "^^"), - new Replacement("\\", "^\\"), - new Replacement("&", "^&"), - new Replacement("|", "^|"), - new Replacement("'", "^'"), - new Replacement(">", "^>"), - new Replacement("<", "^<"))); - - @NotNull - @Override - public String create(@NotNull final RunAsCmdSettings settings) { - final StringBuilder sb = new StringBuilder(); - sb.append("@ECHO OFF"); - - sb.append(LINE_SEPARATOR); - sb.append("ECHO "); - sb.append(ApplyCmdStringReplacements(new Message("Starting: " + settings.getCommandLine(), NORMAL_STATUS, null).toString())); - - sb.append(LINE_SEPARATOR); - sb.append(settings.getCommandLine()); - - return sb.toString(); - } - - @NotNull - private static String ApplyCmdStringReplacements(@NotNull final String text) - { - String curText = text; - for (Replacement replacement: OurReplacements) { - curText = curText.replace(replacement.getTargetString(), replacement.getReplacementString()); - } - - return curText; - } - - private static class Replacement - { - private final String myTargetString; - private final String myReplacementString; - - Replacement(@NotNull final String targetString, @NotNull final String replacementString) { - myTargetString = targetString; - myReplacementString = replacementString; - } - - @NotNull - String getTargetString() { - return myTargetString; - } - - @NotNull - String getReplacementString() { - return myReplacementString; - } - } -} diff --git a/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/ShGenerator.java b/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/ShGenerator.java new file mode 100644 index 0000000..6b6b9ab --- /dev/null +++ b/runAs-agent/src/main/java/jetbrains/buildServer/runAs/agent/ShGenerator.java @@ -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 { + + @NotNull + @Override + public String create(@NotNull final Params settings) { + final StringBuilder sb = new StringBuilder(); + sb.append(settings.getCommandLine()); + return sb.toString(); + } +} diff --git a/runAs-agent/src/main/resources/META-INF/build-agent-plugin-runAs.xml b/runAs-agent/src/main/resources/META-INF/build-agent-plugin-runAs.xml index e73514e..b13a9f2 100644 --- a/runAs-agent/src/main/resources/META-INF/build-agent-plugin-runAs.xml +++ b/runAs-agent/src/main/resources/META-INF/build-agent-plugin-runAs.xml @@ -16,23 +16,23 @@ - + - + - + - + diff --git a/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/RunAsCmdGeneratorTest.java b/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/CmdGeneratorTest.java similarity index 82% rename from runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/RunAsCmdGeneratorTest.java rename to runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/CmdGeneratorTest.java index 6e3eb02..0c5f897 100644 --- a/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/RunAsCmdGeneratorTest.java +++ b/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/CmdGeneratorTest.java @@ -1,12 +1,13 @@ 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 RunAsCmdGeneratorTest { +public class CmdGeneratorTest { private static final String LINE_SEPARATOR = System.getProperty("line.separator"); @DataProvider(name = "cmdLinesCases") @@ -31,10 +32,10 @@ public Object[][] getCmdLinesCases() { @Test(dataProvider = "cmdLinesCases") public void shouldGenerateContent(@NotNull final String cmdLine, @NotNull final String cmdLineInMessage) { // Given - final RunAsCmdGenerator instance = createInstance(); + final ResourceGenerator instance = createInstance(); // When - final String content = instance.create(new RunAsCmdSettings(cmdLine)); + final String content = instance.create(new Params(cmdLine)); // Then then(content).isEqualTo("@ECHO OFF" @@ -45,8 +46,8 @@ public void shouldGenerateContent(@NotNull final String cmdLine, @NotNull final } @NotNull - private RunAsCmdGenerator createInstance() + private ResourceGenerator createInstance() { - return new RunAsCmdGenerator(); + return new CmdGenerator(); } } diff --git a/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/ExecutableFilePublisherTest.java b/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/ExecutableFilePublisherTest.java index ba40990..8798bd9 100644 --- a/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/ExecutableFilePublisherTest.java +++ b/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/ExecutableFilePublisherTest.java @@ -26,20 +26,41 @@ public void setUp() } @Test() - public void shouldWriteFileToDiskWhenPublishBeforeBuild() throws IOException { + public void shouldInvokePublishBeforeBuildFileInBasePublisherAndMakeItExecutableForAllWhenPublishBeforeBuildFile() throws IOException { // Given final File file = new File("file"); + final CommandLineExecutionContext executionContext = new CommandLineExecutionContext(0); myCtx.checking(new Expectations() {{ + oneOf(myResourcePublisher).publishBeforeBuildFile(executionContext, file, "content"); + oneOf(myFileAccessService).makeExecutableForAll(file); }}); final ExecutableFilePublisher instance = createInstance(); // When - // instance.publishBeforeBuildFile(new CommandLineExecutionContext(0), file, "content"); + instance.publishBeforeBuildFile(executionContext, file, "content"); // Then - // myCtx.assertIsSatisfied(); + myCtx.assertIsSatisfied(); + } + + @Test() + public void shouldInvokePublishAfterBuildArtifactFileInBasePublisherWhenPublishBeforeBuildFile() throws IOException { + // Given + final File file = new File("file"); + final CommandLineExecutionContext executionContext = new CommandLineExecutionContext(0); + myCtx.checking(new Expectations() {{ + oneOf(myResourcePublisher).publishAfterBuildArtifactFile(executionContext, file); + }}); + + final ExecutableFilePublisher instance = createInstance(); + + // When + instance.publishAfterBuildArtifactFile(executionContext, file); + + // Then + myCtx.assertIsSatisfied(); } @NotNull diff --git a/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/RunAsPlatformSpecificSetupBuilderTest.java b/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/RunAsPlatformSpecificSetupBuilderTest.java index 9b5794b..8e48d3b 100644 --- a/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/RunAsPlatformSpecificSetupBuilderTest.java +++ b/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/RunAsPlatformSpecificSetupBuilderTest.java @@ -23,7 +23,7 @@ public class RunAsPlatformSpecificSetupBuilderTest { private ResourceGenerator myCredentialsGenerator; private CommandLineResource myCommandLineResource1; private CommandLineResource myCommandLineResource2; - private ResourceGenerator myArgsGenerator; + private ResourceGenerator myArgsGenerator; private CommandLineArgumentsService myCommandLineArgumentsService; private SettingsProvider mySettingsProvider; private ResourcePublisher myExecutableFilePublisher; @@ -41,7 +41,7 @@ public void setUp() //noinspection unchecked myCredentialsGenerator = (ResourceGenerator)myCtx.mock(ResourceGenerator.class, "WindowsSettingsGenerator"); //noinspection unchecked - myArgsGenerator = (ResourceGenerator)myCtx.mock(ResourceGenerator.class, "ArgsGenerator"); + myArgsGenerator = (ResourceGenerator)myCtx.mock(ResourceGenerator.class, "ArgsGenerator"); //noinspection unchecked myCommandLineResource1 = myCtx.mock(CommandLineResource.class, "Res1"); myCommandLineResource2 = myCtx.mock(CommandLineResource.class, "Res2"); @@ -64,7 +64,7 @@ public void shouldBuildSetup() throws IOException { final String credentialsContent = "credentials content"; final String cmdContent = "args content"; final CommandLineSetup commandLineSetup = new CommandLineSetup(toolName, args, resources); - final RunAsCmdSettings runAsCmdSettings = new RunAsCmdSettings("cmd line"); + final Params params = new Params("cmd line"); final List additionalArgs = Arrays.asList(new CommandLineArgument("arg1", CommandLineArgument.Type.PARAMETER), new CommandLineArgument("arg 2", CommandLineArgument.Type.PARAMETER)); final Settings settings = new Settings(user, password, additionalArgs); myCtx.checking(new Expectations() {{ @@ -84,13 +84,14 @@ public void shouldBuildSetup() throws IOException { oneOf(myCommandLineArgumentsService).createCommandLineString(with(any(List.class))); will(returnValue("cmd line")); - oneOf(myArgsGenerator).create(runAsCmdSettings); + oneOf(myArgsGenerator).create(params); will(returnValue(cmdContent)); oneOf(myRunnerParametersService).getToolPath(Constants.RUN_AS_TOOL_NAME); will(returnValue(runAsToolPath)); oneOf(myFileService).validatePath(runAsTool); + oneOf(myFileAccessService).makeExecutableForMe(runAsTool); }}); final CommandLineSetupBuilder instance = createInstance(); @@ -106,7 +107,7 @@ public void shouldBuildSetup() throws IOException { myCommandLineResource1, myCommandLineResource2, new CommandLineFile(myBeforeBuildPublisher, credentialsFile.getAbsoluteFile(), credentialsContent), - new CommandLineFile(myBeforeBuildPublisher, cmdFile.getAbsoluteFile(), cmdContent)); + new CommandLineFile(myExecutableFilePublisher, cmdFile.getAbsoluteFile(), cmdContent)); then(setup.getArgs()).containsExactly( new CommandLineArgument(credentialsFile.getAbsolutePath(), CommandLineArgument.Type.PARAMETER), diff --git a/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/ShGeneratorTest.java b/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/ShGeneratorTest.java new file mode 100644 index 0000000..fed03f7 --- /dev/null +++ b/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/ShGeneratorTest.java @@ -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 instance = createInstance(); + + // When + final String content = instance.create(new Params(cmdLine)); + + // Then + then(content).isEqualTo(cmdLine); + } + + @NotNull + private ResourceGenerator createInstance() + { + return new ShGenerator(); + } +} diff --git a/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/UnixSettingsGeneratorTest.java b/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/UnixSettingsGeneratorTest.java new file mode 100644 index 0000000..f3b4390 --- /dev/null +++ b/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/UnixSettingsGeneratorTest.java @@ -0,0 +1,45 @@ +package jetbrains.buildServer.runAs.agent; + +import java.util.Arrays; +import java.util.List; +import jetbrains.buildServer.dotNet.buildRunner.agent.CommandLineArgument; +import jetbrains.buildServer.dotNet.buildRunner.agent.ResourceGenerator; +import org.jetbrains.annotations.NotNull; +import org.jmock.Mockery; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import static org.assertj.core.api.BDDAssertions.then; + +public class UnixSettingsGeneratorTest { + private static final String ourlineSeparator = System.getProperty("line.separator"); + private Mockery myCtx; + + @BeforeMethod + public void setUp() + { + myCtx = new Mockery(); + } + + @Test() + public void shouldGenerateContent() { + // Given + final String expectedContent = "--user nik"; + final List additionalArgs = Arrays.asList(new CommandLineArgument("arg1", CommandLineArgument.Type.PARAMETER), new CommandLineArgument("arg 2", CommandLineArgument.Type.PARAMETER)); + + final ResourceGenerator instance = createInstance(); + + // When + final String content = instance.create(new Settings("nik", "aaa", additionalArgs)); + + // Then + myCtx.assertIsSatisfied(); + then(content.trim().replace("\n", " ").replace("\r", "")).isEqualTo(expectedContent.trim().replace("\n", " ").replace("\r", "")); + } + + @NotNull + private ResourceGenerator createInstance() + { + return new UnixSettingsGenerator(); + } +} diff --git a/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/WindowsWindowsSettingsGeneratorTest.java b/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/WindowsSettingsGeneratorTest.java similarity index 84% rename from runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/WindowsWindowsSettingsGeneratorTest.java rename to runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/WindowsSettingsGeneratorTest.java index 19c9c3d..c80556f 100644 --- a/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/WindowsWindowsSettingsGeneratorTest.java +++ b/runAs-agent/src/test/java/jetbrains/buildServer/runAs/agent/WindowsSettingsGeneratorTest.java @@ -3,6 +3,7 @@ import java.util.Arrays; import java.util.List; import jetbrains.buildServer.dotNet.buildRunner.agent.CommandLineArgument; +import jetbrains.buildServer.dotNet.buildRunner.agent.ResourceGenerator; import org.jetbrains.annotations.NotNull; import org.jmock.Mockery; import org.testng.annotations.BeforeMethod; @@ -10,7 +11,7 @@ import static org.assertj.core.api.BDDAssertions.then; -public class WindowsWindowsSettingsGeneratorTest { +public class WindowsSettingsGeneratorTest { private static final String ourlineSeparator = System.getProperty("line.separator"); private Mockery myCtx; @@ -26,7 +27,7 @@ public void shouldGenerateContent() { final String expectedContent = "-u:nik" + ourlineSeparator + "arg1" + ourlineSeparator + "arg 2"; final List additionalArgs = Arrays.asList(new CommandLineArgument("arg1", CommandLineArgument.Type.PARAMETER), new CommandLineArgument("arg 2", CommandLineArgument.Type.PARAMETER)); - final WindowsSettingsGenerator instance = createInstance(); + final ResourceGenerator instance = createInstance(); // When final String content = instance.create(new Settings("nik", "aaa", additionalArgs)); @@ -37,7 +38,7 @@ public void shouldGenerateContent() { } @NotNull - private WindowsSettingsGenerator createInstance() + private ResourceGenerator createInstance() { return new WindowsSettingsGenerator(); } diff --git a/runAs-agent/src/test/resources/testng-runAs.xml b/runAs-agent/src/test/resources/testng-runAs.xml index 0c689ac..816baef 100644 --- a/runAs-agent/src/test/resources/testng-runAs.xml +++ b/runAs-agent/src/test/resources/testng-runAs.xml @@ -2,8 +2,10 @@ - - + + + +