2 * Copyright (C) 2012 Openismus GmbH
4 * This file is part of GWT-Glom.
6 * GWT-Glom is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
11 * GWT-Glom is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with GWT-Glom. If not, see <http://www.gnu.org/licenses/>.
20 package org.glom.web.server;
22 import static org.junit.Assert.*;
25 import java.sql.SQLException;
27 import org.glom.web.server.libglom.Document;
28 import org.glom.web.server.libglom.Document.HostingMode;
29 import org.junit.AfterClass;
30 import org.junit.Test;
33 * @author Murray Cumming <murrayc@openismus.com>
36 public class SelfHostExampleNonNumericPrimaryKeysTest {
38 private static SelfHoster selfHoster = null;
41 public void test() throws SQLException {
42 final URL url = SelfHostExampleNonNumericPrimaryKeysTest.class.getResource("test_example_music_collection_text_pk_fields.glom");
43 assertTrue(url != null);
44 final String strUri = url.toString();
46 final Document document = new Document();
47 document.setFileURI(strUri);
48 assertTrue(document.load());
50 selfHoster = new SelfHoster(document);
51 final boolean hosted = selfHoster.createAndSelfHostFromExample(HostingMode.HOSTING_MODE_POSTGRES_SELF);
54 SelfHostTestUtils.testExampleMusiccollectionData(selfHoster, document);
58 public static void tearDown() {
59 if (selfHoster != null) {