I have created a Symbol in TestRunPublisher for descriptor. The code now looks like following:
public class TestUploader extends Publisher implements SimpleBuildStep {
private final String name;
private final String password;
//getters are there for above variables.
@DataBoundConstructor
public TestUploader (String name, String password){
//set the data to class members.
}
@Symbol("TestUploader")
@Extension
ublic static final class DescriptorImpl extends BuildStepDescriptor<Publisher> {
public DescriptorImpl () {
load();
}
}
public boolean isApplicable (Class<? extends AbstractProject> aClass) {return true;}
public String getDisplayName () {return "TestUploader";}
@Override
public boolean configure (StaplerRequest req, JSONObject formData) throws FormException {
save();
return super.configure(req, formData);
}
}
I think I am missing out on something.