diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2013-08-03 23:13:32 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2013-08-03 23:13:32 +0200 |
commit | 2b1c32590db960be2b5f62897e65bb10d434cae0 (patch) | |
tree | 84623e4293f59f67331a7760a700121737313c48 /container-compiler-plugin/src/test | |
parent | df92538ab3d83da9839f08b28fc8a67317565463 (diff) | |
download | container-playground-2b1c32590db960be2b5f62897e65bb10d434cae0.tar.gz container-playground-2b1c32590db960be2b5f62897e65bb10d434cae0.tar.bz2 container-playground-2b1c32590db960be2b5f62897e65bb10d434cae0.tar.xz container-playground-2b1c32590db960be2b5f62897e65bb10d434cae0.zip |
wip
Diffstat (limited to 'container-compiler-plugin/src/test')
2 files changed, 25 insertions, 3 deletions
diff --git a/container-compiler-plugin/src/test/java/io/trygvis/container/compiler/model/TypeRefTest.java b/container-compiler-plugin/src/test/java/io/trygvis/container/compiler/model/TypeRefTest.java new file mode 100644 index 0000000..94425cc --- /dev/null +++ b/container-compiler-plugin/src/test/java/io/trygvis/container/compiler/model/TypeRefTest.java @@ -0,0 +1,19 @@ +package io.trygvis.container.compiler.model; + +import org.testng.Assert; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertEquals; + +public class TypeRefTest { + @Test + public void testBasic() { + TypeRef foo = new TypeRef("wat.Foo"); + TypeRef string = new TypeRef(String.class); + TypeRef bar = new TypeRef("wat.Bar").args(string); + TypeRef baz = new TypeRef("woot.Baz").args(bar); + assertEquals(foo.toString(), "wat.Foo"); + assertEquals(bar.toString(), "wat.Bar<java.lang.String>"); + assertEquals(baz.toString(), "woot.Baz<wat.Bar<java.lang.String>>"); + } +} diff --git a/container-compiler-plugin/src/test/resources/io/trygvis/persistence/test/Person.java b/container-compiler-plugin/src/test/resources/io/trygvis/persistence/test/Person.java index 3f1be35..43a0c78 100644 --- a/container-compiler-plugin/src/test/resources/io/trygvis/persistence/test/Person.java +++ b/container-compiler-plugin/src/test/resources/io/trygvis/persistence/test/Person.java @@ -1,14 +1,11 @@ package io.trygvis.persistence.test; -import io.trygvis.persistence.SqlEntity; - import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.ManyToOne; import java.util.Date; @Entity -//@SqlEntity("io.trygvis.persistence.test.PersonTypeHandler") public class Person { @Id public Long id; @@ -24,4 +21,10 @@ public class Person { // @OneToMany(mappedBy = "id") // @OrderBy("birthDate asc") // private List<Person> children = new ArrayList<>(); + + public Person(Long id, Date birthDate, Person mother) { + this.id = id; + this.birthDate = birthDate; + this.mother = mother; + } } |