assertNotNull(pluginsDir); assertTrue(pluginsDir.isDirectory());
assertNotNull("Plugin Dir '" + pluginsDir + "' is null", pluginsDir); assertTrue("Plugin Dir '" + pluginsDir + "' is not a directory", pluginsDir.isDirectory());
  public void testPlugins() throws Exception  {    assertNotNull(pluginsDir);    assertTrue(pluginsDir.isDirectory());        StringBuffer result = new StringBuffer();    int docPluginsCounter = 0;    int brandingPluginsCounter = 0;    int sourcePluginsCounter = 0;        File[] plugins = pluginsDir.listFiles();    for (int i = 0; i < plugins.length; i++)    {      File plugin = plugins[i];      if (isPluginToTest(plugin))      {        JarFile jarFile = plugin.isFile() ? new JarFile(plugin) : null;        String name = plugin.getName().replaceAll("(_\\d\\.\\d\\.\\d(\\..*)?)?(\\.jar)?$", "");                if (isDocPlugin(name))        {          docPluginsCounter++;          String missingFiles = getMissingFiles(plugin, REQUIRED_DOC_PLUGIN_FILES);           if (missingFiles.length() > 0)          {            result.append(",").append(missingFiles);          }          else          {            String docZipResult = testDocZip(plugin);            if (docZipResult.length() > 0)            {              result.append(",").append(docZipResult);            }          }        }                if (isBrandingPlugin(name))        {          brandingPluginsCounter++;          String missingFiles = jarFile == null ?             getMissingFiles(plugin, REQUIRED_BRANDING_PLUGIN_FILES) :             getMissingFiles(jarFile, REQUIRED_BRANDING_PLUGIN_FILES);          if (missingFiles.length() > 0)          {            result.append(",").append(missingFiles);          }        }                if (isSourcePlugin(name))        {          sourcePluginsCounter++;          String missingFiles = getMissingFiles(plugin, REQUIRED_SOURCE_PLUGIN_FILES);           if (missingFiles.length() > 0)          {            result.append(",").append(missingFiles);          }          else          {            String sourceDirResult = testSrcDir(plugin);            if (sourceDirResult.length() > 0)            {              result.append(",").append(sourceDirResult);            }          }                  }                {          String missingFiles = jarFile == null ?             getMissingFiles(plugin, REQUIRED_REGULAR_PLUGIN_FILES) :             getMissingFiles(jarFile, REQUIRED_REGULAR_PLUGIN_FILES);          if (missingFiles.length() > 0)          {            result.append(",").append(missingFiles);          }        }      }    }        if (result.length() > 0)    {      result.deleteCharAt(0);    }        assertTrue(result.toString(), result.length() == 0);        assertEquals("expected number of doc plugins", expectedNumberOfDocPlugins, docPluginsCounter);    assertEquals("expected number of source plugins", expectedNumberOfSourcePlugins, sourcePluginsCounter);    assertEquals("expected number of branding plugins", brandingPluginNames.size(), brandingPluginsCounter);  }