Skip to content

Module Data Structure

mojavelinux edited this page Feb 22, 2012 · 6 revisions

Below is the proposed data structure for the module information that will be used to generate the module pages (down to the individual container artifacts). The goal is to try to capture the information in the most generic way to avoid having to perform a lot of custom logic in the templates.

The modules have been divided into three types thus far:

  • Platform
  • Container Adapter
  • Extension

Each type has its own branch which can hold information unique to that type. For instance, the container adapters have a list of enrichers and configuration properties.

The data structure will be stored in an OpenCascade object, which allows property chaining. OpenCascade is similar to OpenStruct, except it supports nested hashes.

core:
    repository: arquillian-core
    groupId: org.jboss.arquillian.core
    artifactId: arquillian-core-impl-base
    type: Platform
    name: Arquillian Core
    desc: ...
    lead: aslakknutsen
    license: ASLv2
    releases:
      - version: 1.0.0.CR7
        released: 2011-12-16
        license: ASLv2
        compiledeps:
          - name: ShrinkWrap Core
            version: 1.0.0-cr-1
          - name: ShrinkWrap Resolvers
            version: 1.0.0-beta-5
          - name: ShrinkWrap Descriptors
            version: 1.1.0-beta-1
        notes: ...
        issues:
          - key: ARQ-678
            desc: "ExceptionProxy - java.lang.NoClassDefFoundError: org/jboss/util/id/SerialVersion"
          - key: ARQ-699
            desc: "@ArquillianResource Deployer gets injected only for the first test when using manual deployment/container modes"
          - key: ARQ-284
            desc: Configuration options should be loadable from multiple sources
          - key: ARQ-533
            desc: "Support Qualifiers on @ArquillianResource in ResourceProvider's SPI"
          - key: ARQ-645
            desc: "@ArquillianResource @OperatesOnDeployment("foo") URL; for multiple containers"
          - key: ARQ-677
            desc: Expose Deployment as part of TestDeployment so SPIs can access more information, e.g. Container
          - key: ARQ-692
            desc: Update to jboss-parent:8 Contains 1.5/1.6 source level IDE issue
          - key: ARQ-703
            desc: Prepare CR7 Core release
      - version: 1.0.0.CR6
        released: 2011-11-26
        license: ASLv2
      - version: 1.0.0.CR5
        released: 2011-09-14
        license: ASLv2
      - version: 1.0.0.CR4
        released: 2011-08-16
        license: ASLv2
    bom: org.jboss.arquillian:arquillian-bom:1.0.0.CR7
    artifacts:
      - variant: JUnit
        coordinates: org.jboss.arquillian.junit:arquillian-junit-container:test
      - variant: TestNG
        coordinates: org.jboss.arquillian.testng:arquillian-testng-container:test
container_wls_12_1_remote:
    repository: arquillian-container-wls
    groupId: org.jboss.arquillian.container 
    artifactId: arquillian-wls-remote-12.1
    type: Container Adapter
    name: Arquillian WebLogic 12.1 Remote Container Adapter
    desc: ...
    lead: vineetreynolds
    license: ASLv2
    releases:
      - version: 1.0.0.Alpha2
        released: 2012-01-22
        license: ASLv2
        compiledeps:
          - name: Arquillian Core
            version: 1.0.0.CR7
        notes: ...
        issues:
          - key: ARQ-706
            desc: Upgrade to Arquillian core CR7 for WebLogic Containers
          - key: ARQ-725
            desc: Improve the performance of the WebLogicContainer implementation
          - key: ARQ-687
            desc: Support for custom hostname verifiers
          - key: ARQ-707
            desc: Implement a remote container for WebLogic 12c
          - key: ARQ-731
            desc: Prepare WebLogic Container 1.0.0.Alpha2
      - version: 1.0.0.Alpha1
        released: 2011-11-02
        license: ASLv2
        compiledeps:
          - name: Arquillian Core
            version: 1.0.0.CR5
    container:
        management: remote
        family: WebLogic
        version: 12.1
        protocol: servlet
        enrichers:
          - type: cdi
          - type: ejb
          - type: resource
          - type: initialcontext
        configuration:
            properties:
              - name: adminUrl
                type: String
                default: null
                desc: The administration URL to connect to
              - name: adminUserName
                type: String
                default: null
                desc: The name of the administrator user
