Skip to content

Commit

Permalink
Testing HTML Report
Browse files Browse the repository at this point in the history
  • Loading branch information
kjindani committed Aug 25, 2023
1 parent 4d52791 commit e5e5601
Show file tree
Hide file tree
Showing 30 changed files with 648 additions and 76 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Publish Test Results
if: always()
uses: dorny/test-reporter@v1
with:
name: JUnit Test Results
path: '**/target/surefire-reports/TEST-*.xml'
reporter: junit
- name: Run Tests with Maven
run: mvn test --file pom.xml

- name: Generate Report
run: mvn surefire-report:report
1 change: 1 addition & 0 deletions jacoco.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.1//EN" "report.dtd"><report name="multiplyintegers"><sessioninfo id="Karim-Jindani-a7bb4a31" start="1692953424723" dump="1692953425666"/><sessioninfo id="Karim-Jindani-5163f507" start="1692959993441" dump="1692959994396"/><sessioninfo id="Karim-Jindani-eba6dde9" start="1692960143542" dump="1692960144518"/><package name="com/example/multiplyintegers"><class name="com/example/multiplyintegers/MultiplyIntegers" sourcefilename="MultiplyIntegers.java"><method name="&lt;init&gt;" desc="()V" line="3"><counter type="INSTRUCTION" missed="3" covered="0"/><counter type="LINE" missed="1" covered="0"/><counter type="COMPLEXITY" missed="1" covered="0"/><counter type="METHOD" missed="1" covered="0"/></method><method name="main" desc="([Ljava/lang/String;)V" line="6"><counter type="INSTRUCTION" missed="26" covered="0"/><counter type="BRANCH" missed="2" covered="0"/><counter type="LINE" missed="10" covered="0"/><counter type="COMPLEXITY" missed="2" covered="0"/><counter type="METHOD" missed="1" covered="0"/></method><method name="multiply" desc="([Ljava/lang/String;)I" line="22"><counter type="INSTRUCTION" missed="0" covered="33"/><counter type="BRANCH" missed="0" covered="4"/><counter type="LINE" missed="0" covered="6"/><counter type="COMPLEXITY" missed="0" covered="3"/><counter type="METHOD" missed="0" covered="1"/></method><counter type="INSTRUCTION" missed="29" covered="33"/><counter type="BRANCH" missed="2" covered="4"/><counter type="LINE" missed="11" covered="6"/><counter type="COMPLEXITY" missed="3" covered="3"/><counter type="METHOD" missed="2" covered="1"/><counter type="CLASS" missed="0" covered="1"/></class><sourcefile name="MultiplyIntegers.java"><line nr="3" mi="3" ci="0" mb="0" cb="0"/><line nr="6" mi="3" ci="0" mb="2" cb="0"/><line nr="7" mi="3" ci="0" mb="0" cb="0"/><line nr="8" mi="1" ci="0" mb="0" cb="0"/><line nr="12" mi="3" ci="0" mb="0" cb="0"/><line nr="13" mi="4" ci="0" mb="0" cb="0"/><line nr="14" mi="2" ci="0" mb="0" cb="0"/><line nr="15" mi="4" ci="0" mb="0" cb="0"/><line nr="16" mi="1" ci="0" mb="0" cb="0"/><line nr="17" mi="4" ci="0" mb="0" cb="0"/><line nr="19" mi="1" ci="0" mb="0" cb="0"/><line nr="22" mi="0" ci="3" mb="0" cb="2"/><line nr="23" mi="0" ci="5" mb="0" cb="0"/><line nr="26" mi="0" ci="2" mb="0" cb="0"/><line nr="27" mi="0" ci="16" mb="0" cb="2"/><line nr="28" mi="0" ci="5" mb="0" cb="0"/><line nr="30" mi="0" ci="2" mb="0" cb="0"/><counter type="INSTRUCTION" missed="29" covered="33"/><counter type="BRANCH" missed="2" covered="4"/><counter type="LINE" missed="11" covered="6"/><counter type="COMPLEXITY" missed="3" covered="3"/><counter type="METHOD" missed="2" covered="1"/><counter type="CLASS" missed="0" covered="1"/></sourcefile><counter type="INSTRUCTION" missed="29" covered="33"/><counter type="BRANCH" missed="2" covered="4"/><counter type="LINE" missed="11" covered="6"/><counter type="COMPLEXITY" missed="3" covered="3"/><counter type="METHOD" missed="2" covered="1"/><counter type="CLASS" missed="0" covered="1"/></package><counter type="INSTRUCTION" missed="29" covered="33"/><counter type="BRANCH" missed="2" covered="4"/><counter type="LINE" missed="11" covered="6"/><counter type="COMPLEXITY" missed="3" covered="3"/><counter type="METHOD" missed="2" covered="1"/><counter type="CLASS" missed="0" covered="1"/></report>
130 changes: 82 additions & 48 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,54 +46,88 @@

