forked from javahometech/my-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
kammana
committed
Apr 4, 2018
0 parents
commit f950e75
Showing
5 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>in.javahome</groupId> | ||
<artifactId>myweb</artifactId> | ||
<packaging>war</packaging> | ||
<version>0.13.0-SNAPSHOT</version> | ||
<name>myweb aplication</name> | ||
<url>http://maven.apache.org</url> | ||
<properties> | ||
<docker.image.prefix>kammana</docker.image.prefix> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>javax.servlet-api</artifactId> | ||
<version>3.0.1</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<!-- Demo git --> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>3.8.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.itextpdf</groupId> | ||
<artifactId>itextpdf</artifactId> | ||
<version>5.0.6</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.poi</groupId> | ||
<artifactId>poi</artifactId> | ||
<version>3.7</version> | ||
</dependency> | ||
|
||
|
||
<!-- <dependency> | ||
<groupId>org.sonarsource.java</groupId> | ||
<artifactId>sonar-jacoco-listeners</artifactId> | ||
<version>3.8</version> | ||
<scope>test</scope> | ||
</dependency> --> | ||
</dependencies> | ||
|
||
<distributionManagement> | ||
<snapshotRepository> | ||
<id>snapshots</id> | ||
<url>http://52.33.227.37:8081/nexus/content/repositories/snapshots</url> | ||
</snapshotRepository> | ||
|
||
<repository> | ||
<id>releases</id> | ||
<url>http://52.33.227.37:8081/nexus/content/repositories/releases</url> | ||
</repository> | ||
</distributionManagement> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.6.1</version> | ||
<configuration> | ||
<source>1.7</source> | ||
<target>1.7</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.19</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>com.spotify</groupId> | ||
<artifactId>docker-maven-plugin</artifactId> | ||
<version>0.4.11</version> | ||
<configuration> | ||
<imageName>${docker.image.prefix}/${project.artifactId}:${project.version}</imageName> | ||
<dockerDirectory>.</dockerDirectory> | ||
<serverId>docker-hub</serverId> | ||
<resources> | ||
<resource> | ||
<targetPath>/</targetPath> | ||
<directory>${project.build.directory}</directory> | ||
<include>${project.build.finalName}.war</include> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
17 changes: 17 additions & 0 deletions
17
src/main/java/in/javahome/myweb/controller/Calculator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package in.javahome.myweb.controller; | ||
/* | ||
* | ||
*/ | ||
public class Calculator { | ||
/* | ||
* @param i | ||
* @param j | ||
* @return int | ||
*/ | ||
public int add(int i, int j){ | ||
return i+j; | ||
} | ||
public int multiply(int i, int j){ | ||
return i*j; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!DOCTYPE web-app PUBLIC | ||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" | ||
"http://java.sun.com/dtd/web-app_2_3.dtd" > | ||
|
||
<web-app> | ||
<display-name>Archetype Created Web Application</display-name> | ||
</web-app> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Bootstrap Example</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | ||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | ||
</head> | ||
<body> | ||
|
||
<div class="container-fluid"> | ||
<h1>Welcome to Java Home Cloud</h1> | ||
</div> | ||
|
||
</body> | ||
</html> |
14 changes: 14 additions & 0 deletions
14
src/test/java/in/javahome/myweb/controller/CalculatorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package in.javahome.myweb.controller; | ||
|
||
import junit.framework.Assert; | ||
import junit.framework.TestCase; | ||
|
||
public class CalculatorTest extends TestCase { | ||
Calculator cal = new Calculator(); | ||
public void testAdd(){ | ||
Assert.assertEquals(cal.add(10, 20), 30); | ||
} | ||
public void testMultiply(){ | ||
Assert.assertEquals(cal.multiply(10, 20), 200); | ||
} | ||
} |