javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/jsrpluginnotifier/TestPlugin2.java
changeset 87 1627c337e51e
parent 72 1f0034e370aa
--- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/jsrpluginnotifier/TestPlugin2.java	Fri Oct 15 12:29:39 2010 +0300
+++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/jsrpluginnotifier/TestPlugin2.java	Fri Oct 29 11:49:32 2010 +0300
@@ -18,6 +18,11 @@
 
 package com.nokia.mj.impl.installer.jsrpluginnotifier;
 
+import com.nokia.mj.impl.utils.Attribute;
+import com.nokia.mj.impl.utils.InstallerErrorMessage;
+import com.nokia.mj.impl.utils.InstallerDetailedErrorMessage;
+import com.nokia.mj.impl.utils.OtaStatusCode;
+
 /**
  * Installer Jsr plugin just for test purposes.
  *
@@ -52,7 +57,19 @@
         if ((aInstallerExtensionInfo.iAttributes != null) &&
                 (aInstallerExtensionInfo.iAttributes.get("JSR-Plugin-Test-Exception") != null))
         {
-            throw new RuntimeException("TestPlugin2.install Exception");
+            if ("InstallerExtensionException".equals(
+                    ((Attribute)aInstallerExtensionInfo.iAttributes.get("JSR-Plugin-Test-Exception")).getValue()))
+            {
+                throw new InstallerExtensionException(
+                    InstallerErrorMessage.INST_UNEXPECTED_ERR, null,
+                    InstallerDetailedErrorMessage.INTERNAL_ERROR,
+                    new String[] { "TestPlugin2.install Exception" },
+                    OtaStatusCode.INTERNAL_ERROR);
+            }
+            else
+            {
+                throw new RuntimeException("TestPlugin2.install Exception");
+            }
         }
 
         return true;
@@ -85,7 +102,19 @@
         if ((aInstallerExtensionInfo.iAttributes != null) &&
                 (aInstallerExtensionInfo.iAttributes.get("JSR-Plugin-Test-Exception") != null))
         {
-            throw new RuntimeException("TestPlugin2.uninstall Exception");
+            if ("InstallerExtensionException".equals(
+                    ((Attribute)aInstallerExtensionInfo.iAttributes.get("JSR-Plugin-Test-Exception")).getValue()))
+            {
+                throw new InstallerExtensionException(
+                    InstallerErrorMessage.INST_UNEXPECTED_ERR, null,
+                    InstallerDetailedErrorMessage.INTERNAL_ERROR,
+                    new String[] { "TestPlugin2.uninstall Exception" },
+                    OtaStatusCode.INTERNAL_ERROR);
+            }
+            else
+            {
+                throw new RuntimeException("TestPlugin2.uninstall Exception");
+            }
         }
 
         return true;