org.eclipse.mylyn.context.sdk.util_3.7.1.v20120425-0100

16:46:37.602 INFO  jd.cli.Main - Decompiling org.eclipse.mylyn.context.sdk.util_3.7.1.v20120425-0100.jar
package org.eclipse.mylyn.context.sdk.util;

import junit.framework.TestCase;
import org.eclipse.mylyn.context.core.ContextCore;
import org.eclipse.mylyn.context.core.IInteractionContext;
import org.eclipse.mylyn.context.core.IInteractionContextManager;
import org.eclipse.mylyn.internal.context.core.InteractionContextManager;
import org.eclipse.mylyn.monitor.core.InteractionEvent;
import org.eclipse.mylyn.monitor.core.InteractionEvent.Kind;

public abstract class AbstractContextTest
  extends TestCase
{
  protected static final String MOCK_HANDLE = "<mock-handle>";
  private static final String MOCK_PROVIDER = "<mock-provider>";
  protected static final String MOCK_ORIGIN = "<mock-origin>";
  protected static final String MOCK_KIND = "java";
  
  protected void setUp()
    throws Exception
  {
    super.setUp();
    if (ContextCore.getContextManager() != null) {
      assertFalse(
      
        "Unexpected context active: " + ((InteractionContextManager)ContextCore.getContextManager()).getActiveContexts(), 
        ContextCore.getContextManager().isContextActive());
    }
  }
  
  protected void tearDown()
    throws Exception
  {
    super.tearDown();
    if (ContextCore.getContextManager() != null) {
      assertFalse(((InteractionContextManager)ContextCore.getContextManager()).getActiveContexts(), 
        ContextCore.getContextManager().isContextActive());
    }
  }
  
  protected InteractionEvent mockSelection(String handle)
  {
    return new InteractionEvent(InteractionEvent.Kind.SELECTION, "java", handle, "<mock-origin>");
  }
  
  protected InteractionEvent mockPropagation(String handle)
  {
    return new InteractionEvent(InteractionEvent.Kind.PROPAGATION, "java", handle, "<mock-origin>");
  }
  
  protected InteractionEvent mockSelection()
  {
    return mockSelection("<mock-handle>");
  }
  
  protected InteractionEvent mockNavigation(String toHandle)
  {
    return new InteractionEvent(InteractionEvent.Kind.SELECTION, "java", toHandle, "<mock-origin>", "<mock-provider>");
  }
  
  protected InteractionEvent mockInterestContribution(String handle, String kind, float value)
  {
    InteractionEvent event = new InteractionEvent(InteractionEvent.Kind.MANIPULATION, kind, handle, "<mock-origin>", 
      value);
    return event;
  }
  
  protected InteractionEvent mockInterestContribution(String handle, float value)
  {
    return mockInterestContribution(handle, "java", value);
  }
  
  protected InteractionEvent mockPreferenceChange(String handle)
  {
    return new InteractionEvent(InteractionEvent.Kind.PREFERENCE, "java", handle, "<mock-origin>");
  }
  
  protected boolean compareTaskscapeEquality(IInteractionContext t1, IInteractionContext t2)
  {
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.sdk.util.AbstractContextTest
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.sdk.util;

import org.eclipse.mylyn.context.core.ContextCore;
import org.eclipse.mylyn.context.core.IInteractionContextManager;
import org.eclipse.mylyn.internal.context.ui.ContextUiPlugin;
import org.eclipse.mylyn.internal.monitor.ui.MonitorUiPlugin;
import org.eclipse.swt.widgets.Display;

public class ContextTestUtil
{
  private static boolean contextUiLazyStarted;
  
  public static void triggerContextUiLazyStart()
  {
    if (contextUiLazyStarted) {
      return;
    }
    contextUiLazyStarted = true;
    
    MonitorUiPlugin.getDefault();
    while (Display.getDefault().readAndDispatch()) {}
    ContextUiPlugin.getDefault();
    
    ContextCore.getContextManager().activateContext("startup");
    ContextCore.getContextManager().deactivateContext("startup");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.sdk.util.ContextTestUtil
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.sdk.util.search;

import java.io.IOException;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.mylyn.context.core.IInteractionElement;

public abstract interface ISearchPluginTest
{
  public abstract List<?> search(int paramInt, IInteractionElement paramIInteractionElement)
    throws IOException, CoreException;
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.sdk.util.search.ISearchPluginTest
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.sdk.util.search;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.mylyn.internal.context.core.AbstractRelationProvider;
import org.eclipse.mylyn.internal.context.core.IActiveSearchListener;

public class TestActiveSearchListener
  implements IActiveSearchListener
{
  private AbstractRelationProvider prov = null;
  private List<?> results = null;
  
  public TestActiveSearchListener(AbstractRelationProvider prov)
  {
    this.prov = prov;
  }
  
  private boolean gathered = false;
  
  public void searchCompleted(List<?> l)
  {
    List<Object> accepted = new ArrayList(l.size());
    if (prov != null)
    {
      for (Object o : l) {
        if (prov.acceptResultElement(o)) {
          accepted.add(o);
        }
      }
      results = accepted;
    }
    else
    {
      results = l;
    }
    gathered = true;
  }
  
  public boolean resultsGathered()
  {
    return gathered;
  }
  
  public List<?> getResults()
  {
    return results;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.sdk.util.search.TestActiveSearchListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.sdk.util;

import java.io.File;
import java.util.List;
import org.eclipse.mylyn.commons.sdk.util.ResourceTestUtil;
import org.eclipse.mylyn.commons.sdk.util.TestProject;
import org.eclipse.mylyn.commons.sdk.util.UiTestUtil;
import org.eclipse.mylyn.internal.context.core.ContextCorePlugin;
import org.eclipse.mylyn.internal.context.core.InteractionContext;
import org.eclipse.mylyn.internal.context.core.InteractionContextManager;
import org.eclipse.mylyn.internal.context.core.InteractionContextScaling;
import org.eclipse.mylyn.internal.context.core.LocalContextStore;
import org.eclipse.mylyn.internal.context.ui.ContextUiPlugin;
import org.eclipse.mylyn.internal.context.ui.FocusedViewerManager;
import org.eclipse.mylyn.internal.ide.ui.IdeUiBridgePlugin;
import org.eclipse.mylyn.internal.resources.ui.ResourceInteractionMonitor;
import org.eclipse.mylyn.internal.resources.ui.ResourceStructureBridge;
import org.eclipse.ui.views.navigator.ResourceNavigator;

public abstract class AbstractResourceContextTest
  extends AbstractContextTest
{
  protected InteractionContextManager manager = ContextCorePlugin.getContextManager();
  protected ResourceInteractionMonitor monitor = new ResourceInteractionMonitor();
  protected ResourceStructureBridge structureBridge = new ResourceStructureBridge();
  protected TestProject project;
  protected InteractionContext context;
  protected InteractionContextScaling scaling = new InteractionContextScaling();
  protected String taskId = getClass().getName();
  protected ResourceNavigator navigator;
  
  protected void setUp()
    throws Exception
  {
    super.setUp();
    assertNotNull(IdeUiBridgePlugin.getDefault());
    project = new TestProject(getClass().getName());
    context = new InteractionContext(taskId, scaling);
    context.reset();
    manager.internalActivateContext(context);
    ContextUiPlugin.getViewerManager().setSyncRefreshMode(true);
    navigator = ((ResourceNavigator)UiTestUtil.openView("org.eclipse.ui.views.ResourceNavigator"));
    assertNotNull(navigator);
  }
  
  protected void tearDown()
    throws Exception
  {
    context.reset();
    assertTrue(context.getInteresting().isEmpty());
    manager.deactivateContext(taskId);
    manager.deleteContext(taskId);
    ContextCorePlugin.getContextStore().getFileForContext(taskId).delete();
    ResourceTestUtil.deleteProject(project.getProject());
    super.tearDown();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.sdk.util.AbstractResourceContextTest
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
1

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