test_class.declarator: datacenterGenerator
test_class.modifier: private
test_class.original_string: private DatacenterGenerator datacenterGenerator;
test_class.type: DatacenterGenerator
test_class.var_name: datacenterGenerator
test_class.declarator: machineGenerator
test_class.modifier: private
test_class.original_string: private MachineGenerator machineGenerator;
test_class.type: MachineGenerator
test_class.var_name: machineGenerator
test_class.file: model/src/test/java/com/abiquo/server/core/scheduler/MachineLoadRuleDAOTest.java
test_class.identifier: MachineLoadRuleDAOTest
test_class.superclass: extends DefaultDAOTestBase<MachineLoadRuleDAO, MachineLoadRule>
test_case.body: @Test
      public void test_findMachineLoadRulesByRackIncludingMachineRules()
          throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
      {
          Datacenter datacenter = datacenterGenerator.createUniqueInstance();
          Rack rack = datacenter.createRack("bRack_1", 2, 4094, 2, 10);
          Machine machine = machineGenerator.createMachine(datacenter, rack);
          MachineLoadRule mclr1 = eg().createInstance(rack);
          MachineLoadRule mclr2 = eg().createInstance(machine);
          ds().persistAll(datacenter, rack, machine, mclr1, mclr2);
  
          MachineLoadRuleDAO dao = createDaoForRollbackTransaction();
          Assert.assertEquals(dao.findByRack(rack, true).size(), 2);
      }
test_case.class_method_signature: MachineLoadRuleDAOTest.test_findMachineLoadRulesByRackIncludingMachineRules()
test_case.full_signature: @Test public void test_findMachineLoadRulesByRackIncludingMachineRules()
test_case.identifier: test_findMachineLoadRulesByRackIncludingMachineRules
test_case.invocations: createUniqueInstance createRack createMachine createInstance eg createInstance eg persistAll ds createDaoForRollbackTransaction assertEquals size findByRack
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_findMachineLoadRulesByRackIncludingMachineRules()
focal_class.declarator: CANDIDATE_MACHINE_RULES =
          "SELECT DISTINCT obj FROM com.abiquo.server.core.scheduler.MachineLoadRule obj WHERE "
              + "obj.machine IN (:machines) OR "
              + // Find rules from machines
              "obj.rack IN (SELECT obj2.rack FROM com.abiquo.server.core.infrastructure.Machine obj2 WHERE obj2 IN (:machines)) OR "
              + // Find rules from racks hosting the machines
              "obj.datacenter IN (SELECT obj3.datacenter FROM com.abiquo.server.core.infrastructure.Machine obj3 WHERE obj3 IN (:machines)) "
focal_class.modifier: private final static
focal_class.original_string: private final static String CANDIDATE_MACHINE_RULES =
          "SELECT DISTINCT obj FROM com.abiquo.server.core.scheduler.MachineLoadRule obj WHERE "
              + "obj.machine IN (:machines) OR "
              + // Find rules from machines
              "obj.rack IN (SELECT obj2.rack FROM com.abiquo.server.core.infrastructure.Machine obj2 WHERE obj2 IN (:machines)) OR "
              + // Find rules from racks hosting the machines
              "obj.datacenter IN (SELECT obj3.datacenter FROM com.abiquo.server.core.infrastructure.Machine obj3 WHERE obj3 IN (:machines)) ";
focal_class.type: String
focal_class.var_name: CANDIDATE_MACHINE_RULES
focal_class.declarator: QUERY_RULES_BY_MACHINE = //
          "SELECT obj FROM com.abiquo.server.core.scheduler.MachineLoadRule obj WHERE "
              + "obj.machine.id = :idMachine"
focal_class.modifier: private final static
focal_class.original_string: private final static String QUERY_RULES_BY_MACHINE = //
          "SELECT obj FROM com.abiquo.server.core.scheduler.MachineLoadRule obj WHERE "
              + "obj.machine.id = :idMachine";
