org.tizen.tizenunittest.gtest_2.0.0.201310011722

16:50:25.459 INFO  jd.cli.Main - Decompiling org.tizen.tizenunittest.gtest_2.0.0.201310011722.jar
package org.tizen.tizenunittest.gtest;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.debug.ui.console.FileLink;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
import org.eclipse.ui.console.TextConsole;
import org.tizen.tizenunittest.gtest.event.ConsoleLinkEvent;
import org.tizen.tizenunittest.gtest.event.TestEvent;
import org.tizen.tizenunittest.gtest.event.TestEventHandler;

public class ConsoleLinkHandler
  extends TestEventHandler
{
  private TextConsole console;
  private IPath rtPath;
  
  public ConsoleLinkHandler(IPath paramIPath, TextConsole paramTextConsole)
  {
    rtPath = paramIPath;
    console = paramTextConsole;
  }
  
  public void handle(TestEvent paramTestEvent)
  {
    if ((paramTestEvent instanceof ConsoleLinkEvent))
    {
      ConsoleLinkEvent localConsoleLinkEvent = (ConsoleLinkEvent)paramTestEvent;
      handleConsoleLink(reg, fileName, lineNo);
    }
  }
  
  public void handleConsoleLink(IRegion paramIRegion, String paramString1, String paramString2)
  {
    IPath localIPath = rtPath.removeLastSegments(1).append(paramString1);
    try
    {
      IFile localIFile = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(localIPath);
      int i = Integer.parseInt(paramString2);
      FileLink localFileLink = new FileLink(localIFile, null, -1, -1, i);
      console.addHyperlink(localFileLink, paramIRegion.getOffset(), paramIRegion.getLength());
    }
    catch (BadLocationException localBadLocationException)
    {
      localBadLocationException.printStackTrace();
    }
  }
  
  public void handleSuiteBeginning(String paramString, int paramInt) {}
  
  public void handleSuiteEnding(String paramString) {}
  
  public void handleError(String paramString1, String paramString2) {}
  
  public void handleSuccess(String paramString1, String paramString2) {}
  
  public void handleFailure(String paramString1, String paramString2, String paramString3, String paramString4) {}
  
  public void handleTestStart(String paramString) {}
  
  public void handleSessionEnd() {}
  
  public void handleSessionStart() {}
}

