meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| sap_hybris_commerce:development_process:systemsetup_annotation_when_methods_run [2020/04/10 10:23] – [Test description] Antonio Robirosa | sap_hybris_commerce:development_process:systemsetup_annotation_when_methods_run [2020/04/10 14:03] (current) – Document the hybris classes Antonio Robirosa | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| The SystemSetup annotation is used to run import data, synchronize catalogues, migrate CMS components and execute Java code during **every** project or essential data creation step. | The SystemSetup annotation is used to run import data, synchronize catalogues, migrate CMS components and execute Java code during **every** project or essential data creation step. | ||
| - | **In past versions | + | **In all hybris version up to 1905 the essential and project data steps aren't run during the initialization of the junit tenant.** This prevents |
| - | ^SystemSetup.Process^INIT^^^UPDATE^^^ALL^^^ | + | ^SystemSetup.Process^INIT^^^UPDATE^^^ALL^^^.^ |
| - | ^^SystemSetup.Type^ESSENTIAL^PROJECT^ALL^ESSENTIAL^PROJECT^ALL^ESSENTIAL^PROJECT^ALL^ | + | ^SystemSetup.Type^ESSENTIAL^PROJECT^ALL^ESSENTIAL^PROJECT^ALL^ESSENTIAL^PROJECT^ALL^What Hybris impexes are imported?^ |
| - | ^ant initialize -Dtenant=master^ | + | ^ant initialize -Dtenant=master|Called once with process INIT and type ESSENTIAL|Called once with process INIT and type PROJECT|Called twice with process INIT and type ESSENTIAL \\ and with process INIT and type PROJECT|No call|||Called once with process INIT and type ESSENTIAL|Called once with process INIT and type PROJECT|Called twice with process INIT and type ESSENTIAL \\ and with process INIT and type PROJECT|Project and essential scripts| |
| - | ^ant initialize -Dtenant=junit^ | + | ^ant initialize -Dtenant=junit|:!: No call|||||||||: |
| - | ^ant yunitinit^ | + | ^ant yunitinit|:!: No call|||||||||: |
| - | ^ant updatesystem -Dtenant=master((with a JSON configuration to run the project data))^ | + | ^ant updatesystem -Dtenant=master((with a JSON configuration to run the project data))|No call|||Called once with process UPDATE and type ESSENTIAL|Called once with process UPDATE and type PROJECT|Called twice with process UPDATE and type ESSENTIAL and with process UPDATE and type PROJECT|Called once with process UPDATE and type ESSENTIAL|Called once with process UPDATE and type PROJECT|Called twice with process INIT and type ESSENTIAL and with process INIT and type PROJECT|Project and essential scripts| |
| - | ^ant updatesystem -Dtenant=junit((with a JSON configuration to run the project data))^ | + | ^ant updatesystem -Dtenant=junit((with a JSON configuration to run the project data))|:!: No call|||||||||: |
| - | ^On HAC, initialize | + | ^ant yunitupdate|: |
| - | ^On HAC, initialize of the master yunit^ | + | |
| - | ^On HAC, update | + | When @SystemSetup(extension = ArecosystemsetuptestConstants.EXTENSIONNAME), the field hybrisContext.getExtensionName() always contains the name of the current extension. \\ |
| - | ^On HAC, update | + | When @SystemSetup(extension = " |
| + | |||
| + | <WRAP center round important 60%> | ||
| + | Because the majority of the SAP hybris projects use Jenkins and **ant targets** to deploy, update system | ||
| + | </ | ||
| + | ===== Cause of this behaviour ===== | ||
| + | |||
| + | The method de.hybris.ant.taskdefs.InitPlatformAntPerformableImpl# | ||
| ===== Test description ===== | ===== Test description ===== | ||
| - | I created a new extension based on the templa yempty and added the property | + | I created a new extension based on the templa yempty and added the property |
| <code java> | <code java> | ||
| - | @SystemSetup(extension = " | + | @SystemSetup(extension = ArecosystemsetuptestConstants.EXTENSIONNAME) |
| public class SystemSetupAnnotationCallsTest { | public class SystemSetupAnnotationCallsTest { | ||
| </ | </ | ||
| Line 30: | Line 37: | ||
| } | } | ||
| </ | </ | ||
| - | I ran all ant commands | + | <WRAP center round important 60%> |
| - | < | + | To make hybris call the methods, I had to create a bean definition in the spring application context. Autowiring without the XML bean definition wasn't working. |
| + | </ | ||
| + | <code xml> | ||
| + | <bean id=" | ||
| + | </ | ||
| + | |||
| + | |||
| + | I created a JSON configuration for the update running system which runs the create project data step: {{ : | ||
| + | I ran the following | ||
| + | < | ||
| + | rm -rf hybris/ | ||
| + | ant clean all | ||
| ant initialize -Dtenant=master | tee initializeMaster.log | grep SystemSetupAnnotationCallsTest | ant initialize -Dtenant=master | tee initializeMaster.log | grep SystemSetupAnnotationCallsTest | ||
| + | ant initialize -Dtenant=junit | tee initializeJunit.log | grep SystemSetupAnnotationCallsTest | ||
| + | ant yunitinit | tee yunitinit.log | grep SystemSetupAnnotationCallsTest | ||
| + | ant updatesystem -Dtenant=master -DconfigFile=/ | ||
| + | ant updatesystem -Dtenant=yunit -DconfigFile=/ | ||
| + | ant yunitupdate -DconfigFile=/ | ||
| </ | </ | ||
| + | |||
| + | Source code: {{ : | ||
| -- Based on SAP hybris 1905 | -- Based on SAP hybris 1905 | ||