01: /**
02: * Copyright (C) 2006 NetMind Consulting Bt.
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 3 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */package hu.netmind.persistence;
18:
19: import java.util.List;
20:
21: /**
22: * Overall tests for persistence layer. These are more like proof-of-concept
23: * test designed to demonstrate concepts of functionality.
24: * @author Brautigam Robert
25: * @version Revision: $Revision$
26: */
27: public class OverallTests extends AbstractPersistenceTest {
28: public OverallTests(String name) throws Exception {
29: super (name);
30: }
31:
32: public void testInsertAndSelectConcept() throws Exception {
33: dropTables("book");
34: // Create book
35: Book book = new Book();
36: book.setTitle("No worries left.");
37: book.setIsbn("1-2-3-4");
38: // Save in store
39: store.save(book);
40: // Select
41: List result = store
42: .find("find book where book.title='No worries left.'");
43: assertEquals(1, result.size());
44: assertEquals("1-2-3-4", ((Book) result.get(0)).getIsbn());
45: assertEquals("No worries left.", ((Book) result.get(0))
46: .getTitle());
47: }
48:
49: }
|