Skip to content

Commit bb6ab62

Browse files
author
oborkovskyi
committed
Added guava 18 test project
1 parent c654cb1 commit bb6ab62

File tree

11 files changed

+399
-0
lines changed

11 files changed

+399
-0
lines changed

guava18/.classpath

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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="optional" value="true"/>
12+
<attribute name="maven.pomderived" value="true"/>
13+
</attributes>
14+
</classpathentry>
15+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
16+
<attributes>
17+
<attribute name="maven.pomderived" value="true"/>
18+
</attributes>
19+
</classpathentry>
20+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
21+
<attributes>
22+
<attribute name="maven.pomderived" value="true"/>
23+
</attributes>
24+
</classpathentry>
25+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
26+
<attributes>
27+
<attribute name="maven.pomderived" value="true"/>
28+
</attributes>
29+
</classpathentry>
30+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
31+
<attributes>
32+
<attribute name="owner.project.facets" value="java"/>
33+
</attributes>
34+
</classpathentry>
35+
<classpathentry kind="output" path="target/classes"/>
36+
</classpath>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
3+
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
4+
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.eclipse.wst.jsdt.core.javascriptValidator"/>
5+
<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
6+
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
7+
</launchConfiguration>

guava18/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*.class
2+
3+
#folders#
4+
/target
5+
/neoDb*
6+
/data
7+
/src/main/webapp/WEB-INF/classes
8+
*/META-INF/*
9+
10+
# Packaged files #
11+
*.jar
12+
*.war
13+
*.ear

guava18/.project

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>guava</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.wst.common.project.facet.core.builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.wst.validation.validationbuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.m2e.core.maven2Builder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
31+
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
32+
<nature>org.eclipse.jdt.core.javanature</nature>
33+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
34+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
35+
</natures>
36+
</projectDescription>

guava18/.springBeans

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beansProjectDescription>
3+
<version>1</version>
4+
<pluginVersion><![CDATA[3.3.0.201307091516-RELEASE]]></pluginVersion>
5+
<configSuffixes>
6+
<configSuffix><![CDATA[xml]]></configSuffix>
7+
</configSuffixes>
8+
<enableImports><![CDATA[false]]></enableImports>
9+
<configs>
10+
<config>src/main/webapp/WEB-INF/api-servlet.xml</config>
11+
</configs>
12+
<configSets>
13+
</configSets>
14+
</beansProjectDescription>

guava18/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
=========
2+
3+
## Guava and Hamcrest Cookbooks and Examples
4+
5+
6+
### Relevant Articles:
7+
- [Guava Collections Cookbook](http://www.baeldung.com/guava-collections)
8+
- [Guava Ordering Cookbook](http://www.baeldung.com/guava-order)
9+
- [Guava Functional Cookbook](http://www.baeldung.com/guava-functions-predicates)
10+
11+
- [Hamcrest Collections Cookbook](http://www.baeldung.com/hamcrest-collections-arrays)
12+
13+
- [Partition a List in Java](http://www.baeldung.com/java-list-split)

guava18/pom.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.baeldung</groupId>
8+
<artifactId>guava</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<dependencies>
12+
<dependency>
13+
<groupId>com.google.guava</groupId>
14+
<artifactId>guava</artifactId>
15+
<version>18.0</version>
16+
</dependency>
17+
<dependency>
18+
<groupId>junit</groupId>
19+
<artifactId>junit</artifactId>
20+
<version>4.12</version>
21+
</dependency>
22+
</dependencies>
23+
<build>
24+
<plugins>
25+
<plugin>
26+
<artifactId>maven-compiler-plugin</artifactId>
27+
<version>3.3</version>
28+
<configuration>
29+
<debug>true</debug>
30+
<optimize>true</optimize>
31+
<source>1.8</source>
32+
<target>1.8</target>
33+
<encoding>UTF-8</encoding>
34+
<showDeprecation>true</showDeprecation>
35+
<showWarnings>true</showWarnings>
36+
</configuration>
37+
</plugin>
38+
</plugins>
39+
</build>
40+
41+
</project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.baeldung.guava.entity;
2+
3+
import com.google.common.base.MoreObjects;
4+
5+
public class Administrator extends User{
6+
public Administrator(long id, String name, int age) {
7+
super(id, name, age);
8+
}
9+
10+
@Override
11+
public String toString() {
12+
return MoreObjects.toStringHelper(this)
13+
.add("id", getId())
14+
.add("name", getName())
15+
.add("age", getAge())
16+
.toString();
17+
}
18+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.baeldung.guava.entity;
2+
3+
public class Player extends User{
4+
public Player(long id, String name, int age) {
5+
super(id, name, age);
6+
}
7+
8+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.baeldung.guava.entity;
2+
3+
import com.google.common.base.MoreObjects;
4+
5+
public class User{
6+
private long id;
7+
private String name;
8+
private int age;
9+
10+
public User(long id, String name, int age) {
11+
this.id = id;
12+
this.name = name;
13+
this.age = age;
14+
}
15+
16+
public long getId() {
17+
return id;
18+
}
19+
20+
public String getName() {
21+
return name;
22+
}
23+
24+
public int getAge() {
25+
return age;
26+
}
27+
28+
@Override
29+
public String toString() {
30+
return MoreObjects.toStringHelper(User.class)
31+
.add("id", id)
32+
.add("name", name)
33+
.add("age", age)
34+
.toString();
35+
}
36+
}

0 commit comments

Comments
 (0)