1 /**
2 * Copyright 2008 WebPhotos
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package net.sf.webphotos.gui;
17
18 import junit.framework.TestCase;
19 import org.junit.Test;
20
21 /**
22 *
23 * @author 60410501
24 */
25 public class PopupMenuTest extends TestCase {
26
27 public PopupMenuTest(String testName) {
28 super(testName);
29 }
30
31 /**
32 * Test of getPreSQL method, of class webfotos.gui.PopupMenu.
33 */
34 @Test
35 public void testGetPreSQL() {
36 System.out.println("getPreSQL");
37
38 PopupMenu instance = new PopupMenu();
39
40 String expResult = "select albumID as ID, categorias.nmcategoria as Categoria, nmalbum as Pauta, DATE_FORMAT(DtInsercao, '%d/%m/%y') as Data from albuns left join categorias using(categoriaID) ";
41 String result = instance.getPreSQL();
42 assertEquals(expResult, result);
43 }
44
45 /**
46 * Test of setPreSQL method, of class webfotos.gui.PopupMenu.
47 */
48 @Test
49 public void testSetPreSQL() {
50 System.out.println("setPreSQL");
51
52 String expResult = "select * from albuns left join categorias using(categoriaID) ";
53 PopupMenu instance = new PopupMenu();
54
55 instance.setPreSQL(expResult);
56 String result = instance.getPreSQL();
57 assertEquals(expResult, result);
58
59 }
60
61 }