</dependencies>


<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>8</source>
<target>8</target>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>multiplyintegers</finalName> <!-- Please do not change this final artifact name-->
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<!-- This is the main class of your program which will be executed-->
<mainClass>com.example.multiplyintegers.MultiplyIntegers</mainClass>
</manifest>
</archive>
</configuration>

<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.7.1</version>
</dependency>
</dependencies>
</plugin>
<!-- Code coverage plugin. Use only if you are adding unit tests. Do not change any of the values in the entries below -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<formats>
<format>XML</format>
</formats>
<outputDirectory>./</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>9</source>
<target>9</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</plugin>
</plugins>
</build>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class MultiplyIntegersTest {
@Test
public void testSingleNumber() {
int result = MultiplyIntegers.multiply("5");
assertEquals(5, result);
assertEquals(6, result);
}

@Test
Expand Down
Binary file modified target/classes/com/example/multiplyintegers/MultiplyIntegers.class
Binary file not shown.
Binary file added target/jacoco.exec
Binary file not shown.
3 changes: 1 addition & 2 deletions target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#Created by Apache Maven 3.9.4
groupId=com.example.multiplyintegers
artifactId=multiplyintegers
groupId=com.example.multiplyintegers
version=1.0-SNAPSHOT
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
com\example\multiplyintegers\MultiplyIntegers.class
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
com\example\multiplyintegers\MultiplyIntegersTest.class
Binary file modified target/multiplyintegers-1.0-SNAPSHOT.jar
Binary file not shown.
Binary file added target/multiplyintegers.jar
Binary file not shown.
168 changes: 168 additions & 0 deletions target/site/css/maven-base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

body {
margin: 0px;
padding: 0px;
}
table {
padding:0px;
width: 100%;
margin-left: -2px;
margin-right: -2px;
}
acronym {
cursor: help;
border-bottom: 1px dotted #feb;
}
table.bodyTable th, table.bodyTable td {
padding: 2px 4px 2px 4px;
vertical-align: top;
}
div.clear {
clear:both;
visibility: hidden;
}
div.clear hr {
display: none;
}
#bannerLeft, #bannerRight {
font-size: xx-large;
font-weight: bold;
}
#bannerLeft img, #bannerRight img {
margin: 0px;
}
.xleft, #bannerLeft img {
float:left;
}
.xright, #bannerRight {
float:right;
}
#banner {
padding: 0px;
}
#breadcrumbs {
padding: 3px 10px 3px 10px;
}
#leftColumn {
width: 170px;
float:left;
overflow: auto;
}
#bodyColumn {
margin-right: 1.5em;
margin-left: 197px;
}
#legend {
padding: 8px 0 8px 0;
}
#navcolumn {
padding: 8px 4px 0 8px;
}
#navcolumn h5 {
margin: 0;
padding: 0;
font-size: small;
}
#navcolumn ul {
margin: 0;
padding: 0;
font-size: small;
}
#navcolumn li {
list-style-type: none;
background-image: none;
background-repeat: no-repeat;
background-position: 0 0.4em;
padding-left: 16px;
list-style-position: outside;
line-height: 1.2em;
font-size: smaller;
}
#navcolumn li.expanded {
background-image: url(../images/expanded.gif);
}
#navcolumn li.collapsed {
background-image: url(../images/collapsed.gif);
}
#navcolumn li.none {
text-indent: -1em;
margin-left: 1em;
}
#poweredBy {
text-align: center;
}
#navcolumn img {
margin-top: 10px;
margin-bottom: 3px;
}
#poweredBy img {
display:block;
margin: 20px 0 20px 17px;
}
#search img {
margin: 0px;
display: block;
}
#search #q, #search #btnG {
border: 1px solid #999;
margin-bottom:10px;
}
#search form {
margin: 0px;
}
#lastPublished {
font-size: x-small;
}
.navSection {
margin-bottom: 2px;
padding: 8px;
}
.navSectionHead {
font-weight: bold;
font-size: x-small;
}
.section {
padding: 4px;
}
#footer {
padding: 3px 10px 3px 10px;
font-size: x-small;
}
#breadcrumbs {
font-size: x-small;
margin: 0pt;
}
.source {
padding: 12px;
margin: 1em 7px 1em 7px;
}
.source pre {
margin: 0px;
padding: 0px;
}
#navcolumn img.imageLink, .imageLink {
padding-left: 0px;
padding-bottom: 0px;
padding-top: 0px;
padding-right: 2px;
border: 0px;
margin: 0px;
}
Loading

0 comments on commit e5e5601

Please sign in to comment.