Skip to content

Commit 7a1b700

Browse files
author
Vihas Splunk
committed
add: add jacoco report
1 parent a2c87d9 commit 7a1b700

File tree

6 files changed

+61
-8
lines changed

6 files changed

+61
-8
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,8 @@ pom.xml.versionsBackup
3535
**/__pycache__/*
3636
test/venv/
3737
venv
38+
39+
!target/site/
40+
target/site/jacoco/*.html
41+
target/site/jacoco/*/*
42+
target/site/*.exec

dependency-reduced-pom.xml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<goal>prepare-agent</goal>
6666
</goals>
6767
<configuration>
68-
<destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
68+
<destFile>${project.build.directory}/site/jacoco-ut.exec</destFile>
6969
<propertyName>surefireArgLine</propertyName>
7070
</configuration>
7171
</execution>
@@ -76,8 +76,8 @@
7676
<goal>report</goal>
7777
</goals>
7878
<configuration>
79-
<dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
80-
<outputDirectory>${project.build.directory}/coverage-reports/jacoco-ut</outputDirectory>
79+
<dataFile>${project.build.directory}/site/jacoco-ut.exec</dataFile>
80+
<outputDirectory>${project.build.directory}/site/jacoco</outputDirectory>
8181
</configuration>
8282
</execution>
8383
</executions>
@@ -87,6 +87,11 @@
8787
</excludes>
8888
</configuration>
8989
</plugin>
90+
<plugin>
91+
<groupId>org.sonarsource.scanner.maven</groupId>
92+
<artifactId>sonar-maven-plugin</artifactId>
93+
<version>3.10.0.2594</version>
94+
</plugin>
9095
<plugin>
9196
<artifactId>maven-surefire-plugin</artifactId>
9297
<version>3.0.0</version>
@@ -206,6 +211,7 @@
206211
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
207212
<junit.version>4.13.2</junit.version>
208213
<junit.vintage.version>5.9.2</junit.vintage.version>
214+
<sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
209215
<java.version>1.8</java.version>
210216
<maven.compiler.source>1.8</maven.compiler.source>
211217
<junit.jupiter.version>5.9.2</junit.jupiter.version>

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<jackson.version>2.14.2</jackson.version>
2222
<kafka.version>3.4.0</kafka.version>
2323
<slf4j.version>2.0.7</slf4j.version>
24-
<sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/coverage-reports/jacoco-ut/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
24+
<sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
2525
</properties>
2626

2727
<dependencies>
@@ -296,7 +296,7 @@
296296
</goals>
297297
<configuration>
298298
<!-- Sets the path to the file which contains the execution data. -->
299-
<destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec
299+
<destFile>${project.build.directory}/site/jacoco-ut.exec
300300
</destFile>
301301
<!--
302302
Sets the name of the property containing the settings
@@ -317,10 +317,10 @@
317317
</goals>
318318
<configuration>
319319
<!-- Sets the path to the file which contains the execution data. -->
320-
<dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec
320+
<dataFile>${project.build.directory}/site/jacoco-ut.exec
321321
</dataFile>
322322
<!-- Sets the output directory for the code coverage report. -->
323-
<outputDirectory>${project.build.directory}/coverage-reports/jacoco-ut
323+
<outputDirectory>${project.build.directory}/site/jacoco
324324
</outputDirectory>
325325
</configuration>
326326
</execution>

src/main/java/com/splunk/hecclient/Indexer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ private String readAndCloseResponse(CloseableHttpResponse resp) {
241241
try {
242242
resp.close();
243243
} catch (IOException ex) {
244-
throw new HecException("failed to close http response", ex);
244+
throw new HecException("failed to close http response", ex); // NOSONAR
245245
}
246246
}
247247

target/site/jacoco/jacoco.csv

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
GROUP,PACKAGE,CLASS,INSTRUCTION_MISSED,INSTRUCTION_COVERED,BRANCH_MISSED,BRANCH_COVERED,LINE_MISSED,LINE_COVERED,COMPLEXITY_MISSED,COMPLEXITY_COVERED,METHOD_MISSED,METHOD_COVERED
2+
splunk-kafka-connect,com.splunk.hecclient,HttpClientBuilder.new Credentials() {...},10,0,0,0,3,0,3,0,3,0
3+
splunk-kafka-connect,com.splunk.hecclient,EventBatch.HttpEventBatchEntity,0,40,0,2,0,9,0,7,0,6
4+
splunk-kafka-connect,com.splunk.hecclient,HttpClientBuilder.new HostnameVerifier() {...},2,6,0,0,1,1,1,1,1,1
5+
splunk-kafka-connect,com.splunk.hecclient,HttpClientBuilder.new TrustStrategy() {...},2,6,0,0,1,1,1,1,1,1
6+
splunk-kafka-connect,com.splunk.hecclient,Hec,38,298,4,14,10,74,4,20,0,15
7+
splunk-kafka-connect,com.splunk.hecclient,ConcurrentHec,23,196,1,13,6,50,1,16,0,10
8+
splunk-kafka-connect,com.splunk.hecclient,HecException,0,9,0,0,0,4,0,2,0,2
9+
splunk-kafka-connect,com.splunk.hecclient,LoadBalancer,48,362,8,24,12,87,7,23,1,13
10+
splunk-kafka-connect,com.splunk.hecclient,HecAckPoller,122,711,11,45,34,160,9,44,0,25
11+
splunk-kafka-connect,com.splunk.hecclient,HecAckPoller.RunAckQuery,21,26,0,0,3,8,0,2,0,2
12+
splunk-kafka-connect,com.splunk.hecclient,HttpClientBuilder,69,132,0,4,16,46,2,13,2,11
13+
splunk-kafka-connect,com.splunk.hecclient,RawEvent,11,63,0,8,3,17,0,8,0,4
14+
splunk-kafka-connect,com.splunk.hecclient,RawEventBatch,22,169,1,9,8,45,3,17,2,13
15+
splunk-kafka-connect,com.splunk.hecclient,JsonEvent,22,60,0,8,6,21,0,11,0,7
16+
splunk-kafka-connect,com.splunk.hecclient,HecEmptyEventException,5,4,0,0,2,2,1,1,1,1
17+
splunk-kafka-connect,com.splunk.hecclient,HecChannel,0,116,0,12,0,35,0,22,0,16
18+
splunk-kafka-connect,com.splunk.hecclient,EventBatch,0,236,0,12,0,60,0,28,0,22
19+
splunk-kafka-connect,com.splunk.hecclient,HecNullEventException,5,4,0,0,2,2,1,1,1,1
20+
splunk-kafka-connect,com.splunk.hecclient,Event,3,204,0,6,1,67,1,29,1,26
21+
splunk-kafka-connect,com.splunk.hecclient,RawEventBatch.Builder,0,45,0,0,0,13,0,7,0,7
22+
splunk-kafka-connect,com.splunk.hecclient,Indexer,179,417,9,19,40,95,10,23,3,16
23+
splunk-kafka-connect,com.splunk.hecclient,EventBatch.GzipDataContentProducer,0,21,0,0,0,6,0,2,0,2
24+
splunk-kafka-connect,com.splunk.hecclient,HecAckPollResponse,0,43,0,4,0,9,0,5,0,3
25+
splunk-kafka-connect,com.splunk.hecclient,HecConfig,5,219,1,1,1,78,2,41,1,41
26+
splunk-kafka-connect,com.splunk.hecclient,Indexer.new Configuration() {...},21,0,0,0,4,0,2,0,2,0
27+
splunk-kafka-connect,com.splunk.hecclient,DoubleSerializer,0,15,0,0,0,4,0,2,0,2
28+
splunk-kafka-connect,com.splunk.hecclient,PostResponse,0,37,0,2,0,13,0,8,0,7
29+
splunk-kafka-connect,com.splunk.hecclient,ResponsePoller,33,79,1,7,7,23,3,11,2,8
30+
splunk-kafka-connect,com.splunk.hecclient,JsonEventBatch,19,33,2,2,7,9,3,6,2,5
31+
splunk-kafka-connect,com.splunk.hecclient,EventBatch.HttpEventBatchEntity.new Enumeration() {...},0,44,0,4,0,4,0,5,0,3
32+
splunk-kafka-connect,com.splunk.kafka.connect,HecClientWrapper,3,3,0,0,1,1,1,1,1,1
33+
splunk-kafka-connect,com.splunk.kafka.connect,KafkaRecordTracker,22,315,4,22,6,69,4,26,0,17
34+
splunk-kafka-connect,com.splunk.kafka.connect,JacksonStructModule.StructSerializer,0,36,0,2,0,7,0,3,0,2
35+
splunk-kafka-connect,com.splunk.kafka.connect,VersionUtils,11,86,0,10,4,26,1,11,1,6
36+
splunk-kafka-connect,com.splunk.kafka.connect,JacksonStructModule,0,10,0,0,0,3,0,1,0,1
37+
splunk-kafka-connect,com.splunk.kafka.connect,SplunkSinkRecord,74,188,14,14,22,47,18,9,5,8
38+
splunk-kafka-connect,com.splunk.kafka.connect,SplunkSinkConnectorConfig,5,1255,6,72,1,195,6,47,0,14
39+
splunk-kafka-connect,com.splunk.kafka.connect,SplunkSinkConnector,57,338,3,25,11,79,4,26,1,15
40+
splunk-kafka-connect,com.splunk.kafka.connect,AbstractClientWrapper,0,3,0,0,0,1,0,1,0,1
41+
splunk-kafka-connect,com.splunk.kafka.connect,SplunkSinkTask,670,858,66,60,135,194,49,47,8,25

target/site/jacoco/jacoco.xml

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)