|
1 |
/**
|
|
2 |
* '$RCSfile$'
|
|
3 |
* Copyright: 2004 Regents of the University of California and the
|
|
4 |
* National Center for Ecological Analysis and Synthesis
|
|
5 |
* Purpose: To test the Access Controls in metacat by JUnit
|
|
6 |
*
|
|
7 |
* '$Author$'
|
|
8 |
* '$Date$'
|
|
9 |
* '$Revision$'
|
|
10 |
*
|
|
11 |
* This program is free software; you can redistribute it and/or modify
|
|
12 |
* it under the terms of the GNU General Public License as published by
|
|
13 |
* the Free Software Foundation; either version 2 of the License, or
|
|
14 |
* (at your option) any later version.
|
|
15 |
*
|
|
16 |
* This program is distributed in the hope that it will be useful,
|
|
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19 |
* GNU General Public License for more details.
|
|
20 |
*
|
|
21 |
* You should have received a copy of the GNU General Public License
|
|
22 |
* along with this program; if not, write to the Free Software
|
|
23 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
24 |
*/
|
|
25 |
|
|
26 |
package edu.ucsb.nceas.metacat.admin.upgrade;
|
|
27 |
|
|
28 |
import junit.framework.Test;
|
|
29 |
import junit.framework.TestSuite;
|
|
30 |
import edu.ucsb.nceas.MCTestCase;
|
|
31 |
|
|
32 |
/**
|
|
33 |
* A JUnit test for testing Metacat replication
|
|
34 |
*/
|
|
35 |
public class UpgradeNodeDataDatetimeTest
|
|
36 |
extends MCTestCase {
|
|
37 |
|
|
38 |
/**
|
|
39 |
* Constructor to build the test
|
|
40 |
*
|
|
41 |
* @param name the name of the test method
|
|
42 |
*/
|
|
43 |
public UpgradeNodeDataDatetimeTest(String name) {
|
|
44 |
super(name);
|
|
45 |
}
|
|
46 |
|
|
47 |
/**
|
|
48 |
* Establish a testing framework by initializing appropriate objects
|
|
49 |
*/
|
|
50 |
public void setUp() {
|
|
51 |
|
|
52 |
}
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Release any objects after tests are complete
|
|
56 |
*/
|
|
57 |
public void tearDown() {
|
|
58 |
}
|
|
59 |
|
|
60 |
/**
|
|
61 |
* Create a suite of tests to be run together
|
|
62 |
*/
|
|
63 |
public static Test suite() {
|
|
64 |
TestSuite suite = new TestSuite();
|
|
65 |
suite.addTest(new UpgradeNodeDataDatetimeTest("initialize"));
|
|
66 |
// Test basic functions
|
|
67 |
suite.addTest(new UpgradeNodeDataDatetimeTest("upgrade"));
|
|
68 |
|
|
69 |
return suite;
|
|
70 |
}
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Run an initial test that always passes to check that the test
|
|
74 |
* harness is working.
|
|
75 |
*/
|
|
76 |
public void initialize() {
|
|
77 |
assertTrue(1 == 1);
|
|
78 |
}
|
|
79 |
|
|
80 |
public void upgrade() throws Exception {
|
|
81 |
UpgradeNodeDataDatetime upgrader = new UpgradeNodeDataDatetime();
|
|
82 |
upgrader.upgrade();
|
|
83 |
}
|
|
84 |
|
|
85 |
}
|
|
86 |
|
0 |
87 |
|
use "test" to exercise upgrade code on staging DB.