Revision 10315
Added by Jing Tao over 7 years ago
test/edu/ucsb/nceas/metacattest/IdentifierManagerTest.java | ||
---|---|---|
350 | 350 |
seriesId.setValue(sid1); |
351 | 351 |
System.out.println("the first sid is "+seriesId.getValue()); |
352 | 352 |
sysmeta.setSeriesId(seriesId); |
353 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
353 | 354 |
MNodeService.getInstance(request).create(session, guid, object, sysmeta); |
354 | 355 |
System.out.println("the first pid is "+guid.getValue()); |
355 | 356 |
Identifier head = IdentifierManager.getInstance().getHeadPID(seriesId); |
... | ... | |
365 | 366 |
Identifier newPid = new Identifier(); |
366 | 367 |
newPid.setValue(generateDocumentId()+"1"); |
367 | 368 |
System.out.println("the second pid is "+newPid.getValue()); |
369 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
368 | 370 |
SystemMetadata newSysMeta = createSystemMetadata(newPid, session.getSubject(), object); |
369 | 371 |
newSysMeta.setObsoletes(guid); |
370 | 372 |
newSysMeta.setSeriesId(seriesId); |
373 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
371 | 374 |
MNodeService.getInstance(request).update(session, guid, object, newPid, newSysMeta); |
372 | 375 |
|
373 | 376 |
//check |
... | ... | |
392 | 395 |
|
393 | 396 |
//case-2 P1(S1) ? P2(S1), S1 = P2 |
394 | 397 |
// http://jenkins-1.dataone.org/documentation/unstable/API-Documentation-development/design/ContentMutability.html |
398 |
System.out.println("case 2======= "); |
|
395 | 399 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
396 | 400 |
Identifier pid1_case2 = new Identifier(); |
397 | 401 |
pid1_case2.setValue(generateDocumentId()); |
... | ... | |
400 | 404 |
sid_case2.setValue(sid_case2_str); |
401 | 405 |
SystemMetadata sysmeta_case2 = createSystemMetadata(pid1_case2, session.getSubject(), object); |
402 | 406 |
sysmeta_case2.setSeriesId(sid_case2); |
407 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
403 | 408 |
CNodeService.getInstance(request).create(session, pid1_case2, object, sysmeta_case2); |
404 | 409 |
|
405 | 410 |
Thread.sleep(1000); |
406 | 411 |
Identifier pid2_case2 = new Identifier(); |
407 | 412 |
pid2_case2.setValue(generateDocumentId()); |
413 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
408 | 414 |
sysmeta = createSystemMetadata(pid2_case2, session.getSubject(), object); |
409 | 415 |
sysmeta.setSeriesId(sid_case2); |
410 |
try { |
|
416 |
//try { |
|
417 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
411 | 418 |
CNodeService.getInstance(request).create(session, pid2_case2, object, sysmeta); |
412 |
fail("we shouldn't get here and an InvalidSystemMetacat exception should be thrown."); |
|
413 |
} catch (Exception e) { |
|
414 |
System.out.println("case 2======= Invalid system metadata to insert the second object"); |
|
419 |
//fail("we shouldn't get here and an InvalidSystemMetacat exception should be thrown."); |
|
420 |
head = IdentifierManager.getInstance().getHeadPID(sid_case2); |
|
421 |
assertTrue(head.getValue().equals(pid2_case2.getValue())); |
|
422 |
|
|
423 |
//} catch (Exception e) { |
|
424 |
/*System.out.println("case 2======= Invalid system metadata to insert the second object"); |
|
415 | 425 |
//check |
416 | 426 |
meta = CNodeService.getInstance(request).getSystemMetadata(session, pid1_case2); |
417 | 427 |
assertTrue(meta.getObsoletedBy() == null); |
418 | 428 |
assertTrue(meta.getObsoletes() == null); |
419 | 429 |
// the pid should be the newPid when we try to get the sid1 |
420 | 430 |
head = IdentifierManager.getInstance().getHeadPID(sid_case2); |
421 |
assertTrue(head.getValue().equals(pid1_case2.getValue())); |
|
422 |
} |
|
431 |
assertTrue(head.getValue().equals(pid1_case2.getValue()));*/
|
|
432 |
//}
|
|
423 | 433 |
|
424 | 434 |
|
425 | 435 |
//case-3 P1(S1) <- P2(S1), S1 = P2, Discouraged, but not error condition, S1 = P2 (P1 and P2 are type 1 ends, not an ideal chain ) |
... | ... | |
431 | 441 |
sid_case3.setValue(sid_case3_str); |
432 | 442 |
SystemMetadata sysmeta_case3 = createSystemMetadata(pid1_case3, session.getSubject(), object); |
433 | 443 |
sysmeta_case3.setSeriesId(sid_case3); |
444 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
434 | 445 |
CNodeService.getInstance(request).create(session, pid1_case3, object, sysmeta_case3); |
435 | 446 |
|
436 | 447 |
Thread.sleep(1000); |
... | ... | |
440 | 451 |
SystemMetadata sysmeta2_case3 = createSystemMetadata(pid2_case3, session.getSubject(), object); |
441 | 452 |
sysmeta2_case3.setSeriesId(sid_case3); |
442 | 453 |
sysmeta2_case3.setObsoletes(pid1_case3); |
454 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
443 | 455 |
CNodeService.getInstance(request).create(session, pid2_case3, object, sysmeta2_case3); |
444 | 456 |
|
445 | 457 |
//check |
... | ... | |
463 | 475 |
sid_case4.setValue("sid."+System.nanoTime()); |
464 | 476 |
SystemMetadata sysmeta_case4 = createSystemMetadata(pid1_case4, session.getSubject(), object); |
465 | 477 |
sysmeta_case4.setSeriesId(sid_case4); |
478 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
466 | 479 |
CNodeService.getInstance(request).create(session, pid1_case4, object, sysmeta_case4); |
467 | 480 |
|
468 | 481 |
Thread.sleep(1000); |
... | ... | |
472 | 485 |
SystemMetadata sysmeta2_case4 = createSystemMetadata(pid2_case4, session.getSubject(), object); |
473 | 486 |
sysmeta2_case4.setSeriesId(sid_case4); |
474 | 487 |
sysmeta2_case4.setObsoletes(pid1_case4); |
488 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
475 | 489 |
CNodeService.getInstance(request).create(session, pid2_case4, object, sysmeta2_case4); |
476 | 490 |
|
477 | 491 |
sysmeta_case4.setObsoletedBy(pid2_case4); |
... | ... | |
488 | 502 |
SystemMetadata sysmeta3_case4 = createSystemMetadata(pid3_case4, session.getSubject(), object); |
489 | 503 |
sysmeta3_case4.setSeriesId(sid2_case4); |
490 | 504 |
sysmeta3_case4.setObsoletes(pid2_case4); |
505 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
491 | 506 |
CNodeService.getInstance(request).create(session, pid3_case4, object, sysmeta3_case4); |
492 | 507 |
|
493 | 508 |
sysmeta2_case4.setObsoletedBy(pid3_case4); |
... | ... | |
523 | 538 |
sid_case5.setValue("sid."+System.nanoTime()); |
524 | 539 |
SystemMetadata sysmeta1_case5 = createSystemMetadata(pid1_case5, session.getSubject(), object); |
525 | 540 |
sysmeta1_case5.setSeriesId(sid_case5); |
541 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
526 | 542 |
CNodeService.getInstance(request).create(session, pid1_case5, object, sysmeta1_case5); |
527 | 543 |
|
528 | 544 |
Thread.sleep(1000); |
... | ... | |
532 | 548 |
SystemMetadata sysmeta2_case5 = createSystemMetadata(pid2_case5, session.getSubject(), object); |
533 | 549 |
sysmeta2_case5.setSeriesId(sid_case5); |
534 | 550 |
sysmeta2_case5.setObsoletes(pid1_case5); |
551 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
535 | 552 |
CNodeService.getInstance(request).create(session, pid2_case5, object, sysmeta2_case5); |
536 | 553 |
|
537 | 554 |
Thread.sleep(1000); |
... | ... | |
543 | 560 |
SystemMetadata sysmeta3_case5 = createSystemMetadata(pid3_case5, session.getSubject(), object); |
544 | 561 |
sysmeta3_case5.setSeriesId(sid2_case5); |
545 | 562 |
sysmeta3_case5.setObsoletes(pid2_case5); |
563 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
546 | 564 |
CNodeService.getInstance(request).create(session, pid3_case5, object, sysmeta3_case5); |
547 | 565 |
|
548 | 566 |
//check |
... | ... | |
573 | 591 |
sid_case6.setValue("sid."+System.nanoTime()); |
574 | 592 |
SystemMetadata sysmeta_case6 = createSystemMetadata(pid1_case6, session.getSubject(), object); |
575 | 593 |
sysmeta_case6.setSeriesId(sid_case6); |
594 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
576 | 595 |
CNodeService.getInstance(request).create(session, pid1_case6, object, sysmeta_case6); |
577 | 596 |
|
578 | 597 |
Thread.sleep(1000); |
... | ... | |
582 | 601 |
SystemMetadata sysmeta2_case6 = createSystemMetadata(pid2_case6, session.getSubject(), object); |
583 | 602 |
sysmeta2_case6.setSeriesId(sid_case6); |
584 | 603 |
sysmeta2_case6.setObsoletes(pid1_case6); |
604 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
585 | 605 |
CNodeService.getInstance(request).create(session, pid2_case6, object, sysmeta2_case6); |
586 | 606 |
|
587 | 607 |
sysmeta_case6.setObsoletedBy(pid2_case6); |
... | ... | |
595 | 615 |
pid3_case6.setValue(generateDocumentId()); |
596 | 616 |
SystemMetadata sysmeta3_case6 = createSystemMetadata(pid3_case6, session.getSubject(), object); |
597 | 617 |
sysmeta3_case6.setObsoletes(pid2_case6); |
618 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
598 | 619 |
CNodeService.getInstance(request).create(session, pid3_case6, object, sysmeta3_case6); |
599 | 620 |
|
600 | 621 |
sysmeta2_case6.setObsoletedBy(pid3_case6); |
... | ... | |
628 | 649 |
sid_case7.setValue("sid."+System.nanoTime()); |
629 | 650 |
SystemMetadata sysmeta_case7 = createSystemMetadata(pid1_case7, session.getSubject(), object); |
630 | 651 |
sysmeta_case7.setSeriesId(sid_case7); |
652 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
631 | 653 |
CNodeService.getInstance(request).create(session, pid1_case7, object, sysmeta_case7); |
632 | 654 |
|
633 | 655 |
Thread.sleep(1000); |
... | ... | |
637 | 659 |
SystemMetadata sysmeta2_case7 = createSystemMetadata(pid2_case7, session.getSubject(), object); |
638 | 660 |
sysmeta2_case7.setSeriesId(sid_case7); |
639 | 661 |
sysmeta2_case7.setObsoletes(pid1_case7); |
662 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
640 | 663 |
CNodeService.getInstance(request).create(session, pid2_case7, object, sysmeta2_case7); |
641 | 664 |
|
642 | 665 |
sysmeta_case7.setObsoletedBy(pid2_case7); |
... | ... | |
650 | 673 |
pid3_case7.setValue(generateDocumentId()); |
651 | 674 |
SystemMetadata sysmeta3_case7 = createSystemMetadata(pid3_case7, session.getSubject(), object); |
652 | 675 |
sysmeta3_case7.setObsoletes(pid2_case7); |
676 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
653 | 677 |
CNodeService.getInstance(request).create(session, pid3_case7, object, sysmeta3_case7); |
654 | 678 |
|
655 | 679 |
sysmeta2_case7.setObsoletedBy(pid3_case7); |
... | ... | |
666 | 690 |
SystemMetadata sysmeta4_case7 = createSystemMetadata(pid4_case7, session.getSubject(), object); |
667 | 691 |
sysmeta4_case7.setObsoletes(pid3_case7); |
668 | 692 |
sysmeta4_case7.setSeriesId(sid2_case7); |
693 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
669 | 694 |
CNodeService.getInstance(request).create(session, pid4_case7, object, sysmeta4_case7); |
670 | 695 |
|
671 | 696 |
sysmeta3_case7.setObsoletedBy(pid4_case7); |
... | ... | |
705 | 730 |
sid_case8.setValue("sid."+System.nanoTime()); |
706 | 731 |
SystemMetadata sysmeta_case8 = createSystemMetadata(pid1_case8, session.getSubject(), object); |
707 | 732 |
sysmeta_case8.setSeriesId(sid_case8); |
733 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
708 | 734 |
CNodeService.getInstance(request).create(session, pid1_case8, object, sysmeta_case8); |
709 | 735 |
|
710 | 736 |
Thread.sleep(1000); |
... | ... | |
714 | 740 |
SystemMetadata sysmeta2_case8 = createSystemMetadata(pid2_case8, session.getSubject(), object); |
715 | 741 |
sysmeta2_case8.setSeriesId(sid_case8); |
716 | 742 |
sysmeta2_case8.setObsoletes(pid1_case8); |
743 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
717 | 744 |
CNodeService.getInstance(request).create(session, pid2_case8, object, sysmeta2_case8); |
718 | 745 |
|
719 | 746 |
sysmeta_case8.setObsoletedBy(pid2_case8); |
... | ... | |
728 | 755 |
SystemMetadata sysmeta3_case8 = createSystemMetadata(pid3_case8, session.getSubject(), object); |
729 | 756 |
sysmeta3_case8.setObsoletes(pid2_case8); |
730 | 757 |
sysmeta3_case8.setSeriesId(sid_case8); |
758 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
731 | 759 |
CNodeService.getInstance(request).create(session, pid3_case8, object, sysmeta3_case8); |
732 | 760 |
|
733 | 761 |
sysmeta2_case8.setObsoletedBy(pid3_case8); |
... | ... | |
744 | 772 |
SystemMetadata sysmeta4_case8 = createSystemMetadata(pid4_case8, session.getSubject(), object); |
745 | 773 |
sysmeta4_case8.setObsoletes(pid3_case8); |
746 | 774 |
sysmeta4_case8.setSeriesId(sid_case8); |
775 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
747 | 776 |
CNodeService.getInstance(request).create(session, pid4_case8, object, sysmeta4_case8); |
748 | 777 |
|
749 | 778 |
//delete pid3_case8 |
... | ... | |
782 | 811 |
sid_case9.setValue("sid."+System.nanoTime()); |
783 | 812 |
SystemMetadata sysmeta_case9 = createSystemMetadata(pid1_case9, session.getSubject(), object); |
784 | 813 |
sysmeta_case9.setSeriesId(sid_case9); |
814 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
785 | 815 |
CNodeService.getInstance(request).create(session, pid1_case9, object, sysmeta_case9); |
786 | 816 |
|
787 | 817 |
Thread.sleep(1000); |
... | ... | |
791 | 821 |
SystemMetadata sysmeta2_case9 = createSystemMetadata(pid2_case9, session.getSubject(), object); |
792 | 822 |
sysmeta2_case9.setSeriesId(sid_case9); |
793 | 823 |
sysmeta2_case9.setObsoletes(pid1_case9); |
824 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
794 | 825 |
CNodeService.getInstance(request).create(session, pid2_case9, object, sysmeta2_case9); |
795 | 826 |
|
796 | 827 |
sysmeta_case9.setObsoletedBy(pid2_case9); |
... | ... | |
808 | 839 |
SystemMetadata sysmeta3_case9 = createSystemMetadata(pid3_case9, session.getSubject(), object); |
809 | 840 |
sysmeta3_case9.setObsoletes(pid2_case9); |
810 | 841 |
sysmeta3_case9.setSeriesId(sid_case9); |
842 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
811 | 843 |
CNodeService.getInstance(request).create(session, pid3_case9, object, sysmeta3_case9); |
812 | 844 |
|
813 | 845 |
//sysmeta2_case8.setObsoletedBy(pid3_case8); |
... | ... | |
822 | 854 |
SystemMetadata sysmeta4_case9 = createSystemMetadata(pid4_case9, session.getSubject(), object); |
823 | 855 |
sysmeta4_case9.setObsoletes(pid3_case9); |
824 | 856 |
sysmeta4_case9.setSeriesId(sid_case9); |
857 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
825 | 858 |
CNodeService.getInstance(request).create(session, pid4_case9, object, sysmeta4_case9); |
826 | 859 |
|
827 | 860 |
//delete pid3_case8 |
... | ... | |
860 | 893 |
sid_case10.setValue("sid."+System.nanoTime()); |
861 | 894 |
SystemMetadata sysmeta_case10 = createSystemMetadata(pid1_case10, session.getSubject(), object); |
862 | 895 |
sysmeta_case10.setSeriesId(sid_case10); |
896 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
863 | 897 |
CNodeService.getInstance(request).create(session, pid1_case10, object, sysmeta_case10); |
864 | 898 |
|
865 | 899 |
Thread.sleep(1000); |
... | ... | |
869 | 903 |
SystemMetadata sysmeta2_case10 = createSystemMetadata(pid2_case10, session.getSubject(), object); |
870 | 904 |
sysmeta2_case10.setSeriesId(sid_case10); |
871 | 905 |
sysmeta2_case10.setObsoletes(pid1_case10); |
906 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
872 | 907 |
CNodeService.getInstance(request).create(session, pid2_case10, object, sysmeta2_case10); |
873 | 908 |
|
874 | 909 |
sysmeta_case10.setObsoletedBy(pid2_case10); |
... | ... | |
886 | 921 |
SystemMetadata sysmeta3_case10 = createSystemMetadata(pid3_case10, session.getSubject(), object); |
887 | 922 |
sysmeta3_case10.setObsoletes(pid2_case10); |
888 | 923 |
sysmeta3_case10.setSeriesId(sid_case10); |
924 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
889 | 925 |
CNodeService.getInstance(request).create(session, pid3_case10, object, sysmeta3_case10); |
890 | 926 |
|
891 | 927 |
sysmeta2_case10.setObsoletedBy(pid3_case10); |
... | ... | |
902 | 938 |
SystemMetadata sysmeta4_case10 = createSystemMetadata(pid4_case10, session.getSubject(), object); |
903 | 939 |
sysmeta4_case10.setObsoletes(pid3_case10); |
904 | 940 |
sysmeta4_case10.setSeriesId(sid_case10); |
941 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
905 | 942 |
CNodeService.getInstance(request).create(session, pid4_case10, object, sysmeta4_case10); |
906 | 943 |
|
907 | 944 |
//delete pid3_case10 |
... | ... | |
940 | 977 |
sid_case11.setValue("sid."+System.nanoTime()); |
941 | 978 |
SystemMetadata sysmeta_case11 = createSystemMetadata(pid1_case11, session.getSubject(), object); |
942 | 979 |
sysmeta_case11.setSeriesId(sid_case11); |
980 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
943 | 981 |
CNodeService.getInstance(request).create(session, pid1_case11, object, sysmeta_case11); |
944 | 982 |
|
945 | 983 |
Thread.sleep(1000); |
... | ... | |
949 | 987 |
SystemMetadata sysmeta2_case11 = createSystemMetadata(pid2_case11, session.getSubject(), object); |
950 | 988 |
sysmeta2_case11.setSeriesId(sid_case11); |
951 | 989 |
sysmeta2_case11.setObsoletes(pid1_case11); |
990 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
952 | 991 |
CNodeService.getInstance(request).create(session, pid2_case11, object, sysmeta2_case11); |
953 | 992 |
|
954 | 993 |
sysmeta_case11.setObsoletedBy(pid2_case11); |
... | ... | |
966 | 1005 |
SystemMetadata sysmeta3_case11 = createSystemMetadata(pid3_case11, session.getSubject(), object); |
967 | 1006 |
sysmeta3_case11.setObsoletes(pid2_case11); |
968 | 1007 |
sysmeta3_case11.setSeriesId(sid_case11); |
1008 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
969 | 1009 |
CNodeService.getInstance(request).create(session, pid3_case11, object, sysmeta3_case11); |
970 | 1010 |
|
971 | 1011 |
sysmeta2_case11.setObsoletedBy(pid3_case11); |
... | ... | |
1005 | 1045 |
sid_case12.setValue("sid."+System.nanoTime()); |
1006 | 1046 |
SystemMetadata sysmeta_case12 = createSystemMetadata(pid1_case12, session.getSubject(), object); |
1007 | 1047 |
sysmeta_case12.setSeriesId(sid_case12); |
1048 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1008 | 1049 |
CNodeService.getInstance(request).create(session, pid1_case12, object, sysmeta_case12); |
1009 | 1050 |
|
1010 | 1051 |
Thread.sleep(1000); |
... | ... | |
1014 | 1055 |
SystemMetadata sysmeta2_case12 = createSystemMetadata(pid2_case12, session.getSubject(), object); |
1015 | 1056 |
sysmeta2_case12.setSeriesId(sid_case12); |
1016 | 1057 |
sysmeta2_case12.setObsoletes(pid1_case12); |
1058 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1017 | 1059 |
CNodeService.getInstance(request).create(session, pid2_case12, object, sysmeta2_case12); |
1018 | 1060 |
|
1019 | 1061 |
sysmeta_case12.setObsoletedBy(pid2_case12); |
... | ... | |
1031 | 1073 |
SystemMetadata sysmeta3_case12 = createSystemMetadata(pid3_case12, session.getSubject(), object); |
1032 | 1074 |
sysmeta3_case12.setObsoletes(pid2_case12); |
1033 | 1075 |
sysmeta3_case12.setSeriesId(sid_case12); |
1076 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1034 | 1077 |
CNodeService.getInstance(request).create(session, pid3_case12, object, sysmeta3_case12); |
1035 | 1078 |
|
1036 | 1079 |
sysmeta2_case12.setObsoletedBy(pid3_case12); |
... | ... | |
1070 | 1113 |
sid_case13.setValue("sid."+System.nanoTime()); |
1071 | 1114 |
SystemMetadata sysmeta_case13 = createSystemMetadata(pid1_case13, session.getSubject(), object); |
1072 | 1115 |
sysmeta_case13.setSeriesId(sid_case13); |
1116 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1073 | 1117 |
CNodeService.getInstance(request).create(session, pid1_case13, object, sysmeta_case13); |
1074 | 1118 |
|
1075 | 1119 |
Thread.sleep(1000); |
... | ... | |
1083 | 1127 |
sysmeta2_case13.setSeriesId(sid_case13); |
1084 | 1128 |
sysmeta2_case13.setObsoletes(pid1_case13); |
1085 | 1129 |
sysmeta2_case13.setObsoletedBy(pid3_case13); |
1130 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1086 | 1131 |
CNodeService.getInstance(request).create(session, pid2_case13, object, sysmeta2_case13); |
1087 | 1132 |
|
1088 | 1133 |
meta = CNodeService.getInstance(request).getSystemMetadata(session, pid2_case13); |
... | ... | |
1107 | 1152 |
sid_case14.setValue("sid."+System.nanoTime()); |
1108 | 1153 |
SystemMetadata sysmeta_case14 = createSystemMetadata(pid1_case14, session.getSubject(), object); |
1109 | 1154 |
sysmeta_case14.setSeriesId(sid_case14); |
1155 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1110 | 1156 |
CNodeService.getInstance(request).create(session, pid1_case14, object, sysmeta_case14); |
1111 | 1157 |
|
1112 | 1158 |
Thread.sleep(1000); |
... | ... | |
1116 | 1162 |
SystemMetadata sysmeta2_case14 = createSystemMetadata(pid2_case14, session.getSubject(), object); |
1117 | 1163 |
sysmeta2_case14.setSeriesId(sid_case14); |
1118 | 1164 |
sysmeta2_case14.setObsoletes(pid1_case14); |
1165 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1119 | 1166 |
CNodeService.getInstance(request).create(session, pid2_case14, object, sysmeta2_case14); |
1120 | 1167 |
|
1121 | 1168 |
Thread.sleep(1000); |
... | ... | |
1126 | 1173 |
sid2_case14.setValue("sid."+System.nanoTime()); |
1127 | 1174 |
SystemMetadata sysmeta3_case14 = createSystemMetadata(pid3_case14, session.getSubject(), object); |
1128 | 1175 |
sysmeta3_case14.setSeriesId(sid2_case14); |
1176 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1129 | 1177 |
CNodeService.getInstance(request).create(session, pid3_case14, object, sysmeta3_case14); |
1130 | 1178 |
|
1131 | 1179 |
sysmeta2_case14.setObsoletedBy(pid3_case14); |
... | ... | |
1160 | 1208 |
sid_case15.setValue("sid."+System.nanoTime()); |
1161 | 1209 |
SystemMetadata sysmeta_case15 = createSystemMetadata(pid1_case15, session.getSubject(), object); |
1162 | 1210 |
sysmeta_case15.setSeriesId(sid_case15); |
1211 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1163 | 1212 |
CNodeService.getInstance(request).create(session, pid1_case15, object, sysmeta_case15); |
1164 | 1213 |
|
1165 | 1214 |
Thread.sleep(1000); |
... | ... | |
1169 | 1218 |
SystemMetadata sysmeta2_case15 = createSystemMetadata(pid2_case15, session.getSubject(), object); |
1170 | 1219 |
sysmeta2_case15.setSeriesId(sid_case15); |
1171 | 1220 |
sysmeta2_case15.setObsoletes(pid1_case15); |
1221 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1172 | 1222 |
CNodeService.getInstance(request).create(session, pid2_case15, object, sysmeta2_case15); |
1173 | 1223 |
|
1174 | 1224 |
sysmeta_case15.setObsoletedBy(pid2_case15); |
... | ... | |
1186 | 1236 |
SystemMetadata sysmeta3_case15 = createSystemMetadata(pid3_case15, session.getSubject(), object); |
1187 | 1237 |
sysmeta3_case15.setSeriesId(sid_case15); |
1188 | 1238 |
sysmeta3_case15.setObsoletes(pid2_case15); |
1239 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1189 | 1240 |
CNodeService.getInstance(request).create(session, pid3_case15, object, sysmeta3_case15); |
1190 | 1241 |
|
1191 | 1242 |
Thread.sleep(1000); |
... | ... | |
1195 | 1246 |
SystemMetadata sysmeta4_case15 = createSystemMetadata(pid4_case15, session.getSubject(), object); |
1196 | 1247 |
sysmeta4_case15.setSeriesId(sid_case15); |
1197 | 1248 |
sysmeta4_case15.setObsoletes(pid3_case15); |
1249 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1198 | 1250 |
CNodeService.getInstance(request).create(session, pid4_case15, object, sysmeta4_case15); |
1199 | 1251 |
|
1200 | 1252 |
Thread.sleep(1000); |
... | ... | |
1206 | 1258 |
SystemMetadata sysmeta5_case15 = createSystemMetadata(pid5_case15, session.getSubject(), object); |
1207 | 1259 |
sysmeta5_case15.setSeriesId(sid2_case15); |
1208 | 1260 |
sysmeta5_case15.setObsoletes(pid4_case15); |
1261 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1209 | 1262 |
CNodeService.getInstance(request).create(session, pid5_case15, object, sysmeta5_case15); |
1210 | 1263 |
|
1211 | 1264 |
sysmeta4_case15.setObsoletedBy(pid5_case15); |
... | ... | |
1254 | 1307 |
sid_case16.setValue("sid."+System.nanoTime()); |
1255 | 1308 |
SystemMetadata sysmeta_case16 = createSystemMetadata(pid1_case16, session.getSubject(), object); |
1256 | 1309 |
sysmeta_case16.setSeriesId(sid_case16); |
1310 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1257 | 1311 |
CNodeService.getInstance(request).create(session, pid1_case16, object, sysmeta_case16); |
1258 | 1312 |
|
1259 | 1313 |
Thread.sleep(1000); |
... | ... | |
1272 | 1326 |
SystemMetadata sysmeta3_case16 = createSystemMetadata(pid3_case16, session.getSubject(), object); |
1273 | 1327 |
sysmeta3_case16.setSeriesId(sid_case16); |
1274 | 1328 |
sysmeta3_case16.setObsoletes(pid2_case16); |
1329 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1275 | 1330 |
CNodeService.getInstance(request).create(session, pid3_case16, object, sysmeta3_case16); |
1276 | 1331 |
|
1277 | 1332 |
sysmeta2_case16.setObsoletedBy(pid3_case16); |
... | ... | |
1288 | 1343 |
SystemMetadata sysmeta4_case16 = createSystemMetadata(pid4_case16, session.getSubject(), object); |
1289 | 1344 |
sysmeta4_case16.setSeriesId(sid2_case16); |
1290 | 1345 |
sysmeta4_case16.setObsoletes(pid3_case16); |
1346 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1291 | 1347 |
CNodeService.getInstance(request).create(session, pid4_case16, object, sysmeta4_case16); |
1292 | 1348 |
|
1293 | 1349 |
CNodeService.getInstance(request).delete(session, pid3_case16); |
... | ... | |
1325 | 1381 |
sid_case17.setValue("sid."+System.nanoTime()); |
1326 | 1382 |
SystemMetadata sysmeta_case17 = createSystemMetadata(pid1_case17, session.getSubject(), object); |
1327 | 1383 |
sysmeta_case17.setSeriesId(sid_case17); |
1384 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1328 | 1385 |
CNodeService.getInstance(request).create(session, pid1_case17, object, sysmeta_case17); |
1329 | 1386 |
|
1330 | 1387 |
Thread.sleep(1000); |
... | ... | |
1334 | 1391 |
SystemMetadata sysmeta2_case17 = createSystemMetadata(pid2_case17, session.getSubject(), object); |
1335 | 1392 |
sysmeta2_case17.setSeriesId(sid_case17); |
1336 | 1393 |
sysmeta2_case17.setObsoletes(pid1_case17); |
1394 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1337 | 1395 |
CNodeService.getInstance(request).create(session, pid2_case17, object, sysmeta2_case17); |
1338 | 1396 |
|
1339 | 1397 |
Thread.sleep(1000); |
... | ... | |
1343 | 1401 |
SystemMetadata sysmeta3_case17 = createSystemMetadata(pid3_case17, session.getSubject(), object); |
1344 | 1402 |
sysmeta3_case17.setSeriesId(sid_case17); |
1345 | 1403 |
sysmeta3_case17.setObsoletes(pid2_case17); |
1404 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1346 | 1405 |
CNodeService.getInstance(request).create(session, pid3_case17, object, sysmeta3_case17); |
1347 | 1406 |
|
1348 | 1407 |
sysmeta2_case17.setObsoletedBy(pid3_case17); |
... | ... | |
1357 | 1416 |
SystemMetadata sysmeta4_case17 = createSystemMetadata(pid4_case17, session.getSubject(), object); |
1358 | 1417 |
sysmeta4_case17.setSeriesId(sid_case17); |
1359 | 1418 |
sysmeta4_case17.setObsoletes(pid3_case17); |
1419 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1360 | 1420 |
CNodeService.getInstance(request).create(session, pid4_case17, object, sysmeta4_case17); |
1361 | 1421 |
|
1362 | 1422 |
CNodeService.getInstance(request).delete(session, pid3_case17); |
... | ... | |
1393 | 1453 |
sid_case18.setValue("sid."+System.nanoTime()); |
1394 | 1454 |
SystemMetadata sysmeta_case18 = createSystemMetadata(pid1_case18, session.getSubject(), object); |
1395 | 1455 |
sysmeta_case18.setSeriesId(sid_case18); |
1456 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1396 | 1457 |
CNodeService.getInstance(request).create(session, pid1_case18, object, sysmeta_case18); |
1397 | 1458 |
|
1398 | 1459 |
Thread.sleep(1000); |
... | ... | |
1402 | 1463 |
SystemMetadata sysmeta2_case18 = createSystemMetadata(pid2_case18, session.getSubject(), object); |
1403 | 1464 |
sysmeta2_case18.setSeriesId(sid_case18); |
1404 | 1465 |
sysmeta2_case18.setObsoletes(pid1_case18); |
1466 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1405 | 1467 |
CNodeService.getInstance(request).create(session, pid2_case18, object, sysmeta2_case18); |
1406 | 1468 |
|
1407 | 1469 |
sysmeta_case18.setObsoletedBy(pid2_case18); |
... | ... | |
1416 | 1478 |
SystemMetadata sysmeta3_case18 = createSystemMetadata(pid3_case18, session.getSubject(), object); |
1417 | 1479 |
sysmeta3_case18.setSeriesId(sid_case18); |
1418 | 1480 |
sysmeta3_case18.setObsoletes(pid2_case18); |
1481 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1419 | 1482 |
CNodeService.getInstance(request).create(session, pid3_case18, object, sysmeta3_case18); |
1420 | 1483 |
|
1421 | 1484 |
sysmeta2_case18.setObsoletedBy(pid3_case18); |
... | ... | |
1430 | 1493 |
SystemMetadata sysmeta4_case18 = createSystemMetadata(pid4_case18, session.getSubject(), object); |
1431 | 1494 |
sysmeta4_case18.setSeriesId(sid_case18); |
1432 | 1495 |
sysmeta4_case18.setObsoletes(pid3_case18); |
1496 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1433 | 1497 |
CNodeService.getInstance(request).create(session, pid4_case18, object, sysmeta4_case18); |
1434 | 1498 |
|
1435 | 1499 |
Thread.sleep(1000); |
... | ... | |
1439 | 1503 |
SystemMetadata sysmeta5_case18 = createSystemMetadata(pid5_case18, session.getSubject(), object); |
1440 | 1504 |
sysmeta5_case18.setSeriesId(sid_case18); |
1441 | 1505 |
sysmeta5_case18.setObsoletes(pid4_case18); |
1506 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1442 | 1507 |
CNodeService.getInstance(request).create(session, pid5_case18, object, sysmeta5_case18); |
1443 | 1508 |
|
1444 | 1509 |
sysmeta4_case18.setObsoletedBy(pid5_case18); |
... | ... | |
1499 | 1564 |
SystemMetadata sysmeta3_case19 = createSystemMetadata(pid3_case19, session.getSubject(), object); |
1500 | 1565 |
sysmeta3_case19.setSeriesId(sid_case19); |
1501 | 1566 |
sysmeta3_case19.setObsoletes(pid2_case19); |
1567 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1502 | 1568 |
CNodeService.getInstance(request).create(session, pid3_case19, object, sysmeta3_case19); |
1503 | 1569 |
SystemMetadata sys3 = CNodeService.getInstance(request).getSystemMetadata(session, pid3_case19); |
1504 | 1570 |
Date time3 = sys3.getDateUploaded(); |
... | ... | |
1508 | 1574 |
SystemMetadata sysmeta2_case19 = createSystemMetadata(pid2_case19, session.getSubject(), object); |
1509 | 1575 |
sysmeta2_case19.setSeriesId(sid_case19); |
1510 | 1576 |
sysmeta2_case19.setObsoletes(pid1_case19); |
1577 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1511 | 1578 |
CNodeService.getInstance(request).create(session, pid2_case19, object, sysmeta2_case19); |
1512 | 1579 |
SystemMetadata sys2 = CNodeService.getInstance(request).getSystemMetadata(session, pid2_case19); |
1513 | 1580 |
Date time2 = sys2.getDateUploaded(); |
... | ... | |
1516 | 1583 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
1517 | 1584 |
SystemMetadata sysmeta1_case19 = createSystemMetadata(pid1_case19, session.getSubject(), object); |
1518 | 1585 |
sysmeta1_case19.setSeriesId(sid_case19); |
1586 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1519 | 1587 |
CNodeService.getInstance(request).create(session, pid1_case19, object, sysmeta1_case19); |
1520 | 1588 |
SystemMetadata sys1 = CNodeService.getInstance(request).getSystemMetadata(session, pid1_case19); |
1521 | 1589 |
Date time1 = sys1.getDateUploaded(); |
Also available in: Unified diff
Add the code to reget the object input stream after generating the system metadata. Otherwise, the checksum will be wrong.