@ -354,14 +354,14 @@ public class T0003_BasicTest extends SampleDataRepositoryTestCase {
@Test
@Test
public void test007_Open ( ) throws IOException {
public void test007_Open ( ) throws IOException {
final FileRepository db2 = new FileRepository ( db . getDirectory ( ) ) ;
try ( final FileRepository db2 = new FileRepository ( db . getDirectory ( ) ) ) {
assertEquals ( db . getDirectory ( ) , db2 . getDirectory ( ) ) ;
assertEquals ( db . getDirectory ( ) , db2 . getDirectory ( ) ) ;
assertEquals ( db . getObjectDatabase ( ) . getDirectory ( ) , db2
assertEquals ( db . getObjectDatabase ( ) . getDirectory ( ) , db2
. getObjectDatabase ( ) . getDirectory ( ) ) ;
. getObjectDatabase ( ) . getDirectory ( ) ) ;
assertNotSame ( db . getConfig ( ) , db2 . getConfig ( ) ) ;
assertNotSame ( db . getConfig ( ) , db2 . getConfig ( ) ) ;
}
}
}
@SuppressWarnings ( "unused" )
@Test
@Test
public void test008_FailOnWrongVersion ( ) throws IOException {
public void test008_FailOnWrongVersion ( ) throws IOException {
final File cfg = new File ( db . getDirectory ( ) , Constants . CONFIG ) ;
final File cfg = new File ( db . getDirectory ( ) , Constants . CONFIG ) ;
@ -370,8 +370,7 @@ public class T0003_BasicTest extends SampleDataRepositoryTestCase {
+ badvers + "\n" ;
+ badvers + "\n" ;
write ( cfg , configStr ) ;
write ( cfg , configStr ) ;
try {
try ( FileRepository unused = new FileRepository ( db . getDirectory ( ) ) ) {
new FileRepository ( db . getDirectory ( ) ) ;
fail ( "incorrectly opened a bad repository" ) ;
fail ( "incorrectly opened a bad repository" ) ;
} catch ( IllegalArgumentException ioe ) {
} catch ( IllegalArgumentException ioe ) {
assertNotNull ( ioe . getMessage ( ) ) ;
assertNotNull ( ioe . getMessage ( ) ) ;
@ -533,9 +532,10 @@ public class T0003_BasicTest extends SampleDataRepositoryTestCase {
public void test025_computeSha1NoStore ( ) throws IOException {
public void test025_computeSha1NoStore ( ) throws IOException {
byte [ ] data = "test025 some data, more than 16 bytes to get good coverage"
byte [ ] data = "test025 some data, more than 16 bytes to get good coverage"
. getBytes ( "ISO-8859-1" ) ;
. getBytes ( "ISO-8859-1" ) ;
final ObjectId id = new ObjectInserter . Formatter ( ) . idFor (
try ( ObjectInserter . Formatter formatter = new ObjectInserter . Formatter ( ) ) {
Constants . OBJ_BLOB , data ) ;
final ObjectId id = formatter . idFor ( Constants . OBJ_BLOB , data ) ;
assertEquals ( "4f561df5ecf0dfbd53a0dc0f37262fef075d9dde" , id . name ( ) ) ;
assertEquals ( "4f561df5ecf0dfbd53a0dc0f37262fef075d9dde" , id . name ( ) ) ;
}
}
}
@Test
@Test