Package org.jacoco.agent.rt.internal.output

Examples of org.jacoco.agent.rt.internal.output.FileOutput


   */
  IAgentOutput createAgentOutput() {
    final OutputMode controllerType = options.getOutput();
    switch (controllerType) {
    case file:
      return new FileOutput();
    case tcpserver:
      return new TcpServerOutput(logger);
    case tcpclient:
      return new TcpClientOutput(logger);
    case none:
View Full Code Here


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

    FileOutput controller = new FileOutput();
    controller.startup(options, new RuntimeData());

    assertTrue("Execution data file should be created", destFile.exists());
    assertEquals("Execution data file should be empty", 0,
        destFile.length());
  }
View Full Code Here

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

    FileOutput controller = new FileOutput();
    controller.startup(options, new RuntimeData());
    controller.writeExecutionData(false);
    controller.shutdown();

    assertTrue("Execution data file should be created", destFile.exists());
    assertTrue("Execution data file should have contents",
        destFile.length() > 0);
  }
View Full Code Here

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

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

TOP

Related Classes of org.jacoco.agent.rt.internal.output.FileOutput

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.