BAEL-2781 - metaprogramming in groovy - review fixes
This commit is contained in:
parent
6eb4d10886
commit
6fe2a0fdcc
|
@ -37,5 +37,9 @@ class Employee {
|
|||
log.info "$methodName is not defined"
|
||||
"method '$methodName' is not defined"
|
||||
}
|
||||
|
||||
def logEmp() {
|
||||
log.info "Employee: $lastName, $firstName is of $age years age"
|
||||
}
|
||||
|
||||
}
|
|
@ -97,7 +97,7 @@ class MetaprogrammingUnitTest extends GroovyTestCase {
|
|||
void testEqualsAndHashCodeAnnotation() {
|
||||
Employee norman = new Employee(1, "norman", "lewis", 28)
|
||||
Employee normanCopy = new Employee(1, "norman", "lewis", 28)
|
||||
assert norman == normanCopy
|
||||
assert norman.equals(normanCopy)
|
||||
assert norman.hashCode() == normanCopy.hashCode()
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,10 @@ class MetaprogrammingUnitTest extends GroovyTestCase {
|
|||
} catch(CloneNotSupportedException e) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void testLoggingAnnotation() {
|
||||
Employee employee = new Employee(1, "Norman", "Lewis", 28)
|
||||
employee.logEmp()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue