Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note that namespaces must be used for template configuration

Stubbing Binding Templates in Testing

(warning) This feature is available in 1.9.7+

Sometimes it is necessary to stub out a binding template for testing. For example, a component may take an optional reference that must be explicitly bound to an external service. The composite containing the component contains a binding template configuration. For testing, the external service is not needed. The binding template can be defined using a blank binding.sca, which will result in no binding being applied to the reference:

Code Block
xml
xml

<config xmlns="urn:fabric3.org" xmlns:f3="urn:fabric3.org" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912">
    <web.server>
        <http port="8900"/>
    </web.server>
    <templates>
       <template name="SystemConfigTestServiceBinding">
          <sca:binding.sca/>
       </template>
    </templates>
</config>

JPA/Hibernate Overrides

Persistence context configuration can also be specified in an environment-dependent fashion similar to the way templates are. For more details, see Data Access.