Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-856

Allow extending @ComponentList to create defined packs of Component Declarations

    XMLWordPrintable

Details

    • N/A
    • N/A

    Description

      Example of usage:

      @Documented
      @Retention(RUNTIME)
      @Target({ TYPE, METHOD, ANNOTATION_TYPE })
      @ComponentList({
      // Rendering
          DefaultSyntaxFactory.class,
          XWikiRenderingContext.class,
          DefaultTransformationManager.class,
          DefaultXWikiRenderingConfiguration.class,
          PlainTextBlockParser.class,
          DefaultContentParser.class,
          PlainTextRendererFactory.class,
          PlainTextBlockRenderer.class,
      // Transformation
          MacroTransformation.class,
          DefaultMacroManager.class,
          DefaultMacroIdFactory.class,
      // Properties
          DefaultBeanManager.class,
          DefaultConverterManager.class,
          EnumConverter.class,
          ConvertUtilsConverter.class,
      // XWiki 2.0
          XWiki20Parser.class,
          XWiki20LinkReferenceParser.class,
          XWiki20ImageReferenceParser.class,
          URLResourceReferenceTypeParser.class,
      // XHTML 1.0
          XHTMLBlockRenderer.class,
          XHTMLRendererFactory.class,
          XHTMLRenderer.class,
          DefaultXHTMLLinkRenderer.class,
          DefaultXHTMLLinkTypeRenderer.class,
          DefaultXHTMLImageRenderer.class,
          DefaultXHTMLImageTypeRenderer.class,
      // Display
          ConfiguredDocumentDisplayer.class,
          DefaultDisplayConfiguration.class,
          DefaultDocumentDisplayer.class,
          DocumentTitleDisplayer.class,
          DocumentContentDisplayer.class,
          SheetDocumentDisplayer.class,
      // Sheet
          DefaultSheetManager.class,
          DefaultModelBridge.class,
          DocumentSheetBinder.class,
          ClassSheetBinder.class,
      // Model
          DefaultDocumentAccessBridge.class,
      // Velocity
      //    DefaultVelocityManager.class,
          DefaultScriptContextManager.class,
          DefaultVelocityFactory.class,
          DefaultVelocityConfiguration.class,
          DefaultVelocityEngine.class,
          DefaultVelocityContextFactory.class,
      // Skin
          DefaultSkinManager.class,
          InternalSkinManager.class,
          InternalSkinConfiguration.class,
          WikiSkinUtils.class,
      // Other (not categorized for now)
          DefaultObservationManager.class,
          DefaultExecutionContextManager.class,
          DefaultExecution.class,
          ScriptExecutionContextInitializer.class,
          XWikiScriptContextInitializer.class,
          ServicesScriptContextInitializer.class,
          DefaultScriptServiceManager.class,
          // Needed by the test itself
          VelocityMacro.class,
          DefaultVelocityMacroConfiguration.class,
          DefaultMacroContentParser.class,
          IndentVelocityMacroFilter.class,
          DefaultContextualLocalizationManager.class, // Needed by XWikiScriptContextInitializer
          DefaultLocalizationManager.class,
          DefaultTranslationBundleContext.class,
          XWikiLocalizationContext.class
      })
      @Inherited
      public @interface PageComponentList
      {
      }
      

      And then (for example):

      @PageComponentList
      @ComponentList({
          StubVelocityManager.class
      })
      public class WebRssTest
      {
          @Rule
          public MockitoOldcoreRule oldcore = new MockitoOldcoreRule();
      ...
      

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: