@ -77,8 +77,6 @@ public class PackWriterTest extends SampleDataRepositoryTestCase {
private ByteArrayOutputStream os ;
private ByteArrayOutputStream os ;
private PackOutputStream cos ;
private File packBase ;
private File packBase ;
private File packFile ;
private File packFile ;
@ -90,7 +88,6 @@ public class PackWriterTest extends SampleDataRepositoryTestCase {
public void setUp ( ) throws Exception {
public void setUp ( ) throws Exception {
super . setUp ( ) ;
super . setUp ( ) ;
os = new ByteArrayOutputStream ( ) ;
os = new ByteArrayOutputStream ( ) ;
cos = new PackOutputStream ( os ) ;
packBase = new File ( trash , "tmp_pack" ) ;
packBase = new File ( trash , "tmp_pack" ) ;
packFile = new File ( trash , "tmp_pack.pack" ) ;
packFile = new File ( trash , "tmp_pack.pack" ) ;
indexFile = new File ( trash , "tmp_pack.idx" ) ;
indexFile = new File ( trash , "tmp_pack.idx" ) ;
@ -314,11 +311,11 @@ public class PackWriterTest extends SampleDataRepositoryTestCase {
* /
* /
public void testWritePack2SizeDeltasVsNoDeltas ( ) throws Exception {
public void testWritePack2SizeDeltasVsNoDeltas ( ) throws Exception {
testWritePack2 ( ) ;
testWritePack2 ( ) ;
final long sizePack2NoDeltas = c os. length ( ) ;
final long sizePack2NoDeltas = os . size ( ) ;
tearDown ( ) ;
tearDown ( ) ;
setUp ( ) ;
setUp ( ) ;
testWritePack2DeltasReuseRefs ( ) ;
testWritePack2DeltasReuseRefs ( ) ;
final long sizePack2DeltasRefs = c os. length ( ) ;
final long sizePack2DeltasRefs = os . size ( ) ;
assertTrue ( sizePack2NoDeltas > sizePack2DeltasRefs ) ;
assertTrue ( sizePack2NoDeltas > sizePack2DeltasRefs ) ;
}
}
@ -333,11 +330,11 @@ public class PackWriterTest extends SampleDataRepositoryTestCase {
* /
* /
public void testWritePack2SizeOffsetsVsRefs ( ) throws Exception {
public void testWritePack2SizeOffsetsVsRefs ( ) throws Exception {
testWritePack2DeltasReuseRefs ( ) ;
testWritePack2DeltasReuseRefs ( ) ;
final long sizePack2DeltasRefs = c os. length ( ) ;
final long sizePack2DeltasRefs = os . size ( ) ;
tearDown ( ) ;
tearDown ( ) ;
setUp ( ) ;
setUp ( ) ;
testWritePack2DeltasReuseOffsets ( ) ;
testWritePack2DeltasReuseOffsets ( ) ;
final long sizePack2DeltasOffsets = c os. length ( ) ;
final long sizePack2DeltasOffsets = os . size ( ) ;
assertTrue ( sizePack2DeltasRefs > sizePack2DeltasOffsets ) ;
assertTrue ( sizePack2DeltasRefs > sizePack2DeltasOffsets ) ;
}
}
@ -351,11 +348,11 @@ public class PackWriterTest extends SampleDataRepositoryTestCase {
* /
* /
public void testWritePack4SizeThinVsNoThin ( ) throws Exception {
public void testWritePack4SizeThinVsNoThin ( ) throws Exception {
testWritePack4 ( ) ;
testWritePack4 ( ) ;
final long sizePack4 = c os. length ( ) ;
final long sizePack4 = os . size ( ) ;
tearDown ( ) ;
tearDown ( ) ;
setUp ( ) ;
setUp ( ) ;
testWritePack4ThinPack ( ) ;
testWritePack4ThinPack ( ) ;
final long sizePack4Thin = c os. length ( ) ;
final long sizePack4Thin = os . size ( ) ;
assertTrue ( sizePack4 > sizePack4Thin ) ;
assertTrue ( sizePack4 > sizePack4Thin ) ;
}
}
@ -482,14 +479,14 @@ public class PackWriterTest extends SampleDataRepositoryTestCase {
writer . setThin ( thin ) ;
writer . setThin ( thin ) ;
writer . setIgnoreMissingUninteresting ( ignoreMissingUninteresting ) ;
writer . setIgnoreMissingUninteresting ( ignoreMissingUninteresting ) ;
writer . preparePack ( interestings , uninterestings ) ;
writer . preparePack ( interestings , uninterestings ) ;
writer . writePack ( c os) ;
writer . writePack ( os ) ;
verifyOpenPack ( thin ) ;
verifyOpenPack ( thin ) ;
}
}
private void createVerifyOpenPack ( final Iterator < RevObject > objectSource )
private void createVerifyOpenPack ( final Iterator < RevObject > objectSource )
throws MissingObjectException , IOException {
throws MissingObjectException , IOException {
writer . preparePack ( objectSource ) ;
writer . preparePack ( objectSource ) ;
writer . writePack ( c os) ;
writer . writePack ( os ) ;
verifyOpenPack ( false ) ;
verifyOpenPack ( false ) ;
}
}