use of jetbrains.buildServer.powershell.agent.detect.PowerShellDetector in project teamcity-powershell by JetBrains.
the class PowerShellInfoProvider method registerDetectedPowerShells.
private void registerDetectedPowerShells(@NotNull final List<PowerShellDetector> detectors, @NotNull final DetectionContext detectionContext) {
Map<String, PowerShellInfo> shells = new HashMap<String, PowerShellInfo>();
for (PowerShellDetector detector : detectors) {
for (Map.Entry<String, PowerShellInfo> entry : detector.findShells(detectionContext).entrySet()) {
if (!shells.containsKey(entry.getKey())) {
shells.put(entry.getKey(), entry.getValue());
entry.getValue().saveInfo(myConfig);
myHolder.addShellInfo(entry.getValue());
}
}
}
// provide parameters for agent compatibility filters
if (!myHolder.getShells().isEmpty()) {
provideMaxVersions();
provideCompatibilityParams();
}
}
use of jetbrains.buildServer.powershell.agent.detect.PowerShellDetector in project teamcity-powershell by JetBrains.
the class PowerShellInfoProviderTest method setUp.
@Override
@BeforeMethod
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
super.setUp();
m = new Mockery() {
{
setImposteriser(ClassImposteriser.INSTANCE);
}
};
myEvents = m.mock(EventDispatcher.class);
myConfig = m.mock(BuildAgentConfiguration.class);
myHolder = new ShellInfoHolder();
m.checking(new Expectations() {
{
allowing(myEvents);
}
});
myTempHome = createTempDir();
myProvider = new PowerShellInfoProvider(myConfig, myEvents, Collections.<PowerShellDetector>emptyList(), myHolder);
}
Aggregations