container_wls_10_3_remote:
    repository: arquillian-container-wls
    groupId: org.jboss.arquillian.container 
    artifactId: arquillian-wls-remote-10.3
    type: Container Adapter
    name: Arquillian WebLogic 10.3 Remote Container Adapter
    desc: ...
    lead: vineetreynolds
    _clip_:
extension_drone:
    repository: arquillian-extension-drone
    groupId: org.jboss.arquillian.extension
    artifactId: arquillian-drone-impl
    type: Extension
    name: Arquillian Drone Extension
    desc: ...
    lead: kpiwko
    license: ASLv2
    releases:
      - version: 1.0.0.CR3
        released: 2011-11-29
        license: ASLv2
        compiledeps:
          - name: Arquillian Core
            version: 1.0.0.CR6
        notes: ...
        issues:
          - key: ARQ-444
            desc: MethodContext is not correctly freed
          - key: ARQ-610
            desc: Method enrichment does not check for a validity of driver
          - key: ARQ-611
            desc: If Drone extension is on classpath but not used, destroying drone instance will lead to failure
          - key: ARQ-631
            desc: The implementationClass property is ignored when using WebDriver interface as type of selenium instance in tests
          - key: ARQ-665
            desc: Update Selenium version to 2.13.0
          - key: ARQ-577
            desc: Enhance exception messages for cases where Drone instances cannot be destroyed because no context was created
          - key: ARQ-666
            desc: Redesign WebDriver browser configuration
          - key: ARQ-667
            desc: Add AS7 container profiles
          - key: ARQ-671
            desc: Prepare Drone 1.0.0.CR3
          - key: ARQ-669
            desc: Update Arquillian Drone build
      - version: 1.0.0.CR2
        released: 2011-08-30
        license: ASLv2
        compiledeps:
          - name: Arquillian Core
            version: 1.0.0.CR4
      - version: 1.0.0.CR1
        released: 2011-06-29
        license: ASLv2
        compiledeps:
          - name: Arquillian Core
            version: 1.0.0.CR1
      - version: 1.0.0.Alpha5
        released: 2011-03-17
        license: ASLv2
        compiledeps:
          - name: Arquillian Core
            version: 1.0.0.Alpha5
    bom: org.jboss.arquillian.extension:arquillian-drone-bom:1.0.0.CR3
    artifacts:
      - variant: impl
        coordinates: org.jboss.arquillian.extension:arquillian-drone-impl
      - variant: selenium
        coordinates: org.jboss.arquillian.extension:arquillian-drone-selenium
    extension:
        configuration:
          - namespace: selenium
            properties:
              - name: serverPort
                type: int
                default: 14444
                desc: Port on machine where Selenium is running
              - name: serverHost
                type: String
                default: localhost
                desc: Hostname of machine where Selenium is running
              - ...
            example:
                browser: *firefox
          - namespace: ajocado
            properties:
              - name: contextRoot
                type: String
                default: http://localhost:8080
                desc: Web server url
              - name: contextPath
                type: String
                default: null
                desc: Url of deployed application
              - ...
            example:
                seleniumMaximize: true
