Project

General

Profile

1
/**
2
 *  '$RCSfile$'
3
 *  Copyright: 2010 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: tao $'
8
 *     '$Date: 2015-02-06 15:23:44 -0800 (Fri, 06 Feb 2015) $'
9
 * '$Revision: 9104 $'
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.dataone.v1;
27

    
28
import java.io.IOException;
29
import java.io.InputStream;
30
import java.io.InputStreamReader;
31
import java.io.Reader;
32
import java.math.BigInteger;
33
import java.util.Date;
34
import java.util.List;
35

    
36
import junit.framework.Test;
37
import junit.framework.TestSuite;
38

    
39
import org.apache.wicket.protocol.http.mock.MockHttpServletRequest;
40
import org.dataone.client.D1Node;
41
import org.dataone.client.NodeLocator;
42
import org.dataone.client.exception.ClientSideException;
43
import org.dataone.service.types.v1.AccessPolicy;
44
import org.dataone.service.types.v1.AccessRule;
45
import org.dataone.service.types.v1.Checksum;
46
import org.dataone.service.types.v1.Identifier;
47
import org.dataone.service.types.v2.Node;
48
import org.dataone.service.types.v2.ObjectFormatList;
49
import org.dataone.service.types.v1.NodeReference;
50
import org.dataone.service.types.v1.NodeType;
51
import org.dataone.service.types.v1.Permission;
52
import org.dataone.service.types.v1.Session;
53
import org.dataone.service.types.v1.Subject;
54
import org.dataone.service.types.v1.SystemMetadata;
55
import org.dataone.service.types.v1.util.ChecksumUtil;
56
import org.dataone.service.types.v2.TypeFactory;
57
import org.dataone.service.util.Constants;
58

    
59

    
60
import edu.ucsb.nceas.MCTestCase;
61
import edu.ucsb.nceas.metacat.client.Metacat;
62
import edu.ucsb.nceas.metacat.client.MetacatFactory;
63
import edu.ucsb.nceas.metacat.dataone.D1NodeServiceTest;
64

    
65
/**
66
 * A JUnit superclass for testing the dataone Node implementations
67
 */
68
public class D1NodeV1ServiceTest extends D1NodeServiceTest {   
69
    
70
    protected MockHttpServletRequest request;
71

    
72
	/**
73
    * constructor for the test
74
    */
75
    public D1NodeV1ServiceTest(String name) {
76
        super(name);
77
        // set up the fake request (for logging)
78
        request = new MockHttpServletRequest(null, null, null);
79
    }
80
  
81
   
82
    public static Test suite() 
83
    {
84
        TestSuite suite = new TestSuite();
85
        suite.addTest(new D1NodeV1ServiceTest("initialize"));
86
        return suite;
87
    }
88
	
89
    public void initialize() {
90
        assertTrue(true);
91
    }
92
	
93
	/**
94
	 * create system metadata with a specified id
95
	 */
96
	public SystemMetadata createV1SystemMetadata(Identifier id, Subject owner, InputStream object)
97
	  throws Exception
98
	{
99
	    org.dataone.service.types.v2.SystemMetadata v2Sysmeta = super.createSystemMetadata(id, owner, object);
100
	    SystemMetadata sm = TypeFactory.convertTypeFromType(v2Sysmeta, SystemMetadata.class);
101
        return sm;
102
	}
103
	
104
 
105
}
(2-2/2)