IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Tests et Performance Java Discussion :

Unitils et TestNG


Sujet :

Tests et Performance Java

  1. #1
    Membre éprouvé
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    1 705
    Détails du profil
    Informations personnelles :
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations forums :
    Inscription : Janvier 2007
    Messages : 1 705
    Points : 934
    Points
    934
    Par défaut Unitils et TestNG
    Bonjour,

    J'ai lu l'article suivant sur Unitils avec TestNG a http://jeprogrammeetcestmajoie.over-...-46458364.html
    Cet exemple utilise un paUnitils.injectJpaResourcesInto(trucDao), mais cette methode n'est plus utilisé dans unitils 3.3 .

    Merci de votrre aide pour modifier mon code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    package unitils01; 
    import org.unitils.database.util.TransactionMode; 
    import org.testng.annotations.Test; 
    import org.unitils.UnitilsTestNG; 
    import org.unitils.database.annotations.Transactional; 
    import org.unitils.orm.jpa.JpaUnitils; 
    import org.unitils.orm.jpa.annotation.JpaEntityManagerFactory; 
    
    @Transactional(TransactionMode.ROLLBACK) @JpaEntityManagerFactory(configFile = "META-INF/persistence-test.xml", persistenceUnit = "trucUnitTest") 
    public class TrucDaoImplTest extends UnitilsTestNG { @Test
    public void testFindByName() { 
    Truc truc = null; 
    TrucDao trucDao = new TrucDaoImpl();
     JpaUnitils.injectJpaResourcesInto(trucDao); //N existe plus ??? 
    truc = trucDao.findByName("coco"); 
    // asserts et tout et tout 
    }

  2. #2
    Membre éprouvé
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    1 705
    Détails du profil
    Informations personnelles :
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations forums :
    Inscription : Janvier 2007
    Messages : 1 705
    Points : 934
    Points
    934
    Par défaut
    Bonjour

    La reponse semble etre de mettre la ligne
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    JpaUnitils.injectEntityManagerInto(trucDao);
    Par contre mon test est en erreur avec le log suivant
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
     
    Running unitils01.TrucDaoImplTest
    18 mai 2012 07:07:18 org.unitils.core.ConfigurationLoader loadLocalConfiguration
    INFO: No local configuration file unitils-local.properties found.
    18 mai 2012 07:07:18 org.hibernate.cfg.annotations.Version <clinit>
    INFO: Hibernate Annotations 3.3.1.GA
    18 mai 2012 07:07:18 org.unitils.database.config.PropertiesDataSourceFactory createDataSource
    INFO: Creating data source. Driver: org.hsqldb.jdbcDriver, url: jdbc:hsqldb:mem:unitTestDB, user: sa, password: <not shown>
    Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.641 sec <<< FAILURE!
     
    Results :
     
    Failed tests:   unitilsAfterTestTearDown(unitils01.TrucDaoImplTest): Invalid XML in persistence unit from class path resource [META-INF/persistence-test.xml]
      testFindByName(unitils01.TrucDaoImplTest): Invalid XML in persistence unit from class path resource [META-INF/persistence-test.xml]
     
    Tests run: 2, Failures: 2, Errors: 0, Skipped: 0
     
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4.593s
    [INFO] Finished at: Fri May 18 07:07:18 CEST 2012
    [INFO] Final Memory: 11M/28M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project unitils01: There are test failures.
    [ERROR]
    [ERROR] Please refer to C:\prj_java\TestAgarder\unitils01\target\surefire-reports for the individual test results.
    [ERROR] -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on projec
    t unitils01: There are test failures.
     
    Please refer to C:\prj_java\TestAgarder\unitils01\target\surefire-reports for the individual test results.
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    et mon fichier XML persistence-test.xml
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
     
    	 <?xml version="1.0" encoding="UTF-8"?>
    <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0">   
    <persistence-unit name="trucUnitTest" transaction-type="RESOURCE_LOCAL">
         <provider>org.hibernate.ejb.HibernatePersistence</provider>
    	   <class>Truc</class>
         <properties>
    	 <property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
    	 <property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:mem:unitTestDB"/>
    	 <property name="javax.persistence.jdbc.user" value="sa"/>
    	 <property name="javax.persistence.jdbc.password" value=""/>
    	 <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
    	 <property name="hibernate.hbm2ddl.auto" value="update"/>
         </properties>
    	 </persistence-unit>
    	 </persistence>
    Mon fichier XML me semble correct, mais il dois y avoir une erreur ?
    Merci d'avance
    Philippe

  3. #3
    Membre éprouvé
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    1 705
    Détails du profil
    Informations personnelles :
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations forums :
    Inscription : Janvier 2007
    Messages : 1 705
    Points : 934
    Points
    934
    Par défaut
    Bonjour,

    J'avais un caractere special dans mon fichier de persistence, desormais j'ai cela
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
     
    iance:aopalliance:jar:1.0:test, org.springframework:spring-orm=org.springframework:spring-orm:jar:2.5.2:test, org.unitils:unitils-dbmaintainer=org.unitils:uniti
    ls-dbmaintainer:jar:3.3:test, org.hibernate:hibernate=org.hibernate:hibernate:jar:3.2.5.ga:test, net.sf.ehcache:ehcache=net.sf.ehcache:ehcache:jar:1.2.3:test, a
    sm:asm-attrs=asm:asm-attrs:jar:1.5.3:test, dom4j:dom4j=dom4j:dom4j:jar:1.6.1:test, antlr:antlr=antlr:antlr:jar:2.7.6:test, cglib:cglib=cglib:cglib:jar:2.1_3:tes
    t, asm:asm=asm:asm:jar:1.5.3:test, org.unitils:unitils-easymock=org.unitils:unitils-easymock:jar:3.3:test, org.easymock:easymock=org.easymock:easymock:jar:2.3:t
    est, org.easymock:easymockclassextension=org.easymock:easymockclassextension:jar:2.3:test, org.unitils:unitils-testng=org.unitils:unitils-testng:jar:3.3:test, o
    rg.testng:testng=org.testng:testng:jar:5.14:test, org.unitils:unitils-inject=org.unitils:unitils-inject:jar:3.3:test, org.dbunit:dbunit=org.dbunit:dbunit:jar:2.
    4.8:test, org.slf4j:slf4j-api=org.slf4j:slf4j-api:jar:1.5.6:test, junit:junit=junit:junit:jar:3.8.2:test, commons-collections:commons-collections=commons-collec
    tions:commons-collections:jar:3.2.1:test, hsqldb:hsqldb=hsqldb:hsqldb:jar:1.8.0.10:test, org.beanshell:bsh=org.beanshell:bsh:jar:2.0b4:test, com.google.inject:g
    uice=com.google.inject:guice:jar:2.0:test, com.beust:jcommander=com.beust:jcommander:jar:1.5:test, javax.persistence:persistence-api=javax.persistence:persisten
    ce-api:jar:1.0:compile, org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec=org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:jar:1.0.1.Final:compile, org.springframe
    work:spring=org.springframework:spring:jar:2.5.5:test, commons-logging:commons-logging=commons-logging:commons-logging:jar:1.1.1:test, org.hibernate:hibernate-e
    ntitymanager=org.hibernate:hibernate-entitymanager:jar:3.3.2.GA:test, org.hibernate:hibernate-annotations=org.hibernate:hibernate-annotations:jar:3.3.1.GA:test,
     org.hibernate:hibernate-commons-annotations=org.hibernate:hibernate-commons-annotations:jar:3.0.0.ga:test, org.hibernate:ejb3-persistence=org.hibernate:ejb3-pe
    rsistence:jar:1.0.1.GA:test, javassist:javassist=javassist:javassist:jar:3.4.GA:test}
    [DEBUG]   (s) redirectTestOutputToFile = false
    [DEBUG]   (s) remoteRepositories = [       id: central
          url: http://repo.maven.apache.org/maven2
       layout: default
    snapshots: [enabled => false, update => daily]
     releases: [enabled => true, update => never]
    ]
    [DEBUG]   (s) reportFormat = brief
    [DEBUG]   (s) reportsDirectory = C:\prj_java\TestAgarder\unitils01\target\surefire-reports
    [DEBUG]   (s) runOrder = filesystem
    [DEBUG]   (s) session = org.apache.maven.execution.MavenSession@4e2f0a
    [DEBUG]   (s) skip = false
    [DEBUG]   (s) skipTests = false
    [DEBUG]   (s) testClassesDirectory = C:\prj_java\TestAgarder\unitils01\target\test-classes
    [DEBUG]   (s) testFailureIgnore = false
    [DEBUG]   (s) testNGArtifactName = org.testng:testng
    [DEBUG]   (s) testSourceDirectory = C:\prj_java\TestAgarder\unitils01\src\test\java
    [DEBUG]   (s) trimStackTrace = true
    [DEBUG]   (s) useFile = true
    [DEBUG]   (s) useManifestOnlyJar = true
    [DEBUG]   (s) useSystemClassLoader = true
    [DEBUG]   (s) useUnlimitedThreads = false
    [DEBUG]   (s) workingDirectory = C:\prj_java\TestAgarder\unitils01
    [DEBUG] -- end configuration --
    [INFO] Surefire report directory: C:\prj_java\TestAgarder\unitils01\target\surefire-reports
    [DEBUG] dummy:dummy:jar:1.0 (selected for null)
    [DEBUG]   org.apache.maven.surefire:surefire-booter:jar:2.10:compile (selected for compile)
    [DEBUG]     org.apache.maven.surefire:surefire-api:jar:2.10:compile (selected for compile)
    [DEBUG] Adding to surefire booter test classpath: C:\Documents and Settings\COUAS\.m2\repository\org\apache\maven\surefire\surefire-booter\2.10\surefire-booter-
    2.10.jar Scope: compile
    [DEBUG] Adding to surefire booter test classpath: C:\Documents and Settings\COUAS\.m2\repository\org\apache\maven\surefire\surefire-api\2.10\surefire-api-2.10.j
    ar Scope: compile
    [DEBUG] Setting system property [user.dir]=[C:\prj_java\TestAgarder\unitils01]
    [DEBUG] Setting system property [localRepository]=[C:\Documents and Settings\COUAS\.m2\repository]
    [DEBUG] Setting system property [basedir]=[C:\prj_java\TestAgarder\unitils01]
    [DEBUG] Using JVM: C:\java\jdk1.6.0_21\jre\bin\java
    [DEBUG] dummy:dummy:jar:1.0 (selected for null)
    [DEBUG]   org.apache.maven.surefire:surefire-testng:jar:2.10:test (selected for test)
    [DEBUG]     org.apache.maven:maven-artifact:jar:2.0:test (selected for test)
    [DEBUG]       org.codehaus.plexus:plexus-utils:jar:1.0.4:test (selected for test)
    [DEBUG]     org.apache.maven.surefire:surefire-testng-utils:jar:2.10:test (selected for test)
    [DEBUG]       org.testng:testng:jar:jdk15:5.7:test (selected for test)
    [DEBUG]         junit:junit:jar:3.8.1:test (selected for test)
    [DEBUG]       org.apache.maven.surefire:surefire-api:jar:2.10:test (selected for test)
    [DEBUG]     org.testng:testng:jar:jdk15:5.7:test (selected for test)
    [DEBUG]       junit:junit:jar:3.8.1:test (selected for test)
    [DEBUG]     org.apache.maven.surefire:surefire-api:jar:2.10:test (selected for test)
    [DEBUG] Adding to surefire test classpath: C:\Documents and Settings\COUAS\.m2\repository\org\apache\maven\surefire\surefire-testng\2.10\surefire-testng-2.10.ja
    r Scope: test
    [DEBUG] Adding to surefire test classpath: C:\Documents and Settings\COUAS\.m2\repository\org\apache\maven\maven-artifact\2.0\maven-artifact-2.0.jar Scope: test
     
    [DEBUG] Adding to surefire test classpath: C:\Documents and Settings\COUAS\.m2\repository\org\codehaus\plexus\plexus-utils\1.0.4\plexus-utils-1.0.4.jar Scope: t
    est
    [DEBUG] Adding to surefire test classpath: C:\Documents and Settings\COUAS\.m2\repository\org\apache\maven\surefire\surefire-testng-utils\2.10\surefire-testng-u
    tils-2.10.jar Scope: test
    [DEBUG] Adding to surefire test classpath: C:\Documents and Settings\COUAS\.m2\repository\org\apache\maven\surefire\surefire-api\2.10\surefire-api-2.10.jar Scop
    e: test
    [DEBUG] test classpath classpath:
    [DEBUG]   C:\prj_java\TestAgarder\unitils01\target\test-classes
    [DEBUG]   C:\prj_java\TestAgarder\unitils01\target\classes
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\unitils\unitils-dbunit\3.3\unitils-dbunit-3.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\unitils\unitils-core\3.3\unitils-core-3.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\commons-lang\commons-lang\2.3\commons-lang-2.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\ognl\ognl\2.6.9\ognl-2.6.9.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\unitils\unitils-database\3.3\unitils-database-3.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\commons-dbcp\commons-dbcp\1.2.2\commons-dbcp-1.2.2.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\commons-pool\commons-pool\1.3\commons-pool-1.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\springframework\spring-jdbc\2.5.2\spring-jdbc-2.5.2.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\springframework\spring-beans\2.5.2\spring-beans-2.5.2.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\springframework\spring-core\2.5.2\spring-core-2.5.2.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\springframework\spring-tx\2.5.2\spring-tx-2.5.2.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\unitils\unitils-orm\3.3\unitils-orm-3.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\unitils\unitils-spring\3.3\unitils-spring-3.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\springframework\spring-test\2.5.2\spring-test-2.5.2.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\springframework\spring-context\2.5.2\spring-context-2.5.2.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\springframework\spring-orm\2.5.2\spring-orm-2.5.2.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\unitils\unitils-dbmaintainer\3.3\unitils-dbmaintainer-3.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\hibernate\hibernate\3.2.5.ga\hibernate-3.2.5.ga.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\net\sf\ehcache\ehcache\1.2.3\ehcache-1.2.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\asm\asm-attrs\1.5.3\asm-attrs-1.5.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\antlr\antlr\2.7.6\antlr-2.7.6.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\cglib\cglib\2.1_3\cglib-2.1_3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\asm\asm\1.5.3\asm-1.5.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\unitils\unitils-easymock\3.3\unitils-easymock-3.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\easymock\easymock\2.3\easymock-2.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\easymock\easymockclassextension\2.3\easymockclassextension-2.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\unitils\unitils-testng\3.3\unitils-testng-3.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\testng\testng\5.8\testng-5.8-jdk15.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\unitils\unitils-inject\3.3\unitils-inject-3.3.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\dbunit\dbunit\2.4.8\dbunit-2.4.8.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\slf4j\slf4j-api\1.5.6\slf4j-api-1.5.6.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\junit\junit\3.8.2\junit-3.8.2.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\hsqldb\hsqldb\1.8.0.10\hsqldb-1.8.0.10.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\testng\testng\5.14\testng-5.14.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\beanshell\bsh\2.0b4\bsh-2.0b4.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\com\google\inject\guice\2.0\guice-2.0.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\com\beust\jcommander\1.5\jcommander-1.5.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\javax\persistence\persistence-api\1.0\persistence-api-1.0.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\jboss\spec\javax\ejb\jboss-ejb-api_3.1_spec\1.0.1.Final\jboss-ejb-api_3.1_spec-1.0.1.Final.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\springframework\spring\2.5.5\spring-2.5.5.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\hibernate\hibernate-entitymanager\3.3.2.GA\hibernate-entitymanager-3.3.2.GA.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\hibernate\hibernate-annotations\3.3.1.GA\hibernate-annotations-3.3.1.GA.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\hibernate\hibernate-commons-annotations\3.0.0.ga\hibernate-commons-annotations-3.0.0.ga.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\hibernate\ejb3-persistence\1.0.1.GA\ejb3-persistence-1.0.1.GA.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\javassist\javassist\3.4.GA\javassist-3.4.GA.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\apache\maven\surefire\surefire-testng-utils\2.10\surefire-testng-utils-2.10.jar
    [DEBUG] provider classpath classpath:
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\apache\maven\surefire\surefire-testng\2.10\surefire-testng-2.10.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\apache\maven\maven-artifact\2.0\maven-artifact-2.0.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\codehaus\plexus\plexus-utils\1.0.4\plexus-utils-1.0.4.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\apache\maven\surefire\surefire-testng-utils\2.10\surefire-testng-utils-2.10.jar
    [DEBUG]   C:\Documents and Settings\COUAS\.m2\repository\org\apache\maven\surefire\surefire-api\2.10\surefire-api-2.10.jar
     
    -------------------------------------------------------
     T E S T S
    -------------------------------------------------------
    Forking command line: cmd.exe /X /C "C:\java\jdk1.6.0_21\jre\bin\java -jar C:\prj_java\TestAgarder\unitils01\target\surefire\surefirebooter4067884344920011423.j
    ar C:\prj_java\TestAgarder\unitils01\target\surefire\surefire2315763711425898304tmp C:\prj_java\TestAgarder\unitils01\target\surefire\surefire121556818303990866
    5tmp"
    Running unitils01.TrucDaoImplTest
    26 mai 2012 11:29:01 org.unitils.core.ConfigurationLoader loadLocalConfiguration
    INFO: No local configuration file unitils-local.properties found.
    26 mai 2012 11:29:01 org.hibernate.cfg.annotations.Version <clinit>
    INFO: Hibernate Annotations 3.3.1.GA
    26 mai 2012 11:29:01 org.unitils.database.config.PropertiesDataSourceFactory createDataSource
    INFO: Creating data source. Driver: org.hsqldb.jdbcDriver, url: jdbc:hsqldb:mem:unitTestDB, user: sa, password: <not shown>
    26 mai 2012 11:29:01 org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean createNativeEntityManagerFactory
    INFO: Building JPA container EntityManagerFactory for persistence unit 'trucUnitTest'
    26 mai 2012 11:29:01 org.hibernate.cfg.Environment <clinit>
    INFO: Hibernate 3.2.5
    26 mai 2012 11:29:01 org.hibernate.cfg.Environment <clinit>
    INFO: hibernate.properties not found
    26 mai 2012 11:29:01 org.hibernate.cfg.Environment buildBytecodeProvider
    INFO: Bytecode provider name : cglib
    26 mai 2012 11:29:01 org.hibernate.cfg.Environment <clinit>
    INFO: using JDK 1.4 java.sql.Timestamp handling
    26 mai 2012 11:29:01 org.hibernate.ejb.Version <clinit>
    INFO: Hibernate EntityManager 3.3.2.GA
    26 mai 2012 11:29:01 org.hibernate.ejb.Ejb3Configuration configure
    INFO: Processing PersistenceUnitInfo [
            name: trucUnitTest
            ...]
    26 mai 2012 11:29:02 org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: unitils01.Truc
    26 mai 2012 11:29:02 org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity unitils01.Truc on table TAB_TRUC
    26 mai 2012 11:29:02 org.hibernate.cfg.AnnotationConfiguration secondPassCompile
    INFO: Hibernate Validator not found: ignoring
    26 mai 2012 11:29:02 org.hibernate.connection.ConnectionProviderFactory newConnectionProvider
    INFO: Initializing connection provider: org.hibernate.connection.DriverManagerConnectionProvider
    26 mai 2012 11:29:02 org.hibernate.connection.DriverManagerConnectionProvider configure
    INFO: Using Hibernate built-in connection pool (not for production use!)
    26 mai 2012 11:29:02 org.hibernate.connection.DriverManagerConnectionProvider configure
    INFO: Hibernate connection pool size: 20
    26 mai 2012 11:29:02 org.hibernate.connection.DriverManagerConnectionProvider configure
    INFO: autocommit mode: true
    26 mai 2012 11:29:02 org.hibernate.connection.DriverManagerConnectionProvider configure
    INFO: using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:mem:unit-testing-jpa
    26 mai 2012 11:29:02 org.hibernate.connection.DriverManagerConnectionProvider configure
    INFO: connection properties: {user=sa, password=****, autocommit=true, type=DEBUG, show_sql=true, release_mode=auto}
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: RDBMS: HSQL Database Engine, version: 1.8.0
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: JDBC driver: HSQL Database Engine Driver, version: 1.8.0
    26 mai 2012 11:29:02 org.hibernate.dialect.Dialect <init>
    INFO: Using dialect: org.hibernate.dialect.HSQLDialect
    26 mai 2012 11:29:02 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
    INFO: Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
    26 mai 2012 11:29:02 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
    INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Automatic flush during beforeCompletion(): disabled
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Automatic session close at end of transaction: disabled
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: JDBC batch size: 15
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: JDBC batch updates for versioned data: disabled
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Scrollable result sets: enabled
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: JDBC3 getGeneratedKeys(): disabled
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Connection release mode: auto
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Default batch fetch size: 1
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Generate SQL with comments: disabled
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Order SQL updates by primary key: disabled
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Order SQL inserts for batching: disabled
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
    INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
    26 mai 2012 11:29:02 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
    INFO: Using ASTQueryTranslatorFactory
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Query language substitutions: {}
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: JPA-QL strict compliance: enabled
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Second-level cache: enabled
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Query cache: disabled
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory createCacheProvider
    INFO: Cache provider: org.hibernate.cache.NoCacheProvider
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Optimize cache for minimal puts: disabled
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Structured second-level cache entries: disabled
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Statistics: disabled
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Deleted entity synthetic identifier rollback: disabled
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Default entity-mode: pojo
    26 mai 2012 11:29:02 org.hibernate.cfg.SettingsFactory buildSettings
    INFO: Named query checking : enabled
    26 mai 2012 11:29:02 org.hibernate.impl.SessionFactoryImpl <init>
    INFO: building session factory
    26 mai 2012 11:29:02 org.hibernate.impl.SessionFactoryObjectFactory addInstance
    INFO: Not binding factory to JNDI, no JNDI name configured
    Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 1.532 sec <<< FAILURE!
     
    Results :
     
    Failed tests:   unitilsAfterTestTearDown(unitils01.TrucDaoImplTest)
      testFindByName(unitils01.TrucDaoImplTest): javax/transaction/SystemException
     
    Tests run: 2, Failures: 2, Errors: 0, Skipped: 0
     
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 5.406s
    [INFO] Finished at: Sat May 26 11:29:02 CEST 2012
    [INFO] Final Memory: 11M/28M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project unitils01: There are test failures.
    [ERROR]
    [ERROR] Please refer to C:\prj_java\TestAgarder\unitils01\target\surefire-reports for the individual test results.
    [ERROR] -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on projec
    t unitils01: There are test failures.
     
    Please refer to C:\prj_java\TestAgarder\unitils01\target\surefire-reports for the individual test results.
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
            at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
            at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
            at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
            at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
            at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
            at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
            at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
            at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
            at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
    Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.
     
    Please refer to C:\prj_java\TestAgarder\unitils01\target\surefire-reports for the individual test results.
            at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:87)
            at org.apache.maven.plugin.surefire.SurefirePlugin.writeSummary(SurefirePlugin.java:641)
            at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:615)
            at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:137)
            at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:98)
            at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
            ... 19 more
    [ERROR]
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
    Appuyez sur une touche pour continuer...

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Net Beans et TESTNG
    Par aymen007 dans le forum NetBeans
    Réponses: 1
    Dernier message: 06/01/2009, 09h54
  2. [TestNG] TestNG avec maven
    Par douz12 dans le forum Tests et Performance
    Réponses: 2
    Dernier message: 10/12/2008, 17h16
  3. TestNG : Connection timed out
    Par onclezeb dans le forum Seam
    Réponses: 1
    Dernier message: 13/06/2008, 11h24
  4. [TestNG] problèmes avec testNG
    Par bard123 dans le forum Tests et Performance
    Réponses: 2
    Dernier message: 16/05/2008, 16h24

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo