test_class.declarator: bareMetalRemovalUpdater = new BareMetalRemovalUpdater()
test_class.modifier: private final
test_class.original_string: private final BareMetalRemovalUpdater bareMetalRemovalUpdater = new BareMetalRemovalUpdater();
test_class.type: BareMetalRemovalUpdater
test_class.var_name: bareMetalRemovalUpdater
test_class.declarator: values
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ResultSet values;
test_class.type: ResultSet
test_class.var_name: values
test_class.declarator: dbConnection
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Connection dbConnection;
test_class.type: Connection
test_class.var_name: dbConnection
test_class.declarator: preparedStatement
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private PreparedStatement preparedStatement;
test_class.type: PreparedStatement
test_class.var_name: preparedStatement
test_class.file: engine/schema/src/test/java/com/cloud/upgrade/dao/BareMetalRemovalUpdaterTest.java
test_class.identifier: BareMetalRemovalUpdaterTest
test_case.body: @Test
      public void test_findAndUpdateRowsThatReferenceBareMetal_whenThereAreTwoRowsThatReferencesBareMetal() throws Exception {
          when(values.next())
                  .thenReturn(true)
                  .thenReturn(true)
                  .thenReturn(true)
                  .thenReturn(false);
          when(values.getString(BareMetalRemovalUpdater.VALUE))
                  .thenReturn("BAREMETAL,hypervisor_a")
                  .thenReturn("someValue")
                  .thenReturn("hypervisor_b,baremetal");
          when(values.getString(BareMetalRemovalUpdater.CATEGORY))
                  .thenReturn("someCategory")
                  .thenReturn("anotherCategory");
          when(values.getString(BareMetalRemovalUpdater.INSTANCE))
                  .thenReturn("someInstance")
                  .thenReturn("anotherInstance");
          when(values.getString(BareMetalRemovalUpdater.COMPONENT))
                  .thenReturn("someComponent")
                  .thenReturn("anotherComponent");
          when(values.getString(BareMetalRemovalUpdater.NAME))
                  .thenReturn("someName")
                  .thenReturn("anotherName");
          final List<Map<String, String>> updatedRows = new ArrayList<>();
  
          bareMetalRemovalUpdater.findAndUpdateRowsThatReferenceBareMetal(values, updatedRows);
  
          assertThat(updatedRows, hasSize(2));
          assertThat(updatedRows, contains(
                  allOf(
                          hasEntry(BareMetalRemovalUpdater.VALUE, "hypervisor_a"),
                          hasEntry(BareMetalRemovalUpdater.CATEGORY, "someCategory"),
                          hasEntry(BareMetalRemovalUpdater.INSTANCE, "someInstance"),
                          hasEntry(BareMetalRemovalUpdater.COMPONENT, "someComponent"),
                          hasEntry(BareMetalRemovalUpdater.NAME, "someName")
                  ),
                  allOf(
                          hasEntry(BareMetalRemovalUpdater.VALUE, "hypervisor_b"),
                          hasEntry(BareMetalRemovalUpdater.CATEGORY, "anotherCategory"),
                          hasEntry(BareMetalRemovalUpdater.INSTANCE, "anotherInstance"),
                          hasEntry(BareMetalRemovalUpdater.COMPONENT, "anotherComponent"),
                          hasEntry(BareMetalRemovalUpdater.NAME, "anotherName")
                  )
          ));
      }
