Package org.xmlBlaster.engine.runlevel

Examples of org.xmlBlaster.engine.runlevel.RunLevelAction


                      "        onStartupRunlevel='3'\n" +
                      "        sequence='5'\n" +
                      "        onFail='resource.configuration.pluginFailed'/>";
  
         RunLevelActionSaxFactory factory = new RunLevelActionSaxFactory(this.glob);
         RunLevelAction action = factory.readObject(xml);

         for (int i=0; i < 2; i++) {
            assertEquals(me + " checking do attribute", "LOAD", action.getDo());
            assertEquals(me + " checking onFail attribute", "resource.configuration.pluginFailed", action.getOnFail().getErrorCode());
            assertEquals(me + " checking onShutdownLevel attribute", -1, action.getOnShutdownRunlevel());
            assertEquals(me + " checking onStartupLevel attribute", 3, action.getOnStartupRunlevel());
            assertEquals(me + " checking sequence attribute", 5, action.getSequence());
            assertEquals(me + " checking hasOnFail", true, action.hasOnFail());
            assertEquals(me + " checking isOnShutdownLevel", false, action.isOnShutdownRunlevel());
            assertEquals(me + " checking isOnStartupLevel", true, action.isOnStartupRunlevel());
            xml = action.toXml();
            action = factory.readObject(xml);
            log.info("going to test the second time ...");
         }

         // now test a null string
View Full Code Here


         config.addAttribute("url", "jdbc:oracle:thin:@localhost:1521:noty");
         config.addAttribute("user", "joe");
         config.addAttribute("password", "secret");
         config.addAttribute("connectionBusyTimeout", "90000");
         config.addAttribute("maxWaitingThreads", "300");
         RunLevelAction action = new RunLevelAction(this.glob, "LOAD", 3, -1, ErrorCode.toErrorCode("internal.unknown"), 5);
         config.addAction(action);
         action = new RunLevelAction(this.glob, "STOP", -1, 2, null, 4);
         config.addAction(action);
    
         String xml = config.toXml();
         log.info(xml);
    
View Full Code Here

      PluginConfigComparator upComparator = new PluginConfigComparator(this.glob, true);
      PluginConfigComparator downComparator = new PluginConfigComparator(this.glob, false);

      PluginConfig config1 = new PluginConfig(this.glob, "test:PLUGIN1", true, "org.universe.Plugin1");
      RunLevelAction action = new RunLevelAction(this.glob, "LOAD", 3, -1, null, 5);
      config1.addAction(action);
      action = new RunLevelAction(this.glob, "STOP", -1, 2, null, 4);
      config1.addAction(action);
    
      PluginConfig config2 = new PluginConfig(this.glob, "test:PLUGIN2", true, "org.universe.Plugin2");
      action = new RunLevelAction(this.glob, "LOAD", 3, -1, null, 5);
      config2.addAction(action);
      action = new RunLevelAction(this.glob, "STOP", -1, 2, null, 4);
      config2.addAction(action);
    
      int cmp = upComparator.compare(config1, config2);
      assertTrue(me + " number of actions", cmp < 0);

      cmp = downComparator.compare(config1, config2);
      assertTrue(me + " number of actions", cmp > 0);

      PluginConfig config3 = new PluginConfig(this.glob, "test:PLUGIN3", true, "org.universe.Plugin3");
      action = new RunLevelAction(this.glob, "LOAD", 2, -1, null, 3);
      config3.addAction(action);
      action = new RunLevelAction(this.glob, "STOP", -1, 1, null, 3);
      config3.addAction(action);
      cmp = upComparator.compare(config1, config3);
      assertTrue(me + " number of actions", cmp > 0);
      cmp = downComparator.compare(config1, config3);
      assertTrue(me + " number of actions", cmp < 0);

      PluginConfig config4 = new PluginConfig(this.glob, "test:PLUGIN4", true, "org.universe.Plugin4");
      action = new RunLevelAction(this.glob, "LOAD", 2, -1, null, 4);
      config4.addAction(action);
      action = new RunLevelAction(this.glob, "STOP", -1, 1, null, 4);
      config4.addAction(action);
      cmp = upComparator.compare(config3, config4);
      assertTrue(me + " number of actions", cmp < 0);
      cmp = downComparator.compare(config3, config4);
      assertTrue(me + " number of actions", cmp < 0);
View Full Code Here

TOP

Related Classes of org.xmlBlaster.engine.runlevel.RunLevelAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.