Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call java class from jmeter?

Tags:

java

jmeter

I have written simple java program:

package bsh;

import test.Testclass;

public class Whatever {

    public static void main(String args[]){
        Testclass t = new Testclass();
        System.out.println(t.squareIt(8));
    }
}


package test;

public class Testclass {

    public Testclass(){
    }

    public int squareIt(int i){
        return i*i;
    }
}

I have two questions about this java program:

  1. How to execute this java program from jmeter?
  2. How to call sqaureIt(int i) method from jmeter?

How can i achieve this?

like image 712
Ami Avatar asked Nov 25 '22 04:11

Ami


1 Answers

I haven't tried main class execution , but i have certainly executed Junit Testcases through Jmeter

Have a look at this doc Junitsampler tutorial

like image 146
Sudhakar Avatar answered Dec 30 '22 17:12

Sudhakar