Project

General

Profile

« Previous | Next » 

Revision 8762

add 'test' for indexing annotations without actually storing the RDF of the generated annotation.

View differences:

test/edu/ucsb/nceas/metacat/annotation/DatapackageSummarizerTest.java
79 79
		TestSuite suite = new TestSuite();
80 80
//		suite.addTest(new DatapackageSummarizerTest("testGenerateAnnotations"));
81 81
//		suite.addTest(new DatapackageSummarizerTest("testGenerateAnnotation"));
82
		suite.addTest(new DatapackageSummarizerTest("testStandaloneAnnotation"));
82
//		suite.addTest(new DatapackageSummarizerTest("testStandaloneAnnotation"));
83
		suite.addTest(new DatapackageSummarizerTest("testIndexAnnotations"));
83 84
//		suite.addTest(new DatapackageSummarizerTest("testGenerateRandomAnnotation"));
84 85
		return suite;
85 86
	}
......
169 170
		// check that it was parsed?
170 171
	}
171 172
	
173
	public void testIndexAnnotations() throws Exception {
174
		testGenerateAnnotations(true);
175
	}
176
	
172 177
	public void testGenerateAnnotations() throws Exception {
178
		testGenerateAnnotations(false);
179
	}
180
	
181
	private void testGenerateAnnotations(boolean indexOnly) throws Exception {
173 182
		
174 183
		// summarize the packages
175 184
		DatapackageSummarizer ds = new DatapackageSummarizer();
......
207 216
				pid.setValue(guid);
208 217
				identifiers.add(pid);
209 218
				
219
				// just index the annotation, don't save it
220
				if (indexOnly) {
221
					ds.indexEphemeralAnnotation(pid);
222
					continue;
223
				}
224
				
210 225
				String annotation = ds.generateAnnotation(pid);
211 226
				Identifier annotationPid = new Identifier();
212 227
				annotationPid.setValue("http://annotation/" + guid);

Also available in: Unified diff