javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/applicationregistrator/SifRegistratorTest.java
changeset 35 85266cc22c7f
parent 21 2a9601315dfc
child 47 f40128debb5d
equal deleted inserted replaced
26:dc7c549001d5 35:85266cc22c7f
   201         SifRegistrator sifReg = new SifRegistrator();
   201         SifRegistrator sifReg = new SifRegistrator();
   202         try
   202         try
   203         {
   203         {
   204             SuiteInfo si = getTestSuite();
   204             SuiteInfo si = getTestSuite();
   205             ComponentId cid = getComponentId(si.getGlobalId());
   205             ComponentId cid = getComponentId(si.getGlobalId());
   206             Uid uid = null;
   206             // Check for USIF Phase 2 registration.
   207             //Uid uid = sifReg.getUid(cid.getId());
   207             Uid uid = sifReg.getUid(cid.getId());
   208             //assertTrue("Suite uid " + si.getUid() + " does not match" +
   208             assertTrue("Suite uid " + si.getUid() + " does not match" +
   209             //           " to uid " + uid + " from SCR",
   209                        " to uid " + uid + " from SCR",
   210             //           si.getUid().equals(uid));
   210                        si.getUid().equals(uid));
   211             Vector apps = si.getApplications();
   211             // Check for USIF Phase 1 registration.
   212             for (int i = 0; i < apps.size(); i++)
   212             //Vector apps = si.getApplications();
   213             {
   213             //for (int i = 0; i < apps.size(); i++)
   214                 cid = getComponentId(si.getGlobalId(i));
   214             //{
   215                 uid = sifReg.getUid(cid.getId());
   215             //    cid = getComponentId(si.getGlobalId(i));
   216                 assertTrue("Application uid " +
   216             //    uid = sifReg.getUid(cid.getId());
   217                            ((ApplicationInfo)apps.elementAt(i)).getUid() +
   217             //    assertTrue("Application uid " +
   218                            " does not match to uid " + uid + " from SCR",
   218             //               ((ApplicationInfo)apps.elementAt(i)).getUid() +
   219                            ((ApplicationInfo)apps.elementAt(i)).getUid().equals(uid));
   219             //               " does not match to uid " + uid + " from SCR",
   220             }
   220             //               ((ApplicationInfo)apps.elementAt(i)).getUid().equals(uid));
       
   221             //}
   221             sifReg.closeSession();
   222             sifReg.closeSession();
   222         }
   223         }
   223         catch (InstallerException ie)
   224         catch (InstallerException ie)
   224         {
   225         {
   225             ie.printStackTrace();
   226             ie.printStackTrace();
   322     }
   323     }
   323 
   324 
   324     private void assertSuiteExists(SuiteInfo aSuite, boolean aExists)
   325     private void assertSuiteExists(SuiteInfo aSuite, boolean aExists)
   325     {
   326     {
   326         String not = (aExists? " not": "");
   327         String not = (aExists? " not": "");
       
   328         // Check for USIF Phase 2 registration.
   327         ComponentId cid = getComponentId(aSuite.getGlobalId());
   329         ComponentId cid = getComponentId(aSuite.getGlobalId());
   328         //assertTrue("Suite " + aSuite.getGlobalId() + not +
   330         assertTrue("Suite " + aSuite.getGlobalId() + not +
   329         //           " found from SCR", (aExists? cid != null: cid == null));
   331                    " found from SCR", (aExists? cid != null: cid == null));
   330         Vector apps = aSuite.getApplications();
   332         // Check for USIF Phase 1 registration.
   331         for (int i = 0; i < apps.size(); i++)
   333         //Vector apps = aSuite.getApplications();
   332         {
   334         //for (int i = 0; i < apps.size(); i++)
   333             cid = getComponentId(aSuite.getGlobalId(i));
   335         //{
   334             assertTrue("Application " + aSuite.getGlobalId(i) + not +
   336         //    cid = getComponentId(aSuite.getGlobalId(i));
   335                        " found from SCR", (aExists? cid != null: cid == null));
   337         //    assertTrue("Application " + aSuite.getGlobalId(i) + not +
   336         }
   338         //               " found from SCR", (aExists? cid != null: cid == null));
       
   339         //}
   337     }
   340     }
   338 
   341 
   339     private void logSuite(SuiteInfo aSuite)
   342     private void logSuite(SuiteInfo aSuite)
   340     {
   343     {
   341         SifRegistrator sifReg = new SifRegistrator();
   344         SifRegistrator sifReg = new SifRegistrator();