1 |
4523
|
daigle
|
<!--
|
2 |
|
|
* sitemaps.html
|
3 |
|
|
*
|
4 |
|
|
* Authors: Michael Daigle
|
5 |
|
|
* Copyright: 2008 Regents of the University of California and the
|
6 |
|
|
* National Center for Ecological Analysis and Synthesis
|
7 |
|
|
* For Details: http://www.nceas.ucsb.edu/
|
8 |
|
|
* Created: 2008 November 4
|
9 |
|
|
* Version:
|
10 |
|
|
* File Info: '$ '
|
11 |
|
|
*
|
12 |
|
|
*
|
13 |
|
|
-->
|
14 |
|
|
<HTML>
|
15 |
|
|
<HEAD>
|
16 |
|
|
<TITLE>Testing Metacat</TITLE>
|
17 |
4528
|
daigle
|
<!-- unfortunately, we have to look for the common css file in the
|
18 |
|
|
user docs directory. This is because the user docs deploy to
|
19 |
|
|
the top level of the metacat docs on the knb web server -->
|
20 |
|
|
<link rel="stylesheet" type="text/css" href="../user/common.css">
|
21 |
4523
|
daigle
|
<link rel="stylesheet" type="text/css" href="./default.css">
|
22 |
|
|
</HEAD>
|
23 |
|
|
<BODY>
|
24 |
|
|
<table width="100%">
|
25 |
|
|
<tr>
|
26 |
|
|
<td class="tablehead" colspan="2"><p class="label">Testing Metacat</p></td>
|
27 |
|
|
<td class="tablehead" colspan="2" align="right">
|
28 |
4528
|
daigle
|
<a href="./metacat-eclipse-project.html">Back</a> | <a href="./index.html">Home</a> |
|
29 |
|
|
<!--a href="add next file here when one exists" -->Next<!-- /a -->
|
30 |
4523
|
daigle
|
</td>
|
31 |
|
|
</tr>
|
32 |
|
|
</table>
|
33 |
|
|
|
34 |
|
|
<div class="header1">Table of Contents</div>
|
35 |
|
|
<div class="toc">
|
36 |
|
|
<div class="toc1"><a href="#Intro">About Metacat Testing</a></div>
|
37 |
|
|
<div class="toc2"><a href="#Overview">Overview</a></div>
|
38 |
|
|
<div class="toc2"><a href="#MetacatImplementation">JUnit Implementation in Metacat</a></div>
|
39 |
|
|
<div class="toc1"><a href="#WritingTestCase">Writing a Test Case</a></div>
|
40 |
|
|
<div class="toc2"><a href="#Basics">Basics</a></div>
|
41 |
|
|
<div class="toc2"><a href="#MCTestCase">MCTestCase Base Class</a></div>
|
42 |
|
|
<div class="toc2"><a href="#BestPractices">Best Practices</a></div>
|
43 |
|
|
<div class="toc1"><a href="#RunTests">Running Test Cases</a></div>
|
44 |
|
|
<div class="toc2"><a href="#AntTask">Ant task</a></div>
|
45 |
|
|
<div class="toc2"><a href="#ConfigureMetacat">Configure Metacat For Testing</a></div>
|
46 |
|
|
<div class="toc2"><a href="#RunAllTests">Run All Tests</a></div>
|
47 |
|
|
<div class="toc2"><a href="#RunOneTest">Run One Test</a></div>
|
48 |
|
|
<div class="toc2"><a href="#ViewingOutput">Viewing Test Output</a></div>
|
49 |
4688
|
daigle
|
<div class="toc1"><a href="#TestDbVersions">Testing Different Database Schema Versions</a></div>
|
50 |
4723
|
daigle
|
<div class="toc2"><a href="#Scripts">Scripts to Run</a></div>
|
51 |
|
|
<div class="toc2"><a href="#CheckoutScripts">Get Scripts Via Checkout</a></div>
|
52 |
|
|
<div class="toc2"><a href="#ScriptRepo">Script Repository</a></div>
|
53 |
|
|
<div class="toc2"><a href="#ManuallyRunScripts">Manually Run Scripts</a></div>
|
54 |
|
|
<div class="toc1"><a href="#UserTesting">User Testing</a></div>
|
55 |
|
|
<div class="toc2"><a href="#TestingSkins">Testing Skins</a></div>
|
56 |
4801
|
daigle
|
<div class="toc2"><a href="#TestingWebLDAP">Testing LDAP Web Interface</a></div>
|
57 |
|
|
<div class="toc2"><a href="#TestingRegistry">Testing Metadata Registry</a></div>
|
58 |
4802
|
daigle
|
<div class="toc2"><a href="#TestingEcogridRegistry">Testing the EcoGrid Registry Service</a></div>
|
59 |
4523
|
daigle
|
</div>
|
60 |
|
|
|
61 |
|
|
<a name="Intro"></a><div class="header1">About Metacat Testing</div>
|
62 |
|
|
<a name="Overview"></a><div class="header2">Overview</div>
|
63 |
|
|
<p>Metacat uses JUnit tests to test its core functionality. These tests are
|
64 |
|
|
good for testing the internal workings of an application, but don't test the
|
65 |
|
|
layout and appearance. JUnit tests are meant to be one tool in the developer's
|
66 |
|
|
test arsinal. If you are not familiar with JUnit, you should search out some
|
67 |
|
|
tutorial documentation online. One such tutorial is at
|
68 |
|
|
<a href="http://clarkware.com/articles/JUnitPrimer.html"> The Clarkware JUnit primer</a></p>
|
69 |
|
|
|
70 |
|
|
<p>Metacat test cases will need to be run on the same server as the Metacat
|
71 |
|
|
instance that you want to test. Since Metacat and its test cases share the same
|
72 |
|
|
configuration files, there is no way to run the tests remotely.</p>
|
73 |
|
|
|
74 |
|
|
<a name="MetacatImplementation"></a><div class="header2">JUnit Implementation in Metacat</div>
|
75 |
|
|
<p>Metacat test cases are located in the code at:
|
76 |
|
|
<div class="code"><workspace>/metacat/test/edu/ucsb/nceas/metacat*/</div>
|
77 |
|
|
There you will find several java files that define JUnit tests.</p>
|
78 |
|
|
|
79 |
|
|
<p> Test cases are run via an ant task, and output from the tests appears in
|
80 |
|
|
a build directory. More on this to follow.</p>
|
81 |
|
|
|
82 |
|
|
<a name="WritingTestCase"></a><div class="header1">Writing a Test Case</div>
|
83 |
|
|
<a name="Basics"></a><div class="header2">Basics</div>
|
84 |
|
|
<p>All you need to do to get your JUnit test included into the Metacat test
|
85 |
|
|
suite is to create it in one of the <workspace>/test/edu/ucsb/nceas/metacat*/
|
86 |
|
|
directories. The ant test tasks will know that it should be run. </p>
|
87 |
|
|
|
88 |
|
|
<p> The following methods are required in a test case class:
|
89 |
|
|
<ul>
|
90 |
|
|
<li>public <Constructor>(String name) - The constructor for the test class. </li>
|
91 |
|
|
<li>public void setUp() - Set up any dependencies for the tests. This is run before each test case.</li>
|
92 |
|
|
<li>public void tearDown() - Release an resources used by the test.</li>
|
93 |
|
|
<li>public static Test suite() - define the test methods that need to be run.</li>
|
94 |
|
|
<li>public void initialize() - define any global initializations that need to be done.</li>
|
95 |
|
|
</ul>
|
96 |
|
|
|
97 |
|
|
You will test for failure using the many assertion methods available.</p>
|
98 |
|
|
|
99 |
|
|
<a name="MCTestCase"></a><div class="header2">MCTestCase Base Class</div>
|
100 |
|
|
<p>Metacat test cases extend the MCTestCase base class, which holds common
|
101 |
|
|
methods and variables. Some of these include:
|
102 |
|
|
<ul>
|
103 |
|
|
<li>SUCCESS/FALURE - boolean variables holding the values for success and failure. </li>
|
104 |
|
|
<li>metacatUrl, username, password - connection variables used for LDAP connectivity</li>
|
105 |
|
|
<li>readDocumentIdWhichEqualsDoc() - method to read a document from Metacat server.</li>
|
106 |
|
|
<li>debug() - method to display debug output to standard error.</li>
|
107 |
|
|
</ul>
|
108 |
|
|
These are just a few examples to give you an idea of what is in MCTestCase.
|
109 |
|
|
</p>
|
110 |
|
|
|
111 |
|
|
<a name="BestPractices"></a><div class="header2">Best Practices</div>
|
112 |
|
|
<p>The following are a few best practices when writing test cases:
|
113 |
|
|
<ul>
|
114 |
|
|
<li>Extend MCTestCase - Although strictly speaking, it is possible to bypass MCTestCase
|
115 |
|
|
and just extend the JUnit TestCase class, you should not do so. You should always
|
116 |
|
|
extend the MCTestCase class.</li>
|
117 |
|
|
<li>Extend Multiple Test Methods - Try to strike a balance between the number of test
|
118 |
|
|
methods and the size of each test. If a test method starts to get huge, you might see
|
119 |
|
|
if you can break it down into mulitple tests based on functionality. If the number of
|
120 |
|
|
tests in the test suite starts to get large, you might see if it makes sense to
|
121 |
|
|
separate them out into different test classes.</li>
|
122 |
|
|
<li>Use assertion message - Most assertion methods have an alternate implementation that
|
123 |
|
|
includes a message parameter. This message will be shown if the assertion fails. You
|
124 |
|
|
should use this version of the assertion method.</li>
|
125 |
|
|
<li>debug() - You should use the debug() method available in the MCTestCase class to
|
126 |
|
|
display debug output as opposed to System.err.println(). The test configuration will
|
127 |
|
|
allow you to turn off debug output when you use the debug() method.</li>
|
128 |
|
|
</ul>
|
129 |
|
|
|
130 |
|
|
<a name="RunTests"></a><div class="header1">Running Test Cases</div>
|
131 |
|
|
<a name="AntTask"></a><div class="header2">Ant task</div>
|
132 |
|
|
<p>As we discussed earlier, the test cases run from within ant tasks. There is a
|
133 |
|
|
task to run all tests and a task to run individual tests. </p>
|
134 |
|
|
<p>You will need to have ant installed on your system. For downloads and instructions,
|
135 |
|
|
visit the <a href="http://ant.apache.org/">Apache Ant site</a>.
|
136 |
|
|
</p>
|
137 |
|
|
<a name="ConfigureMetacat"></a><div class="header2">Configure Metacat For Testing</div>
|
138 |
|
|
<p>The test cases will look at the server's metacat properties file for configuration,
|
139 |
|
|
so there are two places that need to be configured.</p>
|
140 |
|
|
<p>First, you need to edit the configuration file at:
|
141 |
|
|
<div class="code"><workspace>/metacat/test/test.properties</div>
|
142 |
|
|
This should only hold one property: metacat.contextDir. This should point to
|
143 |
|
|
the context directory for the metacat server you are testing. For example:
|
144 |
|
|
<div class="code">metacat.contextDir=/usr/share/tomcat5.5/webapps/knb</div>
|
145 |
|
|
The test classes will use this to determine where to look for the server
|
146 |
|
|
metacat.properties file.</p>
|
147 |
|
|
|
148 |
|
|
<p>the remainder of the configuration needs to happen in the actual server's
|
149 |
|
|
metacat.properties file located at:
|
150 |
|
|
<div class="code"><workspace>/metacat/lib/metacat.properties</div>
|
151 |
4526
|
daigle
|
You will need to verify that all test.* properties are set correctly:
|
152 |
4523
|
daigle
|
<ul>
|
153 |
|
|
<li>test.printdebug - true if you want debug output, false otherwise </li>
|
154 |
|
|
<li>test.metacatUrl - the url for the metacat servlet (i.e. http://localhost:8080/knb/metacat)</li>
|
155 |
|
|
<li>test.contextUrl - the url for the metacat web service (i.e. http://localhost:8080/knb)</li>
|
156 |
|
|
<li>test.metacatDeployDir - the directory where metacat is physically deployed (i.e. /usr/local/tomcat/webapps/knb)</li>
|
157 |
|
|
<li>test.mcUser - the first metacat test user ("uid=kepler,o=unaffiliated,dc=ecoinformatics,dc=org" should be fine)</li>
|
158 |
|
|
<li>test.mcPassword - the first metacat test password ("kepler" should be fine)</li>
|
159 |
|
|
<li>test.mcAnotherUser - the second metacat test user. This user must be a member of the knb-usr
|
160 |
|
|
group in ldap. ("uid=test,o=NCEAS,dc=ecoinformatics,dc=org" should be fine)</li>
|
161 |
|
|
<li>test.mcAnotherPassword - the second metacat test password ("test" should be fine)</li>
|
162 |
|
|
<li>test.piscoUser - the pisco test user ("uid=piscotest,o=PISCO,dc=ecoinformatics,dc=org" should be fine)</li>
|
163 |
|
|
<li>test.piscoPassword - the pisco test password ("testPW" should be fine)</li>
|
164 |
|
|
<li>test.lterUser - the lter test user ("uid=tmonkey,o=LTER,dc=ecoinformatics,dc=org" should be fine)</li>
|
165 |
|
|
<li>test.lterPassword - the lter test password ("T3$tusr" should be fine)</li>
|
166 |
|
|
<li>test.testProperty - a property to verify that we can read properties (leave as "testing")</li>
|
167 |
|
|
</ul>
|
168 |
|
|
</p>
|
169 |
|
|
|
170 |
|
|
<p>Note that none of the test users should also be administrative users. This will mess up
|
171 |
|
|
the access tests since some document modifications will succeed when we expect them to fail.</p>
|
172 |
|
|
|
173 |
|
|
<p>Once this is done, you will need to rebuild and redeploy the Metacat server. Note that
|
174 |
|
|
changing these properties does nothing to change the way the Metacat server runs. Rebuilding
|
175 |
|
|
and redeploying merely makes the test properties available to the JUnit tests.</p>
|
176 |
|
|
|
177 |
|
|
<a name="RunAllTests"></a><div class="header2">Run All Tests</div>
|
178 |
|
|
<p>To run all tests, go to the <workspace>/metacat directory and type</p>
|
179 |
|
|
<div class="code">ant clean test</div>
|
180 |
|
|
You will see a line to standard output summarizing each test result.
|
181 |
|
|
</p>
|
182 |
|
|
|
183 |
|
|
<a name="RunOneTest"></a><div class="header2">Run One Test</div>
|
184 |
|
|
<p>To run one test, go to the <workspace>/metacat directory and type</p>
|
185 |
|
|
<div class="code">ant clean runonetest -Dtesttorun=<test_name></div>
|
186 |
|
|
Where <test_name> is the name of the JUnit test class (without .java on
|
187 |
|
|
the end). You will see debug information print to standard error.
|
188 |
|
|
</p>
|
189 |
|
|
|
190 |
|
|
<a name="ViewingOutput"></a><div class="header2">Viewing Test Output</div>
|
191 |
|
|
<p>Regardless of whether you ran one test or all tests, you will see output in
|
192 |
|
|
the Metacat build directory in your code at:
|
193 |
|
|
<div class="code"><workspace>/metacat/build</div>
|
194 |
|
|
There will be one output file for each test class. The files will look like
|
195 |
|
|
<div class="code">TEST-edu.ucsb.nceas.<test_dir>.<test_name>.txt</div>
|
196 |
|
|
where <test_dir> is the metacat* directory where the test lives and
|
197 |
|
|
<test_name> is the name of the JUnit test class. These output files will have
|
198 |
|
|
all standard error and standard out output as well as information on assertion
|
199 |
|
|
failures in the event of a failed test.
|
200 |
|
|
</p>
|
201 |
4688
|
daigle
|
|
202 |
|
|
<a name="TestDbVersions"></a><div class="header1">Testing Different Database Schema Versions</div>
|
203 |
|
|
<p>Now and again it is necessary to restore your test database to an older schema version
|
204 |
|
|
either because you need to test upgrade functionality, or you need to test backwords
|
205 |
|
|
compatibility of code. This section describes how to get your db schema to an older
|
206 |
|
|
version.
|
207 |
|
|
|
208 |
4723
|
daigle
|
<a name="Scripts"></a><div class="header2">Scripts to Run</div>
|
209 |
4688
|
daigle
|
<p>It is assumed that you have an empty metacat database up and running with a
|
210 |
|
|
metacat user.
|
211 |
|
|
<p>There are two types of scripts that need to be run in order to create a Metacat
|
212 |
|
|
schema:</p>
|
213 |
|
|
<ul>
|
214 |
|
|
<li>xmltables-<dbtype>.sql - where <dbtype> is either oracle or postgres
|
215 |
|
|
depending on what type of database you are running against. This script creates the
|
216 |
|
|
necessary tables for Metacat.</li>
|
217 |
|
|
<li>loaddtdschema-<dbtype>.sql - where <dbtype> is either oracle or postgres
|
218 |
|
|
depending on what type of database you are running against. This script creates the
|
219 |
|
|
necessary seed data for Metacat.</li>
|
220 |
|
|
</ul>
|
221 |
|
|
|
222 |
4723
|
daigle
|
<a name="CheckoutScripts"></a><div class="header2">Get Scripts Via Checkout</div>
|
223 |
4688
|
daigle
|
<p>One way to get the scripts you need is to check out the release tag for the version
|
224 |
|
|
of metacat that you want to install. You can then run the two scripts shown above to
|
225 |
|
|
create your database.</p>
|
226 |
|
|
|
227 |
4723
|
daigle
|
<a name="ScriptRepo"></a><div class="header2">Script Repository</div>
|
228 |
4688
|
daigle
|
<p>For convenience, the scripts to create each version have been extracted and
|
229 |
|
|
checked into:</p>
|
230 |
|
|
<div class="code"><metacat_code>/src/scripts/metacat-db-versions</div>
|
231 |
|
|
<p>The files look like:</p>
|
232 |
|
|
<ul>
|
233 |
|
|
<li><version>_xmltables-<dbtype>.sql - where <version> is the version
|
234 |
|
|
of the schema that you want to create and <dbtype> is either oracle or postgres
|
235 |
|
|
depending on what type of database you are running against. This script creates the
|
236 |
|
|
necessary tables for Metacat.</li>
|
237 |
|
|
<li><version>_loaddtdschema-<dbtype>.sql - where <version> is the version
|
238 |
|
|
of the schema that you want to create and <dbtype> is either oracle or postgres
|
239 |
|
|
depending on what type of database you are running against. This script creates the
|
240 |
|
|
necessary seed data for Metacat.</li>
|
241 |
|
|
<li><version>_cleanall-<dbtype>.sql - where <version> is the version
|
242 |
|
|
of the schema that you want to create and <dbtype> is either oracle or postgres
|
243 |
|
|
depending on what type of database you are running against. This is a convenience script
|
244 |
|
|
to clean out the changes for that version.</li>
|
245 |
|
|
</ul>
|
246 |
|
|
|
247 |
4723
|
daigle
|
<a name="ManuallyRunScripts"></a><div class="header2">Manually Run Scripts</div>
|
248 |
4688
|
daigle
|
<p>For instructions on running database scripts manually, please refer to:
|
249 |
|
|
<a href="../user/run-db-scripts.html">how to run database scripts</a></p>
|
250 |
4523
|
daigle
|
|
251 |
4723
|
daigle
|
<a name="UserTesting"></a><div class="header1">User Testing</div>
|
252 |
|
|
<p>The following sections describe some basic end user testing to stress
|
253 |
|
|
code that might not get tested by unit testing.</p>
|
254 |
|
|
|
255 |
|
|
<a name="TestingSkins"></a><div class="header2">Testing Skins</div>
|
256 |
|
|
<p>For each Skin:</p>
|
257 |
|
|
<ul>
|
258 |
|
|
<li>View main skin page by going to:
|
259 |
|
|
<div class="code">http://dev.nceas.ucsb.edu/knb/style/skins/<skin_name></div>
|
260 |
|
|
for each skin, where <skin_name> is in:
|
261 |
4801
|
daigle
|
<div class="code">default, nceas, esa, knb, lter, ltss, obfs, nrs, sanparks, saeon</div>
|
262 |
|
|
Note that the kepler skin is installed on a different metacat instance and can be found at:
|
263 |
|
|
<div class="code">http://kepler-dev.nceas.ucsb.edu/kepler</div>
|
264 |
4723
|
daigle
|
</li>
|
265 |
|
|
<li>Test logging in. Where applicable (available on the skin) log in using an LDAP account.</li>
|
266 |
|
|
<li>Test Basic searching
|
267 |
|
|
<ul>
|
268 |
|
|
<li>Do a basic search with nothing in the search field. Should return all docs.</li>
|
269 |
|
|
<li>Select a distinct word in the title of a doc. Go back to main page and search for
|
270 |
|
|
that word.</li>
|
271 |
|
|
<li>Select the link to the doc and open the metadata. Choose a distinct word from a
|
272 |
|
|
field that is not Title, Abstract, Keywords or Personnel. Go back to the main page and
|
273 |
|
|
search all fields (if applicable)</li>
|
274 |
|
|
</ul>
|
275 |
|
|
</li>
|
276 |
|
|
<li>Test Advanced Searching
|
277 |
|
|
<ul>
|
278 |
|
|
<li>On the main page, choose advanced search (if applicable)</li>
|
279 |
|
|
<li>Test a variety of different search criteria</li>
|
280 |
|
|
</ul>
|
281 |
|
|
</li>
|
282 |
|
|
<li>Test Registry (if applicable)
|
283 |
|
|
<ul>
|
284 |
|
|
<li>Create a new account</li>
|
285 |
|
|
<li>use the "forgot your password" link</li>
|
286 |
|
|
<li>change your password</li>
|
287 |
|
|
</ul>
|
288 |
|
|
</li>
|
289 |
|
|
<li>Test Viewing Document
|
290 |
|
|
<ul>
|
291 |
|
|
<li>Use your search to find a document</li>
|
292 |
|
|
<li>Choose the link to a document - you should see document details
|
293 |
|
|
<li>In a separate browser, try the shortcut to the doc:
|
294 |
|
|
<div class="code">http://dev.nceas.ucsb.edu/knb/metacat/<doc_id>/<skin_name></div>
|
295 |
|
|
You should see the same results as going to the doc via search.</li>
|
296 |
|
|
</ul>
|
297 |
|
|
</li>
|
298 |
|
|
<li>Download Metadata
|
299 |
|
|
<ul>
|
300 |
|
|
<li>Choose the metadata download</li>
|
301 |
|
|
<li>Save the file</li>
|
302 |
|
|
<li>view contents for basic validity (contents exist, etc)</li>
|
303 |
|
|
</ul>
|
304 |
|
|
</li>
|
305 |
4801
|
daigle
|
<li>Download Data
|
306 |
4723
|
daigle
|
<ul>
|
307 |
|
|
<li>Choose the data download</li>
|
308 |
|
|
<li>view the data for basic validity (contents exist, etc)</li>
|
309 |
|
|
</ul>
|
310 |
|
|
</li>
|
311 |
|
|
<li>View Data Table
|
312 |
|
|
<ul>
|
313 |
|
|
<li>Find a document with a data table</li>
|
314 |
|
|
<li>Choose to view the data table</li>
|
315 |
|
|
<li>view the data table for basic validity (contents exist, etc)</li>
|
316 |
|
|
</ul>
|
317 |
|
|
</li>
|
318 |
4801
|
daigle
|
</ul>
|
319 |
|
|
|
320 |
|
|
<a name="TestingWebLDAP"></a><div class="header2">Testing LDAP Web Interface</div>
|
321 |
|
|
<p>The following skins use a perl based LDAP web interface to create
|
322 |
|
|
accounts, change passwords and reset forgotten passwords: </p>
|
323 |
|
|
<div class="code">default, nceas, esa, knb, lter, ltss, obfs, nrs, sanparks, saeon</div>
|
324 |
|
|
<p>Following the instructions in the <a href="#TestingSkins"> Testing Skins</a> section
|
325 |
|
|
go to each of these skins and test:</p>
|
326 |
|
|
|
327 |
|
|
<ul>
|
328 |
|
|
<li>Create LDAP Account
|
329 |
|
|
<ul>
|
330 |
|
|
<li>Choose the "Create a New Account" link</li>
|
331 |
|
|
<li>Fill out the required information.
|
332 |
|
|
<ul>
|
333 |
|
|
<li>Choose a username that will be easy to find and remove from ldap later.</li>
|
334 |
|
|
<li>Use your real email address</li>
|
335 |
|
|
</ul>
|
336 |
|
|
</li>
|
337 |
|
|
<li>Hit the "Register" button</li>
|
338 |
|
|
<li>You may see a page with similar accounts. If so, choose to continue.</li>
|
339 |
|
|
<li>You should get a "Registration Succeeded" message.</li>
|
340 |
|
|
</ul>
|
341 |
|
|
</li>
|
342 |
|
|
<li>Change LDAP Password (if available)</li>
|
343 |
|
|
<ul>
|
344 |
|
|
<li>Choose the "Change Your Password" link</li>
|
345 |
|
|
<li>Fill out the requested information</li>
|
346 |
|
|
<li>Hit the "Change password" button</li>
|
347 |
|
|
<li>You should get a "Your password has been changed" message.</li>
|
348 |
|
|
</ul>
|
349 |
|
|
</li>
|
350 |
|
|
<li>Request Forgotten LDAP Password Reset
|
351 |
|
|
<ul>
|
352 |
|
|
<li>Choose the "Forgot Your Password" link</li>
|
353 |
|
|
<li>Enter your username</li>
|
354 |
|
|
<li>Hit the "Reset Password" button</li>
|
355 |
|
|
<li>You should get a "Your password has been reset" message.</li>
|
356 |
|
|
<li>You should get an email with your new password</li>
|
357 |
|
|
<li>Verify that you can log in with the new password</li>
|
358 |
|
|
</ul>
|
359 |
|
|
</li>
|
360 |
|
|
</ul>
|
361 |
|
|
|
362 |
|
|
<a name="TestingRegistry"></a><div class="header2">Testing Metadata Registry</div>
|
363 |
|
|
<p>The following skins use a perl based registry service to register metadata and
|
364 |
|
|
data in metacat via the web: </p>
|
365 |
|
|
<div class="code">nceas, esa, ltss, obfs, nrs, sanparks, saeon</div>
|
366 |
|
|
<p>Following the instructions in the <a href="#TestingSkins"> Testing Skins</a> section
|
367 |
|
|
go to each of these skins and test:</p>
|
368 |
|
|
|
369 |
|
|
<ul>
|
370 |
|
|
<li>Choose the "Register Dataset" link</li>
|
371 |
|
|
<li>Fill out required fields. Note that there are typically many different fields.
|
372 |
|
|
You should test out different combinations including attaching datasets if
|
373 |
|
|
available.</li>
|
374 |
|
|
<li>Hit the "Submit Dataset" button</li>
|
375 |
|
|
<li>Review the information for accuracy</li>
|
376 |
|
|
<li>Submit the data set</li>
|
377 |
|
|
<li>You should get a "Success" message.</li>
|
378 |
|
|
<li>Search for the data set in metacat and review for accuracy</li>
|
379 |
|
|
</ul>
|
380 |
|
|
|
381 |
|
|
<a name="TestingEcogridRegistry"></a><div class="header2">Testing the EcoGrid Registry Service</div>
|
382 |
|
|
<p>The EcoGrid registry service maintains a database of systems that are available to EcoGrid. Primarily,
|
383 |
|
|
these are Metacat instances which are built with the EcoGrid service automatically activated. Testing
|
384 |
|
|
the registry service is somewhat complicated. The procedure described here uses Eclipse to test.
|
385 |
|
|
These instructions assume that you have Eclipse installed and the Seek project set up as a Java project
|
386 |
|
|
in Eclipse.</p>
|
387 |
|
|
|
388 |
|
|
<ul>
|
389 |
|
|
<li>Configure the Seek project in Eclipse
|
390 |
|
|
<ul>
|
391 |
|
|
<li>Right click on the Seek project and go to Properties->Java Build Path->Source</li>
|
392 |
|
|
<li>Only the following two direcories should be set up as source:
|
393 |
|
|
<ul>
|
394 |
|
|
<li>seek/projects/ecogrid/src</li>
|
395 |
|
|
<li>seek/projects/ecogrid/tests</li>
|
396 |
|
|
</ul>
|
397 |
|
|
</li>
|
398 |
|
|
<li>Right click on the Seek project and go to Properties->Java Build Path->Libraries</li>
|
399 |
|
|
<li>Add all Jars from:
|
400 |
|
|
<ul>
|
401 |
|
|
<li>seek/projects/ecogrid/lib/</li>
|
402 |
|
|
<li>seek/projects/ecogrid/lib/axis-1_3/</li>
|
403 |
|
|
<li>seek/projects/ecogrid/build/lib/</li>
|
404 |
|
|
</ul>
|
405 |
|
|
</li>
|
406 |
|
|
<li>If you do not already have an Ant view open in Eclipse, in the menu, go to
|
407 |
|
|
Window->Show View->Ant</li>
|
408 |
|
|
<li>drag the file from the seek project at seek/projects/ecogrid/build.xml into
|
409 |
|
|
the Ant window you just opened.</li>
|
410 |
|
|
<li>Double click the serverjar and stubjar targets to build those jar files.<li>
|
411 |
|
|
<li>Right click on the Seek project and go to Properties->Java Build Path->Libraries</li>
|
412 |
|
|
<li>Add the two Jar files you just created:
|
413 |
|
|
<ul>
|
414 |
4839
|
daigle
|
<li>seek/projects/ecogrid/build/lib/RegistryServiceImpl.jar</li>
|
415 |
|
|
<li>seek/projects/ecogrid/build/lib/RegistryService-stub.jar</li>
|
416 |
4801
|
daigle
|
</ul>
|
417 |
|
|
</li>
|
418 |
|
|
</ul>
|
419 |
|
|
</li>
|
420 |
|
|
<li>View the RegistryServiceClient usage
|
421 |
|
|
<ul>
|
422 |
|
|
<li>In Eclipse, go to the registry service client at: <br>
|
423 |
|
|
seek/projects/ecogrid/src/org/ecoinformatics/ecogrid/client/RegistryServiceClient.java</li>
|
424 |
|
|
<li>Right click on RegistryServiceClient.java and go to Run As->Open Run Dialog</li>
|
425 |
|
|
<li>Name it something like "RegistryServiceClient noargs" since you are running it without arguments.</li>
|
426 |
|
|
<li>Hit the "Apply" button and then the "Run" button.</li>
|
427 |
|
|
<li>Proceed past the project error warning dialog</li>
|
428 |
|
|
<li>In the Eclipse console you should see usage instructions that look like:
|
429 |
|
|
<ul>
|
430 |
|
|
<li>Usage: java RegistryServiceClient add session_id local_file GSH</li>
|
431 |
|
|
<li>Usage: java RegistryServiceClient update session_id docid local_file GSH</li>
|
432 |
|
|
<li>Usage: java RegistryServiceClient remove session_id docid GSH</li>
|
433 |
|
|
<li>Usage: java RegistryServiceClient list session_id GSH</li>
|
434 |
|
|
<li>Usage: java RegistryServiceClient query session_id query_field query_string GSH</li>
|
435 |
|
|
</ul>
|
436 |
|
|
</li>
|
437 |
|
|
<li>Note: now you can run the client using the green "run" button in the Eclipse
|
438 |
|
|
menu. We will use that button from now on, instead of going to the java file.</li>
|
439 |
|
|
</ul>
|
440 |
|
|
</li>
|
441 |
|
|
<li>List Registry Services on dev
|
442 |
|
|
<ul>
|
443 |
|
|
<li>In Eclipse, go to the green run button dropdown and choose "Open Run Dialog"</li>
|
444 |
|
|
<li>Right click on the "RegistryServiceClient noargs" configuration you created earlier and choose "duplicate".</li>
|
445 |
|
|
<li>Name your new configuration "RegistryServiceClient list dev.nceas"
|
446 |
|
|
<li>Go to the Arguments tab and enter: list 12345 http://dev.nceas.ucsb.edu/registry/services/RegistryService
|
447 |
|
|
<ul>
|
448 |
|
|
<li>This conforms to the list usage we saw earlier</li>
|
449 |
|
|
<li>Note that the session ID is not needed for listing, so we include a random value.</li>
|
450 |
|
|
<li>GSH always refers to the server where the registry database is held.</li>
|
451 |
|
|
</ul>
|
452 |
|
|
</li>
|
453 |
|
|
<li>Choose "Run"</li>
|
454 |
|
|
<li>Proceed past the project error warning dialog</li>
|
455 |
|
|
<li>You should see a listing of details for all services registered on the dev server.</li>
|
456 |
|
|
</ul>
|
457 |
|
|
</li>
|
458 |
|
|
<li>Register a new service on dev
|
459 |
|
|
<ul>
|
460 |
|
|
<li>Look in your service list you just printed and find a service that has a
|
461 |
|
|
service type of: http://ecoinformatics.org/identifierservice-1.0.0</li>
|
462 |
|
|
<li>Get the service ID and use it to get the xml description from dev metacat by going to:</br>
|
463 |
|
|
http://kepler-dev.nceas.ucsb.edu/kepler/metacat/<service_id></li>
|
464 |
|
|
<li>Save the file to disk</li>
|
465 |
|
|
<li>Edit the file and change the id to something unique and the description to be something
|
466 |
|
|
easily recognizable.</li>
|
467 |
|
|
<li>In the browser, go to: http://kepler-dev.nceas.ucsb.edu/kepler/style/skins/dev/login.html</li>
|
468 |
|
|
<li>Log in and make note of the sessionId that was returned</li>
|
469 |
|
|
<li>In Eclipse, go to the green run button dropdown and choose "Open Run Dialog"</li>
|
470 |
|
|
<li>Right click on the "RegistryServiceClient noargs" configuration you created earlier and choose "duplicate".</li>
|
471 |
|
|
<li>Name your new configuration "RegistryServiceClient add-test dev.nceas"
|
472 |
|
|
<li>Go to the Arguments tab and enter: add <sessionId> <xml_file_path> http://dev.nceas.ucsb.edu/registry/services/RegistryService
|
473 |
|
|
<ul>
|
474 |
|
|
<li>This conforms to the add usage we saw earlier</li>
|
475 |
|
|
<li>The <sessionId> is the id you got after loggin in via the dev skin.</li>
|
476 |
|
|
<li>The <xml_file_path> is the full path to the descriptor file you downloaded and modified.</li>
|
477 |
|
|
<li>GSH always refers to the server where the registry database is held.</li>
|
478 |
|
|
</ul>
|
479 |
|
|
</li>
|
480 |
|
|
<li>Choose "Run"</li>
|
481 |
|
|
<li>Proceed past the project error warning dialog</li>
|
482 |
|
|
<li>You should see a message saying: "The new id is <id>, where <id> is the unique id
|
483 |
|
|
you added to the service descriptor file.</li>
|
484 |
|
|
<li>Follow the instructions shown above to list services to make sure your new service shows up</li>
|
485 |
|
|
</ul>
|
486 |
|
|
</li>
|
487 |
|
|
</ul>
|
488 |
|
|
|
489 |
4523
|
daigle
|
<br>
|
490 |
4528
|
daigle
|
<a href="./metacat-eclipse-project.html">Back</a> | <a href="./index.html">Home</a> |
|
491 |
|
|
<!--a href="add next file here when one exists" -->Next<!-- /a -->
|
492 |
4523
|
daigle
|
|
493 |
|
|
</BODY>
|
494 |
|
|
</HTML>
|