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.action;
20:
21: import static org.easymock.classextension.EasyMock.replay;
22:
23: import javax.swing.Action;
24:
25: import net.sourceforge.squirrel_sql.BaseSQuirreLJUnit4TestCase;
26: import net.sourceforge.squirrel_sql.client.IApplication;
27: import net.sourceforge.squirrel_sql.test.TestUtil;
28:
29: import org.easymock.classextension.EasyMock;
30: import org.junit.After;
31: import org.junit.Before;
32: import org.junit.Test;
33:
34: public class ActionCollectionTest extends BaseSQuirreLJUnit4TestCase {
35:
36: ActionCollection actionCollectionUnderTest = null;
37: IApplication mockApplication = null;
38: Action mockAction = null;
39:
40: @Before
41: public void setUp() throws Exception {
42: mockApplication = TestUtil.getEasyMockApplication(false);
43: mockAction = EasyMock.createMock(Action.class);
44:
45: replay(mockAction);
46:
47: actionCollectionUnderTest = new ActionCollection(
48: mockApplication);
49: }
50:
51: @After
52: public void tearDown() throws Exception {
53: actionCollectionUnderTest = null;
54: }
55:
56: // Null tests
57:
58: @Test(expected=IllegalArgumentException.class)
59: public final void testAddNull() {
60: actionCollectionUnderTest.add(null);
61: }
62:
63: @Test(expected=IllegalArgumentException.class)
64: public final void testEnableAction() {
65: actionCollectionUnderTest.enableAction(null, true);
66: }
67:
68: }
|