Search in sources :

Example 11 with AgentOptions

use of org.jacoco.core.runtime.AgentOptions in project jacoco by jacoco.

the class FileOutputTest method testInvalidDestFile.

@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());
}
Also used : RuntimeData(org.jacoco.core.runtime.RuntimeData) FileOutput(org.jacoco.agent.rt.internal.output.FileOutput) AgentOptions(org.jacoco.core.runtime.AgentOptions) Test(org.junit.Test)

Aggregations

AgentOptions (org.jacoco.core.runtime.AgentOptions)11 RuntimeData (org.jacoco.core.runtime.RuntimeData)7 Test (org.junit.Test)5 IOException (java.io.IOException)4 Before (org.junit.Before)4 FileOutput (org.jacoco.agent.rt.internal.output.FileOutput)3 File (java.io.File)2 InstanceNotFoundException (javax.management.InstanceNotFoundException)2 ExceptionRecorder (org.jacoco.agent.rt.internal.ExceptionRecorder)2 IAgentOutput (org.jacoco.agent.rt.internal.output.IAgentOutput)2 ServerSocket (java.net.ServerSocket)1 Socket (java.net.Socket)1 MockSocket (org.jacoco.agent.rt.internal.output.MockSocketConnection.MockSocket)1 IRuntime (org.jacoco.core.runtime.IRuntime)1 RemoteControlReader (org.jacoco.core.runtime.RemoteControlReader)1 RemoteControlWriter (org.jacoco.core.runtime.RemoteControlWriter)1