plus d'erreure code mais plein d'erreures a junit test ????

Modérateurs : graffion, jmdouin, agoncal, mlebihan

Répondre
wfh
Messages : 14
Inscription : 21 oct. 2007 14:48

plus d'erreure code mais plein d'erreures a junit test ????

Message par wfh » 21 oct. 2007 20:46

En faite, il n'y pas de bug car je voulai modifier le code test.
la je n'est que modifier customerDAO et creer les exceptions, là il n'y a aucune erreure ou que se soit, mais j'ai 8 erreure au junit test ???? comprend pas, à quoi faut il se fier ? :cry:

wfh
Messages : 14
Inscription : 21 oct. 2007 14:48

ou bien je ne sais pas comment faire les tests

Message par wfh » 21 oct. 2007 21:50

je dois mal lancer les tests sans doute ????
je les lance sous eclipse en important dans la librairie eclipse les jar junit. C'est comme ça que l'on doit faire ????

mlebihan
Messages : 114
Inscription : 09 févr. 2007 1:03

Message par mlebihan » 21 oct. 2007 23:11

Il faut lancer les tests en mode ligne de commande et ne pas se fier à ce que peut présenter Eclipse, au moins le temps où l'on lance les tests.

Quant à avoir plein d'erreurs au moment où les tests sont lancés. De quelles erreurs s'agit-il? Il faut un minimum de précision pour que quelqu'un puisse vous aider sur le forum.


M. Le Bihan.

wfh
Messages : 14
Inscription : 21 oct. 2007 14:48

Merci pour votre aide

Message par wfh » 22 oct. 2007 11:17

Ce que je veux dire c'est que je n'ai aucunne erreure même dans la classe CustumorDAOTest.

wfh
Messages : 14
Inscription : 21 oct. 2007 14:48

YANT CREER TOUTE LES EXCEPTION COMME DANS LE SUJET

Message par wfh » 22 oct. 2007 12:31

pourtant quand je lance ant yaps-test j'ai 17 erreures ???
pourtanrt j'ai bien creer les classes exceptions de même manierre indiquer que dans l'énoncé du sujet ??????

wfh
Messages : 14
Inscription : 21 oct. 2007 14:48

JE SUIS COMPLETEMENT PERDU

Message par wfh » 22 oct. 2007 13:11

HELP PLEASE
en modifiant les repertoir de eclipse comme dans le sujet, j'ai maintenant 50 erreures. :?

wfh
Messages : 14
Inscription : 21 oct. 2007 14:48

pire

Message par wfh » 22 oct. 2007 14:35

je ne comprend plus rien. depuis eclise j'ai 0 erreure mais un fail.
en tapant en console ant yaps-test j'ai 50 erreures. :?

mlebihan
Messages : 114
Inscription : 09 févr. 2007 1:03

Message par mlebihan » 22 oct. 2007 15:41

Pour vous aider, il faut nous présenter les erreurs.
Quels sont les messages que vous avez?

Et en ayant fait quoi?


M. Le Bihan.

wfh
Messages : 14
Inscription : 21 oct. 2007 14:48

Message par wfh » 22 oct. 2007 16:29

J'ai creer les classes exceptions induits dans l'énonceée du sujet, j'ai modifier customerDAO pour lancer les bonnes exception.
Sur junit je n'ai aucune erreures.
Par contre en tapant dans la console Msdos: ant yaps-test là j'ai cinquante erreures.
Est que c' est due à mon organisation fichier eclipse ?
Merci pour votre patience.

mlebihan
Messages : 114
Inscription : 09 févr. 2007 1:03

Message par mlebihan » 22 oct. 2007 17:09

Quelles sont les erreurs?

Que disent les messages sur la console?
De quoi se plaignent-ils?

wfh
Messages : 14
Inscription : 21 oct. 2007 14:48

Message par wfh » 22 oct. 2007 17:28

Code : Tout sélectionner

    [javac]                                     ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\AllT
