use of jetbrains.buildServer.powershell.agent.detect.PowerShellInfo in project teamcity-powershell by JetBrains.
the class PowerShellInfoProviderTest method testSelect32OVer64_Version.
/**
* Both 64 bit and 32 bit PowerShells have good enough versions.
* Any bitness is required
* 64bit should be used
*/
@Test(dataProvider = "editionProvider")
public void testSelect32OVer64_Version(@NotNull final PowerShellEdition edition) {
final Map<String, String> params = new HashMap<String, String>();
mock32Bit("5.0", edition);
mock64bit("5.0", edition);
m.checking(new Expectations() {
{
allowing(myConfig).getConfigurationParameters();
will(returnValue(params));
}
});
final PowerShellInfo info = myProvider.selectTool(null, "3.0", null);
assertNotNull(info);
assertEquals(PowerShellBitness.x64, info.getBitness());
}
use of jetbrains.buildServer.powershell.agent.detect.PowerShellInfo in project teamcity-powershell by JetBrains.
the class PowerShellInfoProviderTest method testNull_BitnessNotSatisfied_32_64.
@Test(dataProvider = "editionProvider")
public void testNull_BitnessNotSatisfied_32_64(@NotNull final PowerShellEdition edition) throws Exception {
myHolder.addShellInfo(new PowerShellInfo(PowerShellBitness.x86, createTempDir(), "1.0", edition, "powershell.exe"));
assertNull(myProvider.selectTool(PowerShellBitness.x64, null, null));
}
use of jetbrains.buildServer.powershell.agent.detect.PowerShellInfo in project teamcity-powershell by JetBrains.
the class PowerShellInfoProviderTest method testUseSemanticVersion.
@Test(dataProvider = "editionProvider")
public void testUseSemanticVersion(@NotNull final PowerShellEdition edition) {
final Map<String, String> params = new HashMap<String, String>();
mock32Bit("3.0-beta4", edition);
mock64bit("6.0-alpha6", edition);
m.checking(new Expectations() {
{
allowing(myConfig).getConfigurationParameters();
will(returnValue(params));
}
});
final PowerShellInfo info = myProvider.selectTool(null, "4.0", null);
assertNotNull(info);
assertEquals(PowerShellBitness.x64, info.getBitness());
assertEquals("6.0-alpha6", info.getVersion());
}
Aggregations