#2908 Make unit-test is failed
Closed: migrated 3 years ago by dmoluguw. Opened 6 years ago by mharmsen.

stanislavlevin opened this Issue 7 days ago

Make unit-test is failed, error log is below:
make_unit-test.log

Tests error logs are attached:
TEST-com.netscape.cmscore.authentication.AuthTokenTest.xml.txt
TEST-com.netscape.cmscore.request.RequestTest.xml.txt

Using jdb, i see:

main[1] list
330 X509CertImpl cert = getFakeCert();
331
332 assertFalse(cmsStub.bToACalled);
333 assertTrue(request.setExtData("key", cert));
334 => assertTrue(cmsStub.bToACalled);
335
336 assertFalse(cmsStub.aToBCalled);
337 X509CertImpl retval = request.getExtDataInCert("key");
338 assertTrue(cmsStub.aToBCalled);
339 assertEquals(cert, retval);

main[1] dump cmsStub.bToACalled
cmsStub.bToACalled = false
main[1] dump cmsStub
cmsStub = {
bToACalled: false
bToACalledWith: null
aToBCalled: false
aToBCalledWith: null
}

main[1] where
[1] com.netscape.cmscore.request.RequestTest.testGetSetCert (RequestTest.java:334)
[2] sun.reflect.NativeMethodAccessorImpl.invoke0 (native method)
[3] sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
[4] sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
[5] java.lang.reflect.Method.invoke (Method.java:498)
[6] junit.framework.TestCase.runTest (TestCase.java:176)
[7] junit.framework.TestCase.runBare (TestCase.java:141)
[8] junit.framework.TestResult$1.protect (TestResult.java:122)
[9] junit.framework.TestResult.runProtected (TestResult.java:142)
[10] junit.framework.TestResult.run (TestResult.java:125)
[11] junit.framework.TestCase.run (TestCase.java:129)
[12] junit.framework.TestSuite.runTest (TestSuite.java:252)
[13] junit.framework.TestSuite.run (TestSuite.java:247)
[14] org.junit.internal.runners.JUnit38ClassRunner.run (JUnit38ClassRunner.java:86)
[15] org.junit.runners.Suite.runChild (Suite.java:128)
[16] org.junit.runners.Suite.runChild (Suite.java:27)
[17] org.junit.runners.ParentRunner$3.run (ParentRunner.java:290)
[18] org.junit.runners.ParentRunner$1.schedule (ParentRunner.java:71)
[19] org.junit.runners.ParentRunner.runChildren (ParentRunner.java:288)
[20] org.junit.runners.ParentRunner.access$000 (ParentRunner.java:58)
[21] org.junit.runners.ParentRunner$2.evaluate (ParentRunner.java:268)
[22] org.junit.runners.ParentRunner.run (ParentRunner.java:363)
[23] org.junit.runner.JUnitCore.run (JUnitCore.java:137)
[24] org.junit.runner.JUnitCore.run (JUnitCore.java:115)
[25] org.junit.runner.JUnitCore.run (JUnitCore.java:105)
[26] org.junit.runner.JUnitCore.run (JUnitCore.java:94)
[27] com.netscape.test.TestRunner.run (TestRunner.java:29)
[28] com.netscape.test.TestRunner.main (TestRunner.java:39)
main[1]

So, there are no CMS.AtoB/BtoA calls(perhaps after 94837a1e00822c7494a2acb73dc18dbc337bc314 and 0beebcfc589e73872a837ac04b2560f04ec795c2) and CMSMemoryStub class looks like outdated

/** 
 * CMSMemoryStub
 *
 * This class is used to help test methods that rely on setting and then
 * getting a value out. It assumes BtoA is always called first, stores
 * the value passed in, and then returns that value for BtoA.
 */
static class CMSMemoryStub extends CMSEngineDefaultStub {
    boolean bToACalled = false;
    byte[] bToACalledWith = null;

    boolean aToBCalled = false;
    String aToBCalledWith = null;

    public String BtoA(byte data[]) {
        bToACalled = true;
        bToACalledWith = data;
        return "garbagetostoreinthehash";
    }

    public byte[] AtoB(String data) {
        aToBCalled = true;
        aToBCalledWith = data;
        return bToACalledWith;
    }
}

stanislavlevin commented 7 days ago

Temporarily i removed this class and all assertions related. Tests have been passed, but i guess CMSMemoryStub should be rewritten.

Metadata Update from @mharmsen:
- Custom field component adjusted to None
- Custom field feature adjusted to None
- Custom field origin adjusted to None
- Custom field proposedmilestone adjusted to None
- Custom field proposedpriority adjusted to None
- Custom field reviewer adjusted to None
- Custom field type adjusted to None
- Custom field version adjusted to None

6 years ago

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/3026

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Metadata Update from @dmoluguw:
- Issue close_status updated to: migrated
- Issue status updated to: Closed (was: Open)

3 years ago

Login to comment on this ticket.

Metadata