Skip to content

Commit 4deff82

Browse files
committed
add apache example module
1 parent 5d0b034 commit 4deff82

5 files changed

Lines changed: 103 additions & 0 deletions

File tree

apacheCommons/pom.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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/xsd/maven-4.0.0.xsd">
3+
<parent>
4+
<artifactId>javalearning</artifactId>
5+
<groupId>com.javalearning</groupId>
6+
<version>1.0-SNAPSHOT</version>
7+
</parent>
8+
<modelVersion>4.0.0</modelVersion>
9+
10+
<artifactId>apacheexample</artifactId>
11+
<packaging>jar</packaging>
12+
13+
<name>apacheexample</name>
14+
<url>http://maven.apache.org</url>
15+
16+
<properties>
17+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18+
</properties>
19+
20+
<dependencies>
21+
<dependency>
22+
<groupId>junit</groupId>
23+
<artifactId>junit</artifactId>
24+
</dependency>
25+
<dependency>
26+
<groupId>org.apache.commons</groupId>
27+
<artifactId>commons-collections4</artifactId>
28+
</dependency>
29+
<dependency>
30+
<groupId>org.apache.commons</groupId>
31+
<artifactId>commons-lang3</artifactId>
32+
</dependency>
33+
</dependencies>
34+
</project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.javalearning.math;
2+
3+
import org.apache.commons.lang3.math.Fraction;
4+
5+
/**
6+
* Created by renqun.yuan on 2015/11/3.
7+
*/
8+
public class FractionExample {
9+
public static void main(String[] args) {
10+
Fraction fraction = Fraction.getFraction(1, 3, 4);
11+
double value = fraction.doubleValue();
12+
System.out.println(value);
13+
}
14+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**
2+
* Created by renqun.yuan on 2015/11/3.
3+
*/
4+
package com.javalearning;
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.javalearning;
2+
3+
import junit.framework.Test;
4+
import junit.framework.TestCase;
5+
import junit.framework.TestSuite;
6+
7+
/**
8+
* Unit test for simple App.
9+
*/
10+
public class AppTest
11+
extends TestCase
12+
{
13+
/**
14+
* Create the test case
15+
*
16+
* @param testName name of the test case
17+
*/
18+
public AppTest( String testName )
19+
{
20+
super( testName );
21+
}
22+
23+
/**
24+
* @return the suite of tests being tested
25+
*/
26+
public static Test suite()
27+
{
28+
return new TestSuite( AppTest.class );
29+
}
30+
31+
/**
32+
* Rigourous Test :-)
33+
*/
34+
public void testApp()
35+
{
36+
assertTrue( true );
37+
}
38+
}

pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<module>designPatterns</module>
1515
<module>guavaExample</module>
1616
<module>questionInwork</module>
17+
<module>apacheCommons</module>
1718
</modules>
1819

1920
<properties>
@@ -22,6 +23,8 @@
2223
<guava.version>18.0</guava.version>
2324
<spring-data-elasticsearch.version>1.2.0.RELEASE</spring-data-elasticsearch.version>
2425
<org.springframework.version>4.1.1.RELEASE</org.springframework.version>
26+
<commons-collections4.version>4.0</commons-collections4.version>
27+
<commons-lang3.version>3.4</commons-lang3.version>
2528
</properties>
2629

2730
<dependencyManagement>
@@ -53,6 +56,16 @@
5356
<version>${org.springframework.version}</version>
5457
<scope>test</scope>
5558
</dependency>
59+
<dependency>
60+
<groupId>org.apache.commons</groupId>
61+
<artifactId>commons-collections4</artifactId>
62+
<version>${commons-collections4.version}</version>
63+
</dependency>
64+
<dependency>
65+
<groupId>org.apache.commons</groupId>
66+
<artifactId>commons-lang3</artifactId>
67+
<version>${commons-lang3.version}</version>
68+
</dependency>
5669
</dependencies>
5770
</dependencyManagement>
5871

0 commit comments

Comments
 (0)