Project

General

Profile

1 5394 berkley
/*  '$RCSfile$'
2
 *  Copyright: 2010 Regents of the University of California and the
3
 *              National Center for Ecological Analysis and Synthesis
4
 *  Purpose: To test the Access Controls in metacat by JUnit
5
 *
6
 *   '$Author: berkley $'
7
 *     '$Date: 2010-05-03 14:26:08 -0700 (Fri, 14 Aug 2009) $'
8
 * '$Revision: 5027 $'
9
 *
10
 * This program is free software; you can redistribute it and/or modify
11
 * it under the terms of the GNU General Public License as published by
12
 * the Free Software Foundation; either version 2 of the License, or
13
 * (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU General Public License
21
 * along with this program; if not, write to the Free Software
22
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
 */
24
25 5568 berkley
package edu.ucsb.nceas.metacat.util;
26 5394 berkley
27
import junit.framework.Test;
28
import junit.framework.TestSuite;
29 6362 leinfelder
import edu.ucsb.nceas.MCTestCase;
30 5394 berkley
31
/**
32
 * A JUnit test for testing the dataone MetacatPopulator class
33
 */
34
public class MetacatPopulatorTest extends MCTestCase
35
{
36
    /**
37
    * consstructor for the test
38
    */
39
    public MetacatPopulatorTest(String name)
40
    {
41
        super(name);
42
    }
43
44
    /**
45
     * Establish a testing framework by initializing appropriate objects
46
     */
47
    public void setUp() throws Exception
48
    {
49
        super.setUp();
50
    }
51
52
    /**
53
     * Release any objects after tests are complete
54
     */
55
    public void tearDown()
56
    {
57
    }
58
59
    /**
60
     * Create a suite of tests to be run together
61
     */
62
    public static Test suite()
63
    {
64
        TestSuite suite = new TestSuite();
65
        suite.addTest(new MetacatPopulatorTest("initialize"));
66
        suite.addTest(new MetacatPopulatorTest("testPopulate"));
67
68
        return suite;
69
    }
70
71
    public void testPopulate()
72
    {
73
        try
74
        {
75 5595 berkley
            //ids to upload to knb-mn:
76
            //connolly.301, kgordon.17.27
77 5394 berkley
            MetacatPopulator mp = new MetacatPopulator(
78 5885 berkley
                    "http://knb.ecoinformatics.org/knb",
79 5595 berkley
                    /*"http://localhost:8080/knb"*/
80 5885 berkley
                    "http://knb-mn.ecoinformatics.org/knb/d1",
81 5874 berkley
                    /*"msucci"*//*"connolly.301"*/ "frog",
82
                    "uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org",
83
                    "kepler");
84 5394 berkley
            mp.populate();
85
        }
86
        catch(Exception e)
87
        {
88
            e.printStackTrace();
89
            fail("Error: " + e.getMessage());
90
        }
91
    }
92
93
    /**
94
     * init
95
     */
96
    public void initialize()
97
    {
98
        assertTrue(1==1);
99
    }
100
}