Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  *  Licensed to the Apache Software Foundation (ASF) under one
  *  or more contributor license agreements.  See the NOTICE file
  *  distributed with this work for additional information
  *  regarding copyright ownership.  The ASF licenses this file
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
package org.apache.isis.core.integtestsupport.legacy.components;
    private final List<Objectfixtures = new ArrayList<Object>();

    // ///////////////////////////////////////////
    // Hook method
    // ///////////////////////////////////////////

Just copies the fixtures added using addFixturesAnnotatedOn(java.lang.Class) into the delegate.
    protected void addFixturesTo(final FixturesInstallerDelegate delegate) {
        for (final Object fixture : ) {
    // ///////////////////////////////////////////
    // addFixturesAnnotatedOn (not API)
    // ///////////////////////////////////////////

Should be called prior to installing; typically called immediately after instantiation.

Note: an alternative design would be to have a 1-arg constructor, but the convention for installers is to make them no-arg.

    public void addFixturesAnnotatedOn(final Class<?> javaClassthrows InstantiationExceptionIllegalAccessException {
        final Fixtures fixturesAnnotation = javaClass.getAnnotation(Fixtures.class);
        if (fixturesAnnotation != null) {
            final Fixture[] fixtureAnnotations = fixturesAnnotation.value();
            for (final Fixture fixtureAnnotation : fixtureAnnotations) {
        final Fixture fixtureAnnotation = javaClass.getAnnotation(Fixture.class);
        if (fixtureAnnotation != null) {
    private void addFixtureRepresentedBy(final Fixture fixtureAnnotationfinal List<Objectfixturesthrows InstantiationExceptionIllegalAccessException {
        final Class<?> fixtureClass = fixtureAnnotation.value();
New to GrepCode? Check out our FAQ X