View Javadoc

1   /***
2    * Jetrix TetriNET Server
3    * Copyright (C) 2004  Emmanuel Bourg
4    *
5    * This program is free software; you can redistribute it and/or
6    * modify it under the terms of the GNU General Public License
7    * as published by the Free Software Foundation; either version 2
8    * of the License, or (at your option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License
16   * along with this program; if not, write to the Free Software
17   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18   */
19  
20  package net.jetrix;
21  
22  import java.util.Locale;
23  
24  import junit.framework.TestCase;
25  
26  import net.jetrix.messages.channel.PlineMessage;
27  import net.jetrix.protocols.*;
28  
29  /***
30   * JUnit TestCase for the class net.jetrix.Message.
31   * 
32   * @author Emmanuel Bourg
33   * @version $Revision: 798 $, $Date: 2009-02-18 16:24:28 +0100 (Wed, 18 Feb 2009) $
34   */
35  public class MessageTest extends TestCase {
36  
37      public void testGetRawMessage()
38      {
39          PlineMessage message = new PlineMessage("hello!");
40  
41          String raw = message.getRawMessage(new TetrinetProtocol(), Locale.FRENCH);
42  
43          assertNotNull("raw message is null", raw);
44  
45          String raw2 = message.getRawMessage(new TetrinetProtocol(), Locale.FRENCH);
46  
47          assertTrue("raw message not cached", raw == raw2);
48      }
49  }