Project

General

Profile

« Previous | Next » 

Revision 3875

Added by Jing Tao almost 16 years ago

Check into cvs head. Add initialize option statment at the beginging of the class.

View differences:

test/edu/ucsb/nceas/metacattest/OnlineDataAccessTest.java
41 41
import edu.ucsb.nceas.metacat.client.MetacatFactory;
42 42
import edu.ucsb.nceas.metacat.client.MetacatInaccessibleException;
43 43
import edu.ucsb.nceas.utilities.IOUtil;
44
import edu.ucsb.nceas.utilities.Options;
44 45
import junit.framework.Test;
45 46
import junit.framework.TestCase;
46 47
import junit.framework.TestSuite;
......
51 52
 */
52 53
public class OnlineDataAccessTest
53 54
    extends TestCase {
54

  
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
    }
55 69
    private String metacatUrl = MetaCatUtil.getOption("metacatUrl");
56 70
    private String username = MetaCatUtil.getOption("mcuser");
57 71
    private String password = MetaCatUtil.getOption("mcpassword");
test/edu/ucsb/nceas/metacattest/SitemapTest.java
43 43
 * @author Matt Jones
44 44
 */
45 45
public class SitemapTest extends TestCase {
46

  
46
	 /* Initialize Options*/
47
    static
48
    {
49
  	  try
50
  	  {
51
  		  Options.initialize(new File("build/tests/metacat.properties"));
52
  		  MetaCatUtil.pathsForIndexing 
53
  		         = MetaCatUtil.getOptionList(MetaCatUtil.getOption("indexPaths"));
54
  	  }
55
  	  catch(Exception e)
56
  	  {
57
  		  System.err.println("Exception in initialize option in MetacatServletNetTest "+e.getMessage());
58
  	  }
59
    }
47 60
    private String propertyFileName = 
48 61
    	MetaCatUtil.getOption("installDir") + "/WEB-INF/metacat.properties";
49 62
        // "/usr/share/tomcat5.5/webapps/knb/WEB-INF/metacat.properties";
test/edu/ucsb/nceas/metacattest/NonAsciiCharacterTest.java
41 41
import edu.ucsb.nceas.metacat.client.MetacatFactory;
42 42
import edu.ucsb.nceas.metacat.client.MetacatInaccessibleException;
43 43
import edu.ucsb.nceas.utilities.IOUtil;
44
import edu.ucsb.nceas.utilities.Options;
44 45
import junit.framework.Test;
45 46
import junit.framework.TestCase;
46 47
import junit.framework.TestSuite;
......
51 52
 */
52 53
public class NonAsciiCharacterTest
53 54
    extends TestCase {
54

  
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
    }
55 69
    private String metacatUrl = MetaCatUtil.getOption("metacatUrl");;
56 70
    private String username = MetaCatUtil.getOption("mcuser");
57 71
    private String password = MetaCatUtil.getOption("mcpassword");
test/edu/ucsb/nceas/metacattest/EventLogTest.java
44 44
 */
45 45
public class EventLogTest extends TestCase
46 46
{
47
	 /* Initialize Options*/
48
    static
49
    {
50
  	  try
51
  	  {
52
  		  Options.initialize(new File("build/tests/metacat.properties"));
53
  		  MetaCatUtil.pathsForIndexing 
54
  		         = MetaCatUtil.getOptionList(MetaCatUtil.getOption("indexPaths"));
55
  	  }
56
  	  catch(Exception e)
57
  	  {
58
  		  System.err.println("Exception in initialize option in MetacatServletNetTest "+e.getMessage());
59
  	  }
60
    }
61
	
47 62
    private String propertyFileName = 
48 63
    	MetaCatUtil.getOption("installDir") + "/WEB-INF/metacat.properties";
49 64

  
test/edu/ucsb/nceas/metacattest/MetaCatServletTest.java
47 47
 */
48 48
public class MetaCatServletTest extends TestCase
49 49
{
50
	/* Initialize Options*/
51
	  static
52
	  {
53
		  try
54
		  {
55
			  Options.initialize(new File("build/tests/metacat.properties"));
56
		  }
57
		  catch(Exception e)
58
		  {
59
			  System.err.println("Exception in initialize option in MetacatServletNetTest "+e.getMessage());
60
		  }
61
	  }
50 62
  private String metacatURL=MetaCatUtil.getOption("junittesturl");
51 63
  private String serialNumber;
52 64
  private static final Log log = LogFactory.getLog("edu.ucsb.nceas.metacattest.MetaCatServletTest");
53
  /* Initialize Options*/
54
  static
55
  {
56
	  try
57
	  {
58
		  Options.initialize(new File("build/tests/metacat.properties"));
59
	  }
60
	  catch(Exception e)
61
	  {
62
		  System.err.println("Exception in initialize option in MetacatServletNetTest "+e.getMessage());
63
	  }
64
  }
65 65
  
66
  
66 67
  /**
67 68
   * Constructor to build the test
68 69
   *
test/edu/ucsb/nceas/metacattest/client/MetacatClientTest.java
48 48
import edu.ucsb.nceas.metacat.client.MetacatFactory;
49 49
import edu.ucsb.nceas.metacat.client.MetacatInaccessibleException;
50 50
import edu.ucsb.nceas.utilities.IOUtil;
51
import edu.ucsb.nceas.utilities.Options;
51 52
import junit.framework.Test;
52 53
import junit.framework.TestCase;
53 54
import junit.framework.TestSuite;
......
60 61
 */
61 62
public class MetacatClientTest extends TestCase
62 63
{
64
	 /* Initialize Options*/
65
    static
66
    {
67
  	  try
68
  	  {
69
  		  Options.initialize(new File("build/tests/metacat.properties"));
70
  		  MetaCatUtil.pathsForIndexing 
71
  		         = MetaCatUtil.getOptionList(MetaCatUtil.getOption("indexPaths"));
72
  	  }
73
  	  catch(Exception e)
74
  	  {
75
  		  System.err.println("Exception in initialize option in MetacatServletNetTest "+e.getMessage());
76
  	  }
77
    }
63 78
    private String metacatUrl = MetaCatUtil.getOption("metacatUrl");
64 79
    private String wrongMetacatUrl=
65 80
                    "http://somepalce.somewhere.com/some/servlet/metacat";

Also available in: Unified diff