Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
44978dc
Update README.md
bamboomaster112 Mar 9, 2020
f1ad9fc
Update README.md
bamboomaster112 Mar 9, 2020
4d27b25
Update README.md
bamboomaster112 Mar 9, 2020
c9a51a9
Update README.md
bamboomaster112 Jun 30, 2020
4666a2c
Update maven.yml
bamboomaster112 Jun 30, 2020
8e4a03a
Update README.md
bamboomaster112 Jun 30, 2020
0cf1279
Update README.md
bamboomaster112 Jun 30, 2020
cad1fcb
Update maven.yml
bamboomaster112 Jun 30, 2020
02328d7
Update maven.yml
bamboomaster112 Jun 30, 2020
ca9191a
Update maven.yml
bamboomaster112 Jun 30, 2020
7137cbf
Update settings.xml
bamboomaster112 Jun 30, 2020
edf5077
Update pom.xml
bamboomaster112 Jun 30, 2020
d841f65
Create codeql-analysis.yml
bamboomaster112 Jul 23, 2020
cde98f7
Update README.md
bamboomaster112 Jul 23, 2020
7e2ba07
Update MySum_Test.java
bamboomaster112 Aug 10, 2020
bec7fd2
Update maven.yml
bamboomaster112 Aug 10, 2020
4a4dfb4
Update pom.xml
bamboomaster112 Aug 10, 2020
9954035
Comment Added
bamboomaster112 Aug 26, 2020
68bb202
Set up CI with Azure Pipelines
bamboomaster112 Sep 14, 2020
8fa3b1e
Set up CI with Azure Pipelines
bamboomaster112 Sep 14, 2020
1c5aa55
Update azure-pipelines-1.yml for Azure Pipelines
bamboomaster112 Sep 14, 2020
9b30ec0
Update azure-pipelines-1.yml for Azure Pipelines
bamboomaster112 Sep 14, 2020
1b51e24
Update azure-pipelines-1.yml for Azure Pipelines
bamboomaster112 Sep 14, 2020
0ae830c
Update azure-pipelines-1.yml for Azure Pipelines
bamboomaster112 Sep 14, 2020
642fe2b
Update azure-pipelines-1.yml for Azure Pipelines
bamboomaster112 Sep 14, 2020
b13cc9b
Set up CI with Azure Pipelines
bamboomaster112 Sep 15, 2020
d90ebb0
Update azure-pipelines.yml for Azure Pipelines
bamboomaster112 Sep 15, 2020
1476638
Updtae MySum.java for CodeQL Test
bamboomaster112 Sep 21, 2020
9d36074
Update MySum.java
bamboomaster112 Sep 21, 2020
948337c
Update MySum.java
bamboomaster112 Sep 21, 2020
579d6f1
Update codeql-analysis.yml
bamboomaster112 Sep 21, 2020
d3c9f53
Update pom.xml
bamboomaster112 Sep 22, 2020
36ac1be
Update pom.xml
bamboomaster112 Sep 23, 2020
dd0e167
Update pom.xml
bamboomaster112 Sep 23, 2020
6ca9ffd
Update maven.yml
bamboomaster112 Sep 23, 2020
33e624d
Update settings.xml
bamboomaster112 Sep 23, 2020
46fc39f
Update pom.xml
bamboomaster112 Sep 23, 2020
307e540
Update pom.xml
bamboomaster112 Sep 23, 2020
1798c6d
Update pom.xml
bamboomaster112 Sep 23, 2020
6f1aa3c
Update settings.xml
bamboomaster112 Sep 23, 2020
6ce6be6
Update settings.xml
bamboomaster112 Sep 23, 2020
576a9b8
Update pom.xml
bamboomaster112 Sep 23, 2020
7a11058
Update azure-pipelines.yml for Azure Pipelines
bamboomaster112 Feb 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "CodeQL"

on:
push:
branches: [master, ]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 12 * * 5'

