Coverage Report - liquibase.util.ui.SwingUIFacade
 
Classes in this File Line Coverage Branch Coverage Complexity
SwingUIFacade
0%
0/2
0%
0/2
1
 
 1  
 package liquibase.util.ui;
 2  
 
 3  
 import javax.swing.JOptionPane;
 4  
 
 5  
 import liquibase.database.Database;
 6  
 import liquibase.exception.DatabaseException;
 7  
 import liquibase.util.StreamUtil;
 8  
 
 9  0
 public class SwingUIFacade implements UIFacade {
 10  
     /**
 11  
      * Displays swing-based dialog about running against a non-localhost database. Returns true if the user selected
 12  
      * that they are OK with that.
 13  
      */
 14  
     @Override
 15  
     public boolean promptForNonLocalDatabase(Database database) throws DatabaseException {
 16  0
         return JOptionPane.showConfirmDialog(
 17  
                 null,
 18  
                 "You are running a database migration against a non-local database." + StreamUtil.getLineSeparator()
 19  
                         + "Database URL is: " + database.getConnection().getURL() + StreamUtil.getLineSeparator()
 20  
                         + "Username is: " + database.getConnection().getConnectionUserName()
 21  
                         + StreamUtil.getLineSeparator() + StreamUtil.getLineSeparator()
 22  
                         + "Area you sure you want to do this?", "Confirm", JOptionPane.YES_NO_OPTION,
 23  
                 JOptionPane.WARNING_MESSAGE) == JOptionPane.NO_OPTION;
 24  
     }
 25  
 
 26  
 }