1   package org.apache.fulcrum.yaafi;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  
23  import org.apache.fulcrum.yaafi.testcontainer.BaseUnitTest;
24  
25  /**
26   * Test suite for ensuring that a dependent test component
27   * properly works even if it is declared before the service
28   * it depends on.
29   *
30   * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
31   */
32  
33  public class DependentTestComponentTest extends BaseUnitTest
34  {
35      /**
36       * Constructor
37       * @param name the name of the test case
38       */
39      public DependentTestComponentTest( String name )
40      {
41          super(name);
42      }
43  
44      /**
45       * DependentTestComponentImpl uses a TestComponent which. Make
46       * sure that the container resolves this cyclic dependency.
47       *
48       * @throws Exception
49       */
50      public void testDependentTestComponent() throws Exception
51      {
52          DependentTestComponent dependentTestComponent = (DependentTestComponent) this.lookup(
53              DependentTestComponent.ROLE
54              );
55  
56          dependentTestComponent.test();
57          dependentTestComponent.toString();
58      }
59  }