/* Location:
 * Qualified Name:     org.tizen.tizenunittest.gtest.ConsoleLinkHandler
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.tizenunittest.gtest;

import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.ui.console.IPatternMatchListener;
import org.eclipse.ui.console.PatternMatchEvent;
import org.eclipse.ui.console.TextConsole;
import org.tizen.tizenunittest.gtest.event.TestEvent;
import org.tizen.tizenunittest.gtest.event.TestEventHandler;
import org.tizen.tizenunittest.gtest.event.parser.ConsoleEventParser;

public class ConsolePatternListener
  implements IPatternMatchListener
{
  private TextConsole console;
  private ConsoleEventParser eventParser;
  private Vector<TestEventHandler> handlers;
  
  public ConsolePatternListener(ConsoleEventParser paramConsoleEventParser)
  {
    eventParser = paramConsoleEventParser;
    handlers = new Vector();
  }
  
  public int getCompilerFlags()
  {
    return 1;
  }
  
  public String getLineQualifier()
  {
    return eventParser.getLineQualifier();
  }
  
  public String getPattern()
  {
    return eventParser.getComprehensiveLinePattern();
  }
  
  public void connect(TextConsole paramTextConsole)
  {
    console = paramTextConsole;
    Iterator localIterator = handlers.iterator();
    while (localIterator.hasNext())
    {
      TestEventHandler localTestEventHandler = (TestEventHandler)localIterator.next();
      localTestEventHandler.handleSessionStart();
    }
  }
  
  public void disconnect()
  {
    Iterator localIterator = handlers.iterator();
    while (localIterator.hasNext())
    {
      TestEventHandler localTestEventHandler = (TestEventHandler)localIterator.next();
      localTestEventHandler.handleSessionEnd();
    }
    console = null;
  }
  
  public void addHandler(TestEventHandler paramTestEventHandler)
  {
    handlers.add(paramTestEventHandler);
  }
  
  public void removeHandler(TestEventHandler paramTestEventHandler)
  {
    handlers.remove(paramTestEventHandler);
  }
  
  public void matchFound(PatternMatchEvent paramPatternMatchEvent)
  {
    try
    {
      IDocument localIDocument = console.getDocument();
      IRegion localIRegion = localIDocument.getLineInformation(localIDocument.getLineOfOffset(paramPatternMatchEvent.getOffset()));
      String str = localIDocument.get(localIRegion.getOffset(), localIRegion.getLength());
      processTestEventsFrom(localIRegion, str);
    }
    catch (BadLocationException localBadLocationException)
    {
      throw new RuntimeException(localBadLocationException);
    }
  }
  
  private void processTestEventsFrom(IRegion paramIRegion, String paramString)
  {
    List localList = eventParser.eventsFrom(paramIRegion, paramString);
    Iterator localIterator = localList.iterator();
    while (localIterator.hasNext())
    {
      TestEvent localTestEvent = (TestEvent)localIterator.next();
      process(localTestEvent);
    }
  }
  
  private void process(TestEvent paramTestEvent)
  {
    Iterator localIterator = handlers.iterator();
    while (localIterator.hasNext())
    {
      TestEventHandler localTestEventHandler = (TestEventHandler)localIterator.next();
      localTestEventHandler.handle(paramTestEvent);
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.tizenunittest.gtest.ConsolePatternListener
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.tizenunittest.gtest;

public class GlobalValues
{
  public static final String PLUGINID = "org.tizen.tizenunittest.gtest";
  public static final String RESULTVIEWID = "org.tizen.tizenunittest.ResultViewId";
  public static final String EXPLORERVIEWID = "org.tizen.tizenunittest.ExplorerViewId";
  public static final String WHITESPACEVALUE = "org.tizen.tizenunittest.SHOW_WHITESPACES";
  public static final String GTEST_XMLOPTION = " --gtest_output=xml";
  public static final String GTEST_LISTS = " --gtest_list_tests";
  public static final String GTEST_FILETER = " --gtest_filter=";
  public static final String GTEST_RUNDISABLED = " --gtest_also_run_disabled_tests";
  public static final String GTEST_SHUFFLE = " --gtest_shuffle";
  public static final String GTEST_DONTPRINTELAPSEDTIME = " --gtest_print_time=0";
  public static final String GTEST_TIME_OUT = " --gtest_time_out=";
  public static final String TIZENUNITTEST_IMAGEPATH = "unittest.gif";
  public static final String RELAUNCH_IMAGEPATH = "obj16/relaunch.gif";
  public static final String REFRESH_IMAGEPATH = "tree/refresh.gif";
  public static final String EXPANDALL_IMAGEPATH = "tree/expand.png";
  public static final String COLLAPSEALL_IMAGEPATH = "tree/collapse.png";
  public static final String CLEARALL_IMAGEPATH = "tree/clearall.png";
  public static final String CHECKFAILED_IMAGEPATH = "tree/checkfailed.png";
  public static final String CHECKALL_IMAGEPATH = "tree/checkall.png";
  public static final String PREVIOUS_FAILURE_IMAGEPATH = "obj16/select_prev.gif";
  public static final String NEXT_FAILURE_IMAGEPATH = "obj16/select_next.gif";
  public static final String LOCK_IMAGEPATH = "obj16/lock.gif";
  public static final String SUCCESSED_IMAGEPATH = "tree/successed.png";
  public static final String FAILED_IMAGEPATH = "tree/failed.png";
  public static final String ABNORMAL_IMAGEPATH = "tree/abnormal.png";
  public static final String TIMEOUT_IMAGEPATH = "tree/timeout.png";
  public static final String ABNORMAL_TERMINATION_IMAGEPATH = "tree/abnormaltermination.png";
  public static final String ERROR_IMAGEPATH = "tree/error.png";
  public static final String DISABLED_IMAGEPATH = "tree/disabled.png";
  public static final String NOTRUNNED_IMAGEPATH = "tree/notrunned.png";
  public static final String FAILURES_IMAGEPATH = "obj16/failures.gif";
  public static final String TEMP_RESULT_XML_PATH = "teMp_gtEst_resUlt_fOr_tiZen.xml";
  public static final String DATAPATH = "/data/";
  public static String RESULT_XML_PATH;
  public static boolean RERUNED = false;
}

/* Location:
 * Qualified Name:     org.tizen.tizenunittest.gtest.GlobalValues
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.tizenunittest.gtest;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.progress.UIJob;
import org.tizen.tizenunittest.gtest.common.UnitTestMessages;
import org.tizen.tizenunittest.gtest.gtest.testexplorer.TXView;
import org.tizen.tizenunittest.gtest.resultview.TestResultView;

public class ShowViews
  extends UIJob
{
  private static final String SHOWRESULTVIEW_JOBNAME = "Show Test Result View and Test Explorer";
  
  public ShowViews()
  {
    super("Show Test Result View and Test Explorer");
  }
  
  private TestResultView showTestResultrViewPartInActivePage(TestResultView paramTestResultView)
  {
    IWorkbenchPart localIWorkbenchPart = null;
    IWorkbenchPage localIWorkbenchPage = null;
    try
    {
      if ((paramTestResultView != null) && (paramTestResultView.isCreated()))
      {
        localTestResultView1 = paramTestResultView;
        localTestResultView2 = localTestResultView1;
        return localTestResultView2;
      }
      localIWorkbenchPage = UnitTestPlugin.getActivePage();
      if (localIWorkbenchPage == null) {
        return null;
      }
      localIWorkbenchPart = localIWorkbenchPage.getActivePart();
      TestResultView localTestResultView1 = (TestResultView)localIWorkbenchPage.showView("%tizenunittestResultViewId");
      TestResultView localTestResultView2 = localTestResultView1;
      return localTestResultView2;
    }
    catch (PartInitException localPartInitException)
    {
      UnitTestPlugin.log(localPartInitException);
      return null;
    }
    finally
    {
      if ((localIWorkbenchPage != null) && (localIWorkbenchPart != null)) {
        localIWorkbenchPage.activate(localIWorkbenchPart);
      }
    }
  }
  
  private TXView showTestExplorerViewPartInActivePage(TXView paramTXView)
  {
    IWorkbenchPart localIWorkbenchPart = null;
    IWorkbenchPage localIWorkbenchPage = null;
    try
    {
      if ((paramTXView != null) && (paramTXView.isCreated()))
      {
        localTXView1 = paramTXView;
        localTXView2 = paramTXView;
        return localTXView2;
      }
      localIWorkbenchPage = UnitTestPlugin.getActivePage();
      if (localIWorkbenchPage == null) {
        return null;
      }
      localIWorkbenchPart = localIWorkbenchPage.getActivePart();
      TXView localTXView1 = (TXView)localIWorkbenchPage.showView("%tizenunittestExplorerViewId");
      TXView localTXView2 = localTXView1;
      return localTXView2;
    }
    catch (PartInitException localPartInitException)
    {
      UnitTestPlugin.log(localPartInitException);
      return null;
    }
    finally
    {
      if ((localIWorkbenchPage != null) && (localIWorkbenchPart != null)) {
        localIWorkbenchPage.activate(localIWorkbenchPart);
      }
    }
  }
  
  private TestResultView findTestRunnerViewPartInActivePage()
  {
    IWorkbenchPage localIWorkbenchPage = UnitTestPlugin.getActivePage();
    if (localIWorkbenchPage == null) {
      return null;
    }
    return (TestResultView)localIWorkbenchPage.findView("org.tizen.tizenunittest.ResultViewId");
  }
  
  private TXView findTestExplorerViewPartInActivePage()
  {
    IWorkbenchPage localIWorkbenchPage = UnitTestPlugin.getActivePage();
    if (localIWorkbenchPage == null) {
      return null;
    }
    return (TXView)localIWorkbenchPage.findView("org.tizen.tizenunittest.ExplorerViewId");
  }
  
  public IStatus runInUIThread(IProgressMonitor paramIProgressMonitor)
  {
    if (showTestResultrViewPartInActivePage(findTestRunnerViewPartInActivePage()) == null) {
      return new Status(2, "org.tizen.tizenunittest.gtest", 0, UnitTestMessages.RESULTVIEW_ERROR_SHOW, null);
    }
    if (showTestExplorerViewPartInActivePage(findTestExplorerViewPartInActivePage()) == null) {
      return new Status(2, "org.tizen.tizenunittest.gtest", 0, UnitTestMessages.TXVIEW_ERROR_SHOW, null);
    }
    return new Status(0, "org.tizen.tizenunittest.gtest", 0, "OK", null);
  }
}

/* Location:
 * Qualified Name:     org.tizen.tizenunittest.gtest.ShowViews
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.tizenunittest.gtest;

import java.net.URL;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.tizen.tizenunittest.gtest.model.CuteModel;

public class UnitTestPlugin
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.tizen.tizenunittest.gtest";
  private static UnitTestPlugin plugin;
  private static final IPath ICONS_PATH = new Path("$nl$/icons");
  private final CuteModel model = new CuteModel();
  private Display display;
  
  public UnitTestPlugin()
  {
    plugin = this;
  }
  
  public void start(BundleContext paramBundleContext)
    throws Exception
  {
    super.start(paramBundleContext);
    display = Display.getCurrent();
    if (display == null) {
      display = Display.getDefault();
    }
  }
  
  public void stop(BundleContext paramBundleContext)
    throws Exception
  {
    plugin = null;
    super.stop(paramBundleContext);
  }
  
  public static UnitTestPlugin getDefault()
  {
    return plugin;
  }
  
  public static String getUniqueIdentifier()
  {
    if (getDefault() == null) {
      return "org.tizen.tizenunittest.gtest";
    }
    return getDefault().getBundle().getSymbolicName();
  }
  
  public static ImageDescriptor getImageDescriptor(String paramString)
  {
    IPath localIPath = ICONS_PATH.append(paramString);
    return createImageDescriptor(getDefault().getBundle(), localIPath);
  }
  
  public static IWorkbenchWindow getActiveWorkbenchWindow()
  {
    if (plugin == null) {
      return null;
    }
    IWorkbench localIWorkbench = plugin.getWorkbench();
    if (localIWorkbench == null) {
      return null;
    }
    return localIWorkbench.getActiveWorkbenchWindow();
  }
  
  public static IWorkbenchPage getActivePage()
  {
    IWorkbenchWindow localIWorkbenchWindow = getActiveWorkbenchWindow();
    if (localIWorkbenchWindow == null) {
      return null;
    }
    return localIWorkbenchWindow.getActivePage();
  }
  
  private static ImageDescriptor createImageDescriptor(Bundle paramBundle, IPath paramIPath)
  {
    URL localURL = FileLocator.find(paramBundle, paramIPath, null);
    return ImageDescriptor.createFromURL(localURL);
  }
  
  public static void log(Throwable paramThrowable)
  {
    log(new Status(4, "org.tizen.tizenunittest.gtest", 4, "Error", paramThrowable));
  }
  
  public static void log(IStatus paramIStatus)
  {
    getDefault().getLog().log(paramIStatus);
  }
  
  public static CuteModel getModel()
  {
    return getDefaultmodel;
  }
  
  public static Display getDisplay()
  {
    return getDefaultdisplay;
  }
}

/* Location:
 * Qualified Name:     org.tizen.tizenunittest.gtest.UnitTestPlugin
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.tizenunittest.gtest.builder;

import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceProxy;
import org.eclipse.core.resources.IResourceProxyVisitor;
import org.eclipse.core.runtime.CoreException;

public class ProjectResource$TargetResourceProxyVisitor
  implements IResourceProxyVisitor
{
  private final IConfiguration config;
  
  public ProjectResource$TargetResourceProxyVisitor(ProjectResource paramProjectResource, IManagedBuildInfo paramIManagedBuildInfo)
  {
    config = paramIManagedBuildInfo.getDefaultConfiguration();
  }
  
  public ProjectResource$TargetResourceProxyVisitor(ProjectResource paramProjectResource, IConfiguration paramIConfiguration)
  {
    config = paramIConfiguration;
  }
  
  public boolean visit(IResourceProxy paramIResourceProxy)
    throws CoreException
  {
    IResource localIResource = paramIResourceProxy.requestResource();
    boolean bool = this$0.isTargetSource(localIResource.getProjectRelativePath());
    if (paramIResourceProxy.getType() == 1)
    {
      IResourceInfo localIResourceInfo = config.getResourceInfo(localIResource.getProjectRelativePath(), false);
      if (bool)
      {
        int i = 0;
        if ((localIResourceInfo instanceof IFolderInfo))
        {
          String str = localIResource.getFileExtension();
          if ((((IFolderInfo)localIResourceInfo).buildsFileType(str)) && (!this$0.isTargetGeneratedResource(localIResource))) {
            i = 1;
          }
        }
        else
        {
          i = 1;
        }
        if (i != 0) {
          this$0.targetAppendBuildResource(localIResource);
        }
      }
      return false;
    }
    if (paramIResourceProxy.getType() == 2) {
      return (bool) && (!this$0.isGeneratedResource(localIResource));
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     org.tizen.tizenunittest.gtest.builder.ProjectResource.TargetResourceProxyVisitor
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.tizenunittest.gtest.builder;

import java.util.ArrayList;
import org.eclipse.cdt.core.settings.model.ICSourceEntry;
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceProxy;
import org.eclipse.core.resources.IResourceProxyVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;

public class ProjectResource
{
  private ICSourceEntry[] targetSrcEntries;
  private ArrayList<IResource> targetBuildResources;
  IProject project;
  
  public ProjectResource(IProject paramIProject)
  {
    project = paramIProject;
    IManagedBuildInfo localIManagedBuildInfo = ManagedBuildManager.getBuildInfo(paramIProject);
    IConfiguration localIConfiguration = localIManagedBuildInfo.getDefaultConfiguration();
    targetSrcEntries = localIConfiguration.getSourceEntries();
  }
  
  protected boolean isTargetSource(IPath paramIPath)
  {
    return !CDataUtil.isExcluded(paramIPath, targetSrcEntries);
  }
  
  protected void targetAppendBuildResource(IResource paramIResource)
  {
    if (targetBuildResources == null) {
      targetBuildResources = new ArrayList();
    }
    targetBuildResources.add(paramIResource);
  }
  
  public boolean isGeneratedResource(IResource paramIResource)
  {
    IPath localIPath = paramIResource.getProjectRelativePath();
    String[] arrayOfString1 = ManagedBuildManager.getBuildInfo(project).getConfigurationNames();
    String[] arrayOfString2;
    int j = (arrayOfString2 = arrayOfString1).length;
    for (int i = 0; i < j; i++)
    {
      String str = arrayOfString2[i];
      Path localPath = new Path(str);
      if (localPath.isPrefixOf(localIPath)) {
        return true;
      }
    }
    return false;
  }
  
  public boolean isTargetGeneratedResource(IResource paramIResource)
  {
    IPath localIPath = paramIResource.getProjectRelativePath();
    String[] arrayOfString1 = ManagedBuildManager.getBuildInfo(project).getConfigurationNames();
    String[] arrayOfString2;
    int j = (arrayOfString2 = arrayOfString1).length;
    for (int i = 0; i < j; i++)
    {
      String str = arrayOfString2[i];
      Path localPath = new Path(str);
      if (localPath.isPrefixOf(localIPath)) {
        return true;
      }
    }
    return false;
  }
  
  public ArrayList<IResource> getTargetBuildResources()
  {
    IManagedBuildInfo localIManagedBuildInfo = ManagedBuildManager.getBuildInfo(project);
    IConfiguration localIConfiguration = localIManagedBuildInfo.getDefaultConfiguration();
    TargetResourceProxyVisitor localTargetResourceProxyVisitor = new TargetResourceProxyVisitor(localIConfiguration);
    try
    {
      project.accept(localTargetResourceProxyVisitor, 0);
    }
    catch (CoreException localCoreException)
    {
      localCoreException.printStackTrace();
    }
    return targetBuildResources;
  }
  
  protected class TargetResourceProxyVisitor
    implements IResourceProxyVisitor
  {
    private final IConfiguration config;
    
    public TargetResourceProxyVisitor(IManagedBuildInfo paramIManagedBuildInfo)
    {
      config = paramIManagedBuildInfo.getDefaultConfiguration();
    }
    
    public TargetResourceProxyVisitor(IConfiguration paramIConfiguration)
    {
      config = paramIConfiguration;
    }
    
    public boolean visit(IResourceProxy paramIResourceProxy)
      throws CoreException
    {
      IResource localIResource = paramIResourceProxy.requestResource();
      boolean bool = isTargetSource(localIResource.getProjectRelativePath());
      if (paramIResourceProxy.getType() == 1)
      {
        IResourceInfo localIResourceInfo = config.getResourceInfo(localIResource.getProjectRelativePath(), false);
        if (bool)
        {
          int i = 0;
          if ((localIResourceInfo instanceof IFolderInfo))
          {
            String str = localIResource.getFileExtension();
            if ((((IFolderInfo)localIResourceInfo).buildsFileType(str)) && (!isTargetGeneratedResource(localIResource))) {
              i = 1;
            }
          }
          else
          {
            i = 1;
          }
          if (i != 0) {
            targetAppendBuildResource(localIResource);
          }
        }
        return false;
      }
      if (paramIResourceProxy.getType() == 2) {
        return (bool) && (!isGeneratedResource(localIResource));
      }
      return true;
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.tizenunittest.gtest.builder.ProjectResource
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.tizenunittest.gtest.builder;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.eclipse.cdt.make.core.MakeProjectNature;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;

public class UnitTestNature
  extends MakeProjectNature
{
  public static final String NATURE_ID = "org.tizen.tizentest.nature";
  private IProject fproject;
  
  public static void addNatureToProject(IProject paramIProject, IProgressMonitor paramIProgressMonitor)
    throws CoreException
  {
    addNature(paramIProject, "org.tizen.tizentest.nature", paramIProgressMonitor);
  }
  
  public static void removeNatureFromProject(IProject paramIProject, IProgressMonitor paramIProgressMonitor)
    throws CoreException
  {
    removeNature(paramIProject, "org.tizen.tizentest.nature", paramIProgressMonitor);
  }
  
  public static void addNature(IProject paramIProject, String paramString, IProgressMonitor paramIProgressMonitor)
    throws CoreException
  {
    IProjectDescription localIProjectDescription = paramIProject.getDescription();
    String[] arrayOfString = localIProjectDescription.getNatureIds();
    ArrayList localArrayList = new ArrayList(Arrays.asList(arrayOfString));
    if (localArrayList.contains(paramString)) {
      return;
    }
    localArrayList.add(paramString);
    localIProjectDescription.setNatureIds((String[])localArrayList.toArray(new String[localArrayList.size()]));
    paramIProject.setDescription(localIProjectDescription, paramIProgressMonitor);
  }
  
  public static void removeNature(IProject paramIProject, String paramString, IProgressMonitor paramIProgressMonitor)
    throws CoreException
  {
    IProjectDescription localIProjectDescription = paramIProject.getDescription();
    String[] arrayOfString = localIProjectDescription.getNatureIds();
    ArrayList localArrayList = new ArrayList(Arrays.asList(arrayOfString));
    if (!localArrayList.contains(paramString)) {
      return;
    }
    localArrayList.remove(paramString);
    localIProjectDescription.setNatureIds((String[])localArrayList.toArray(new String[localArrayList.size()]));
    paramIProject.setDescription(localIProjectDescription, paramIProgressMonitor);
  }
  
  public void configure()
    throws CoreException
  {}
  
  public void setProject(IProject paramIProject)
  {
    fproject = paramIProject;
  }
  
  public IProject getProject()
  {
    return fproject;
  }
}

/* Location:
 * Qualified Name:     org.tizen.tizenunittest.gtest.builder.UnitTestNature
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.tizenunittest.gtest.common;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IFunctionDeclaration;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.core.settings.model.CSourceEntry;
import org.eclipse.cdt.core.settings.model.ICSourceEntry;
import org.eclipse.cdt.managedbuilder.core.IBuilder;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.tizen.nativecommon.build.CommonConfigurationManager;
import org.xml.sax.SAXException;

public class UnitTestCommon
{
  public static void changeBuilder(IProject paramIProject)
  {
    IManagedBuildInfo localIManagedBuildInfo = ManagedBuildManager.getBuildInfo(paramIProject);
    IConfiguration[] arrayOfIConfiguration1 = localIManagedBuildInfo.getDefaultConfiguration().getManagedProject().getConfigurations();
    IBuilder[] arrayOfIBuilder1 = ManagedBuildManager.getRealBuilders();
    IConfiguration[] arrayOfIConfiguration2;
    int j = (arrayOfIConfiguration2 = arrayOfIConfiguration1).length;
    for (int i = 0; i < j; i++)
    {
      IConfiguration localIConfiguration = arrayOfIConfiguration2[i];
      IBuilder[] arrayOfIBuilder2;
      int m = (arrayOfIBuilder2 = arrayOfIBuilder1).length;
      for (int k = 0; k < m; k++)
      {
        IBuilder localIBuilder = arrayOfIBuilder2[k];
        if ((localIBuilder != null) && (localIBuilder.getName().equals("Tizen TEST MAKE builder")))
        {
          localIConfiguration.changeBuilder(localIBuilder, ManagedBuildManager.calculateChildId(localIBuilder.getBaseId(), null), localIBuilder.getName());
          return;
        }
      }
    }
  }
  
  public static boolean equalsTargetBuildName(IProject paramIProject1, IProject paramIProject2)
  {
    String str1 = projectBuildName(paramIProject1);
    String str2 = projectBuildName(paramIProject2);
    return str1.equals(str2);
  }
  
  public static boolean equalsArch(IProject paramIProject1, IProject paramIProject2)
  {
    IManagedBuildInfo localIManagedBuildInfo1 = ManagedBuildManager.getBuildInfo(paramIProject1);
    IConfiguration localIConfiguration1 = localIManagedBuildInfo1.getDefaultConfiguration();
    String str1 = CommonConfigurationManager.getArchitecture(localIConfiguration1);
    IManagedBuildInfo localIManagedBuildInfo2 = ManagedBuildManager.getBuildInfo(paramIProject2);
    IConfiguration localIConfiguration2 = localIManagedBuildInfo2.getDefaultConfiguration();
    String str2 = CommonConfigurationManager.getArchitecture(localIConfiguration2);
    return str1.equals(str2);
  }
  
  public static String projectBuildName(IProject paramIProject)
  {
    IManagedBuildInfo localIManagedBuildInfo = ManagedBuildManager.getBuildInfo(paramIProject);
    return localIManagedBuildInfo.getConfigurationName();
  }
  
  public static String projectConfigId(IProject paramIProject)
  {
    IManagedBuildInfo localIManagedBuildInfo = ManagedBuildManager.getBuildInfo(paramIProject);
    IConfiguration localIConfiguration = localIManagedBuildInfo.getDefaultConfiguration();
    return localIConfiguration.getParent().getId();
  }
  
  public void setSourceEntry(IProject paramIProject1, IProject paramIProject2)
    throws CoreException
  {
    String str = paramIProject2.getName() + "'s include";
    IManagedBuildInfo localIManagedBuildInfo = ManagedBuildManager.getBuildInfo(paramIProject1);
    IConfiguration localIConfiguration1 = localIManagedBuildInfo.getDefaultConfiguration();
    IPath localIPath = paramIProject2.getFolder("include").getLocation();
    if ((localIPath == null) || (localIPath.isEmpty())) {
      return;
    }
    IFolder localIFolder = paramIProject1.getFolder(str);
    if (localIFolder.exists()) {
      localIFolder.delete(true, null);
    }
    localIFolder.createLink(localIPath, 0, null);
    CSourceEntry localCSourceEntry = new CSourceEntry(str, null, 0);
    IConfiguration[] arrayOfIConfiguration;
    int j = (arrayOfIConfiguration = localIConfiguration1.getManagedProject().getConfigurations()).length;
    for (int i = 0; i < j; i++)
    {
      IConfiguration localIConfiguration2 = arrayOfIConfiguration[i];
      ICSourceEntry[] arrayOfICSourceEntry = localIConfiguration2.getSourceEntries();
      HashSet localHashSet = new HashSet();
      for (int k = 0; k < arrayOfICSourceEntry.length; k++) {
        localHashSet.add(arrayOfICSourceEntry[k]);
      }
      if (!localHashSet.contains(localCSourceEntry))
      {
        localHashSet.add(localCSourceEntry);
        localIConfiguration2.setSourceEntries((ICSourceEntry[])localHashSet.toArray(new ICSourceEntry[localHashSet.size()]));
      }
    }
    ManagedBuildManager.saveBuildInfo(paramIProject1, true);
  }
  
  public ArrayList<IFile> divideCFile(List<?> paramList, IProject paramIProject1, IProject paramIProject2, IProgressMonitor paramIProgressMonitor)
    throws CoreException, IOException, ParserConfigurationException, SAXException
  {
    ArrayList localArrayList = new ArrayList();
    Iterator localIterator = paramList.iterator();
    int i = 0;
    while (localIterator.hasNext())
    {
      IFile localIFile = (IFile)localIterator.next();
      ITranslationUnit localITranslationUnit = (ITranslationUnit)CoreModel.getDefault().create(localIFile);
      if (localITranslationUnit != null)
      {
        ICElement[] arrayOfICElement;
        int k = (arrayOfICElement = localITranslationUnit.getChildren()).length;
        for (int j = 0; j < k; j++)
        {
          ICElement localICElement = arrayOfICElement[j];
          if (localICElement.getElementType() == 74)
          {
            IFunctionDeclaration localIFunctionDeclaration = (IFunctionDeclaration)localICElement;
            if (localIFunctionDeclaration.getElementName().equals("OspMain"))
            {
              if (localIFunctionDeclaration.isActive())
              {
                i = 1;
                break;
              }
              i = 0;
            }
          }
        }
        if (i != 0)
        {
          replaceTargetMain(paramIProject1, localIFile);
          i = 0;
        }
        else
        {
          localArrayList.add(localIFile);
        }
      }
    }
    return localArrayList;
  }
  
  protected String getTargetMainFile(IProject paramIProject)
    throws ParserConfigurationException, SAXException, IOException
  {
    return new UnitTestXml(paramIProject).getTargetMainFile();
  }
  
  protected void setTargetMainName(IProject paramIProject, String paramString)
    throws ParserConfigurationException, SAXException, IOException, TransformerException
  {
    new UnitTestXml(paramIProject).setTargetMainName(paramString);
  }
  
  public static String makePropertyOption(String paramString)
  {
    paramString = paramString.replaceAll("\\\\", "/");
    return String.format("\"%s\"", new Object[] { paramString });
  }
  
  /* Error */
  private String replaceTargetMain(IProject paramIProject, IFile paramIFile)
    throws CoreException, IOException, ParserConfigurationException, SAXException
  {
    // Byte code:
    //   0: ldc_w 285
    //   3: astore 4
    //   5: aload_2
    //   6: invokeinterface 287 1 0
    //   11: astore 6
    //   13: new 99	java/lang/StringBuilder
    //   16: dup
    //   17: ldc_w 288
    //   20: invokespecial 106	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   23: aload 6
    //   25: invokevirtual 111	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   28: invokevirtual 115	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   31: astore 7
    //   33: new 290	java/io/FileInputStream
    //   36: dup
    //   37: aload_2
    //   38: invokeinterface 292 1 0
    //   43: invokeinterface 293 1 0
    //   48: invokespecial 294	java/io/FileInputStream:<init>	(Ljava/lang/String;)V
    //   51: astore 8
    //   53: aconst_null
    //   54: astore 9
    //   56: aload_0
    //   57: aload_1
    //   58: invokevirtual 295	org/tizen/tizenunittest/gtest/common/UnitTestCommon:getTargetMainFile	(Lorg/eclipse/core/resources/IProject;)Ljava/lang/String;
    //   61: astore 9
    //   63: aconst_null
    //   64: astore 10
    //   66: aload 9
    //   68: ifnull +48 -> 116
    //   71: aload_1
    //   72: new 99	java/lang/StringBuilder
    //   75: dup
    //   76: ldc_w 288
    //   79: invokespecial 106	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   82: aload 9
    //   84: invokevirtual 111	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   87: invokevirtual 115	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   90: invokeinterface 297 2 0
    //   95: astore 10
    //   97: aload 10
    //   99: invokeinterface 301 1 0
    //   104: ifeq +12 -> 116
    //   107: aload 10
    //   109: iconst_1
    //   110: aconst_null
    //   111: invokeinterface 302 3 0
    //   116: aload_1
    //   117: aload 7
    //   119: invokeinterface 297 2 0
    //   124: astore 10
    //   126: aload 10
    //   128: invokeinterface 301 1 0
    //   133: ifeq +12 -> 145
    //   136: aload 10
    //   138: iconst_1
    //   139: aconst_null
    //   140: invokeinterface 302 3 0
    //   145: aload 10
    //   147: aload 8
    //   149: iconst_1
    //   150: aconst_null
    //   151: invokeinterface 303 4 0
    //   156: aconst_null
    //   157: astore 11
    //   159: new 306	java/io/File
    //   162: dup
    //   163: aload_1
    //   164: aload 7
    //   166: invokeinterface 297 2 0
    //   171: invokeinterface 292 1 0
    //   176: invokeinterface 293 1 0
    //   181: invokespecial 308	java/io/File:<init>	(Ljava/lang/String;)V
    //   184: astore 12
    //   186: new 309	java/io/RandomAccessFile
    //   189: dup
    //   190: aload 12
    //   192: ldc_w 311
    //   195: invokespecial 313	java/io/RandomAccessFile:<init>	(Ljava/io/File;Ljava/lang/String;)V
    //   198: astore 11
    //   200: aload 11
    //   202: invokevirtual 316	java/io/RandomAccessFile:length	()J
    //   205: l2i
    //   206: newarray <illegal type>
    //   208: astore_3
    //   209: aload 11
    //   211: aload_3
    //   212: invokevirtual 320	java/io/RandomAccessFile:readFully	([B)V
    //   215: aload 11
    //   217: lconst_0
    //   218: invokevirtual 324	java/io/RandomAccessFile:seek	(J)V
    //   221: new 49	java/lang/String
    //   224: dup
    //   225: aload_3
    //   226: invokespecial 328	java/lang/String:<init>	([B)V
    //   229: astore 5
    //   231: aload 11
    //   233: aload 4
    //   235: invokevirtual 330	java/lang/String:getBytes	()[B
    //   238: invokevirtual 334	java/io/RandomAccessFile:write	([B)V
    //   241: aload 11
    //   243: aload 5
    //   245: invokevirtual 330	java/lang/String:getBytes	()[B
    //   248: invokevirtual 334	java/io/RandomAccessFile:write	([B)V
    //   251: goto +13 -> 264
    //   254: astore 13
    //   256: aload 11
    //   258: invokestatic 337	org/tizen/sdblib/util/IOUtil:tryClose	(Ljava/io/Closeable;)V
    //   261: aload 13
    //   263: athrow
    //   264: aload 11
    //   266: invokestatic 337	org/tizen/sdblib/util/IOUtil:tryClose	(Ljava/io/Closeable;)V
    //   269: aload_0
    //   270: aload_1
    //   271: aload_2
    //   272: invokeinterface 287 1 0
    //   277: invokevirtual 343	org/tizen/tizenunittest/gtest/common/UnitTestCommon:setTargetMainName	(Lorg/eclipse/core/resources/IProject;Ljava/lang/String;)V
    //   280: goto +10 -> 290
    //   283: astore 12
    //   285: aload 12
    //   287: invokestatic 345	org/tizen/common/util/log/Logger:log	(Ljava/lang/Throwable;)V
    //   290: aload_1
    //   291: iconst_2
    //   292: new 351	org/eclipse/core/runtime/NullProgressMonitor
    //   295: dup
    //   296: invokespecial 353	org/eclipse/core/runtime/NullProgressMonitor:<init>	()V
    //   299: invokeinterface 354 3 0
    //   304: aload 7
    //   306: areturn
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	307	0	this	UnitTestCommon
    //   0	307	1	paramIProject	IProject
    //   0	307	2	paramIFile	IFile
    //   208	18	3	arrayOfByte	byte[]
    //   3	231	4	str1	String
    //   229	15	5	str2	String
    //   11	13	6	str3	String
    //   31	274	7	str4	String
    //   51	97	8	localFileInputStream	FileInputStream
    //   54	29	9	str5	String
    //   64	82	10	localIFile	IFile
    //   157	108	11	localRandomAccessFile	RandomAccessFile
    //   184	7	12	localFile	File
    //   283	3	12	localTransformerException	TransformerException
    //   254	8	13	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   159	254	254	finally
    //   269	280	283	javax/xml/transform/TransformerException
  }
  
  public void setStringtoFile(String paramString1, String paramString2, ArrayList<IFile> paramArrayList)
    throws CoreException, IOException
  {
    File localFile = new File(paramString1);
    StringBuilder localStringBuilder = new StringBuilder();
    RandomAccessFile localRandomAccessFile = new RandomAccessFile(lo
1 2 3 4 5 6 7 8 9 10 11 12 13

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd