Java Code Examples for org.eclipse.jgit.util.SystemReader#setInstance()

The following examples show how to use org.eclipse.jgit.util.SystemReader#setInstance() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransportCommand.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public final void run () throws GitException {
    SystemReader original = SystemReader.getInstance();
    String externalTool = original.getenv(PROP_ENV_GIT_SSH);
    boolean replace = externalTool != null;
    if ("true".equals(System.getProperty(PROP_GIT_SSH_SYSTEM_CLIENT, "false"))) { // NOI18N
        replace = false;
    }
    try {
        if (replace) {
            LOG.log(Level.WARNING, "{0} set to {1}, ignoring and using the default implementation via JSch", new Object[] { PROP_ENV_GIT_SSH, externalTool }); //NOI18N
            SystemReader.setInstance(new DelegatingSystemReader(original));
        }
        runTransportCommand();
    } finally {
        if (replace) {
            SystemReader.setInstance(original);
        }
    }
}
 
Example 2
Source File: RefreshableConfigServerIntegrationTests.java    From spring-cloud-config with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void init() throws IOException {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());

	localRepo = ConfigServerTestUtils.prepareLocalRepo();
}
 
Example 3
Source File: ConfigClientBackwardsCompatibilityIntegrationTests.java    From spring-cloud-config with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void init() throws IOException {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());

	ConfigServerTestUtils.prepareLocalRepo();
}
 
Example 4
Source File: CustomCompositeEnvironmentRepositoryTests.java    From spring-cloud-config with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void init() throws Exception {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());

	ConfigServerTestUtils.prepareLocalRepo();
}
 
Example 5
Source File: CustomCompositeEnvironmentRepositoryTests.java    From spring-cloud-config with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void init() throws Exception {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());

	ConfigServerTestUtils.prepareLocalRepo();
}
 
Example 6
Source File: BootstrapConfigServerIntegrationTests.java    From spring-cloud-config with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void init() throws IOException {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());

	ConfigServerTestUtils.prepareLocalRepo("encrypt-repo");
}
 
Example 7
Source File: NativeConfigServerIntegrationTests.java    From spring-cloud-config with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void init() throws IOException {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());

	ConfigServerTestUtils.prepareLocalRepo();
}
 
Example 8
Source File: ConfigClientOffIntegrationTests.java    From spring-cloud-config with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void init() throws IOException {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());

	ConfigServerTestUtils.prepareLocalRepo();
}
 
Example 9
Source File: CompositeIntegrationTests.java    From spring-cloud-config with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void init() throws Exception {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());

	ConfigServerTestUtils.prepareLocalRepo();
	ConfigServerTestUtils.prepareLocalSvnRepo(
			"src/test/resources/svn-config-repo", "target/repos/svn-config-repo");
}
 
Example 10
Source File: CompositeIntegrationTests.java    From spring-cloud-config with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void init() throws Exception {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());

	ConfigServerTestUtils.prepareLocalRepo();
	ConfigServerTestUtils.prepareLocalSvnRepo(
			"src/test/resources/svn-config-repo", "target/repos/svn-config-repo");
}
 
Example 11
Source File: VanillaConfigServerIntegrationTests.java    From spring-cloud-config with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void init() throws IOException {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());

	ConfigServerTestUtils.prepareLocalRepo();
}
 
Example 12
Source File: ConfigClientOnIntegrationTests.java    From spring-cloud-config with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void init() throws IOException {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());

	localRepo = ConfigServerTestUtils.prepareLocalRepo();
}
 
Example 13
Source File: JGitEnvironmentRepositoryConcurrencyTests.java    From spring-cloud-config with Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void initClass() {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());
}
 
Example 14
Source File: MultipleJGitEnvironmentProfilePlaceholderRepositoryTests.java    From spring-cloud-config with Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void initClass() {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());
}
 
Example 15
Source File: MultipleJGitEnvironmentRepositoryIntegrationTests.java    From spring-cloud-config with Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void initClass() {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());
}
 
Example 16
Source File: MultipleJGitEnvironmentLabelPlaceholderRepositoryTests.java    From spring-cloud-config with Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void initClass() {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());
}
 
Example 17
Source File: MultipleJGitEnvironmentApplicationPlaceholderRepositoryTests.java    From spring-cloud-config with Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void initClass() {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());
}
 
Example 18
Source File: JGitEnvironmentRepositoryIntegrationTests.java    From spring-cloud-config with Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void initClass() {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());
}
 
Example 19
Source File: JGitEnvironmentRepositoryTests.java    From spring-cloud-config with Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void initClass() {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());
}
 
Example 20
Source File: MultipleJGitEnvironmentRepositoryTests.java    From spring-cloud-config with Apache License 2.0 4 votes vote down vote up
@BeforeClass
public static void initClass() {
	// mock Git configuration to make tests independent of local Git configuration
	SystemReader.setInstance(new MockSystemReader());
}