Project

General

Profile

Revision c5ea433d

IDc5ea433da767bed104593581247423ee931e6ed0
Parent 1df6e09d
Child 8e204953

Added by Katja Luther about 2 years ago

adapt test to not throw the exception put adding it to the result in pollProgressMonitor

View differences:

eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ProgressMonitorServiceTest.java
22 22
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
23 23
import eu.etaxonomy.cdm.api.service.IProgressMonitorService;
24 24
import eu.etaxonomy.cdm.api.service.ITestService;
25
import eu.etaxonomy.cdm.api.service.UpdateResult;
25 26
import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
26 27
import eu.etaxonomy.cdm.common.monitor.RemotingProgressMonitor;
27 28
import eu.etaxonomy.taxeditor.httpinvoker.RemotingSessionAwareTest;
......
92 93
                    new MockPostMoniteredOperationEnabled(expectedMonitor, uuid),
93 94
                    (IFeedbackGenerator)null,
94 95
                    new NullProgressMonitor());
95
            Assert.fail("Exception due to inconsistent number of feedback generators not thrown");
96
            if (expectedMonitor.getResult() instanceof UpdateResult){
97
                UpdateResult result = (UpdateResult)expectedMonitor.getResult();
98
                if (!result.getExceptions().contains(ise)){
99
                    Assert.fail("Exception due to inconsistent number of feedback generators not thrown");
100
                }
101
            }
102
//            Assert.fail("Exception due to inconsistent number of feedback generators not thrown");
96 103
        } catch(IllegalStateException e) {
97 104

  
98 105
        }
......
119 126
                            null,
120 127
                            (IFeedbackGenerator)null,
121 128
                            new NullProgressMonitor());
122
                    Assert.fail("InterruptedException wrapped in an IllegalStateException should be thrown");
129
                    if (expectedMonitor.getResult() instanceof UpdateResult){
130
                        UpdateResult result = (UpdateResult)expectedMonitor.getResult();
131
                        if (!result.getExceptions().contains(ise)){
132
                            Assert.fail("Exception due to inconsistent number of feedback generators not thrown");
133
                        }
134
                    }
135
//                    Assert.fail("InterruptedException wrapped in an IllegalStateException should be thrown");
123 136
                } catch (InterruptedException e) {
124 137

  
125 138
                } catch (IllegalStateException e) {
......
228 241
                    new MockPostMoniteredOperationEnabled(expectedMonitor, newUuid),
229 242
                    feebackGenerators,
230 243
                    new NullProgressMonitor());
231
            Assert.fail("Exception due to inconsistent number of feedback generators not thrown");
244
            if (expectedMonitor.getResult() instanceof UpdateResult){
245
                UpdateResult result = (UpdateResult)expectedMonitor.getResult();
246
                if (result.getExceptions().isEmpty()){
247
                    Assert.fail("Exception due to inconsistent number of feedback generators not thrown");
248
                }
249
            }
250
//            Assert.fail("Exception due to inconsistent number of feedback generators not thrown");
232 251
        } catch(IllegalStateException ise) {
233 252

  
234 253
        }
......
262 281
                    new MockPostMoniteredOperationEnabled(expectedMonitor, uuid),
263 282
                    feebackGenerators,
264 283
                    new NullProgressMonitor());
265
            Assert.fail("Exception due to inconsistent number of feedback generators not thrown");
284
            if (expectedMonitor.getResult() instanceof UpdateResult){
285
                UpdateResult result = (UpdateResult)expectedMonitor.getResult();
286
                if (result.getExceptions().isEmpty()){
287
                    Assert.fail("Exception due to inconsistent number of feedback generators not thrown");
288
                }
289
            }
290
//            Assert.fail("Exception due to inconsistent number of feedback generators not thrown");
266 291
        } catch(IllegalStateException ise) {
267 292

  
268 293
        }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)