focal_class.type: String
focal_class.var_name: QUERY_RULES_BY_MACHINE
focal_class.file: model/src/main/java/com/abiquo/server/core/scheduler/MachineLoadRuleDAO.java
focal_class.identifier: MachineLoadRuleDAO
focal_class.class_method_signature: MachineLoadRuleDAO.MachineLoadRuleDAO()
focal_class.full_signature: public  MachineLoadRuleDAO()
focal_class.identifier: MachineLoadRuleDAO
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  MachineLoadRuleDAO()
focal_class.class_method_signature: MachineLoadRuleDAO.MachineLoadRuleDAO(final EntityManager entityManager)
focal_class.full_signature: public  MachineLoadRuleDAO(final EntityManager entityManager)
focal_class.identifier: MachineLoadRuleDAO
focal_class.modifiers: public
focal_class.parameters: (final EntityManager entityManager)
focal_class.signature:  MachineLoadRuleDAO(final EntityManager entityManager)
focal_class.class_method_signature: MachineLoadRuleDAO.findCandidateMachineLoadRules(
          final Collection<Machine> firstPassCandidateMachines)
focal_class.full_signature: @SuppressWarnings("unchecked") public List<MachineLoadRule> findCandidateMachineLoadRules(
          final Collection<Machine> firstPassCandidateMachines)
focal_class.identifier: findCandidateMachineLoadRules
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (
          final Collection<Machine> firstPassCandidateMachines)
focal_class.return: List<MachineLoadRule>
focal_class.signature: List<MachineLoadRule> findCandidateMachineLoadRules(
          final Collection<Machine> firstPassCandidateMachines)
focal_class.class_method_signature: MachineLoadRuleDAO.getRulesForDatacenter(final Integer idDatacenter)
focal_class.full_signature: public List<MachineLoadRule> getRulesForDatacenter(final Integer idDatacenter)
focal_class.identifier: getRulesForDatacenter
focal_class.modifiers: public
focal_class.parameters: (final Integer idDatacenter)
focal_class.return: List<MachineLoadRule>
focal_class.signature: List<MachineLoadRule> getRulesForDatacenter(final Integer idDatacenter)
focal_class.class_method_signature: MachineLoadRuleDAO.findByMachine(final Integer idMachine)
focal_class.full_signature: @SuppressWarnings("unchecked") public List<MachineLoadRule> findByMachine(final Integer idMachine)
focal_class.identifier: findByMachine
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (final Integer idMachine)
focal_class.return: List<MachineLoadRule>
focal_class.signature: List<MachineLoadRule> findByMachine(final Integer idMachine)
focal_class.class_method_signature: MachineLoadRuleDAO.findByRack(final Rack rack)
focal_class.full_signature: public List<MachineLoadRule> findByRack(final Rack rack)
focal_class.identifier: findByRack
focal_class.modifiers: public
focal_class.parameters: (final Rack rack)
focal_class.return: List<MachineLoadRule>
focal_class.signature: List<MachineLoadRule> findByRack(final Rack rack)
focal_class.class_method_signature: MachineLoadRuleDAO.findByRack(final Rack rack, final boolean includeMachineRules)
focal_class.full_signature: @SuppressWarnings("unchecked") public List<MachineLoadRule> findByRack(final Rack rack, final boolean includeMachineRules)
focal_class.identifier: findByRack
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (final Rack rack, final boolean includeMachineRules)
focal_class.return: List<MachineLoadRule>
focal_class.signature: List<MachineLoadRule> findByRack(final Rack rack, final boolean includeMachineRules)
focal_class.class_method_signature: MachineLoadRuleDAO.sameRack(final Rack rack)
focal_class.full_signature: private Criterion sameRack(final Rack rack)
focal_class.identifier: sameRack
focal_class.modifiers: private
focal_class.parameters: (final Rack rack)
focal_class.return: Criterion
focal_class.signature: Criterion sameRack(final Rack rack)
focal_class.class_method_signature: MachineLoadRuleDAO.nullMachine()
focal_class.full_signature: private Criterion nullMachine()
focal_class.identifier: nullMachine
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Criterion
focal_class.signature: Criterion nullMachine()
focal_class.superclass: extends DefaultDAOBase<Integer, MachineLoadRule>
focal_method.body: public List<MachineLoadRule> findByRack(final Rack rack)
      {
          return findByRack(rack, false);
      }
focal_method.class_method_signature: MachineLoadRuleDAO.findByRack(final Rack rack)
focal_method.full_signature: public List<MachineLoadRule> findByRack(final Rack rack)
focal_method.identifier: findByRack
focal_method.invocations: findByRack
focal_method.modifiers: public
focal_method.parameters: (final Rack rack)
focal_method.return: List<MachineLoadRule>
focal_method.signature: List<MachineLoadRule> findByRack(final Rack rack)