test_case.class_method_signature: BareMetalRemovalUpdaterTest.test_findAndUpdateRowsThatReferenceBareMetal_whenThereAreTwoRowsThatReferencesBareMetal()
test_case.full_signature: @Test public void test_findAndUpdateRowsThatReferenceBareMetal_whenThereAreTwoRowsThatReferencesBareMetal()
test_case.identifier: test_findAndUpdateRowsThatReferenceBareMetal_whenThereAreTwoRowsThatReferencesBareMetal
test_case.invocations: thenReturn thenReturn thenReturn thenReturn when next thenReturn thenReturn thenReturn when getString thenReturn thenReturn when getString thenReturn thenReturn when getString thenReturn thenReturn when getString thenReturn thenReturn when getString findAndUpdateRowsThatReferenceBareMetal assertThat hasSize assertThat contains allOf hasEntry hasEntry hasEntry hasEntry hasEntry allOf hasEntry hasEntry hasEntry hasEntry hasEntry
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_findAndUpdateRowsThatReferenceBareMetal_whenThereAreTwoRowsThatReferencesBareMetal()
focal_class.declarator: logger = Logger.getLogger(BareMetalRemovalUpdater.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = Logger.getLogger(BareMetalRemovalUpdater.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: BARE_METAL = "baremetal"
focal_class.modifier: private static final
focal_class.original_string: private static final String BARE_METAL = "baremetal";
focal_class.type: String
focal_class.var_name: BARE_METAL
focal_class.declarator: VALUE_SEPARATOR = ","
focal_class.modifier: private static final
focal_class.original_string: private static final String VALUE_SEPARATOR = ",";
focal_class.type: String
focal_class.var_name: VALUE_SEPARATOR
focal_class.declarator: HYPERVISOR_LIST = "hypervisor.list"
focal_class.modifier: private static final
focal_class.original_string: private static final String HYPERVISOR_LIST = "hypervisor.list";
focal_class.type: String
focal_class.var_name: HYPERVISOR_LIST
focal_class.declarator: VALUE = "value"
focal_class.modifier: public static final
focal_class.original_string: public static final String VALUE = "value";
focal_class.type: String
focal_class.var_name: VALUE
focal_class.declarator: CATEGORY = "category"
focal_class.modifier: public static final
focal_class.original_string: public static final String CATEGORY = "category";
focal_class.type: String
focal_class.var_name: CATEGORY
focal_class.declarator: INSTANCE = "instance"
focal_class.modifier: public static final
focal_class.original_string: public static final String INSTANCE = "instance";
focal_class.type: String
focal_class.var_name: INSTANCE
focal_class.declarator: COMPONENT = "component"
focal_class.modifier: public static final
focal_class.original_string: public static final String COMPONENT = "component";
focal_class.type: String
focal_class.var_name: COMPONENT
focal_class.declarator: NAME = "name"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME = "name";
focal_class.type: String
focal_class.var_name: NAME
focal_class.declarator: SELECT_CONFIGURATION_ITEMS = "SELECT category, instance, component, name, value FROM configuration WHERE name = ?"
focal_class.modifier: public static final
focal_class.original_string: public static final String SELECT_CONFIGURATION_ITEMS = "SELECT category, instance, component, name, value FROM configuration WHERE name = ?";
focal_class.type: String
focal_class.var_name: SELECT_CONFIGURATION_ITEMS
focal_class.declarator: UPDATE_CONFIGURATION_ITEM = "UPDATE configuration SET value = ? WHERE category = ? AND instance = ? AND component = ? AND name = ?"
focal_class.modifier: public static final
focal_class.original_string: public static final String UPDATE_CONFIGURATION_ITEM = "UPDATE configuration SET value = ? WHERE category = ? AND instance = ? AND component = ? AND name = ?";
focal_class.type: String
focal_class.var_name: UPDATE_CONFIGURATION_ITEM
focal_class.file: engine/schema/src/main/java/com/cloud/upgrade/dao/BareMetalRemovalUpdater.java
focal_class.identifier: BareMetalRemovalUpdater
focal_class.class_method_signature: BareMetalRemovalUpdater.updateConfigurationValuesThatReferenceBareMetal(final Connection conn)
focal_class.full_signature: public void updateConfigurationValuesThatReferenceBareMetal(final Connection conn)
focal_class.identifier: updateConfigurationValuesThatReferenceBareMetal
focal_class.modifiers: public
focal_class.parameters: (final Connection conn)
focal_class.return: void
focal_class.signature: void updateConfigurationValuesThatReferenceBareMetal(final Connection conn)
focal_class.class_method_signature: BareMetalRemovalUpdater.createUpdatedConfigurationItemValues(final Connection conn)
focal_class.full_signature: public List<Map<String, String>> createUpdatedConfigurationItemValues(final Connection conn)
focal_class.identifier: createUpdatedConfigurationItemValues
focal_class.modifiers: public
focal_class.parameters: (final Connection conn)
focal_class.return: List<Map<String, String>>
focal_class.signature: List<Map<String, String>> createUpdatedConfigurationItemValues(final Connection conn)
focal_class.class_method_signature: BareMetalRemovalUpdater.updateConfigurationItems(final Connection conn, final List<Map<String, String>> updatedRows)
focal_class.full_signature: public void updateConfigurationItems(final Connection conn, final List<Map<String, String>> updatedRows)
focal_class.identifier: updateConfigurationItems
focal_class.modifiers: public
focal_class.parameters: (final Connection conn, final List<Map<String, String>> updatedRows)
focal_class.return: void
focal_class.signature: void updateConfigurationItems(final Connection conn, final List<Map<String, String>> updatedRows)
focal_class.class_method_signature: BareMetalRemovalUpdater.updateConfigurationItem(final Connection conn, final String category, final String instance, final String component, final String name, final String value)
focal_class.full_signature: public void updateConfigurationItem(final Connection conn, final String category, final String instance, final String component, final String name, final String value)
focal_class.identifier: updateConfigurationItem
focal_class.modifiers: public
focal_class.parameters: (final Connection conn, final String category, final String instance, final String component, final String name, final String value)
focal_class.return: void
focal_class.signature: void updateConfigurationItem(final Connection conn, final String category, final String instance, final String component, final String name, final String value)
focal_class.class_method_signature: BareMetalRemovalUpdater.findAndUpdateRowsThatReferenceBareMetal(final ResultSet values, final List<Map<String, String>> updatedRows)
focal_class.full_signature: public void findAndUpdateRowsThatReferenceBareMetal(final ResultSet values, final List<Map<String, String>> updatedRows)
focal_class.identifier: findAndUpdateRowsThatReferenceBareMetal
focal_class.modifiers: public
focal_class.parameters: (final ResultSet values, final List<Map<String, String>> updatedRows)
focal_class.return: void
focal_class.signature: void findAndUpdateRowsThatReferenceBareMetal(final ResultSet values, final List<Map<String, String>> updatedRows)
focal_class.class_method_signature: BareMetalRemovalUpdater.createUpdatedValue(final String value)
focal_class.full_signature: public String createUpdatedValue(final String value)
focal_class.identifier: createUpdatedValue
focal_class.modifiers: public
focal_class.parameters: (final String value)
focal_class.return: String
focal_class.signature: String createUpdatedValue(final String value)
focal_class.class_method_signature: BareMetalRemovalUpdater.hasReferenceToBareMetal(final String value)
focal_class.full_signature: public boolean hasReferenceToBareMetal(final String value)
focal_class.identifier: hasReferenceToBareMetal
focal_class.modifiers: public
focal_class.parameters: (final String value)
focal_class.return: boolean
focal_class.signature: boolean hasReferenceToBareMetal(final String value)
focal_class.class_method_signature: BareMetalRemovalUpdater.createUpdatedRow(final String category, final String instance, final String component, final String name, final String filteredValue)
focal_class.full_signature: private HashMap<String, String> createUpdatedRow(final String category, final String instance, final String component, final String name, final String filteredValue)
focal_class.identifier: createUpdatedRow
focal_class.modifiers: private
focal_class.parameters: (final String category, final String instance, final String component, final String name, final String filteredValue)
focal_class.return: HashMap<String, String>
focal_class.signature: HashMap<String, String> createUpdatedRow(final String category, final String instance, final String component, final String name, final String filteredValue)
focal_class.class_method_signature: BareMetalRemovalUpdater.printConfigurationItem(final String category, final String instance, final String component, final String name, final String value)
focal_class.full_signature: private String printConfigurationItem(final String category, final String instance, final String component, final String name, final String value)
focal_class.identifier: printConfigurationItem
focal_class.modifiers: private
focal_class.parameters: (final String category, final String instance, final String component, final String name, final String value)
focal_class.return: String
focal_class.signature: String printConfigurationItem(final String category, final String instance, final String component, final String name, final String value)
focal_method.body: public void findAndUpdateRowsThatReferenceBareMetal(final ResultSet values, final List<Map<String, String>> updatedRows) throws SQLException {
          while (values.next()) {
              final String value = values.getString(VALUE);
              if (value != null && hasReferenceToBareMetal(value)) {
                  final String category = values.getString(CATEGORY);
                  final String instance = values.getString(INSTANCE);
                  final String component = values.getString(COMPONENT);
                  final String name = values.getString(NAME);
                  logger.info("Found one configuration item that references BareMetal: " + printConfigurationItem(category, instance, component, name, value));
                  final HashMap<String, String> updatedRow = createUpdatedRow(category, instance, component, name, createUpdatedValue(value));
                  updatedRows.add(updatedRow);
              }
          }
      }
focal_method.class_method_signature: BareMetalRemovalUpdater.findAndUpdateRowsThatReferenceBareMetal(final ResultSet values, final List<Map<String, String>> updatedRows)
focal_method.full_signature: public void findAndUpdateRowsThatReferenceBareMetal(final ResultSet values, final List<Map<String, String>> updatedRows)
focal_method.identifier: findAndUpdateRowsThatReferenceBareMetal
focal_method.invocations: next getString hasReferenceToBareMetal getString getString getString getString info printConfigurationItem createUpdatedRow createUpdatedValue add
focal_method.modifiers: public
focal_method.parameters: (final ResultSet values, final List<Map<String, String>> updatedRows)
focal_method.return: void
focal_method.signature: void findAndUpdateRowsThatReferenceBareMetal(final ResultSet values, final List<Map<String, String>> updatedRows)