Commit
42c49641c4a6235b1dc3f39a16f22a7fe847eadb
Iniciando projeto Demo
| @@ -0,0 +1,10 @@ |
| @@ -0,0 +1,10 @@ |
| |
1
| +<?xml version="1.0" encoding="UTF-8"?> |
| |
2
| +<classpath> |
| |
3
| + <classpathentry kind="src" path="src/main/java"/> |
| |
4
| + <classpathentry kind="src" path="src/main/resources"/> |
| |
5
| + <classpathentry kind="src" path="src/test/java"/> |
| |
6
| + <classpathentry kind="src" path="src/test/resources"/> |
| |
7
| + <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> |
| |
8
| + <classpathentry exported="true" kind="con" path="org.springsource.ide.eclipse.gradle.classpathcontainer"/> |
| |
9
| + <classpathentry kind="output" path="bin"/> |
| |
10
| +</classpath> |
| @@ -0,0 +1,3 @@ |
| @@ -0,0 +1,3 @@ |
| |
1
| +build/ |
| |
2
| +.gradle/ |
| |
3
| +bin/ |
| @@ -0,0 +1,18 @@ |
| @@ -0,0 +1,18 @@ |
| |
1
| +<?xml version="1.0" encoding="UTF-8"?> |
| |
2
| +<projectDescription> |
| |
3
| + <name>gsan-auto-leitura</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
| + </buildSpec> |
| |
14
| + <natures> |
| |
15
| + <nature>org.springsource.ide.eclipse.gradle.core.nature</nature> |
| |
16
| + <nature>org.eclipse.jdt.core.javanature</nature> |
| |
17
| + </natures> |
| |
18
| +</projectDescription> |
| @@ -0,0 +1,5 @@ |
| @@ -0,0 +1,5 @@ |
| |
1
| +#org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences |
| |
2
| +#Mon Sep 07 21:43:56 BRT 2015 |
| |
3
| +build.family.org.gradle.tooling.model.eclipse.HierarchicalEclipseProject=; |
| |
4
| +org.springsource.ide.eclipse.gradle.linkedresources= |
| |
5
| +org.springsource.ide.eclipse.gradle.rootprojectloc= |
| @@ -0,0 +1,8 @@ |
| @@ -0,0 +1,8 @@ |
| |
1
| +#org.springsource.ide.eclipse.gradle.core.actions.GradleRefreshPreferences |
| |
2
| +#Mon Sep 07 21:43:11 BRT 2015 |
| |
3
| +addResourceFilters=true |
| |
4
| +afterTasks=afterEclipseImport; |
| |
5
| +beforeTasks=cleanEclipse;eclipse; |
| |
6
| +enableAfterTasks=true |
| |
7
| +enableBeforeTasks=true |
| |
8
| +useHierarchicalNames=false |
| @@ -0,0 +1,12 @@ |
| @@ -0,0 +1,12 @@ |
| |
1
| +eclipse.preferences.version=1 |
| |
2
| +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled |
| |
3
| +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate |
| |
4
| +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 |
| |
5
| +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve |
| |
6
| +org.eclipse.jdt.core.compiler.compliance=1.8 |
| |
7
| +org.eclipse.jdt.core.compiler.debug.lineNumber=generate |
| |
8
| +org.eclipse.jdt.core.compiler.debug.localVariable=generate |
| |
9
| +org.eclipse.jdt.core.compiler.debug.sourceFile=generate |
| |
10
| +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error |
| |
11
| +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error |
| |
12
| +org.eclipse.jdt.core.compiler.source=1.8 |
| @@ -0,0 +1,32 @@ |
| @@ -0,0 +1,32 @@ |
| |
1
| +apply plugin: 'java' |
| |
2
| +apply plugin: 'eclipse' |
| |
3
| + |
| |
4
| +sourceCompatibility = 1.8 |
| |
5
| +version = '0.1' |
| |
6
| +jar { |
| |
7
| + manifest { |
| |
8
| + attributes 'Implementation-Title': 'Auto Leitura', |
| |
9
| + 'Implementation-Version': version |
| |
10
| + } |
| |
11
| +} |
| |
12
| + |
| |
13
| +repositories { |
| |
14
| + mavenCentral() |
| |
15
| +} |
| |
16
| + |
| |
17
| +dependencies { |
| |
18
| + compile group: 'commons-collections', name: 'commons-collections', version: '3.2' |
| |
19
| + testCompile group: 'junit', name: 'junit', version: '4.+' |
| |
20
| +} |
| |
21
| + |
| |
22
| +test { |
| |
23
| + systemProperties 'property': 'value' |
| |
24
| +} |
| |
25
| + |
| |
26
| +uploadArchives { |
| |
27
| + repositories { |
| |
28
| + flatDir { |
| |
29
| + dirs 'repos' |
| |
30
| + } |
| |
31
| + } |
| |
32
| +} |
| @@ -0,0 +1,26 @@ |
| @@ -0,0 +1,26 @@ |
| |
1
| +package br.org.softwarepublico.modelo; |
| |
2
| + |
| |
3
| +import java.io.Serializable; |
| |
4
| + |
| |
5
| +public class Imovel implements Serializable { |
| |
6
| + |
| |
7
| + private static final long serialVersionUID = 5168449993099540127L; |
| |
8
| + |
| |
9
| + private String matricula; |
| |
10
| + |
| |
11
| + public Imovel() {} |
| |
12
| + |
| |
13
| + public String getMatricula() { |
| |
14
| + return matricula; |
| |
15
| + } |
| |
16
| + |
| |
17
| + public void setMatricula(String matricula) { |
| |
18
| + this.matricula = matricula; |
| |
19
| + } |
| |
20
| + |
| |
21
| + @Override |
| |
22
| + public boolean equals(Object obj) { |
| |
23
| + return ((Imovel)obj).getMatricula().equals(this.getMatricula()); |
| |
24
| + } |
| |
25
| + |
| |
26
| +} |
| @@ -0,0 +1,35 @@ |
| @@ -0,0 +1,35 @@ |
| |
1
| +package br.gov.softwarepublico.teste.modelo; |
| |
2
| + |
| |
3
| +import org.junit.Assert; |
| |
4
| +import org.junit.Before; |
| |
5
| +import org.junit.Test; |
| |
6
| + |
| |
7
| +import br.org.softwarepublico.modelo.Imovel; |
| |
8
| + |
| |
9
| +public class ImovelTeste { |
| |
10
| + |
| |
11
| + Imovel imovel1; |
| |
12
| + Imovel imovel2; |
| |
13
| + |
| |
14
| + @Before |
| |
15
| + public void setup() { |
| |
16
| + imovel1 = new Imovel(); |
| |
17
| + imovel2 = new Imovel(); |
| |
18
| + } |
| |
19
| + |
| |
20
| + @Test |
| |
21
| + public void imoveisIguais() { |
| |
22
| + imovel1.setMatricula("12345"); |
| |
23
| + imovel2.setMatricula("12345"); |
| |
24
| + |
| |
25
| + Assert.assertTrue(imovel1.equals(imovel2)); |
| |
26
| + } |
| |
27
| + |
| |
28
| + @Test |
| |
29
| + public void imoveisDiferentes() { |
| |
30
| + imovel1.setMatricula("12345"); |
| |
31
| + imovel2.setMatricula("12344"); |
| |
32
| + |
| |
33
| + Assert.assertFalse(imovel1.equals(imovel2)); |
| |
34
| + } |
| |
35
| +} |