5252 */
5353public class TestsToRunConverterBuilder extends Builder implements SimpleBuildStep {
5454
55- private TestsToRunConverterModel model ;
55+ private TestsToRunConverterModel framework ;
5656
5757 private final String TESTS_TO_RUN_PARAMETER = "testsToRun" ;
5858 private final String TESTS_TO_RUN_CONVERTED_PARAMETER = "testsToRunConverted" ;
5959
6060 private final String DEFAULT_EXECUTING_DIRECTORY = "${workspace}" ;
6161 private final String CHECKOUT_DIRECTORY_PARAMETER = "testsToRunCheckoutDirectory" ;
6262
63- public TestsToRunConverterBuilder (String model ) {
64- this .model = new TestsToRunConverterModel (model , "" , "" );
63+ public TestsToRunConverterBuilder (String framework ) {
64+ this .framework = new TestsToRunConverterModel (framework , "" , "" );
6565 }
6666
6767 @ DataBoundConstructor
6868 public TestsToRunConverterBuilder (String framework , String format , String delimiter ) {
69- this .model = new TestsToRunConverterModel (framework , format , delimiter );
69+ this .framework = new TestsToRunConverterModel (framework , format , delimiter );
7070 }
7171
7272 @ Override
@@ -106,13 +106,13 @@ public void perform(@Nonnull Run<?, ?> build, @Nonnull FilePath filePath, @Nonnu
106106 return ;
107107 }
108108
109- if (model == null || SdkStringUtils .isEmpty (model . getName ())) {
109+ if (framework == null || SdkStringUtils .isEmpty (getFramework ())) {
110110 printToConsole (listener , "No frameworkModel is selected. Skipping." );
111111 return ;
112112 }
113- String frameworkName = model . getName ();
114- String frameworkFormat = model . getFormat ();
115- String frameworkDelimiter = model . getDelimiter ();
113+ String frameworkName = getFramework ();
114+ String frameworkFormat = getFormat ();
115+ String frameworkDelimiter = getDelimiter ();
116116 printToConsole (listener , "Selected framework = " + frameworkName );
117117 if (SdkStringUtils .isNotEmpty (frameworkFormat )) {
118118 printToConsole (listener , "Using format = " + frameworkFormat );
@@ -127,10 +127,10 @@ public void perform(@Nonnull Run<?, ?> build, @Nonnull FilePath filePath, @Nonnu
127127 printToConsole (listener , TESTS_TO_RUN_CONVERTED_PARAMETER + " = " + convertResult .getConvertedTestsString ());
128128
129129 if (JobProcessorFactory .WORKFLOW_RUN_NAME .equals (build .getClass ().getName ())) {
130- List <ParameterValue > newParams = (parameterAction != null ) ? new ArrayList <>(parameterAction .getAllParameters ()) : new ArrayList <>();
131- newParams .add (new StringParameterValue (TESTS_TO_RUN_CONVERTED_PARAMETER , convertResult .getConvertedTestsString ()));
132- ParametersAction newParametersAction = new ParametersAction (newParams );
133- build .addOrReplaceAction (newParametersAction );
130+ List <ParameterValue > newParams = (parameterAction != null ) ? new ArrayList <>(parameterAction .getAllParameters ()) : new ArrayList <>();
131+ newParams .add (new StringParameterValue (TESTS_TO_RUN_CONVERTED_PARAMETER , convertResult .getConvertedTestsString ()));
132+ ParametersAction newParametersAction = new ParametersAction (newParams );
133+ build .addOrReplaceAction (newParametersAction );
134134 } else {
135135 VariableInjectionAction via = new VariableInjectionAction (TESTS_TO_RUN_CONVERTED_PARAMETER , convertResult .getConvertedTestsString ());
136136 build .addAction (via );
@@ -140,8 +140,8 @@ public void perform(@Nonnull Run<?, ?> build, @Nonnull FilePath filePath, @Nonnu
140140 public Map <String , String > getProperties () {
141141 Map <String , String > properties = new HashMap ();
142142
143- properties .put (TestsToRunConverter .CONVERTER_FORMAT , model . getFormat ());
144- properties .put (TestsToRunConverter .CONVERTER_DELIMITER , model . getDelimiter ());
143+ properties .put (TestsToRunConverter .CONVERTER_FORMAT , getFormat ());
144+ properties .put (TestsToRunConverter .CONVERTER_DELIMITER , getDelimiter ());
145145
146146 return properties ;
147147 }
@@ -151,7 +151,23 @@ public Map<String, String> getProperties() {
151151 * @return
152152 */
153153 public TestsToRunConverterModel getTestsToRunConverterModel () {
154- return model ;
154+ return framework ;
155+ }
156+
157+ /***
158+ * Used in Pipeline
159+ * @return
160+ */
161+ public String getFramework () {
162+ return framework .getFramework ().getName ();
163+ }
164+
165+ public String getDelimiter () {
166+ return framework .getFramework ().getDelimiter ();
167+ }
168+
169+ public String getFormat () {
170+ return framework .getFramework ().getFormat ();
155171 }
156172
157173 private void printToConsole (TaskListener listener , String msg ) {
0 commit comments