h1(#Test2). Yakindu SCT Testcase 07 - Custom Generators

|_. Nr |_. Testname |_. Test Instructions |_. Postconditions |_. Status|
| 7.1 | Create Xtend2/Java Generator | Select the TestProject in the Package Explorer<p>Select *File->New->Project...*</p><p>Select YAKINDU SCT-> *Xtend2/Java Generator Project*</p><p>Click on Next button</p><p>Enter TestProject.generator.xtend as Project name</p><p>Enter testproject.generator.xtend.XtendGenerator as Generator class</p><p>Check Use Xtend checkbox</p><p>Click on Finish button</p> | Project *TestProject.generator.xtend* has been created in the workspace. | %{color:red}open% |
| 7.1.1 | Create Generator Model for Custom Xtend/Java Generator | Select TestProject in project explorer.<p>Select *File→New→Other* from the menu.</p><p>Select *YAKINDU SCT→Code Generator Model*.</p><p>Click *Next*.</p><p>As file name, enter StaircaseXtend.sgen.</p> <p>Click *Next*.</p><p>Select Custom Xtend2/Java-based Generator and check Staircase.sct.</p><p>Click on *Finish* button.</p> | File StaircaseXtend.sgen has been created with initial settings. (errors occur due to not found generator) | %{color:red}open% |
| 7.1.2 | Add Project to buildpath | Open the properties of the TestProject project (*rightclick → Properties or [Alt+Enter]*).<p>Select *Java Build Path*.</p><p>Select tab *Projects*.</p><p>Click *Add…*.</p><p>Add TestProject.generator.xtend.</p><p>Click *OK*.</p> |  | %{color:red}open% |
| 7.1.3 | Setup Xtend Generator Model | Open the file StaircaseXtend.sgen and set the following features:<p>&emsp;- targetFolder = "src-gen-xtend"<br>&emsp;- generatorProject = "TestProject.generator.xtend"<br>&emsp;- generatorClass = "testproject.generator.xtend.XtendGenerator"</p><p>Save the file. | Folder src-gen-xtend with generated code created.</p> | %{color:red}open% |
| 7.2| Create Java Generator | Select the TestProject in the Package Explorer<p>Select *File->New->Project...*<p>Select *YAKINDU SCT-> Xtend2/Java Generator Project*<p>Click on *Next* button<p>Enter TestProject.generator.java as Project name<p>Enter TestProject.generator.java.JavaGenerator as Generator class<p>Check *no* checkbox<p>Click on *Finish* button | Project TestProject.generator.java has been created in the workspace. | %{color:red}open% |
| 7.2.1 | Add Project to buildpath | Open the properties of the TestProject project (*rightclick → Properties or [Alt+Enter]*).<p>Select *Java Build Path*.</p><p>Select tab *Projects*.</p><p>Click *Add…*.</p><p>Add TestProject.generator.java.</p><p>Click *OK*.</p> | No errors occurred. | %{color:red}open% |
| 7.2.2 | Create Generator Model for Java  | Select TestProject in project explorer.<p>Select *File→New→Other* from the menu.<p>Select *YAKINDU SCT→Code Generator Model*.<p>Click *Next*.<p>As file name, enter JavaTestcase.sgen.<p>Click Next.<p>Select Custom Xtend2/Java-based Generator and check Staircase.sct.<p>Click on *Finish* button. | File JavaTestcase.sgen has been created with initial settings. | %{color:red}open% |
| 7.2.3 | Setup Java Generator Model | Open the file JavaTestcase.sgen and set the following features:<p> - targetFolder = "src-gen-java"<br> - generatorProject = "TestProject.generator.java"<br> - generatorClass = "Testproject.generator.java.JavaGenerator"<p>Save the file. | Folder src-gen-java has been created and populated with generated code. | %{color:red}open% |
| 7.3 | Create Custom Generator | Select the TestProject in the Package Explorer<p>Select *File->New->Project...*<p>Select *YAKINDU SCT-> Xtend2/Java Generator Project*<p>Click on *Next* button<p>Enter TestProject.generator.custom as Project name<p>Enter TestProject.generator.custom.CustomGenerator as Generator class<p>Check *Use Xtend* and *Configure for Plugin Export* checkbox<p>Enter CustomGenerator as Generator name.<p>Click on *Finish* button | Project TestProject.generator.custom has been created in the workspace. | %{color:red}open% |
| 7.3.1 | Use the new Generator Plugin | Select *File -> Export... -> Plug-in Development -> Deployable plug-ins and fragments*<p> <p>Click *next*<p><p>Check TestProject.generator.custom<p> <p>Choose some arbitrary target folder<p><p>Copy the exported *jar* file into the *plugins* folder of the product installation<p><p>Go back to SCT and select <p>*File -> Restart* | no errors should appear | %{color:red}open% |
| 7.3.3 | Create Generator Model for Custom | Select TestProject in project explorer.<p>Select *File→New→Other* from the menu.<p>Select *YAKINDU SCT→Code Generator Model*.<p>Click *Next*.<p>As file name, enter CustomTestcase.sgen.<p>Click Next.<p>Select Custom Generator and check Staircase.sct.<p>Click on *Finish* button. | A new option is visible in the dropdown menu <p>File CustomTestcase.sgen has been created with initial settings.<p>Folders src and src-gen have been created and populated by builder. | %{color:red}open% |
|
