public final void testPerlCompatibility() throws InvalidSrsException {
// Test values are coming from the SRS-0.31 PERL module on
// the date which is included in the setup function.
Srs srs = new Srs();
srs.setDefaultRemotePart(new DomainPart("hostb.com"));
srs.setLocalDomains(localDomains);
srs.setSecretKeyString("secret");
String rp0 = forward(srs, "usera@hosta.com", "userb@hostb.com");
assertEquals("SRS0=VtG6=2I=hosta.com=usera@hostb.com", rp0);
assertEquals("usera@hosta.com", reverse(srs, rp0));
srs.setDefaultRemotePart(new DomainPart("hostc.com"));
String rp1 = forward(srs, rp0, "userc@hostc.com");
assertEquals("SRS1=IC2k=hostb.com==VtG6=2I=hosta.com=usera@hostc.com",
rp1);
assertEquals(rp0, reverse(srs, rp1));
srs.setDefaultRemotePart(new DomainPart("hostd.com"));
String rp2 = forward(srs, rp1, "userd@hostd.com");
assertEquals("SRS1=IC2k=hostb.com==VtG6=2I=hosta.com=usera@hostd.com",
rp2);
assertEquals(rp0, reverse(srs, rp2));
}