Package com.mountainminds.eclemma.core

Examples of com.mountainminds.eclemma.core.ICoverageSession


  @Test
  public void testRemoveSessionListener1() {
    manager.removeSessionListener(listener);

    ICoverageSession s0 = new DummySession();
    manager.addSession(s0, false, null);
    // No events recorded any more
    assertEquals(reflistener, listener);
  }
View Full Code Here


    assertEquals(reflistener, listener);
  }

  @Test
  public void testMergeSession1() throws Exception {
    ICoverageSession s0 = new DummySession();
    ICoverageSession s1 = new DummySession();
    ICoverageSession s2 = new DummySession();
    manager.addSession(s0, false, null);
    manager.addSession(s1, false, null);
    manager.addSession(s2, false, null);
    listener.clear();

    final ICoverageSession m0 = manager.mergeSessions(Arrays.asList(s0, s1),
        "Merged", new NullProgressMonitor());

    assertEquals("Merged", m0.getDescription());
    assertNull(m0.getLaunchConfiguration());
    assertEquals(Arrays.asList(s2, m0), manager.getSessions());
    assertEquals(m0, manager.getActiveSession());
    reflistener.sessionAdded(m0);
    reflistener.sessionActivated(m0);
    reflistener.sessionRemoved(s0);
View Full Code Here

  }

  @Test
  public void testMergeSession2() throws Exception {
    ILaunchConfiguration launch = new DummyLaunchConfiguration();
    ICoverageSession s0 = new DummySession(launch);
    ICoverageSession s1 = new DummySession(launch);
    manager.addSession(s0, false, null);
    manager.addSession(s1, false, null);
    listener.clear();

    final ICoverageSession m0 = manager.mergeSessions(Arrays.asList(s0, s1),
        "Merged", new NullProgressMonitor());

    assertEquals("Merged", m0.getDescription());
    assertSame(launch, m0.getLaunchConfiguration());
    assertEquals(Arrays.asList(m0), manager.getSessions());
    assertEquals(m0, manager.getActiveSession());
    reflistener.sessionAdded(m0);
    reflistener.sessionActivated(m0);
    reflistener.sessionRemoved(s0);
View Full Code Here

    removeSession(getSession(key));
  }

  public void removeAllSessions() {
    while (!sessions.isEmpty()) {
      ICoverageSession session = (ICoverageSession) sessions.remove(0);
      keymap.values().remove(session);
      fireSessionRemoved(session);
    }
    if (activeSession != null) {
      activeSession = null;
View Full Code Here

   
    return parent;
  }
 
  private String getSessionDescription() {
    ICoverageSession session = CoverageTools.getSessionManager().getActiveSession();
    return session == null ? UIMessages.CoveragePropertyPageNoSession_value : session.getDescription();
  }
View Full Code Here

   
    return parent;
  }
 
  private String getSessionDescription() {
    ICoverageSession session = CoverageTools.getSessionManager().getActiveSession();
    return session == null ? UIMessages.CoveragePropertyPageNoSession_value : session.getDescription();
  }
View Full Code Here

  public void importSession(IProgressMonitor monitor) throws CoreException {
    monitor.beginTask(CoreMessages.ImportingSession_task, 2);
    IInstrumentation[] instr = instrument(new SubProgressMonitor(monitor, 1));
    IPath[] cfiles = new IPath[1];
    cfiles[0] = createCopy(new SubProgressMonitor(monitor, 1));
    ICoverageSession s = CoverageTools.createCoverageSession(description, instr, cfiles, null);
    CoverageTools.getSessionManager().addSession(s, true, null);
    monitor.done();
  }
View Full Code Here

        .setText(UIMessages.ExportReportPage1Sessions_label);
    sessionstable = new TableViewer(parent, SWT.BORDER);
    sessionstable.setLabelProvider(new WorkbenchLabelProvider());
    sessionstable.setContentProvider(new ArrayContentProvider());
    sessionstable.setInput(CoverageTools.getSessionManager().getSessions());
    ICoverageSession active = CoverageTools.getSessionManager()
        .getActiveSession();
    if (active != null) {
      sessionstable.setSelection(new StructuredSelection(active));
    }
    GridData gd = new GridData(GridData.FILL_BOTH);
View Full Code Here

    page1.saveWidgetValues();
    return createReport();
  }

  private boolean createReport() {
    final ICoverageSession session = page1.getSelectedSession();
    final ISessionExporter exporter = CoverageTools.getExporter(session);
    exporter.setFormat(page1.getExportFormat());
    exporter.setDestination(page1.getDestination());
    final IRunnableWithProgress op = new IRunnableWithProgress() {
      public void run(IProgressMonitor monitor)
          throws InvocationTargetException, InterruptedException {
        try {
          exporter.export(monitor);
        } catch (Exception e) {
          throw new InvocationTargetException(e);
        }
      }
    };
    try {
      getContainer().run(true, true, op);
    } catch (InterruptedException e) {
      return false;
    } catch (InvocationTargetException ite) {
      final Throwable ex = ite.getTargetException();
      EclEmmaUIPlugin.log(ex);
      final String title = UIMessages.ExportReportErrorDialog_title;
      String msg = UIMessages.ExportReportErrorDialog_message;
      msg = NLS.bind(msg, session.getDescription());
      final IStatus status;
      if (ex instanceof CoreException) {
        status = ((CoreException) ex).getStatus();
      } else {
        status = EclEmmaUIPlugin.errorStatus(String.valueOf(ex.getMessage()),
View Full Code Here

    removeSession(getSession(key));
  }

  public void removeAllSessions() {
    while (!sessions.isEmpty()) {
      ICoverageSession session = sessions.remove(0);
      keymap.values().remove(session);
      fireSessionRemoved(session);
    }
    if (activeSession != null) {
      activeSession = null;
View Full Code Here

TOP

Related Classes of com.mountainminds.eclemma.core.ICoverageSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.