Project

General

Profile

1
/*  '$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
package edu.ucsb.nceas.metacat.util;
26

    
27
import junit.framework.Test;
28
import junit.framework.TestSuite;
29
import edu.ucsb.nceas.MCTestCase;
30

    
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
            //ids to upload to knb-mn:
76
            //connolly.301, kgordon.17.27
77
            MetacatPopulator mp = new MetacatPopulator(
78
                    "http://knb.ecoinformatics.org/knb",  
79
                    /*"http://localhost:8080/knb"*/
80
                    "https://demo1.test.dataone.org/metacat/d1/mn", 
81
                    //"https://knb-test-1.test.dataone.org/metacat/d1/mn", 
82
                    /*"msucci"*//*"connolly.301"*/ 
83
                    "tao.1.1", //"frog", 
84
                    "uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org", 
85
                    "kepler");
86
            mp.populate();
87
        }
88
        catch(Exception e)
89
        {
90
            e.printStackTrace();
91
            fail("Error: " + e.getMessage());
92
        }
93
    }
94
    
95
    /**
96
     * init
97
     */
98
    public void initialize()
99
    {
100
        assertTrue(1==1);
101
    }
102
}
    (1-1/1)