Skip to content

Commit fcb9d86

Browse files
committed
maven examples
1 parent 2d42e4c commit fcb9d86

223 files changed

Lines changed: 17184 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
10+
<attributes>
11+
<attribute name="test" value="true"/>
12+
<attribute name="optional" value="true"/>
13+
<attribute name="maven.pomderived" value="true"/>
14+
</attributes>
15+
</classpathentry>
16+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
17+
<attributes>
18+
<attribute name="maven.pomderived" value="true"/>
19+
</attributes>
20+
</classpathentry>
21+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
22+
<classpathentry kind="output" path="target/classes"/>
23+
</classpath>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>MV 01-MathProject_1</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.compliance=1.8
5+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
7+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
8+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
9+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
10+
org.eclipse.jdt.core.compiler.release=enabled
11+
org.eclipse.jdt.core.compiler.source=1.8
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>ineuron</groupId>
5+
<artifactId>MathProject-1</artifactId>
6+
<packaging>jar</packaging>
7+
<version>1.0</version>
8+
<name>MathProject-1</name>
9+
<url>http://maven.apache.org</url>
10+
<dependencies>
11+
<dependency>
12+
<groupId>junit</groupId>
13+
<artifactId>junit</artifactId>
14+
<version>3.8.1</version>
15+
<scope>test</scope>
16+
</dependency>
17+
</dependencies>
18+
</project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package in.ineuron;
2+
3+
public class MathApp {
4+
public int add(int x, int y){
5+
return x+y;
6+
}
7+
public static void main( String[] args ){
8+
MathApp m = new MathApp();
9+
int result = m.add(100,200);
10+
System.out.println("The sum is :: "+result);
11+
}
12+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package in.ineuron;
2+
3+
import junit.framework.*;
4+
5+
public class AppTest extends TestCase{
6+
public void testSumWithPositiveNumber(){
7+
MathApp ar = new MathApp();
8+
int actual = ar.add(10,20);
9+
int expected = 30;
10+
assertEquals(actual,expected);
11+
}
12+
public void testSumWithNegativeNumber(){
13+
MathApp ar = new MathApp();
14+
int actual = ar.add(-10,-20);
15+
int expected = -30;
16+
assertEquals(actual,expected);
17+
}
18+
public void testSumWithMixedNumber(){
19+
MathApp ar = new MathApp();
20+
int actual = ar.add(-10,20);
21+
int expected = 10;
22+
assertEquals(actual,expected);
23+
}
24+
public void testSumWithZero(){
25+
MathApp ar = new MathApp();
26+
int actual = ar.add(0,0);
27+
int expected = 0;
28+
assertEquals(actual,expected);
29+
}
30+
}
2.17 KB
Binary file not shown.
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
artifactId=MathProject-1
2+
groupId=ineuron
3+
version=1.0

0 commit comments

Comments
 (0)