Examples of AgentOptions


Examples of org.jacoco.core.runtime.AgentOptions

   *
   * @param agentArgs
   *            agent options as text string
   */
  public JacocoAgent(String options) {
    this(new AgentOptions(options));
  }
View Full Code Here

Examples of org.jacoco.core.runtime.AgentOptions

  /**
   * Create default agent options
   */
  protected AbstractCoverageTask() {
    super();
    agentOptions = new AgentOptions();
    enabled = true;
  }
View Full Code Here

Examples of org.jacoco.core.runtime.AgentOptions

  @Before
  public void setup() throws Exception {
    runtime = new StubRuntime();
    controller = new MBeanController();
    controller.startup(new AgentOptions(), runtime);
  }
View Full Code Here

Examples of org.jacoco.core.runtime.AgentOptions

          throws IOException {
        return con.getSocketA();
      }
    };
    runtime = new StubRuntime();
    controller.startup(new AgentOptions(), runtime);
    remoteReader = new RemoteControlReader(remoteSocket.getInputStream());
  }
View Full Code Here

Examples of org.jacoco.core.runtime.AgentOptions

  public TemporaryFolder folder = new TemporaryFolder();

  @Test
  public void testWriteData() throws Exception {
    File destFile = folder.newFile("jacoco.exec");
    AgentOptions options = new AgentOptions();
    options.setDestfile(destFile.getAbsolutePath());

    IRuntime runtime = new StubRuntime();

    LocalController controller = new LocalController();
    controller.startup(options, runtime);
View Full Code Here

Examples of org.jacoco.core.runtime.AgentOptions

    assertTrue("Execution data file should be created", destFile.exists());
  }

  @Test(expected = IOException.class)
  public void testInvalidDestFile() throws Exception {
    AgentOptions options = new AgentOptions();
    options.setDestfile(folder.newFolder("folder").getAbsolutePath());
    IRuntime runtime = new StubRuntime();
    LocalController controller = new LocalController();

    // Startup should fail as the file can not be created:
    controller.startup(options, runtime);
View Full Code Here

Examples of org.jacoco.core.runtime.AgentOptions

   *
   * @param agentArgs
   *            agent options as text string
   */
  public JacocoAgent(String options) {
    this(new AgentOptions(options));
  }
View Full Code Here

Examples of org.jacoco.core.runtime.AgentOptions

  /**
   * Create default agent options
   */
  protected AbstractCoverageTask() {
    agentOptions = new AgentOptions();
    enabled = true;
  }
View Full Code Here

Examples of org.jacoco.core.runtime.AgentOptions

import org.junit.Test;

public class JacocoAgentTest {
  @Test
  public void shouldCreateController() {
    AgentOptions options = new AgentOptions();

    options.setOutput(OutputMode.file);
    JacocoAgent agent = new JacocoAgent(options, null);
    assertTrue(agent.createAgentController() instanceof LocalController);

    options.setOutput(OutputMode.tcpserver);
    assertTrue(agent.createAgentController() instanceof TcpServerController);

    options.setOutput(OutputMode.tcpclient);
    assertTrue(agent.createAgentController() instanceof TcpClientController);

    options.setOutput(OutputMode.mbean);
    assertTrue(agent.createAgentController() instanceof MBeanController);
  }
View Full Code Here

Examples of org.jacoco.core.runtime.AgentOptions

        .get(AGENT_ARTIFACT_NAME);
    return jacocoAgentArtifact.getFile();
  }

  private AgentOptions createAgentOptions() {
    final AgentOptions agentOptions = new AgentOptions();
    agentOptions.setDestfile(destFile.getAbsolutePath());
    if (append != null) {
      agentOptions.setAppend(append.booleanValue());
    }
    if (getIncludes() != null && !getIncludes().isEmpty()) {
      final String agentIncludes = StringUtils.join(getIncludes()
          .iterator(), ":");
      agentOptions.setIncludes(agentIncludes);
    }
    if (getExcludes() != null && !getExcludes().isEmpty()) {
      final String agentExcludes = StringUtils.join(getExcludes()
          .iterator(), ":");
      agentOptions.setExcludes(agentExcludes);
    }
    if (exclClassLoaders != null) {
      agentOptions.setExclClassloader(exclClassLoaders);
    }
    if (sessionId != null) {
      agentOptions.setSessionId(sessionId);
    }
    if (dumpOnExit != null) {
      agentOptions.setDumpOnExit(dumpOnExit.booleanValue());
    }
    if (output != null) {
      agentOptions.setOutput(output);
    }
    if (address != null) {
      agentOptions.setAddress(address);
    }
    if (port != null) {
      agentOptions.setPort(port.intValue());
    }
    if (classDumpDir != null) {
      agentOptions.setClassDumpDir(classDumpDir.getAbsolutePath());
    }
    return agentOptions;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.