public void setUp() { // Turn off INFO log messages. ILOG.J2CsMapping.Util.Logging.Logger.getLogger("").setLevel(ILOG.J2CsMapping.Util.Logging.Level.SEVERE); fixture_ = new TestEncryptorV2.EncryptorFixture(true, new TestEncryptorV2.Anonymous_C1()); }
public void testKekRetrievalFailure() { int[] nErrors_0 = new int[] { 0 }; fixture_ = new TestEncryptorV2.EncryptorFixture(false, new TestEncryptorV2.Anonymous_C0(nErrors_0)); Blob plainText = new Blob("Data to encrypt"); EncryptedContent encryptedContent = fixture_.encryptor_ .encrypt(plainText.getImmutableArray()); // Check that KEK interests has been sent. Assert.AssertTrue(fixture_.face_.sentInterests_[0].getName().getPrefix(6) .equals(new Name("/access/policy/identity/NAC/dataset/KEK"))); // ... and failed to retrieve. Assert.AssertEquals(0, fixture_.face_.sentData_.Count); Assert.AssertEquals(1, nErrors_0[0]); Assert.AssertEquals(0, fixture_.face_.sentData_.Count); // Check recovery. fixture_.publishData(); fixture_.face_.delayedCallTable_.setNowOffsetMilliseconds_(73000); fixture_.face_.processEvents(); Data kekData = fixture_.face_.sentData_[0]; Assert.AssertTrue(kekData.getName().getPrefix(6) .equals(new Name("/access/policy/identity/NAC/dataset/KEK"))); Assert.AssertEquals(7, kekData.getName().size()); }