Example #1
0
 private static String getHomeDirectory() {
   return new File(
           PathManager.getResourceRoot(
               JetParsingTest.class, "/org/jetbrains/jet/parsing/JetParsingTest.class"))
       .getParentFile()
       .getParentFile()
       .getParent();
 }
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    myNestedFormLoader = new MyNestedFormLoader();

    final String swingPath = PathUtil.getJarPathForClass(AbstractButton.class);

    java.util.List<URL> cp = new ArrayList<URL>();
    appendPath(cp, JBTabbedPane.class);
    appendPath(cp, TIntObjectHashMap.class);
    appendPath(cp, UIUtil.class);
    appendPath(cp, SystemInfoRt.class);
    appendPath(cp, ApplicationManager.class);
    appendPath(cp, PathManager.getResourceRoot(this.getClass(), "/messages/UIBundle.properties"));
    appendPath(cp, PathManager.getResourceRoot(this.getClass(), "/RuntimeBundle.properties"));
    appendPath(cp, GridLayoutManager.class); // forms_rt
    appendPath(cp, DataProvider.class);
    myClassFinder =
        new MyClassFinder(
            new URL[] {new File(swingPath).toURI().toURL()}, cp.toArray(new URL[cp.size()]));
  }
 /**
  * Configures given classpath to reference target i18n bundle file(s).
  *
  * @param classPath process classpath
  * @param bundlePath path to the target bundle file
  * @param contextClass class from the same content root as the target bundle file
  */
 public static void addBundle(
     @NotNull PathsList classPath, @NotNull String bundlePath, @NotNull Class<?> contextClass) {
   String pathToUse = bundlePath.replace('.', '/');
   if (!pathToUse.endsWith(".properties")) {
     pathToUse += ".properties";
   }
   if (!pathToUse.startsWith("/")) {
     pathToUse = '/' + pathToUse;
   }
   String root = PathManager.getResourceRoot(contextClass, pathToUse);
   if (root != null) {
     classPath.add(root);
   }
 }
 @Before
 public void setUp() throws Exception {
   super.setUp();
   // PlatformTestCase.initPlatformLangPrefix();
   File pluginRoot = new File(PluginPathManager.getPluginHomePath("svn4idea"));
   if (!pluginRoot.isDirectory()) {
     // try standalone mode
     Class aClass = Svn17TestCase.class;
     String rootPath =
         PathManager.getResourceRoot(aClass, "/" + aClass.getName().replace('.', '/') + ".class");
     pluginRoot = new File(rootPath).getParentFile().getParentFile().getParentFile();
   }
   myWorkingCopyRoot = new File(pluginRoot, "testData/move2unv");
 }