Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 228172 - Can not run junit test using String and Double encrypted datapool data
Summary: Can not run junit test using String and Double encrypted datapool data
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 blocker (vote)
Target Milestone: ---   Edit
Assignee: Paul Slauenwhite CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 202695
Blocks:
  Show dependency tree
 
Reported: 2008-04-22 04:47 EDT by Xin Ying Huang CLA
Modified: 2016-05-05 10:32 EDT (History)
5 users (show)

See Also:
dmorris: review+


Attachments
fixed this error and created a patch (1.17 KB, text/plain)
2008-04-22 04:49 EDT, Xin Ying Huang CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xin Ying Huang CLA 2008-04-22 04:47:24 EDT
Build ID: tptp45 if6

Steps To Reproduce:
1, create Junit test project

2, create a encypted datapool 

3, reference created encrypted datapool to junit test 

4, run junit test and failed 


Env :

 --tptp.runtime.allInOne.win32.win32.x86-TPTP-4.5.0M6.zip
 --agntctrl.win_ia32-TPTP-4.5.0M6.zip(if running with AC)
Reference:http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.hyades.test.doc.user/samples/saccessdp.htm

There is no error when running the junit test with a normal datapool(no
encrypted data)

when encrypt a "string" variable, the stack trace for the error case will be:


 junit.framework.AssertionFailedError
        at junit.framework.Assert.fail(Assert.java:47)
        at junit.framework.Assert.assertTrue(Assert.java:20)
        at junit.framework.Assert.assertNotNull(Assert.java:217)
        at junit.framework.Assert.assertNotNull(Assert.java:210)
        at
shoppingCartTest_src.testShoppingCartConstructor(shoppingCartTest_src.java:90)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at junit.framework.TestCase.runTest(TestCase.java:164)
        at junit.framework.TestCase.runBare(TestCase.java:130)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:120)
        at
org.eclipse.hyades.test.common.junit.HyadesTestCase.run(HyadesTestCase.java:172)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at
org.eclipse.hyades.test.common.junit.HyadesTestSuite.runTest(HyadesTestSuite.java:457)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at
org.eclipse.hyades.test.common.junit.HyadesTestSuite.doRun(HyadesTestSuite.java:425)
        at
org.eclipse.hyades.test.common.junit.HyadesTestSuite.run(HyadesTestSuite.java:338)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestDecorator.run(TestDecorator.java:30)
        at junit.extensions.RepeatedTest.run(RepeatedTest.java:26)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at
org.eclipse.hyades.test.common.junit.HyadesTestSuite.runTest(HyadesTestSuite.java:457)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at
org.eclipse.hyades.test.common.junit.HyadesTestSuite.doRun(HyadesTestSuite.java:425)
        at
org.eclipse.hyades.test.common.junit.HyadesTestSuite.run(HyadesTestSuite.java:338)
        at
org.eclipse.hyades.test.common.junit.HyadesTestRunner.run(HyadesTestRunner.java:504)
        at
org.eclipse.hyades.test.java.runner.HyadesJUnitRunner



When encrypting a Double type variable the stack trace of error result would
be:

java.lang.NumberFormatException: For input string: "0cb2d7dd"
        at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
        at java.lang.Double.parseDouble(Unknown Source)
        at
org.eclipse.hyades.models.common.datapool.impl.DPLCellImpl.getDoubleValue(DPLCellImpl.java:435)
        at
shoppingCartTest_src.testShoppingCartConstructor(shoppingCartTest_src.java:86)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at junit.framework.TestCase.runTest(TestCase.java:164)
        at junit.framework.TestCase.runBare(TestCase.java:130)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:120)
        at
org.eclipse.hyades.test.common.junit.HyadesTestCase.run(HyadesTestCase.java:172)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at
org.eclipse.hyades.test.common.junit.HyadesTestSuite.runTest(HyadesTestSuite.java:457)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at
org.eclipse.hyades.test.common.junit.HyadesTestSuite.doRun(HyadesTestSuite.java:425)
        at
org.eclipse.hyades.test.common.junit.HyadesTestSuite.run(HyadesTestSuite.java:338)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestDecorator.run(TestDecorator.java:30)
        at junit.extensions.RepeatedTest.run(RepeatedTest.java:26)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at
org.eclipse.hyades.test.common.junit.HyadesTestSuite.runTest(HyadesTestSuite.java:457)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at
org.eclipse.hyades.test.common.junit.HyadesTestSuite.doRun(HyadesTestSuite.java:425)
        at
org.eclipse.hyades.test.common.junit.HyadesTestSuite.run(HyadesTestSuite.java:338)
        at
org.eclipse.hyades.test.common.junit.HyadesTestRunner.run(HyadesTestRunner.java:504)
        at
org.eclipse.hyades.test.java.runner.HyadesJUnitRunner.main(HyadesJUnitRunner.java:117)

Comment #64 and Comment #65 are both verified by IAC/AC with IBM50/Sun
jre1.5.0_14


More information:
Comment 1 Xin Ying Huang CLA 2008-04-22 04:49:35 EDT
Created attachment 96988 [details]
fixed this error and created a patch

For the errors in commments #65 and # 64 (can not run junit test using String
and Double encrypted data ) , they're caused by an minor typing error in the
org.eclispe.hyades.test.tools.core plugin , in order to fix these errors ,pls
do below modification :

  1, open the class :
org.eclipse.hyades.test.common.testservices.resources.DatapoolPasswordProvider 
, update below code  :

 result = ServiceInvoker.invokeService(getProviderName(),
                                       
"method=getDatapoolList,args:testId={0}".concat(testId));


 into :

 result = ServiceInvoker.invokeService(getProviderName(),
                                       
"method=getDatapoolList,args:testId=".concat(testId));

(the reason for errrors is that there are a useless {0} in code )
Comment 2 Paul Slauenwhite CLA 2008-04-22 06:45:44 EDT
Time estimate for reviewing and testing the patch as well as creating a new test case.
Comment 3 Paul Slauenwhite CLA 2008-04-22 13:24:25 EDT
Duwayne, please review Xin's patch.
Comment 4 Paul Slauenwhite CLA 2008-04-22 13:28:35 EDT
The following JUnit test suites have been added to cover this symtom (and non-encrypted datapools):

/org.eclipse.hyades.test.ui.datapool.tests/junit/datapool/Test.UI.DatapoolEditor_running.testsuite
/org.eclipse.hyades.test.ui.datapool.tests/junit/datapool/Test.UI.EncryptedDatapoolEditor_running.testsuite
Comment 5 Paul Slauenwhite CLA 2008-04-22 13:31:48 EDT
Hours worked for reviewing and testing the patch as well as creating new
test suites.
Comment 6 DuWayne Morris CLA 2008-04-22 13:32:24 EDT
Reviewed and approved.
Comment 7 Paul Slauenwhite CLA 2008-04-22 13:49:44 EDT
Patch checked in to CVS (HEAD).
Comment 8 Xin Ying Huang CLA 2008-05-15 01:56:23 EDT
Verified and it's ok to close now .