Project

General

Profile

« Previous | Next » 

Revision 6959

test harness for running system metadata generation outside of the upgrade process

View differences:

test/edu/ucsb/nceas/metacat/admin/upgrade/GenerateSystemMetadataTest.java
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 system metadata generation
34
 */
35
public class GenerateSystemMetadataTest
36
    extends MCTestCase {
37
    
38
	/**
39
     * Constructor to build the test
40
     *
41
     * @param name the name of the test method
42
     */
43
    public GenerateSystemMetadataTest(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 GenerateSystemMetadataTest("initialize"));
66
        // Test basic functions
67
        suite.addTest(new GenerateSystemMetadataTest("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
    	GenerateSystemMetadata upgrader = new GenerateSystemMetadata();
82
        upgrader.upgrade();
83
    }
84
    
85
}
86

  
0 87

  
build.xml
275 275
		<property name="docdir" value="./docs" />
276 276
		<property name="cgidir" value="./cgi-bin" />
277 277
		<property name="testdir" value="./test" />
278
		<property name="testtorun" value="UpgradeNodeDataDatetimeTest" />
278
		<property name="testtorun" value="GenerateSystemMetadataTest" />
279 279
		<property name="junittestsdir"
280 280
			value="./test/edu/ucsb/nceas/metacattest" />
281 281
		<property name="junitnettestsdir"

Also available in: Unified diff