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;
23 import java.io.IOException;
24 import java.io.InputStream;
26 import junit.framework.TestCase;
28 import org.junit.Test;
31 * @author Murray Cumming <murrayc@openismus.com>
34 public class OnlineGlomPropertiesTest extends TestCase {
36 OnlineGlomProperties config = null;
38 public void setUp() throws IOException {
39 config = new OnlineGlomProperties();
41 final InputStream is = Thread.currentThread().getContextClassLoader()
42 .getResourceAsStream("onlineglom.properties.sample");
45 config.load(is); // can throw an IOException
49 * Test method for {@link org.glom.web.server.OnlineGlomProperties#getCredentials(java.lang.String)}.
52 public void testGetCredentials() {
53 OnlineGlomProperties.Credentials credentials = config.getCredentials("lesson-planner.glom");
54 assertEquals("ben", credentials.userName);
55 assertEquals("ChangeMeToo", credentials.password);
59 * Test method for {@link org.glom.web.server.OnlineGlomProperties#getGlobalUsername()}.
62 public void testGetGlobalUsername() {
63 assertEquals("someuser", config.getGlobalUsername());
68 * Test method for {@link org.glom.web.server.OnlineGlomProperties#getGlobalPassword()}.
71 public void testGetGlobalPassword() {
72 assertEquals("ChangeMe", config.getGlobalPassword());
76 * Test method for {@link org.glom.web.server.OnlineGlomProperties#getGlobalLocale()}.
79 public void testGetGlobalLocale() {
80 assertEquals("", config.getGlobalLocale());
84 * Test method for {@link org.glom.web.server.OnlineGlomProperties#getDocumentsDirectory()}.
87 public void testGetDocumentsDirectory() {
88 assertEquals("/home/someuser/glomfiles", config.getDocumentsDirectory());
91 public void tearDown() {