|
|
@ -55,6 +55,7 @@ import java.io.EOFException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStreamReader; |
|
|
|
import java.io.InputStreamReader; |
|
|
|
import java.io.Reader; |
|
|
|
import java.io.Reader; |
|
|
|
|
|
|
|
import java.io.StringReader; |
|
|
|
|
|
|
|
|
|
|
|
import org.eclipse.jgit.errors.PackProtocolException; |
|
|
|
import org.eclipse.jgit.errors.PackProtocolException; |
|
|
|
import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; |
|
|
|
import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; |
|
|
@ -280,9 +281,7 @@ public class PushCertificateParserTest { |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void testParseReader() throws Exception { |
|
|
|
public void testParseReader() throws Exception { |
|
|
|
Reader reader = new InputStreamReader( |
|
|
|
Reader reader = new StringReader(concatPacketLines(INPUT, 0, 18)); |
|
|
|
new ByteArrayInputStream( |
|
|
|
|
|
|
|
Constants.encode(concatPacketLines(INPUT, 0, 18)))); |
|
|
|
|
|
|
|
PushCertificate streamCert = PushCertificateParser.fromReader(reader); |
|
|
|
PushCertificate streamCert = PushCertificateParser.fromReader(reader); |
|
|
|
|
|
|
|
|
|
|
|
PacketLineIn pckIn = newPacketLineIn(INPUT); |
|
|
|
PacketLineIn pckIn = newPacketLineIn(INPUT); |
|
|
@ -320,6 +319,14 @@ public class PushCertificateParserTest { |
|
|
|
assertEquals(pckCmd.getNewId().name(), streamCmd.getNewId().name()); |
|
|
|
assertEquals(pckCmd.getNewId().name(), streamCmd.getNewId().name()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void testParseString() throws Exception { |
|
|
|
|
|
|
|
String str = concatPacketLines(INPUT, 0, 18); |
|
|
|
|
|
|
|
assertEquals( |
|
|
|
|
|
|
|
PushCertificateParser.fromReader(new StringReader(str)), |
|
|
|
|
|
|
|
PushCertificateParser.fromString(str)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void testParseMultipleFromStream() throws Exception { |
|
|
|
public void testParseMultipleFromStream() throws Exception { |
|
|
|
String input = concatPacketLines(INPUT, 0, 17); |
|
|
|
String input = concatPacketLines(INPUT, 0, 17); |
|
|
|