source: core/java/test/scalatest/net/i2p/crypto/SU3FileSpec.scala @ e8ac24b

Last change on this file since e8ac24b was e8ac24b, checked in by meeh <meeh@…>, 3 years ago

Added some missing files from earlier commits caused by -R stuff in mtn.

  • Property mode set to 100644
File size: 953 bytes
Line 
1package net.i2p.crypto
2
3import java.io.File
4
5import org.scalatest.FunSpec
6import org.scalatest.Matchers
7
8
9class SU3FileSpec extends FunSpec with Matchers {
10
11  def cheater(methodName : String, parameters: (AnyRef,Class[_])*): AnyRef = {
12    val parameterValues = parameters.map(_._1)
13    val parameterTypes = parameters.map(_._2)
14    val method = classOf[SU3File].getDeclaredMethod(methodName, parameterTypes:_*)
15    method.setAccessible(true)
16    method.invoke(classOf[SU3File], parameterValues:_*)
17  }
18
19  describe("SU3File") {
20    val certFileUrl = getClass.getResource("/resources/meeh_at_mail.i2p.crt")
21    val certFile = new File(certFileUrl.toURI)
22
23    val seedFileUrl = getClass.getResource("/resources/i2pseeds.su3")
24    val seedFile = new File(seedFileUrl.toURI)
25
26    it("should be able to verify a valid file") {
27      cheater("verifySigCLI", (seedFile.getAbsolutePath, classOf[String]), (certFile.getAbsolutePath, classOf[String]))
28    }
29  }
30}
Note: See TracBrowser for help on using the repository browser.