@Override public Date getDeletedDate() { return file.getDeletedDate(); }
@Override public Date getDeletedDate() { return super.getDeletedDate(); // To change body of overridden methods use File | Settings | File Templates. }
@Test public void testGetDeletedFiles() throws Exception { final String path1 = "path1"; final Calendar date1 = Calendar.getInstance(); final Node deletedNode1 = createDeletedNode( path1, date1 ); final String path2 = "path2"; final Calendar date2 = Calendar.getInstance(); final Node deletedNode2 = createDeletedNode( path2, date2 ); final NodeIterator nodeIterator = mock( NodeIterator.class ); when( nodeIterator.hasNext() ).thenReturn( true, true, false ); // 2 nodes in trash when( nodeIterator.nextNode() ).thenReturn( deletedNode1, deletedNode2 ); final Node nodeTrash = mock( Node.class ); when( nodeTrash.getNodes() ).thenReturn( nodeIterator ); final Node nodeUserFolder = mock( Node.class ); when( nodeUserFolder.hasNode( anyString() ) ).thenReturn( true ); when( nodeUserFolder.getNode( anyString() ) ).thenReturn( nodeTrash ); when( session.getItem( anyString() ) ).thenReturn( nodeUserFolder ); final List<RepositoryFile> deletedFiles = defaultDeleteHelper.getDeletedFiles( session, pentahoJcrConstants ); assertNotNull( deletedFiles ); assertEquals( 2, deletedFiles.size() ); assertEquals( path1, deletedFiles.get( 0 ).getOriginalParentFolderPath() ); assertEquals( path2, deletedFiles.get( 1 ).getOriginalParentFolderPath() ); assertEquals( date1.getTime(), deletedFiles.get( 0 ).getDeletedDate() ); assertEquals( date2.getTime(), deletedFiles.get( 1 ).getDeletedDate() ); }
for ( RepositoryFile file : deletedFiles ) { if ( file.getOriginalParentFolderPath().equals( path1 ) ) { assertEquals( file.getDeletedDate(), date1.getTime() ); } else if ( file.getOriginalParentFolderPath().equals( path2 ) ) { assertEquals( file.getDeletedDate(), date2.getTime() ); } else { fail( "Deleted file doesn't have correct path" );
appended = true; if ( expectedFile.getDeletedDate() != null ) { description.appendText( appended ? "," : "" ); description.appendText( "deletedDate=" ); description.appendText( expectedFile.getDeletedDate().toString() ); appended = true;
@Override public boolean matchesSafely( final RepositoryFile file ) { return ( expectedFile.getId() != null ? expectedFile.getId().equals( file.getId() ) : true ) && ( expectedFile.getName() != null ? expectedFile.getName().equals( file.getName() ) : true ) && ( expectedFile.getTitle() != null ? expectedFile.getTitle().equals( file.getTitle() ) : true ) && ( expectedFile.getPath() != null ? expectedFile.getPath().equals( file.getPath() ) : true ) && ( expectedFile.getCreatedDate() != null ? expectedFile.getCreatedDate().equals( file.getCreatedDate() ) : true ) && ( expectedFile.getLastModifiedDate() != null ? expectedFile.getLastModifiedDate().equals( file.getLastModifiedDate() ) : true ) && ( expectedFile.getVersionId() != null ? expectedFile.getVersionId().equals( file.getVersionId() ) : true ) && ( expectedFile.getDeletedDate() != null ? expectedFile.getDeletedDate().equals( file.getDeletedDate() ) : true ); }
f.setDeletedDate( marshalDate( v.getDeletedDate() ) );
public Builder( final RepositoryFile other ) { this( other.getName() ); synchronized ( other ) { this.id( other.getId() ).path( other.getPath() ).createdDate( other.getCreatedDate() ).creatorId( other.getCreatorId() ).fileSize( other.getFileSize() ).folder( other.isFolder() ).lastModificationDate( other.getLastModifiedDate() ).versioned( other.isVersioned() ).hidden( other.isHidden() ).schedulable( other.isSchedulable() ).versionId( other.getVersionId() ).locked( other.isLocked() ).lockDate( other.getLockDate() ).lockOwner( other.getLockOwner() ).lockMessage( other.getLockMessage() ).title( other.getTitle() ).description( other.getDescription() ).locale( other.getLocale() ).originalParentFolderPath( other.getOriginalParentFolderPath() ).deletedDate( other.getDeletedDate() ).localePropertiesMap( other.getLocalePropertiesMap() ).aclNode( other.isAclNode() ); } }