コード例 #1
0
  static {
    System.setProperty("svnkit.log.native.calls", "true");
    final JavaSVNDebugLogger logger =
        new JavaSVNDebugLogger(
            Boolean.getBoolean(LOG_PARAMETER_NAME), Boolean.getBoolean(TRACE_NATIVE_CALLS), LOG);
    SVNDebugLog.setDefaultLog(logger);

    SVNJNAUtil.setJNAEnabled(true);
    SvnHttpAuthMethodsDefaultChecker.check();

    SVNAdminAreaFactory.setSelector(new SvnFormatSelector());

    DAVRepositoryFactory.setup();
    SVNRepositoryFactoryImpl.setup();
    FSRepositoryFactory.setup();

    // non-optimized writing is fast enough on Linux/MacOS, and somewhat more reliable
    if (SystemInfo.isWindows) {
      SVNAdminArea14.setOptimizedWritingEnabled(true);
    }

    if (!SVNJNAUtil.isJNAPresent()) {
      LOG.warn("JNA is not found by svnkit library");
    }
    initLogFilters();

    // Alexander Kitaev says it is default value (SSLv3) - since 8254
    if (!SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.7")
        && System.getProperty(SVNKIT_HTTP_SSL_PROTOCOLS) == null) {
      System.setProperty(SVNKIT_HTTP_SSL_PROTOCOLS, "SSLv3");
    }
  }
コード例 #2
0
 public void refreshSSLProperty() {
   if (ourSSLProtocolsExplicitlySet) return;
   if (SvnConfiguration.SSLProtocols.all.equals(myConfiguration.SSL_PROTOCOLS)) {
     System.clearProperty(SVNKIT_HTTP_SSL_PROTOCOLS);
   } else if (SvnConfiguration.SSLProtocols.sslv3.equals(myConfiguration.SSL_PROTOCOLS)) {
     System.setProperty(SVNKIT_HTTP_SSL_PROTOCOLS, "SSLv3");
   } else if (SvnConfiguration.SSLProtocols.tlsv1.equals(myConfiguration.SSL_PROTOCOLS)) {
     System.setProperty(SVNKIT_HTTP_SSL_PROTOCOLS, "TLSv1");
   }
 }
コード例 #3
0
  static {
    System.setProperty("svnkit.log.native.calls", "true");
    final JavaSVNDebugLogger logger =
        new JavaSVNDebugLogger(
            Boolean.getBoolean(LOG_PARAMETER_NAME), Boolean.getBoolean(TRACE_NATIVE_CALLS), LOG);
    SVNDebugLog.setDefaultLog(logger);

    SVNJNAUtil.setJNAEnabled(true);
    SvnHttpAuthMethodsDefaultChecker.check();

    SVNAdminAreaFactory.setSelector(new SvnFormatSelector());

    DAVRepositoryFactory.setup();
    SVNRepositoryFactoryImpl.setup();
    FSRepositoryFactory.setup();

    // non-optimized writing is fast enough on Linux/MacOS, and somewhat more reliable
    if (SystemInfo.isWindows) {
      SVNAdminArea14.setOptimizedWritingEnabled(true);
    }

    if (!SVNJNAUtil.isJNAPresent()) {
      LOG.warn("JNA is not found by svnkit library");
    }
    initLogFilters();

    ourSSLProtocolsExplicitlySet = System.getProperty(SVNKIT_HTTP_SSL_PROTOCOLS) != null;
  }
コード例 #4
0
  @Before
  public void setUp() throws Exception {
    System.setProperty("svnkit.wc.17", "false");
    UIUtil.invokeAndWaitIfNeeded(
        new Runnable() {
          @Override
          public void run() {
            try {
              final IdeaTestFixtureFactory fixtureFactory =
                  IdeaTestFixtureFactory.getFixtureFactory();
              myTempDirFixture = fixtureFactory.createTempDirTestFixture();
              myTempDirFixture.setUp();

              final File svnRoot = new File(myTempDirFixture.getTempDirPath(), "svnroot");
              svnRoot.mkdir();

              File pluginRoot = new File(PluginPathManager.getPluginHomePath("svn4idea"));
              if (!pluginRoot.isDirectory()) {
                // try standalone mode
                Class aClass = SvnTestCase.class;
                String rootPath =
                    PathManager.getResourceRoot(
                        aClass, "/" + aClass.getName().replace('.', '/') + ".class");
                pluginRoot = new File(rootPath).getParentFile().getParentFile().getParentFile();
              }
              myClientBinaryPath = new File(pluginRoot, "testData/svn/bin");

              ZipUtil.extract(new File(pluginRoot, "testData/svn/newrepo.zip"), svnRoot, null);

              myWcRoot = new File(myTempDirFixture.getTempDirPath(), "wcroot");
              myWcRoot.mkdir();

              myRepoUrl = "file:///" + FileUtil.toSystemIndependentName(svnRoot.getPath());

              initProject(myWcRoot);
              activateVCS(SvnVcs17.VCS_NAME);

              verify(runSvn("co", myRepoUrl, "."));

              myGate = new MockChangeListManagerGate(ChangeListManager.getInstance(myProject));

              myRefreshCopiesStub =
                  new AtomicSectionsAware() {
                    @Override
                    public void enter() {}

                    @Override
                    public void exit() {}

                    @Override
                    public boolean shouldExitAsap() {
                      return false;
                    }

                    @Override
                    public void checkShouldExit() throws ProcessCanceledException {}
                  };

              final SvnVcs17 vcs = SvnVcs17.getInstance(myProject);
              ((StartupManagerImpl) StartupManager.getInstance(myProject))
                  .runPostStartupActivities();
              // vcs.postStartup();
              ((SvnFileUrlMappingImpl17) vcs.getSvnFileUrlMapping()).realRefresh();

            } catch (Exception e) {
              throw new RuntimeException(e);
            }
          }
        });
    // there should be kind-a waiting for after change list manager finds all changes and runs inner
    // refresh of copies in the above method
    ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
    VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
    changeListManager.ensureUpToDate(false);
  }