This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Unit testing of InstallAnywhere custom code ( JUnit or others )
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Dec 03, 2012
04:18 PM
Unit testing of InstallAnywhere custom code ( JUnit or others )
Hello
We have a number of custom code classes that we use for checking various prerequisites that are part of our installer. Currently, it's very tedious testing minor changes to this code since it involves repeated builds and runs of the complete installer to test. Is there some documentation out there that explains how the custom code can be unit-tested using JUnit or some other testing framework?
I was able to include all the java classes we use in a project and write some simple test cases that execute some of the code. Anything that uses the InstallerProxy class, however, does not work, and it appears that I'm not setting up the InstallerProxy correctly to supply the correct context. Can anyone offer any more guidance on this?
Thank you
Arjun
We have a number of custom code classes that we use for checking various prerequisites that are part of our installer. Currently, it's very tedious testing minor changes to this code since it involves repeated builds and runs of the complete installer to test. Is there some documentation out there that explains how the custom code can be unit-tested using JUnit or some other testing framework?
I was able to include all the java classes we use in a project and write some simple test cases that execute some of the code. Anything that uses the InstallerProxy class, however, does not work, and it appears that I'm not setting up the InstallerProxy correctly to supply the correct context. Can anyone offer any more guidance on this?
Thank you
Arjun
1 Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Dec 04, 2012
01:40 PM
Here is the sample code that I am using.....Best of luck
@Test
public void testPerformActionDuringInstall() throws InstallException, ConfigurationException {
CustomCodeAction customCodeAction = new CustomCodeAction();
final InstallerProxy ipMock = mock(InstallerProxy.class);
final HashMap testProperties = new HashMap();
testProperties.put("$PRODUCT_VERSION_NUMBER$", "1.0.0");
doAnswer(new Answer
@Test
public void testPerformActionDuringInstall() throws InstallException, ConfigurationException {
CustomCodeAction customCodeAction = new CustomCodeAction();
final InstallerProxy ipMock = mock(InstallerProxy.class);
final HashMap
testProperties.put("$PRODUCT_VERSION_NUMBER$", "1.0.0");
doAnswer(new Answer
