TP04 OrderLineDAO

Modérateurs : graffion, jmdouin, agoncal, mlebihan

Ruddy Reisberg
Messages : 41
Inscription : 01 nov. 2016 16:13

TP04 OrderLineDAO

Message par Ruddy Reisberg » 06 nov. 2017 17:05

Bonjour,


De nombreuses fonctions de ma classe OrderLineDAO ne veulent pas tourner a cause du fait que les méthodes n'ont pas le même type entre OrderLineDAO (qui hérite de AbstractDataAccessObject) et la classe AbstractDataAccessObject.
Exemple, sur la fonction remove, je ne sais plus si je dois mettre un void ou non, et même si je le mets (et que j'enleve le return) il me demande d'enlver le final dans la classe AbstractDataAccessObject.

Avez vous demandé d'opérer des modifications lors du dernier cours auquel je n'ai pas pu assister?

Merci beaucoup

graffion
Messages : 635
Inscription : 21 juin 2005 14:05

Re: TP04 OrderLineDAO

Message par graffion » 07 nov. 2017 16:59

Bonjour,

Vous n'avez pas bien compris le "template method design pattern" visiblement.
Relisez la section Implémentation de l'énoncé http://aisl.cnam.fr/xwiki/wiki/aisl/vie ... n=colibri&

Ruddy Reisberg
Messages : 41
Inscription : 01 nov. 2016 16:13

Re: TP04 OrderLineDAO

Message par Ruddy Reisberg » 07 nov. 2017 17:06

Bonjour,
Oui j'ai vu mon erreur il y a quelques heures, je n'implémentais pas du tout les bonnes méthodes, mais apparemment j'ai un nouveau problème au moment de l'insertion sql;

Pourtant j'ai l'impression que mon Order a le bon constructeur, et que l'ordres des attributs lors de l'insertion sql est bien respecté

Voici la trace:

java.lang.NullPointerException
at com.yaps.petstore.domain.order.OrderDAO.getInsertSqlStatement(OrderDAO.java:43)
at com.yaps.petstore.persistence.AbstractDataAccessObject.insert(AbstractDataAccessObject.java:191)
at com.yaps.petstore.domain.order.OrderDAO.insert(OrderDAO.java:96)
at com.yaps.petstore.domain.OrderLineDAOTest.createOrderLine(OrderLineDAOTest.java:257)
at com.yaps.petstore.domain.OrderLineDAOTest.testDomainCreateOrderLine(OrderLineDAOTest.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:121)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
java.lang.NullPointerException
at com.yaps.petstore.domain.orderline.OrderLineDAO.getInsertSqlStatement(OrderLineDAO.java:32)
at com.yaps.petstore.persistence.AbstractDataAccessObject.insert(AbstractDataAccessObject.java:191)
at com.yaps.petstore.domain.OrderLineDAOTest.createOrderLine(OrderLineDAOTest.java:261)
at com.yaps.petstore.domain.OrderLineDAOTest.testDomainCreateOrderLine(OrderLineDAOTest.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:121)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
java.lang.NullPointerException
at com.yaps.petstore.domain.order.OrderDAO.getInsertSqlStatement(OrderDAO.java:43)
at com.yaps.petstore.persistence.AbstractDataAccessObject.insert(AbstractDataAccessObject.java:191)
at com.yaps.petstore.domain.order.OrderDAO.insert(OrderDAO.java:96)
at com.yaps.petstore.domain.OrderLineDAOTest.createOrderLine(OrderLineDAOTest.java:257)
at com.yaps.petstore.domain.OrderLineDAOTest.testDomainFindAllOrderLines(OrderLineDAOTest.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:121)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
java.lang.NullPointerException
at com.yaps.petstore.domain.orderline.OrderLineDAO.getInsertSqlStatement(OrderLineDAO.java:32)
at com.yaps.petstore.persistence.AbstractDataAccessObject.insert(AbstractDataAccessObject.java:191)
at com.yaps.petstore.domain.OrderLineDAOTest.createOrderLine(OrderLineDAOTest.java:261)
at com.yaps.petstore.domain.OrderLineDAOTest.testDomainFindAllOrderLines(OrderLineDAOTest.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:121)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
java.lang.NullPointerException
at com.yaps.petstore.domain.order.OrderDAO.getInsertSqlStatement(OrderDAO.java:43)
at com.yaps.petstore.persistence.AbstractDataAccessObject.insert(AbstractDataAccessObject.java:191)
at com.yaps.petstore.domain.order.OrderDAO.insert(OrderDAO.java:96)
at com.yaps.petstore.domain.OrderLineDAOTest.createOrderLine(OrderLineDAOTest.java:257)
at com.yaps.petstore.domain.OrderLineDAOTest.testDomainUpdateOrderLineWithInvalidValues(OrderLineDAOTest.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:121)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
java.lang.NullPointerException
at com.yaps.petstore.domain.orderline.OrderLineDAO.getInsertSqlStatement(OrderLineDAO.java:32)
at com.yaps.petstore.persistence.AbstractDataAccessObject.insert(AbstractDataAccessObject.java:191)
at com.yaps.petstore.domain.OrderLineDAOTest.createOrderLine(OrderLineDAOTest.java:261)
at com.yaps.petstore.domain.OrderLineDAOTest.testDomainUpdateOrderLineWithInvalidValues(OrderLineDAOTest.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:121)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
java.lang.NullPointerException
at com.yaps.petstore.domain.order.OrderDAO.getInsertSqlStatement(OrderDAO.java:43)
at com.yaps.petstore.persistence.AbstractDataAccessObject.insert(AbstractDataAccessObject.java:191)
at com.yaps.petstore.domain.order.OrderDAO.insert(OrderDAO.java:96)
at com.yaps.petstore.domain.OrderDAOTest.createOrder(OrderDAOTest.java:285)
at com.yaps.petstore.domain.OrderDAOTest.testDomainFindAllOrders(OrderDAOTest.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:121)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
java.lang.NullPointerException
at com.yaps.petstore.domain.order.OrderDAO.getInsertSqlStatement(OrderDAO.java:43)
at com.yaps.petstore.persistence.AbstractDataAccessObject.insert(AbstractDataAccessObject.java:191)
at com.yaps.petstore.domain.order.OrderDAO.insert(OrderDAO.java:96)
at com.yaps.petstore.domain.OrderDAOTest.createOrder(OrderDAOTest.java:285)
at com.yaps.petstore.domain.OrderDAOTest.testDomainUpdateOrder(OrderDAOTest.java:218)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:121)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
java.lang.NullPointerException
at com.yaps.petstore.domain.order.OrderDAO.getInsertSqlStatement(OrderDAO.java:43)
at com.yaps.petstore.persistence.AbstractDataAccessObject.insert(AbstractDataAccessObject.java:191)
at com.yaps.petstore.domain.order.OrderDAO.insert(OrderDAO.java:96)
at com.yaps.petstore.domain.OrderDAOTest.createOrder(OrderDAOTest.java:285)
at com.yaps.petstore.domain.OrderDAOTest.testDomainCreateOrder(OrderDAOTest.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:121)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
java.lang.NullPointerException
at com.yaps.petstore.domain.order.OrderDAO.getInsertSqlStatement(OrderDAO.java:43)
at com.yaps.petstore.persistence.AbstractDataAccessObject.insert(AbstractDataAccessObject.java:191)
at com.yaps.petstore.domain.order.OrderDAO.insert(OrderDAO.java:96)
at com.yaps.petstore.domain.OrderDAOTest.createOrder(OrderDAOTest.java:285)
at com.yaps.petstore.domain.OrderDAOTest.testDomainUpdateOrderWithInvalidValues(OrderDAOTest.java:162)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:121)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

