1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.webphotos.gui;
17
18 import junit.framework.TestCase;
19 import org.junit.Test;
20
21
22
23
24
25 public class PopupMenuTest extends TestCase {
26
27 public PopupMenuTest(String testName) {
28 super(testName);
29 }
30
31
32
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
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 }