use of jetbrains.buildServer.serverSide.TeamCityProperties in project teamcity-git by JetBrains.
the class AgentConfigPluginTest method setUp.
@BeforeMethod
public void setUp() {
new TeamCityProperties() {
{
setModel(new BasePropertiesModel() {
});
}
};
myMockery = new Mockery();
myAgentConfig = myMockery.mock(BuildAgentConfiguration.class);
myBuild = myMockery.mock(AgentRunningBuild.class);
myBuildSharedConfigParameters = new HashMap<String, String>();
myMockery.checking(new Expectations() {
{
allowing(myBuild).getSharedConfigParameters();
will(returnValue(myBuildSharedConfigParameters));
allowing(myBuild).getBuildLogger();
allowing(myAgentConfig).getCacheDirectory("git");
will(returnValue(new File("")));
}
});
myMirrorManager = new MirrorManagerImpl(new AgentMirrorConfig(myAgentConfig), new HashCalculatorImpl(), new RemoteRepositoryUrlInvestigatorImpl());
}
use of jetbrains.buildServer.serverSide.TeamCityProperties in project teamcity-git by JetBrains.
the class JSchClient method initInternalProperties.
private static void initInternalProperties(final Logger logger) {
String intPropsPath = System.getenv(GitSSHHandler.TEAMCITY_INT_PROPS_PATH);
File intPropsFile = intPropsPath == null ? null : new File(intPropsPath);
if (intPropsFile != null && !intPropsFile.isFile()) {
logger.log(Logger.WARN, "Could not find an internal properties file at path: " + intPropsPath);
intPropsFile = null;
}
if (intPropsFile == null) {
new TeamCityProperties() {
{
setBaseModel();
}
};
} else {
Map<String, String> loadedProps = new HashMap<>();
Properties props = new Properties();
try {
FileReader r = new FileReader(intPropsFile);
props.load(r);
props.forEach((k, v) -> loadedProps.put((String) k, (String) v));
} catch (IOException e) {
logger.log(Logger.WARN, "Could not load internal properties from the file: " + intPropsPath + ", error: " + e.toString());
}
new TeamCityProperties() {
{
setModel(new BasePropertiesModel() {
@NotNull
@Override
public Map<String, String> getUserDefinedProperties() {
return loadedProps;
}
});
}
};
}
}
use of jetbrains.buildServer.serverSide.TeamCityProperties in project teamcity-git by JetBrains.
the class ScriptGenTest method setUp.
@BeforeMethod
public void setUp() throws Exception {
new TeamCityProperties() {
{
setModel(new BasePropertiesModel() {
});
}
};
myTempFiles = new TempFiles();
}
use of jetbrains.buildServer.serverSide.TeamCityProperties in project teamcity-git by JetBrains.
the class GitVcsSupportTest method setUp.
@BeforeMethod
public void setUp() throws IOException {
myTestLogger.setLogLevel(Level.INFO);
new TeamCityProperties() {
{
setModel(new BasePropertiesModel() {
});
}
};
myPropertiesToClean = new HashSet<>();
myContext = new Mockery();
myTempFiles = new TempFiles();
myServerPaths = new ServerPaths(myTempFiles.createTempDir().getAbsolutePath());
myConfigBuilder = new PluginConfigBuilder(myServerPaths);
myTmpDir = myTempFiles.createTempDir();
myMainRepositoryDir = new File(myTmpDir, "repo.git");
copyRepository(dataFile("repo.git"), myMainRepositoryDir);
copyRepository(dataFile("submodule.git"), new File(myTmpDir, "submodule"));
copyRepository(dataFile("submodule.git"), new File(myTmpDir, "submodule.git"));
copyRepository(dataFile("sub-submodule.git"), new File(myTmpDir, "sub-submodule.git"));
myContext = new Mockery();
myResetCacheManager = myContext.mock(ResetCacheRegister.class);
myContext.checking(new Expectations() {
{
allowing(myResetCacheManager).registerHandler(with(any(ResetCacheHandler.class)));
}
});
}
use of jetbrains.buildServer.serverSide.TeamCityProperties in project teamcity-git by JetBrains.
the class ServerPluginConfigTest method setUp.
@BeforeMethod
public void setUp() throws Exception {
new TeamCityProperties() {
{
setModel(new BasePropertiesModel() {
});
}
};
myTempFiles = new TempFiles();
File dotBuildServer = myTempFiles.createTempDir();
myServerPaths = new ServerPaths(dotBuildServer.getAbsolutePath());
myPropertiesBeforeTest = GitTestUtil.copyCurrentProperties();
}
Aggregations