extension_persistence:
    repository: arquillian-extension-persistence
    groupId: org.jboss.arquillian.extension
    artifactId: arquillian-persistence-impl
    type: Extension
    name: Arquillian Persistence Extension
    desc: ...
    lead: bartoszmajsak
    license: ASLv2
    releases:
      - version: 1.0.0.Alpha3
        released: 2011-12-30
        license: ASLv2
        compiledeps:
          - name: Arquillian Core
            version: 1.0.0.CR6
        notes: ...
        issues:
          - key: ARQ-685
            desc: Failing to locate datasets when deploying as WAR archive.
          - key: ARQ-693
            desc: Custom SQL statements / scripts to be run before and after test execution
          - key: ARQ-694
            desc: Seeding database using SQL scripts
          - key: ARQ-695
            desc: Investigate possibility of excluding Apache POI library
          - key: ARQ-711
            desc: Add support for JSON data sets
          - key: ARQ-716
            desc: Prepare Persistence Alpha3 release
      - version: 1.0.0.Alpha2
        released: 2011-12-03
        license: ASLv2
        compiledeps:
          - name: Arquillian Core
            version: 1.0.0.CR6
      - version: 1.0.0.Alpha1
        released: 2011-11-14
        license: ASLv2
        compiledeps:
          - name: Arquillian Core
            version: 1.0.0.CR5
    artifacts:
      - variant: impl
        coordinates: org.jboss.arquillian.extension:arquillian-persistence-impl
    extension:
        configuration:
          - namespace: persistence
            properties:
              - name: defaultDataSource 
                type: String
                default: null
                desc: JNDI name of DataSource
              - name: defaultDataSetLocation
                type: String
                default: datasets/
                desc: Classpath folder from which data sets are resolved
              - name: defaultSqlScriptLocation
                type: String
                default: scripts/
                desc: Classpath folder from which sql scripts are resolved
              - name: initStatement
                type: String
                default: null
                desc: SQL statement used to initialize database before each test
              - name: cleanupStatement
                type: String
                default: null
                desc: SQL statement used to cleanup database after each test
              - name: dumpData
                type: boolean
                default: false
                desc: Whether to dump the data stored in the database
              - name: excludePoi
                type: boolean
                default: false
                desc: exclude Apache POI archive when not using excel data sets
              - name: userTransactionJndi
                type: String
                default: java:comp/UserTransaction
                desc: JNDI name of UserTransaction, which is used for managing transactions
            example:
                defaultDataSource: java:jboss/datasources/ExampleDS
                initStatement: SET REFERENTIAL_INTEGRITY FALSE
                userTransactionJndi: java:jboss/UserTransaction

The data above can be read using the following Ruby script:

require 'rubygems'
require 'yaml'
require 'hashery/opencascade'

# Convert string keys into symbols to enable OpenCascade chaining structure
def symbolize_keys(hash)
    hash.inject({}) { |result, (key, value)|
        new_key = case key
            when String then key.to_sym
            else
                key
            end
        new_value = case value
            when Hash then symbolize_keys(value)
            when Array then
                # assumes value of array is hash
                value.map{|v| symbolize_keys(v)}
            else
                value
            end
        result[new_key] = new_value
        result
    }
end
modules = OpenCascade[symbolize_keys(YAML.load_file('module-data-structure.yml'))]
# puts modules.inspect

ext = modules.extension_persistence

puts "#{ext.name} led by #{ext.lead}"
puts "Lastest release #{ext.releases[0].version}"
puts "Compiled against #{ext.releases[0].compiledeps[0].name} #{ext.releases[0].compiledeps[0].version}"

Below are some scripts to mine this data from the git repositories.

Mine module lead:

require 'rubygems'
require 'git'
require 'rexml/document'

lead = 'Aslak Knutsen'
g = Git.open('arquillian-extension-drone')
g.gtree('HEAD').children.each do |entry|
  if entry[0].eql? 'pom.xml'
    pom = REXML::Document.new(g.object(entry[1]).contents)
    pom.elements.each('project/developers/developer') do |dev|
      if !dev.elements['roles'].elements.find { |role| role.name.eql? 'role' and role.text =~ / Lead/ }.nil?
        lead = dev.elements['name'].text
        break
      end
    end
  end
end
puts lead

Mine enrichers by container:

require 'rubygems'
require 'git'
require 'rexml/document'

g = Git.open('arquillian-container-wls')
g.gtree('HEAD').children.each do |l1|
  if l1[0] =~ /-(remote|managed|embedded)/
    puts l1[0]
    g.gtree(l1[1]).children.each do |l2|
      enrichers = []
      if l2[0].eql? 'pom.xml'
        pom = REXML::Document.new(g.object(l2[1]).contents)
        pom.each_element('project/dependencies/dependency') do |dep| 
          if dep.elements['groupId'].text.eql? 'org.jboss.arquillian.testenricher'
            enrichers << dep.elements['artifactId'].text.sub(/^arquillian-testenricher-/, '')
          end
        end
        puts enrichers.join(', ')
      end
    end
  end
end
Clone this wiki locally