graffion
Messages : 635
Inscription : 21 juin 2005 14:05

Re: TP04 OrderLineDAO

Message par graffion » 07 nov. 2017 18:12

Il suffit donc de mettre un point d'arrêt
at com.yaps.petstore.domain.order.OrderDAO.getInsertSqlStatement(OrderDAO.java:43)
et de lancer le test unitaire OrderLineDAOTest par "Debug as ... JUnit test" dans Eclipse pour inspecter la requête en construction.

Ruddy Reisberg
Messages : 41
Inscription : 01 nov. 2016 16:13

Re: TP04 OrderLineDAO

Message par Ruddy Reisberg » 08 nov. 2017 1:41

Ah oui super, je vois que certaines informations sont nulles, y compris le customer...
En fait je crois que c'est le customer nul qui fait tout planter,

Maintenant je ne comprends pas pourquoi, car j'ai l'impression que toutes mes informations sont correctes...
Avez vous une idée de l'origine du problème?

Il me semble que cest bien a cause de cela, car si le create est faux alors forcément les find, update et create de orderDAO et de OrderLineDAO ne marcheront pas (7 faillures + 1 error (dont le début de la trace est visible ci dessous)


com.yaps.petstore.exception.CheckException: Invalid Customer
at com.yaps.petstore.service.OrderService.createOrder(OrderService.java:42)
[...]

Ruddy Reisberg
Messages : 41
Inscription : 01 nov. 2016 16:13

Re: TP04 OrderLineDAO

Message par Ruddy Reisberg » 08 nov. 2017 17:19

J'ai compris, je n'avais pas décrit le constructeur spécial dans la classe Order, impossible de trouver les données en questions.
Maintenant j'ai un nouveau problème!
De ce que je comprends, l'erreur est dans le select et cela casse tout les autres tests (update etc...) de OrderLineDAO et OrderDAO. Ils n'arrive pas à trouver l'objet mais comment avancer maintenant?

com.yaps.petstore.exception.ObjectNotFoundException
at com.yaps.petstore.persistence.AbstractDataAccessObject.select(AbstractDataAccessObject.java:80)
at com.yaps.petstore.persistence.AbstractDataAccessObject.findByPrimaryKey(AbstractDataAccessObject.java:53)
at com.yaps.petstore.domain.OrderLineDAOTest.removeOrderLine(OrderLineDAOTest.java:273)
at com.yaps.petstore.domain.OrderLineDAOTest.testDomainCreateOrderLine(OrderLineDAOTest.java:135)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:121)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Répondre

Qui est en ligne ?

Utilisateurs parcourant ce forum : Google [Bot] et 1 invité