KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > scenario > standalone > sql > request > AbstractRequestTest


1 /**
2  * C-JDBC: Clustered JDBC.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: c-jdbc@objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation; either version 2.1 of the License, or any later
10  * version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20  *
21  * Initial developer(s): Mathieu Peltier.
22  * Contributor(s): ______________________________________.
23  */

24
25 package org.objectweb.cjdbc.scenario.standalone.sql.request;
26
27 import org.objectweb.cjdbc.common.sql.SelectRequest;
28 import org.objectweb.cjdbc.scenario.templates.NoTemplate;
29
30 /**
31  * <code>AbstractRequestTest</code> test class.
32  *
33  * @author <a HREF="mailto:Mathieu.Peltier@inrialpes.fr">Mathieu Peltier </a>
34  * @see org.objectweb.cjdbc.common.sql.AbstractRequest
35  */

36 public class AbstractRequestTest extends NoTemplate
37 {
38     
39   /**
40    * @see org.objectweb.cjdbc.common.sql.AbstractRequest#trimCarriageReturnAndTabs()
41    */

42   public void testTrimCarriageReturnAndTabs() throws Exception JavaDoc
43   {
44     String JavaDoc original = "I have a dream";
45     String JavaDoc carriaged1 = new SelectRequest("I"
46         + System.getProperty("line.separator") + "have"
47         + System.getProperty("line.separator") + "a"
48         + System.getProperty("line.separator") + "dream", false, 0, System
49         .getProperty("line.separator")).trimCarriageReturnAndTabs();
50
51     String JavaDoc carriaged2 = new SelectRequest("I"
52         + System.getProperty("line.separator") + "have"
53         + System.getProperty("line.separator") + "a"
54         + System.getProperty("line.separator") + "dream", false, 0, System
55         .getProperty("line.separator")).trimCarriageReturnAndTabs();
56
57     String JavaDoc carriaged3 = new SelectRequest("I\thave\ta\tdream", false, 0, System
58         .getProperty("line.separator")).trimCarriageReturnAndTabs();
59
60     String JavaDoc carriaged4 = new SelectRequest("I"
61         + System.getProperty("line.separator") + "have\ta"
62         + System.getProperty("line.separator") + "dream", false, 0, System
63         .getProperty("line.separator")).trimCarriageReturnAndTabs();
64
65     assertEquals(original, carriaged1);
66     assertEquals(original, carriaged2);
67     assertEquals(original, carriaged3);
68     assertEquals(original, carriaged4);
69   }
70 }
71
Popular Tags