Skip to content

Commit

Permalink
[MSHARED-685] assert some things (#16)
Browse files Browse the repository at this point in the history
* assert some things
  • Loading branch information
elharo authored Feb 24, 2020
1 parent 5f0ea24 commit 5769481
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ private void createTestData()
{
File rootDir = tempFolder.getRoot();
File folder1 = new File( rootDir, "folder1" );
folder1.mkdirs();
if ( !folder1.mkdirs() )
{
Assert.fail();
}

FileTestHelper.generateTestFile( new File( rootDir, "file1.txt" ), 11 );
FileTestHelper.generateTestFile( new File( rootDir, "file2.txt" ), 12 );
Expand All @@ -60,7 +63,10 @@ private void createTestData()
FileTestHelper.generateTestFile( new File( folder1, "file5.dat" ), 15 );

File folder2 = new File( folder1, "ignorefolder" );
folder2.mkdirs();
if ( !folder2.mkdirs() )
{
Assert.fail();
}
FileTestHelper.generateTestFile( new File( folder2, "file7.txt" ), 17 );
}

Expand Down Expand Up @@ -131,11 +137,9 @@ public void checkSymlinkBehaviour()
ds.scan();
String[] includedDirectories = ds.getIncludedDirectories();
String[] files = ds.getIncludedFiles();

//FIXME: This should be changed to some kind of assert...WhatEver()...
System.out.println( "files = " + files );


assertAlwaysIncluded( Arrays.asList( files ) );
assertEquals( 5, includedDirectories.length );
assertEquals( 9, files.length );
}

@Test
Expand All @@ -155,7 +159,7 @@ public void followSymlinksFalse()
assertAlwaysIncluded( included );
assertEquals( 9, included.size() );
List<String> includedDirs = Arrays.asList( ds.getIncludedDirectories() );
assertTrue( includedDirs.contains( "" ) ); // w00t !
assertTrue( includedDirs.contains( "" ) );
assertTrue( includedDirs.contains( "aRegularDir" ) );
assertTrue( includedDirs.contains( "symDir" ) );
assertTrue( includedDirs.contains( "symLinkToDirOnTheOutside" ) );
Expand Down

0 comments on commit 5769481

Please sign in to comment.