001// SECTION-START[License Header] 002// <editor-fold defaultstate="collapsed" desc=" Generated License "> 003/* 004 * Java Object Management and Configuration 005 * Copyright (C) Christian Schulte, 2005-206 006 * All rights reserved. 007 * 008 * Redistribution and use in source and binary forms, with or without 009 * modification, are permitted provided that the following conditions 010 * are met: 011 * 012 * o Redistributions of source code must retain the above copyright 013 * notice, this list of conditions and the following disclaimer. 014 * 015 * o Redistributions in binary form must reproduce the above copyright 016 * notice, this list of conditions and the following disclaimer in 017 * the documentation and/or other materials provided with the 018 * distribution. 019 * 020 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 021 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 022 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 023 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, 024 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 025 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 026 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 027 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 028 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 029 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 030 * 031 * $JOMC: OverrideTestImplementationTest.java 4588 2012-06-03 06:01:30Z schulte2005 $ 032 * 033 */ 034// </editor-fold> 035// SECTION-END 036package org.jomc.ri.test; 037 038import org.junit.Test; 039import static org.junit.Assert.assertEquals; 040 041// SECTION-START[Documentation] 042// <editor-fold defaultstate="collapsed" desc=" Generated Documentation "> 043/** 044 * Override test cases. 045 * 046 * <dl> 047 * <dt><b>Identifier:</b></dt><dd>JOMC :: RI :: Tests :: Override Test Implementation Tests</dd> 048 * <dt><b>Name:</b></dt><dd>JOMC :: RI :: Tests :: Override Test Implementation Tests</dd> 049 * <dt><b>Abstract:</b></dt><dd>No</dd> 050 * <dt><b>Final:</b></dt><dd>No</dd> 051 * <dt><b>Stateless:</b></dt><dd>No</dd> 052 * </dl> 053 * 054 * @author <a href="mailto:schulte2005@users.sourceforge.net">Christian Schulte</a> 1.0 055 * @version 1.3 056 */ 057// </editor-fold> 058// SECTION-END 059// SECTION-START[Annotations] 060// <editor-fold defaultstate="collapsed" desc=" Generated Annotations "> 061@javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.3", comments = "See http://jomc.sourceforge.net/jomc/1.3/jomc-tools-1.3" ) 062// </editor-fold> 063// SECTION-END 064public class OverrideTestImplementationTest 065{ 066 // SECTION-START[OverrideTestImplementationTest] 067 068 @Test 069 public final void testProperty() throws Exception 070 { 071 System.out.println( this.getOverrideTestSpecification().getProperty() ); 072 assertEquals( "Overriden", this.getOverrideTestSpecification().getProperty() ); 073 System.out.println( this.getOverrideTestSpecification().getDependency().getProperty() ); 074 assertEquals( "Recursion 1", this.getOverrideTestSpecification().getDependency().getProperty() ); 075 System.out.println( this.getOverrideTestSpecification().getDependency().getDependency().getProperty() ); 076 assertEquals( "Recursion 2", this.getOverrideTestSpecification().getDependency().getDependency(). 077 getProperty() ); 078 079 System.out.println( this.getOverrideTestSpecification().getDependency().getDependency().getDependency(). 080 getProperty() ); 081 082 assertEquals( "Recursion 3", this.getOverrideTestSpecification().getDependency().getDependency(). 083 getDependency().getProperty() ); 084 085 System.out.println( this.getOverrideTestSpecification().getDependency().getDependency().getDependency(). 086 getDependency().getProperty() ); 087 088 assertEquals( "Recursion 4", this.getOverrideTestSpecification().getDependency().getDependency(). 089 getDependency().getDependency().getProperty() ); 090 091 } 092 093 @Test 094 public final void testMessage() throws Exception 095 { 096 System.out.println( this.getOverrideTestSpecification().getMessage() ); 097 assertEquals( "Overriden", this.getOverrideTestSpecification().getMessage() ); 098 System.out.println( this.getOverrideTestSpecification().getDependency().getMessage() ); 099 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}