OpenPojo / openpojo

POJO Testing & Identity Management Made Trivial
http://openpojo.com
Apache License 2.0
156 stars 40 forks source link

Add the ability to test inherited PojoFields. #51

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 9 years ago
In an Abstract Class one may declare a field with its getter and setter.
When another class extends this class, and define other fields with getters & 
setters its not possible to test those.

Ideally, enhance the Setter & Getter testers to include inherited fields.

Things to pay attention to:
  1. Field Shadowing / Over-riding.
  2. Method over-riding.

Original issue reported on code.google.com by oshou...@gmail.com on 20 Jan 2015 at 3:13

GoogleCodeExporter commented 9 years ago
related to Issue 23

Original comment by oshou...@gmail.com on 20 Jan 2015 at 3:17

lucasdelucca commented 8 years ago

Hello everyone!

Seems that Issue 23 answer isn't more applicable in this question. I need to test attributes and methods inherited, because superclass is abstract and can't be tested. (like getter, setters, default null values). com.openpojo.registry.ServiceRegistrar doesn't have a getPojoClassAdaptationService(). This functionality exists on openpojo? How to do that?

oshoukry commented 8 years ago

Adding asm library to classpath resolved the issue brought up by Lucas.

zygimantus commented 6 years ago

What is asm library?

oshoukry commented 6 years ago

@zygimantus Which version of OpenPojo are you using? The dependency for testing abstract classes depends on ASM library version 5+ see http://asm.ow2.io/ Or just add the following to your maven pom file:

  <dependency>
    <groupId>org.ow2.asm</groupId>
    <artifactId>asm</artifactId>
    <version>5.2</version>
  </dependency>