source: trunk/gli/src/org/greenstone/gatherer/msm/MDSTest.java@ 6550

Last change on this file since 6550 was 6550, checked in by jmt12, 20 years ago

A silly little test suite for the new metadata sets, which I'll keep around until I'm happy they work as they should.

  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1package org.greenstone.gatherer.msm;
2
3import java.io.*;
4import org.greenstone.gatherer.msm.MetadataSet;
5import org.greenstone.gatherer.util.Utility;
6import org.w3c.dom.*;
7
8public class MDSTest {
9
10 static public void main(String[] args) {
11 new MDSTest(args[0]);
12 }
13
14 private long final_memory;
15 private long max_memory;
16 private long starting_memory;
17
18 public MDSTest(String filename) {
19 //Runtime runtime = Runtime.getRuntime();
20 // Determine starting memory
21 //max_memory = runtime.maxMemory();
22 //System.err.println("Maximum memory: " + max_memory);
23 //starting_memory = runtime.freeMemory();
24 //System.err.println("Inital memory use: " + (max_memory - starting_memory));
25 // Parse and load the requested metadata set.
26 MetadataSet set = new MetadataSet(new File("metadata" + File.separator + filename));
27 // Output memory now
28 //System.err.println("Loading document took: " + ((max_memory - runtime.freeMemory()) - starting_memory));
29 // Now print out the name and description of the set, as well as the same for each element.
30 System.err.println("Name: " + set.getName());
31 System.err.println("Description: " + set.getDescription());
32 //System.err.println("***** Elements *****");
33 for(int i = 0; i < set.size(); i++) {
34 Element element = set.getElement(i);
35 System.err.println(MSMUtils.getIdentifier(element) + ": " + MSMUtils.getDescription(element));
36 }
37 //System.err.println("***** ******** *****");
38 // Output final memory
39 //System.err.println("Further exploring DOM took: " + ((max_memory - runtime.freeMemory()) - starting_memory));
40 }
41}
Note: See TracBrowser for help on using the repository browser.