Problème maven-jmeter--plugin et JDBCSampler
Bonjour à tous,
J'utilise Jmeter lors de mes tests d'intégration afin d'insérer un jeu de données fixe dans ma base de données.
Je souhaiterais auparavant vider le contenu de certaines tables de ma base, j'utilise pour cela JDBCSampler et JDBCDataSource dans mon script jmx.
Ce script fonctionne très bien lorsque je l'exécute dans Jmeter, cependant lors de l'exécution par le plugin maven maven-jmeter--plugin, j'obtiens une erreur :
Code:
1 2 3 4
| [INFO] Executing test: /root/workspace/testsJmeter/src/test/jmeter/JDD-SuppreBase.jmx
Created the tree successfully using /root/workspace/testsJmeter/src/test/jmeter/JDD-SuppreBase.jmx
Starting the test @ Wed Jul 28 13:58:19 CEST 2010 (1280318299762)
Uncaught Exception java.lang.NoClassDefFoundError: org/apache/excalibur/instrument/Instrumentable. See log file for details. |
Dans mon fichier jmeter.properties de mon projet eclipse, j'ai modifier la clé user.classpath pour ajouter le jar excalibur-instrument qui contient la classe manquante mais ca ne change rien à l'erreur.
Ce problème ne se produit pas si mon script jmx fait uniquement des requetes Soap via le SOAPSampler.
Ci joint l'extrait de mon pom.xml :
Code:
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
| <profile>
<id>JMETER</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<id>build-classpath</id>
<phase>generate-resources</phase>
<goals>
<goal>build-classpath</goal>
</goals>
<configuration>
<cpFile>${project.build.directory}/classpath</cpFile>
<includeScope>test</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.jmeter</groupId>
<artifactId>maven-jmeter-plugin</artifactId>
<version>1.2-DGFIP</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>test</phase>
<goals>
<goal>jmeter</goal>
</goals>
<configuration>
<reportDir>${project.build.directory}/jmeter-reports</reportDir>
<classpathDump>${project.build.directory}/classpath</classpathDump>
<includes>
<include>JDD-SuppreBase.jmx</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile> |
Ci joint mon script jmx :
Code:
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
|
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.1">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Plan de test" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="Variables pré-définies" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Groupe d'unités" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Contrôleur Boucle" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">1</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">1</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
<longProp name="ThreadGroup.start_time">1280233184000</longProp>
<longProp name="ThreadGroup.end_time">1280233184000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="Requête JDBC" enabled="true">
<stringProp name="dataSource">test</stringProp>
<stringProp name="queryType">Select Statement</stringProp>
<stringProp name="query">BEGIN; DELETE FROM itmts.t_emetteur_trace; DELETE FROM itmts.t_metier_trace;
DELETE FROM itmts.t_trace_principale;END;</stringProp>
<stringProp name="queryArguments"></stringProp>
<stringProp name="queryArgumentsTypes"></stringProp>
<stringProp name="variableNames"></stringProp>
</JDBCSampler>
<hashTree/>
<JDBCDataSource guiclass="TestBeanGUI" testclass="JDBCDataSource" testname="Configuration de connexion JDBC" enabled="true">
<stringProp name="dataSource">test</stringProp>
<stringProp name="poolMax">10</stringProp>
<stringProp name="timeout">10000</stringProp>
<stringProp name="trimInterval">60000</stringProp>
<boolProp name="autocommit">true</boolProp>
<boolProp name="keepAlive">true</boolProp>
<stringProp name="connectionAge">5000</stringProp>
<stringProp name="checkQuery"></stringProp>
<stringProp name="dbUrl">jdbc:postgresql://XX.XX.XX.XX:XX/XX</stringProp>
<stringProp name="driver">org.postgresql.Driver</stringProp>
<stringProp name="username">XXX</stringProp>
<stringProp name="password">XXX</stringProp>
</JDBCDataSource>
<hashTree/>
</hashTree>
</hashTree>
</hashTree>
</jmeterTestPlan> |
Merci d'avance pour votre aide,