RepositoryRequest { public RepositoryRequest() { } RepositoryRequest();  RepositoryRequest( String path, Boolean showHidden, Integer depth, String legacyFilter ); FILES_TYPE_FILTER getTypes(); void setTypes( FILES_TYPE_FILTER types ); Set<String> getIncludeMemberSet(); void setIncludeMemberSet( Set<String> includeMemberSet ); Set<String> getExcludeMemberSet(); void setExcludeMemberSet( Set<String> excludeMemberSet ); boolean isShowHidden(); boolean isIncludeSystemFolders(); void setIncludeSystemFolders( boolean includeSystemFolders ); void setShowHidden( boolean showHidden ); Integer getDepth(); void setDepth( Integer depth ); String getChildNodeFilter(); void setChildNodeFilter( String childNodeFilter ); String getPath(); void setPath( String path ); boolean isIncludeAcls(); void setIncludeAcls( boolean includeAcls ); static final String PATH_SEPARATOR; }
@Test public void testRepositoryRequest() { RepositoryRequest defaultRequest = new RepositoryRequest(); assertFalse( defaultRequest.isShowHidden() ); assertEquals( RepositoryRequest.FILES_TYPE_FILTER.FILES_FOLDERS, defaultRequest.getTypes() ); assertNull( defaultRequest.getIncludeMemberSet() ); assertNull( defaultRequest.getExcludeMemberSet() ); assertEquals( new Integer( -1 ), defaultRequest.getDepth() ); assertNull( defaultRequest.getPath() ); assertFalse( defaultRequest.isIncludeAcls() ); assertNull( defaultRequest.getChildNodeFilter() ); assertTrue( defaultRequest.isIncludeSystemFolders() ); RepositoryRequest nullRequest = new RepositoryRequest( null, null, null, null ); assertFalse( nullRequest.isShowHidden() ); assertEquals( new Integer( -1 ), nullRequest.getDepth() ); assertTrue( nullRequest.isIncludeSystemFolders() ); assertEquals( SHOW_HIDE, request.isShowHidden() ); assertEquals( RepositoryRequest.FILES_TYPE_FILTER.FILES, request.getTypes() ); assertEquals( INCLUDE_SET, request.getIncludeMemberSet() ); assertEquals( EXCLUDE_SET, request.getExcludeMemberSet() ); assertEquals( DEPTH, request.getDepth() ); assertEquals( PATH, request.getPath() ); assertEquals( INCLUDE_ACLS, request.isIncludeAcls() ); assertEquals( CHILD_FILTER, request.getChildNodeFilter() ); assertEquals( INCLUDE_SYSTEM_FOLDERS, request.isIncludeSystemFolders() ); boolean newShowHide = !SHOW_HIDE; request.setShowHidden( newShowHide ); assertEquals( newShowHide, request.isShowHidden() ); boolean newIncludeSystemFolders = !INCLUDE_SYSTEM_FOLDERS; request.setIncludeSystemFolders( newIncludeSystemFolders ); assertEquals( newIncludeSystemFolders, request.isIncludeSystemFolders() ); String newPath = "newPath"; request.setPath( newPath ); assertEquals( newPath, request.getPath() ); String legacyFilter = "includeMembers=(include)|excludeMembers=(exclude)"; try { new RepositoryRequest( PATH, SHOW_HIDE, DEPTH, legacyFilter ); fail( "RuntimeException should of been thrown" ); } catch ( RuntimeException e ) { } }