ests.java:22: cannot find symbol
    [javac] symbol  : class TestSuite
    [javac] location: class AllTests
    [javac]     public static TestSuite suite() {
    [javac]                   ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:3: package junit.framework does not exist
    [javac] import junit.framework.TestCase;
    [javac]                       ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:4: package junit.framework does not exist
    [javac] import junit.framework.TestSuite;
    [javac]                       ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:9: cannot find symbol
    [javac] symbol: class TestCase
    [javac] public final class CustomerDAOTest extends TestCase {
    [javac]                                            ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:17: cannot find symbol
    [javac] symbol  : class TestSuite
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]     public static TestSuite suite() {
    [javac]                   ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerTest.java:3: package junit.framework does not exist
    [javac] import junit.framework.TestCase;
    [javac]                       ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerTest.java:4: package junit.framework does not exist
    [javac] import junit.framework.TestSuite;
    [javac]                       ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerTest.java:9: cannot find symbol
    [javac] symbol: class TestCase
    [javac] public final class CustomerTest extends TestCase {
    [javac]                                         ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerTest.java:15: cannot find symbol
    [javac] symbol  : class TestSuite
    [javac] location: class com.yaps.petstore.CustomerTest
    [javac]     public static TestSuite suite() {
    [javac]                   ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\AllT
ests.java:24: cannot find symbol
    [javac] symbol  : class TestSuite
    [javac] location: class AllTests
    [javac]         final TestSuite suite = new TestSuite();
    [javac]               ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\AllT
ests.java:24: cannot find symbol
    [javac] symbol  : class TestSuite
    [javac] location: class AllTests
    [javac]         final TestSuite suite = new TestSuite();
    [javac]                                     ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\AllT
ests.java:33: package junit.textui does not exist
    [javac]         junit.textui.TestRunner.run(suite());
    [javac]                     ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:18: cannot find symbol
    [javac] symbol  : class TestSuite
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]         return new TestSuite(CustomerDAOTest.class);
    [javac]                    ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:33: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Object with unknonw id should not be found");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:40: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Object with empty id should not be found");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:47: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Object with null id should not be found");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:63: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Object has not been created yet it shouldn't be fo
und");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:74: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Object has been created it should be found");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:83: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("An object with the same id has already been create
d");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:92: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Object has been deleted it shouldn't be found");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:104: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Updating a none existing object should break");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:123: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Object has been created it should be found");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:131: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Updating an object with empty values should break"
);
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:140: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Updating an object with null values should break")
;
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:148: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Object should be found");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:156: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Object has been deleted it shouldn't be found");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:175: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Object has been created it should be found");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:189: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Object should be found");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:200: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Object has been deleted it shouldn't be found");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:214: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]             fail("Deleting an unknown object should break");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:259: cannot find symbol
    [javac] symbol  : method assertEquals(java.lang.String,java.lang.String,java
.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]         assertEquals("firstname", "firstname" + id, customer.getFirs
tname());
    [javac]         ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:260: cannot find symbol
    [javac] symbol  : method assertEquals(java.lang.String,java.lang.String,java
.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]         assertEquals("lastname", "lastname" + id, customer.getLastna
me());
    [javac]         ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:261: cannot find symbol
    [javac] symbol  : method assertEquals(java.lang.String,java.lang.String,java
.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]         assertEquals("city", "city" + id, customer.getCity());
    [javac]         ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:262: cannot find symbol
    [javac] symbol  : method assertEquals(java.lang.String,java.lang.String,java
.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]         assertEquals("country", "cnty" + id, customer.getCountry());

    [javac]         ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:263: cannot find symbol
    [javac] symbol  : method assertEquals(java.lang.String,java.lang.String,java
.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]         assertEquals("state", "state" + id, customer.getState());
    [javac]         ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:264: cannot find symbol
    [javac] symbol  : method assertEquals(java.lang.String,java.lang.String,java
.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]         assertEquals("street1", "street1" + id, customer.getStreet1(
));
    [javac]         ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:265: cannot find symbol
    [javac] symbol  : method assertEquals(java.lang.String,java.lang.String,java
.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]         assertEquals("street2", "street2" + id, customer.getStreet2(
));
    [javac]         ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:266: cannot find symbol
    [javac] symbol  : method assertEquals(java.lang.String,java.lang.String,java
.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]         assertEquals("telephone", "phone" + id, customer.getTelephon
e());
    [javac]         ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerDAOTest.java:267: cannot find symbol
    [javac] symbol  : method assertEquals(java.lang.String,java.lang.String,java
.lang.String)
    [javac] location: class com.yaps.petstore.CustomerDAOTest
    [javac]         assertEquals("zipcode", "zip" + id, customer.getZipcode());
    [javac]         ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerTest.java:16: cannot find symbol
    [javac] symbol  : class TestSuite
    [javac] location: class com.yaps.petstore.CustomerTest
    [javac]         return new TestSuite(CustomerTest.class);
    [javac]                    ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerTest.java:31: cannot find symbol
    [javac] symbol  : method assertEquals(java.lang.String,java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerTest
    [javac]             assertEquals("Bill", customer.getFirstname());
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerTest.java:32: cannot find symbol
    [javac] symbol  : method assertEquals(java.lang.String,java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerTest
    [javac]             assertEquals("Gates", customer.getLastname());
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerTest.java:34: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerTest
    [javac]             fail("Custumer data is OK!");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerTest.java:46: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerTest
    [javac]             fail("Object with empty values should not be created");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerTest.java:48: cannot find symbol
    [javac] symbol  : method assertEquals(java.lang.String,java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerTest
    [javac]             assertEquals("Invalid customer first name", e.getMessage
());
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerTest.java:54: cannot find symbol
    [javac] symbol  : method fail(java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerTest
    [javac]             fail("Object with null values should not be created");
    [javac]             ^
    [javac] C:\Documents and Settings\Philippe\workspace\tp01\Yaps\test\src\com\
yaps\petstore\CustomerTest.java:56: cannot find symbol
    [javac] symbol  : method assertEquals(java.lang.String,java.lang.String)
    [javac] location: class com.yaps.petstore.CustomerTest
    [javac]             assertEquals("Invalid customer first name", e.getMessage
());
    [javac]             ^
    [javac] 50 errors

BUILD FAILED
C:\Documents and Settings\Philippe\workspace\tp01\Yaps\build.xml:94: Compile fai
led; see the compiler error output for details.

Total time: 1 second
C:\Documents and Settings\Philippe\workspace\tp01\Yaps>

wfh
Messages : 14
Inscription : 21 oct. 2007 14:48

Message par wfh » 22 oct. 2007 18:00

Peutêtre que le problem vient que les classes test ne sont pas compiler dans yaps/classes/test/ par contre les sources sont bien compiler dans
yaps/classes/productions/ :?:

mlebihan
Messages : 114
Inscription : 09 févr. 2007 1:03

Message par mlebihan » 22 oct. 2007 19:35

Il y a deux problèmes à mon avis à résoudre.

Le premier, mineur, ne pas utiliser le répertoire Documents and Settings pour son projet, si possible, pour éviter les noms à espaces.

Le deuxième, qui est la cause de vos soucis, est que la variable d'environnement JUNIT_HOME n'est sans doute pas définie.

Il faut la faire pointer à l'emplacement où vous avez téléchargé JUnit 4.4

SET JUNIT_HOME=c:\JUnit4.4
par exemple.

Et une bonne partie des erreurs de compilation devraient être résorbées.

Bonne continuation,

M. Le Bihan

wfh
Messages : 14
Inscription : 21 oct. 2007 14:48

MERCI

Message par wfh » 23 oct. 2007 9:00

j'ai fait ant yaps-test et là j'ai aucunne erreure apres avoir corriger mon code. Le fichier a était compiler.
Le seul hic c'est que j'ai fait plusieur fois ant yaps-test et là ma machine continue sans cesse à faire le test junit qui ne s'arrete pas même apres 10 minute.

Et quand je fait ant yaps-make, cela ne donne rien et la machine continu à mouler sans cesse et ne produit rien.

Que dois je faire? Merci pour toutes aide .

Répondre

Qui est en ligne ?

Utilisateurs parcourant ce forum : Aucun utilisateur inscrit et 1 invité