Coverage Report
livenotificationrun
measured on November 5, 2007 4:04:16 PM CET
up to the title page
org . codecover . simplejavaapp . controller . AppController . onOpen
Statement Coverage Branch Coverage Loop Coverage Strict Condition Coverage
private void onOpen(String fileId) 4 / 10 40 %
3 / 14 21 %
0 / 0 ---
0 / 3 0 %
AppController.java
109       private void onOpen(String fileId) {
110           if (model.isFileModified(fileId)) {
111               int result = view.showConfirmationDialog(
112                       "The file has modifications. Save before proceeding?",
113                       fileId);
114  
115               switch (result) {
116                   case JOptionPane.YES_OPTION:
117                       if (!onSave(fileId)) {
118                           /* Saving was aborted or failed, so we don't proceed */
119                           return;
120                       }
121                       break;
122                   case JOptionPane.NO_OPTION:
123                       break;
124                   case JOptionPane.CANCEL_OPTION:
125                       /* Saving was aborted or failed, so we don't proceed */
126                       return;
127               }
128           }
129  
130           String path = view.showOpenDialog(fileId);
131  
132           if (path == null) {
133               return;
134           }
135  
136           try {
137               String newFileId = model.loadFile(new File(path));
138  
139               view.openFileInWindow(fileId, newFileId);
140               model.closeFile(fileId, true);
141           } catch (ParserConfigurationException e) {
142               view.showErrorDialog("Error loading file", fileId);
143           } catch (SAXException e) {
144               view.showErrorDialog("Error loading file", fileId);
145           } catch (IOException e) {
146               view.showErrorDialog("Error loading file", fileId);
147           }
148       }
created on November 17, 2007 7:07:00 PM CET with CodeCover