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, 2012-013 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: CommandExecutionExceptionTest.java 4756 2013-01-04 08:01:00Z schulte $ 032 * 033 */ 034// </editor-fold> 035// SECTION-END 036package org.jomc.cli.commands.test; 037 038import java.io.ObjectInputStream; 039import org.jomc.cli.commands.CommandExecutionException; 040import org.junit.Test; 041import static org.junit.Assert.assertEquals; 042 043// SECTION-START[Documentation] 044// <editor-fold defaultstate="collapsed" desc=" Generated Documentation "> 045/** 046 * Test cases for class {@code org.jomc.cli.commands.CommandExecutionException}. 047 * 048 * <dl> 049 * <dt><b>Identifier:</b></dt><dd>JOMC ⁑ CLI ⁑ Tests ⁑ Command Execution Exception Test</dd> 050 * <dt><b>Name:</b></dt><dd>JOMC ⁑ CLI ⁑ Tests ⁑ Command Execution Exception Test</dd> 051 * <dt><b>Abstract:</b></dt><dd>No</dd> 052 * <dt><b>Final:</b></dt><dd>No</dd> 053 * <dt><b>Stateless:</b></dt><dd>No</dd> 054 * </dl> 055 * 056 * @author <a href="mailto:cs@schulte.it">Christian Schulte</a> 1.2 057 * @version 1.4.1 058 */ 059// </editor-fold> 060// SECTION-END 061// SECTION-START[Annotations] 062// <editor-fold defaultstate="collapsed" desc=" Generated Annotations "> 063@javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.4", comments = "See http://www.jomc.org/jomc/1.4/jomc-tools-1.4" ) 064// </editor-fold> 065// SECTION-END 066public class CommandExecutionExceptionTest 067{ 068 // SECTION-START[CommandExecutionExceptionTest] 069 070 /** Constant to prefix relative resource names with. */ 071 private static final String ABSOLUTE_RESOURCE_NAME_PREFIX = "/org/jomc/cli/commands/test/"; 072 073 @Test 074 public final void testCommandExecutionException() throws Exception 075 { 076 final ObjectInputStream in = new ObjectInputStream( this.getClass().getResourceAsStream( 077 ABSOLUTE_RESOURCE_NAME_PREFIX + "CommandExecutionException.ser" ) ); 078 079 final CommandExecutionException e = (CommandExecutionException) in.readObject(); 080 in.close(); 081 082 assertEquals( "TEST", e.getMessage() ); 083 } 084 085 // SECTION-END 086 // SECTION-START[Constructors] 087 // <editor-fold defaultstate="collapsed" desc=" Generated Constructors "> 088 /** Creates a new {@code CommandExecutionExceptionTest} instance. */ 089 @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.4", comments = "See http://www.jomc.org/jomc/1.4/jomc-tools-1.4" ) 090 public CommandExecutionExceptionTest() 091 { 092 // SECTION-START[Default Constructor] 093 super(); 094 // SECTION-END 095 } 096 // </editor-fold> 097 // SECTION-END 098 // SECTION-START[Dependencies] 099 // SECTION-END 100 // SECTION-START[Properties] 101 // SECTION-END 102 // SECTION-START[Messages] 103 // SECTION-END 104}