1 /* |
1 /* |
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
319 "VeryVeryLongGroupNameThatMustBeShortened", |
319 "VeryVeryLongGroupNameThatMustBeShortened", |
320 // String aMIDletName, |
320 // String aMIDletName, |
321 "GameMIDlet", |
321 "GameMIDlet", |
322 // String aTargetDrive, |
322 // String aTargetDrive, |
323 "C:", |
323 "C:", |
324 // String aIconFileName contains alread the name of the converted icon, |
324 // String aIconFileName contains the name of the converted icon, |
325 "c:\\private\\102033E6\\installer\\jiutdata\\icon1.mbm", |
325 "c:\\private\\102033E6\\installer\\jiutdata\\icon1.mbm", |
326 // String aJarFileName, |
326 // String aJarFileName, |
327 "c:\\private\\102033E6\\installer\\jiutdata\\utils\\einstein_EN_FR_IT_DE_ES_N97_v2942.jar", |
327 "c:\\private\\102033E6\\installer\\jiutdata\\utils\\einstein_EN_FR_IT_DE_ES_N97_v2942.jar", |
328 // boolean aHidden, |
328 // boolean aHidden, |
329 false, |
329 false, |
346 // convert icon before registering |
346 // convert icon before registering |
347 StringBuffer iconSuffix = new StringBuffer(); |
347 StringBuffer iconSuffix = new StringBuffer(); |
348 boolean convOk = appReg.convertIcon("icon.png", "c:\\private\\102033E6\\installer\\jiutdata\\icon1.mbm", |
348 boolean convOk = appReg.convertIcon("icon.png", "c:\\private\\102033E6\\installer\\jiutdata\\icon1.mbm", |
349 "c:\\private\\102033E6\\installer\\jiutdata\\utils\\einstein_EN_FR_IT_DE_ES_N97_v2942.jar", iconSuffix); |
349 "c:\\private\\102033E6\\installer\\jiutdata\\utils\\einstein_EN_FR_IT_DE_ES_N97_v2942.jar", iconSuffix); |
350 assertTrue("Icon conversion failed.", convOk); |
350 assertTrue("Icon conversion failed.", convOk); |
351 assertTrue("Suffix of the converted icon is incorrect.", iconSuffix.toString().equals(".mbm")); |
351 // Allowed icon suffixes .mbm and .png. |
|
352 String expectedSuffix = ".mbm"; |
|
353 if (iconSuffix.toString().equals(".png")) |
|
354 { |
|
355 expectedSuffix = ".png"; |
|
356 } |
|
357 assertTrue("Suffix of the converted icon is incorrect.", |
|
358 iconSuffix.toString().equals(expectedSuffix)); |
352 |
359 |
353 appReg.registerApplication(appRegInfo); |
360 appReg.registerApplication(appRegInfo); |
354 appReg.commitSession(true); |
361 appReg.commitSession(true); |
355 } |
362 } |
356 catch (InstallerException ie) |
363 catch (InstallerException ie) |
704 // convert svg icon before registering |
711 // convert svg icon before registering |
705 StringBuffer iconSuffix = new StringBuffer(); |
712 StringBuffer iconSuffix = new StringBuffer(); |
706 boolean convOk = appReg.convertIcon("gear.svg", "c:\\private\\102033E6\\installer\\jiutdata\\icon2.mif", |
713 boolean convOk = appReg.convertIcon("gear.svg", "c:\\private\\102033E6\\installer\\jiutdata\\icon2.mif", |
707 "c:\\private\\102033E6\\installer\\jiutdata\\utils\\MIDPTestMisc.jar", iconSuffix); |
714 "c:\\private\\102033E6\\installer\\jiutdata\\utils\\MIDPTestMisc.jar", iconSuffix); |
708 assertTrue("Icon conversion failed.", convOk); |
715 assertTrue("Icon conversion failed.", convOk); |
709 assertTrue("Suffix of the converted icon is incorrect.", iconSuffix.toString().equals(".mif")); |
716 // Allowed icon suffixes are .mif and .svg. |
|
717 String expectedSuffix = ".mif"; |
|
718 if (iconSuffix.toString().equals(".svg")) |
|
719 { |
|
720 expectedSuffix = ".svg"; |
|
721 } |
|
722 assertTrue("Suffix of the converted icon is incorrect.", |
|
723 iconSuffix.toString().equals(expectedSuffix)); |
710 |
724 |
711 appReg.registerApplication(appRegInfo); |
725 appReg.registerApplication(appRegInfo); |
712 appReg.commitSession(true); |
726 appReg.commitSession(true); |
713 } |
727 } |
714 catch (InstallerException ie) |
728 catch (InstallerException ie) |