01: /*
02: * Copyright (C) 2007 Rob Manning
03: * manningr@users.sourceforge.net
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18: */
19: package net.sourceforge.squirrel_sql.client;
20:
21: import static org.junit.Assert.assertEquals;
22: import static org.junit.Assert.assertNotNull;
23:
24: import org.junit.After;
25: import org.junit.Before;
26: import org.junit.Test;
27:
28: public class ApplicationArgumentsTest {
29:
30: ApplicationArguments applicationArgumentsUnderTest = null;
31:
32: String[] _rawArgs = new String[] { "1", "2", "3", "4" };
33:
34: @Before
35: public void setUp() throws Exception {
36: ApplicationArguments.reset();
37: ApplicationArguments.initialize(_rawArgs);
38: applicationArgumentsUnderTest = ApplicationArguments
39: .getInstance();
40: }
41:
42: @After
43: public void tearDown() throws Exception {
44: ApplicationArguments.reset();
45: }
46:
47: @Test
48: public final void testGetRawArguments() {
49: String[] rawArgs = applicationArgumentsUnderTest
50: .getRawArguments();
51: assertNotNull(rawArgs);
52: assertEquals(4, rawArgs.length);
53: assertEquals("1", rawArgs[0]);
54: assertEquals("2", rawArgs[1]);
55: assertEquals("3", rawArgs[2]);
56: assertEquals("4", rawArgs[3]);
57: }
58:
59: }
|