Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A unit test class for a DAO is generated even if the DAO itself is not #2

Open
uwesinha opened this issue Apr 6, 2020 · 1 comment

Comments

@uwesinha
Copy link

uwesinha commented Apr 6, 2020

Affected environment

  • PVEntityGenerator 4.8.2.0
  • Target platform: Java5JPA (other platforms might also be affected)

How to reproduce

  • Start PVEG with an arbitrary ACCDB source
  • Open the "Entity Generation" tab
  • Select an entity (e.g. Something) from the list on the left-hand side
  • Switch to the "Generation Options" tab
  • In the panel on the right:
    • under "Entity class", set "Generate entity" to "True"
    • under "Home class", set "Generate home/DAO" to "False"
  • Klick "Generate files" to (re)generate the respective Java source files

Expected behaviour

Assuming that I selected the entity named Something and my entity classes are in a package named com.example.entity:

  • .../src/main/java/com/example/entity/Something.java is created
  • .../src/test/java/com/example/entity/SomethingTest.java is created
  • .../src/main/java/com/example/entity/dao/SomethingDAO.java is not created
  • .../src/test/java/com/example/entity/dao/SomethingDAOTest .java is not created

Actual behaviour

  • .../src/main/java/com/example/entity/Something.java is created
  • .../src/test/java/com/example/entity/SomethingTest.java is created
  • .../src/main/java/com/example/entity/dao/SomethingDAO.java is not created
  • .../src/test/java/com/example/entity/dao/SomethingDAOTest .java is created
@uwesinha
Copy link
Author

uwesinha commented Apr 6, 2020

IMHO, the test in entity_dao_unittest-class.xsl, Line 20 is wrong (or, at least, incomplete). It does not test if the generate-home parameter is set to "true".

Unfortunately I don't have a proper dev environment for C# so I can't provide a pull request...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant