Revision 49865
Added by Argiro Kokogiannaki over 6 years ago
TestClass.java | ||
---|---|---|
150 | 150 |
types.add(ClaimUtils.PUBLICATION); |
151 | 151 |
|
152 | 152 |
|
153 |
// claims = fetchClaimHandler.fetchClaimsByUser("i.fava@cineca.it",30,0,types);
|
|
153 |
claims = fetchClaimHandler.fetchClaimsByUser("argirok_1@hotmail.com",1,0,types, false);
|
|
154 | 154 |
// claims = fetchClaimHandler.fetchClaimsByUser("argirok@di.uoa.gr",3,0,null,"claim.claim_date",false,types,false); |
155 | 155 |
// |
156 | 156 |
// claims = fetchClaimHandler.fetchClaimsByProject("corda_______::ab9c77ce02967b24fc9c1a74276e4677",5,0); |
157 |
claims = fetchClaimHandler.fetchClaimsByProject("corda__h2020::94c962e736df90a5075a7f660ba3d7f6",12,0,null, "claim.claim_date",false,types,true); |
|
157 |
// claims = fetchClaimHandler.fetchClaimsByProject("corda__h2020::94c962e736df90a5075a7f660ba3d7f6",12,0,null, "claim.claim_date",false,types,true);
|
|
158 | 158 |
//claims = fetchClaimHandler.fetchClaimsByToken("corda__h2020::94c962e736df90a5075a7f660ba3d7f6","argiro@gmail.com",12,0,null, "claim.claim_date",false,types,false); |
159 | 159 |
|
160 | 160 |
// claims = fetchClaimHandler.fetchClaimsByDate("2016-01-14 14:53:50","2016-04-21",10,0); |
... | ... | |
192 | 192 |
public void testInsert() throws Exception, SQLStoreException { |
193 | 193 |
//acm_________::31e0e5e7cbd6e2556336d7e795f55c49 |
194 | 194 |
//dedup_wf_001::64ca1e3a4d1590456ad3dd7df8a18cd7 |
195 |
|
|
196 |
// String id=claimHandler.buildAndInsertClaim("argirok@di.uoa.gr", "project", "corda_______::2c37878a0cede85dbbd1081bb9b4a2f8", "openaire", "OPEN", null,"dataset", "10.5281/ZENODO.154647", "datacite", "EMBARGO","2017-05-01"); |
|
195 |
/* |
|
196 |
claimedBy argirok_1@hotmail.com |
|
197 |
sourceId corda_______::2c37878a0cede85dbbd1081bb9b4a2f8 |
|
198 |
sourceType project |
|
199 |
sourceCollectedFrom openaire |
|
200 |
sourceAccessRights OPEN |
|
201 |
sourceEmbargoEndDate |
|
202 |
targetId 10.1007/978-3-540-76323-9_4 |
|
203 |
targetType software |
|
204 |
targetCollectedFrom crossref |
|
205 |
targetAccessRights EMBARGO |
|
206 |
targetEmbargoEndDate 2028-11-10T13:55:47.935Z |
|
207 |
*/ |
|
208 |
String id=claimHandler.buildAndInsertClaim("argirok_1@hotmail.com", "project", "corda__h2020::94c962e736df90a5075a7f660ba3d7f6", "openaire", "OPEN", null,"software", "10.1007/978-3-540-76323-9_4", "crossref", "EMBARGO","2028-11-10T13:55:47.935Z"); |
|
197 | 209 |
|
198 | 210 |
|
199 | 211 |
// String id=claimHandler.buildAndInsertClaim("argirok@di.uoa.gr", "context", "egi::country::gr", |
... | ... | |
238 | 250 |
@Test |
239 | 251 |
public void testHttpRequest() throws Exception { |
240 | 252 |
SearchUtils searchUtils= new SearchUtils(); |
241 |
log.info(searchUtils.fetchPublicationXmlFromIndex("doajarticles::eb8a123eb82b25013b0001d0e2d1842b")); |
|
242 |
log.info(searchUtils.fetchDatasetXmlFromIndex("doajarticles::eb8a123eb82b25013b0001d0e2d1842b")); |
|
253 |
log.info(searchUtils.fetchPublicationXmlFromIndex("doajarticles::eb8a123eb82b25013b0001d0e2d1842b", false));
|
|
254 |
log.info(searchUtils.fetchDatasetXmlFromIndex("doajarticles::eb8a123eb82b25013b0001d0e2d1842b", false));
|
|
243 | 255 |
} |
244 | 256 |
|
245 | 257 |
@Test |
246 | 258 |
public void testXpath() throws Exception { |
247 |
Result r=indexResultHandler.fetchResultById("dedup_wf_001::88a1eedd1ffce63dccf51d8ce2053c85"); |
|
259 |
Result r=indexResultHandler.fetchResultById("dedup_wf_001::88a1eedd1ffce63dccf51d8ce2053c85", false);
|
|
248 | 260 |
} |
249 | 261 |
|
250 | 262 |
@Test |
263 |
public void testSoftwareXpath() throws Exception { |
|
264 |
// http://scoobydoo.di.uoa.gr:5000/search/software?softwareId=datacite____%3A%3Aabe9e916b29d028789d7ae3c6f79f254 |
|
265 |
Result r=indexResultHandler.fetchSoftwareById("datacite____::abe9e916b29d028789d7ae3c6f79f254", false); |
|
266 |
if(r!=null){ |
|
267 |
System.out.println(r.toString()); |
|
268 |
} |
|
269 |
|
|
270 |
} |
|
271 |
@Test |
|
272 |
public void testPublicationXpath() throws Exception { |
|
273 |
Result r=indexResultHandler.fetchPublicationById("od________18::5acd89ab4df2b877a7a208ea2a123a87", false); |
|
274 |
if(r!=null){ |
|
275 |
System.out.println(r.toString()); |
|
276 |
} |
|
277 |
|
|
278 |
} |
|
279 |
|
|
280 |
@Test |
|
251 | 281 |
public void testParsingDMF() throws IOException, SAXException, ParserConfigurationException, XPathExpressionException, TransformerException { |
252 | 282 |
Result r=DMFParser.dmf2Result("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + |
253 | 283 |
"<record xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:prov=\"http://www.openarchives.org/OAI/2.0/provenance\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\" xmlns:dr=\"http://www.driver-repository.eu/namespace/dr\" xmlns:oaf=\"http://namespace.openaire.eu/oaf\">\n" + |
... | ... | |
307 | 337 |
@Test |
308 | 338 |
public void buildProject() throws Exception { |
309 | 339 |
String id = "arc_________::089188bbc5db213fb2b00a0d93043fc4"; |
310 |
Project pr = projectHandler.fetchProjectByID(id); |
|
340 |
Project pr = projectHandler.fetchProjectByID(id,false);
|
|
311 | 341 |
log.info(pr.toString()); |
312 | 342 |
id="corda_______::404d91e07cd4d32fddd8fc636ad4daf7"; |
313 |
pr = projectHandler.fetchProjectByID(id); |
|
343 |
pr = projectHandler.fetchProjectByID(id, false);
|
|
314 | 344 |
log.info(pr.toString()); |
315 | 345 |
|
316 | 346 |
} |
Also available in: Unified diff
change migration procedure: search first in beta then in production| add software | change directIndexHandler check for response