2012-08-13 5 views
3

안녕하세요, lazerycode에서 jmeter-maven-plugin으로 JMeter로드 밸런싱 테스트를 자동화하려고합니다. My JMeter 테스트는 maven-jar-plugin으로 테스트 - 항아리에 압축 된 premade junit 클래스 파일을 사용합니다. 그러나 jar 파일이 로컬 maven 저장소에 설치되기 전에 maven은 jmeter 테스트를 시작합니다. jmeter 플러그인에서 종속성으로 사용할 수 있도록 테스트 - jar을 설치할 수있는 방법이 있습니까? 아래에서 jmeter 플러그인 구성을 찾을 수 있습니다.jmeter plugin maven test-jar

<plugin> 
      <groupId>com.lazerycode.jmeter</groupId> 
      <artifactId>jmeter-maven-plugin</artifactId> 
      <version>1.4.1</version> 
      <executions> 
       <execution> 
        <id>jmeter-test</id> 
        <phase>integration-test</phase> 
        <goals> 
         <goal>jmeter</goal> 
        </goals> 
       </execution> 
      </executions> 
      <dependencies> 
       <dependency> 
        <groupId>groupID</groupId> 
        <artifactId>artifactID</artifactId> 
        <version>${project-version}</version> 
        <type>test-jar</type> 
       </dependency> 
      </dependencies> 
      <configuration> 
       <propertiesUser> 
        <current.protocol>http</current.protocol> 
        <current.dns>localhost</current.dns> 
        <current.port>8088</current.port> 
       </propertiesUser> 
       <testFilesDirectory>${basedir}/src/jmeter/tests/</testFilesDirectory> 
       <ignoreResultErrors>true</ignoreResultErrors> 
       <ignoreResultFailures>true</ignoreResultFailures> 
       <useOldTestEndDetection>true</useOldTestEndDetection> 
      </configuration> 
     </plugin> 

들으

답변

3

테스트 용기를 다른 모듈에 넣은 다음 해당 모듈에 종속 된 jmeter 플러그인을 사용하여 프로젝트를 만듭니다. 그런 다음 테스트를 설치하고 단일 Maven 호출로 jmeter에서 테스트를 실행할 수 있습니다.

+0

감사합니다.이 문제가 해결되었습니다. :) –

1

나는 활성화 프로필을 사용하여이 문제를 해결 : -

<profiles> 
     <profile> 
       <id>ptest</id> 
       <activation> 
        <property> 
         <name>ptest</name> 
        </property> 
       </activation> 

       <build> 

        <resources> 
         <resource> 
          <directory>src/jmeter</directory> 
         </resource> 
        </resources> 

        <plugins> 
         <plugin> 
          <groupId>com.lazerycode.jmeter</groupId> 
          <artifactId>jmeter-maven-plugin</artifactId> 
          <version>1.4.1</version> 
          <executions> 
           <execution> 
            <id>jmeter-tests</id> 
            <phase>verify</phase> 
            <goals> 
             <goal>jmeter</goal> 
            </goals> 
           </execution> 
          </executions> 
          <configuration> 
           <useOldTestEndDetection>true</useOldTestEndDetection> 
          </configuration> 
         </plugin> 
        </plugins> 
       </build> 
      </profile> 
    </profiles> 

프로파일을 사용하지 않는, 한 번 설치 한 다음 프로필을 연속적으로 실행할 수있는이 방법을 사용 켜져있다.