Project

General

Profile

« Previous | Next » 

Revision 4080

Added by daigle about 16 years ago

Merge 1.9 changes into Head

View differences:

NonAsciiCharacterTest.java
33 33
import java.util.SimpleTimeZone;
34 34
import java.util.TimeZone;
35 35

  
36
import edu.ucsb.nceas.metacat.MetaCatUtil;
37 36
import edu.ucsb.nceas.metacat.client.InsufficientKarmaException;
38 37
import edu.ucsb.nceas.metacat.client.Metacat;
39 38
import edu.ucsb.nceas.metacat.client.MetacatAuthException;
40 39
import edu.ucsb.nceas.metacat.client.MetacatException;
41 40
import edu.ucsb.nceas.metacat.client.MetacatFactory;
42 41
import edu.ucsb.nceas.metacat.client.MetacatInaccessibleException;
42
import edu.ucsb.nceas.metacat.service.PropertyService;
43
import edu.ucsb.nceas.metacat.util.SystemUtil;
43 44
import edu.ucsb.nceas.utilities.IOUtil;
44
import edu.ucsb.nceas.utilities.Options;
45
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
45 46
import junit.framework.Test;
46 47
import junit.framework.TestCase;
47 48
import junit.framework.TestSuite;
......
52 53
 */
53 54
public class NonAsciiCharacterTest
54 55
    extends TestCase {
55
	 /* Initialize Options*/
56
    static
57
    {
58
  	  try
59
  	  {
60
  		  Options.initialize(new File("build/tests/metacat.properties"));
61
  		  MetaCatUtil.pathsForIndexing 
62
  		         = MetaCatUtil.getOptionList(MetaCatUtil.getOption("indexPaths"));
63
  	  }
64
  	  catch(Exception e)
65
  	  {
66
  		  System.err.println("Exception in initialize option in MetacatServletNetTest "+e.getMessage());
67
  	  }
68
    }
69
    private String metacatUrl = MetaCatUtil.getOption("metacatUrl");;
70
    private String username = MetaCatUtil.getOption("mcuser");
71
    private String password = MetaCatUtil.getOption("mcpassword");
72
    private String anotheruser = MetaCatUtil.getOption("mcanotheruser");
73
    private String anotherpassword = MetaCatUtil.getOption("mcanotherpassword");
56

  
57
    private static String metacatUrl;
58
    private static String username;
59
	private static String password;
60
	private static String anotheruser;
61
	private static String anotherpassword;
62
	static {
63
		try {
64
		    metacatUrl = SystemUtil.getServletURL();
65
			username = PropertyService.getProperty("mcuser");
66
			password = PropertyService.getProperty("mcpassword");
67
			anotheruser = PropertyService.getProperty("mcanotheruser");
68
			anotherpassword = PropertyService.getProperty("mcanotherpassword");
69
		} catch (PropertyNotFoundException pnfe) {
70
			System.err.println("Could not get property in static block: " 
71
					+ pnfe.getMessage());
72
		}
73
	}
74

  
74 75
    private String prefix = "test";
75 76
    private String newdocid = null;
76 77
    private String testdocument = "";

Also available in: Unified diff