View Javadoc

1   // SECTION-START[License Header]
2   // <editor-fold defaultstate="collapsed" desc=" Generated License ">
3   /*
4    *   Java Object Management and Configuration
5    *   Copyright (C) Christian Schulte, 2005-206
6    *   All rights reserved.
7    *
8    *   Redistribution and use in source and binary forms, with or without
9    *   modification, are permitted provided that the following conditions
10   *   are met:
11   *
12   *     o Redistributions of source code must retain the above copyright
13   *       notice, this list of conditions and the following disclaimer.
14   *
15   *     o Redistributions in binary form must reproduce the above copyright
16   *       notice, this list of conditions and the following disclaimer in
17   *       the documentation and/or other materials provided with the
18   *       distribution.
19   *
20   *   THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21   *   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22   *   AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
23   *   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
24   *   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25   *   NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26   *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27   *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28   *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29   *   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30   *
31   *   $JOMC: OverrideTestImplementationTest.java 4588 2012-06-03 06:01:30Z schulte2005 $
32   *
33   */
34  // </editor-fold>
35  // SECTION-END
36  package org.jomc.ri.test;
37  
38  import org.junit.Test;
39  import static org.junit.Assert.assertEquals;
40  
41  // SECTION-START[Documentation]
42  // <editor-fold defaultstate="collapsed" desc=" Generated Documentation ">
43  /**
44   * Override test cases.
45   *
46   * <dl>
47   *   <dt><b>Identifier:</b></dt><dd>JOMC :: RI :: Tests :: Override Test Implementation Tests</dd>
48   *   <dt><b>Name:</b></dt><dd>JOMC :: RI :: Tests :: Override Test Implementation Tests</dd>
49   *   <dt><b>Abstract:</b></dt><dd>No</dd>
50   *   <dt><b>Final:</b></dt><dd>No</dd>
51   *   <dt><b>Stateless:</b></dt><dd>No</dd>
52   * </dl>
53   *
54   * @author <a href="mailto:schulte2005@users.sourceforge.net">Christian Schulte</a> 1.0
55   * @version 1.3
56   */
57  // </editor-fold>
58  // SECTION-END
59  // SECTION-START[Annotations]
60  // <editor-fold defaultstate="collapsed" desc=" Generated Annotations ">
61  @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.3", comments = "See http://jomc.sourceforge.net/jomc/1.3/jomc-tools-1.3" )
62  // </editor-fold>
63  // SECTION-END
64  public class OverrideTestImplementationTest
65  {
66      // SECTION-START[OverrideTestImplementationTest]
67  
68      @Test
69      public final void testProperty() throws Exception
70      {
71          System.out.println( this.getOverrideTestSpecification().getProperty() );
72          assertEquals( "Overriden", this.getOverrideTestSpecification().getProperty() );
73          System.out.println( this.getOverrideTestSpecification().getDependency().getProperty() );
74          assertEquals( "Recursion 1", this.getOverrideTestSpecification().getDependency().getProperty() );
75          System.out.println( this.getOverrideTestSpecification().getDependency().getDependency().getProperty() );
76          assertEquals( "Recursion 2", this.getOverrideTestSpecification().getDependency().getDependency().
77              getProperty() );
78  
79          System.out.println( this.getOverrideTestSpecification().getDependency().getDependency().getDependency().
80              getProperty() );
81  
82          assertEquals( "Recursion 3", this.getOverrideTestSpecification().getDependency().getDependency().
83              getDependency().getProperty() );
84  
85          System.out.println( this.getOverrideTestSpecification().getDependency().getDependency().getDependency().
86              getDependency().getProperty() );
87  
88          assertEquals( "Recursion 4", this.getOverrideTestSpecification().getDependency().getDependency().
89              getDependency().getDependency().getProperty() );
90  
91      }
92  
93      @Test
94      public final void testMessage() throws Exception
95      {
96          System.out.println( this.getOverrideTestSpecification().getMessage() );
97          assertEquals( "Overriden", this.getOverrideTestSpecification().getMessage() );
98          System.out.println( this.getOverrideTestSpecification().getDependency().getMessage() );
99          assertEquals( "Recursion 1", this.getOverrideTestSpecification().getDependency().getMessage() );
100         System.out.println( this.getOverrideTestSpecification().getDependency().getDependency().getMessage() );
101         assertEquals( "Recursion 2", this.getOverrideTestSpecification().getDependency().getDependency().
102             getMessage() );
103 
104         System.out.println( this.getOverrideTestSpecification().getDependency().getDependency().getDependency().
105             getMessage() );
106 
107         assertEquals( "Recursion 3", this.getOverrideTestSpecification().getDependency().getDependency().
108             getDependency().getMessage() );
109 
110         System.out.println( this.getOverrideTestSpecification().getDependency().getDependency().getDependency().
111             getDependency().getMessage() );
112 
113         assertEquals( "Recursion 4", this.getOverrideTestSpecification().getDependency().getDependency().
114             getDependency().getDependency().getMessage() );
115 
116     }
117 
118     // SECTION-END
119     // SECTION-START[Constructors]
120     // <editor-fold defaultstate="collapsed" desc=" Generated Constructors ">
121     /** Creates a new {@code OverrideTestImplementationTest} instance. */
122     @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.3", comments = "See http://jomc.sourceforge.net/jomc/1.3/jomc-tools-1.3" )
123     public OverrideTestImplementationTest()
124     {
125         // SECTION-START[Default Constructor]
126         super();
127         // SECTION-END
128     }
129     // </editor-fold>
130     // SECTION-END
131     // SECTION-START[Dependencies]
132     // <editor-fold defaultstate="collapsed" desc=" Generated Dependencies ">
133     /**
134      * Gets the {@code <Override Test Specification>} dependency.
135      * <p>
136      *   This method returns the {@code <JOMC :: RI :: Tests :: Override Test Implementation>} object of the {@code <JOMC :: RI :: Tests :: Override Test Specification>} specification at any specification level.
137      *   That specification does not apply to any scope. A new object is returned whenever requested and bound to this instance.
138      * </p>
139      * <p><strong>Properties:</strong>
140      *   <table border="1" width="100%" cellpadding="3" cellspacing="0">
141      *     <tr class="TableSubHeadingColor">
142      *       <th align="left" scope="col" nowrap><b>Name</b></th>
143      *       <th align="left" scope="col" nowrap><b>Type</b></th>
144      *       <th align="left" scope="col" nowrap><b>Documentation</b></th>
145      *     </tr>
146      *     <tr class="TableRow">
147      *       <td align="left" valign="top" nowrap>{@code <propertyImpl>}</td>
148      *       <td align="left" valign="top" nowrap>{@code java.lang.String}</td>
149      *       <td align="left" valign="top"></td>
150      *     </tr>
151      *   </table>
152      * </p>
153      * <dl>
154      *   <dt><b>Final:</b></dt><dd>No</dd>
155      * </dl>
156      * @return The {@code <Override Test Specification>} dependency.
157      * @throws org.jomc.ObjectManagementException if getting the dependency instance fails.
158      */
159     @SuppressWarnings("unused")
160     @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.3", comments = "See http://jomc.sourceforge.net/jomc/1.3/jomc-tools-1.3" )
161     private org.jomc.ri.test.support.OverrideTestSpecification getOverrideTestSpecification()
162     {
163         final org.jomc.ri.test.support.OverrideTestSpecification _d = (org.jomc.ri.test.support.OverrideTestSpecification) org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getDependency( this, "Override Test Specification" );
164         assert _d != null : "'Override Test Specification' dependency not found.";
165         return _d;
166     }
167     // </editor-fold>
168     // SECTION-END
169     // SECTION-START[Properties]
170     // SECTION-END
171     // SECTION-START[Messages]
172     // SECTION-END
173 }