001/** 002 * Logback: the reliable, generic, fast and flexible logging framework. 003 * Copyright (C) 1999-2015, QOS.ch. All rights reserved. 004 * 005 * This program and the accompanying materials are dual-licensed under 006 * either the terms of the Eclipse Public License v1.0 as published by 007 * the Eclipse Foundation 008 * 009 * or (per the licensee's choosing) 010 * 011 * under the terms of the GNU Lesser General Public License version 2.1 012 * as published by the Free Software Foundation. 013 */ 014package ch.qos.logback.classic.net.mock; 015 016import java.util.ArrayList; 017import java.util.List; 018 019import javax.jms.Destination; 020import javax.jms.JMSException; 021import javax.jms.Message; 022import javax.jms.Queue; 023import javax.jms.QueueSender; 024 025public class MockQueueSender implements QueueSender { 026 027 List<Message> messageList = new ArrayList<Message>(); 028 Queue queue; 029 030 public MockQueueSender(Queue queue) { 031 this.queue = queue; 032 } 033 034 public List<Message> getMessageList() { 035 return messageList; 036 } 037 038 public Queue getQueue() throws JMSException { 039 return queue; 040 } 041 042 public void send(Message message) throws JMSException { 043 messageList.add(message); 044 045 } 046 047 public void send(Queue arg0, Message arg1) throws JMSException { 048 049 } 050 051 public void send(Message arg0, int arg1, int arg2, long arg3) throws JMSException { 052 053 } 054 055 public void send(Queue arg0, Message arg1, int arg2, int arg3, long arg4) throws JMSException { 056 057 } 058 059 public void close() throws JMSException { 060 061 } 062 063 public int getDeliveryMode() throws JMSException { 064 065 return 0; 066 } 067 068 public Destination getDestination() throws JMSException { 069 070 return null; 071 } 072 073 public boolean getDisableMessageID() throws JMSException { 074 075 return false; 076 } 077 078 public boolean getDisableMessageTimestamp() throws JMSException { 079 080 return false; 081 } 082 083 public int getPriority() throws JMSException { 084 085 return 0; 086 } 087 088 public long getTimeToLive() throws JMSException { 089 090 return 0; 091 } 092 093 public void send(Destination arg0, Message arg1) throws JMSException { 094 095 } 096 097 public void send(Destination arg0, Message arg1, int arg2, int arg3, long arg4) throws JMSException { 098 099 } 100 101 public void setDeliveryMode(int arg0) throws JMSException { 102 103 } 104 105 public void setDisableMessageID(boolean arg0) throws JMSException { 106 107 } 108 109 public void setDisableMessageTimestamp(boolean arg0) throws JMSException { 110 111 } 112 113 public void setPriority(int arg0) throws JMSException { 114 115 } 116 117 public void setTimeToLive(long arg0) throws JMSException { 118 119 } 120 121}