The following describes the plugin structure in nGrinder.
nGrinder uses the Atlanssian Plugin Framwork to customize nGrinder behavior without modifying nGrinder code .
nGrinder supports the following plugin extension points to fit nGrinder to your environments.
/**
* Plugin extension for {@link PerfTest} start and finish.
*
* This plugin is necessary if you want to report the test start and end.
*
* @author JunHo Yoon
* @since 3.0
*/
public interface OnTestStartRunnable {
/**
* method which will be invoked whenever {@link PerfTest} is started.
*
* @param perfTest
* Performance Test
* @param perfTestService
* perfTestService interface
* @param version
* ngrinder version
*/
public void start(PerfTest perfTest, IPerfTestService perfTestService, String version);
/**
* method which will be invoked whenever {@link PerfTest} is finished
*
*
* @param perfTest
* Performance Test
* @param reason
* stop reason
* @param perfTestService
* perfTestService interface
* @param vesion
* ngrinder version
*/
public void finish(PerfTest perfTest, String stopReason, IPerfTestService perfTestService, String vesion);
}
/**
* Plugin extension for user authentication.
*
* @author JunHo Yoon
* @since 3.0
*/
public interface OnLoginRunnable {
/**
* Load user by userId
*
* @param userId
* @return User instance
*/
public User loadUser(String userId);
/**
* Validate user by userId and password.
*
* Against password can be provided by plugin. In such case encPass, encoder, salt might be null.
*
* @param userId
* user providing id
* @param password
* user providing password
* @param encPass
* encrypted password
* @param encoder
* encoder which encrypts password
* @param salt
* salt of encoding
* @return true is validated
*/
public boolean validateUser(String userId, String password, String encPass, Object encoder, Object salt);
/**
* Save user in plugin.<br/>
* This method is only necessary to implement if there is need to save the user in the plugin. Generally dummy
* implementation is enough.
*
* @param user
* user to be saved.
*/
public void saveUser(User user);
}
Each nGrinder admin can create his or her own plugin by implementing above interfaces based on the atlassian plugin architecture.
The first step is to download Atlassian Plugin Framework SDK