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"
|
log.info "$methodName is not defined"
|
||||||
"method '$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() {
|
void testEqualsAndHashCodeAnnotation() {
|
||||||
Employee norman = new Employee(1, "norman", "lewis", 28)
|
Employee norman = new Employee(1, "norman", "lewis", 28)
|
||||||
Employee normanCopy = 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()
|
assert norman.hashCode() == normanCopy.hashCode()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,7 +109,10 @@ class MetaprogrammingUnitTest extends GroovyTestCase {
|
|||||||
} catch(CloneNotSupportedException e) {
|
} catch(CloneNotSupportedException e) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void testLoggingAnnotation() {
|
||||||
|
Employee employee = new Employee(1, "Norman", "Lewis", 28)
|
||||||
|
employee.logEmp()
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user