jobs:
analyse:
name: Analyse
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
with:
languages: java # go, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Java CI

on: [push]
on: push

jobs:
build:
Expand Down
8 changes: 4 additions & 4 deletions .m2/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
</repository>
<repository>
<id>github</id>
<name>GitHub Apache Maven Packages</name>
<url>https://maven.pkg.github.com/Gazetteer-Panda</url>
<name>GitHub OWNER Apache Maven Packages</name>
<url>https://maven.pkg.github.com/PramodhMDT/sunshine-action</url>
</repository>
</repositories>
</profile>
Expand All @@ -29,8 +29,8 @@
<servers>
<server>
<id>github</id>
<username>Actions</username>
<password>TOKEN</password>
<username>PramodhMDT</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>
</settings>
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
![CodeQL](https://github.com/PramodhMDT/JavaTestDemo/workflows/CodeQL/badge.svg?branch=master)

# This is sample math application

## Given a number n, finds the sum of numbers from 1 to n

Edited by Pramodh Kumar M

Added One Line
31 changes: 31 additions & 0 deletions azure-pipelines-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java

trigger:
- master

pool: Default

steps:
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'package'

- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
contents: 'target\*.jar'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: MyBuildOutputs
22 changes: 22 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java

trigger:
- master

pool:
vmImage: ubuntu-22.04

steps:
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
#mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'package'
30 changes: 27 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.javatestdemo</groupId>
<artifactId>javatestdemo</artifactId>
<version>1.1.3</version>
<version>1.1.4</version>
<name>JavaTestDemo</name>
<packaging>jar</packaging>
<description>This is Java Testing Demo</description>
<url>http://maven.pkg.github.com/Gazetteer-Panda</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -16,6 +15,25 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<repositories>
<!--
<repository>
<id>github</id>
<name>GitHub PramodhMDT Apache Maven Packages</name>
<url>https://maven.pkg.github.com/pramodhmdt/sunshine-action</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
-->
<repository>
<id>github</id>
<name>GitHub TobseF Apache Maven Packages</name>
<url>https://maven.pkg.github.com/TobseF/HelloMaven</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>

<dependencies>
<dependency>
Expand All @@ -35,6 +53,12 @@
<version>4.12</version>
<scope>test</scope>
</dependency>
<!--
<dependency>
<groupId>com.sunshineaction</groupId>
<artifactId>sunshineaction</artifactId>
<version>1.2.6</version>
</dependency> -->
</dependencies>


Expand Down Expand Up @@ -72,7 +96,7 @@
<distributionManagement>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/Gazetteer-Panda/javatestdemo</url>
<url>https://maven.pkg.github.com/PramodhMDT/javatestdemo</url>
<releases>
<enabled>true</enabled>
</releases>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/javatestdemo/MySum.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.javatestdemo;

//Main Class
public class MySum {

static int sumofnumbers (int numbers) {
Expand All @@ -12,6 +12,6 @@ static int sumofnumbers (int numbers) {

public static void main(String[] args) {
int numbers = Integer.parseInt(args[0]);
System.out.println(sumofnumbers(numbers));
System.out.println(sumofnumbers(numbers));
}
}
10 changes: 9 additions & 1 deletion src/test/java/com/javatestdemo/MySum_Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,13 @@ public void mySimpleTest_3() {
assertEquals(Obj1.sumofnumbers(13), 91);
assertEquals(Obj1.sumofnumbers(14), 105);
assertEquals(Obj1.sumofnumbers(15), 120);
}
}
@Test //Test 4
public void mySimpleTest_4() {
assertEquals(Obj1.sumofnumbers(16), 136);
assertEquals(Obj1.sumofnumbers(17), 153);
assertEquals(Obj1.sumofnumbers(18), 171);
assertEquals(Obj1.sumofnumbers(19), 190);
assertEquals(Obj1.sumofnumbers(20), 210);
}
}