|
1 |
| -/** |
| 1 | +/* |
2 | 2 | * Copyright 2018 Philipp Salvisberg <philipp.salvisberg@trivadis.com>
|
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
|
15 | 15 | */
|
16 | 16 | package org.utplsql.sqldev.test.coverage;
|
17 | 17 |
|
18 |
| -import java.sql.Connection; |
19 |
| -import java.util.Collections; |
20 |
| -import org.eclipse.xtext.xbase.lib.CollectionLiterals; |
21 |
| -import org.eclipse.xtext.xbase.lib.Exceptions; |
| 18 | +import java.util.Arrays; |
| 19 | + |
| 20 | +import org.junit.Assert; |
22 | 21 | import org.junit.Test;
|
23 | 22 | import org.utplsql.sqldev.coverage.CodeCoverageReporter;
|
| 23 | +import org.utplsql.sqldev.model.DatabaseTools; |
| 24 | +import org.utplsql.sqldev.model.SystemTools; |
24 | 25 | import org.utplsql.sqldev.test.AbstractJdbcTest;
|
25 |
| -import org.utplsql.sqldev.ui.coverage.CodeCoverageReporterDialog; |
26 | 26 |
|
27 |
| -@SuppressWarnings("all") |
| 27 | + |
28 | 28 | public class CodeCoverageReporterDialogTest extends AbstractJdbcTest {
|
29 |
| - @Test |
30 |
| - public void layout() { |
31 |
| - try { |
32 |
| - Connection _connection = AbstractJdbcTest.dataSource.getConnection(); |
33 |
| - final CodeCoverageReporter reporter = new CodeCoverageReporter(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("SCOTT")), Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("a", "b", "c")), _connection); |
34 |
| - reporter.showParameterWindow(); |
35 |
| - Thread.sleep((4 * 1000)); |
36 |
| - CodeCoverageReporterDialog _frame = reporter.getFrame(); |
37 |
| - if (_frame!=null) { |
38 |
| - _frame.exit(); |
39 |
| - } |
40 |
| - } catch (Throwable _e) { |
41 |
| - throw Exceptions.sneakyThrow(_e); |
| 29 | + |
| 30 | + @Test |
| 31 | + public void layout() { |
| 32 | + final CodeCoverageReporter reporter = new CodeCoverageReporter(Arrays.asList("SCOTT"), |
| 33 | + Arrays.asList("a", "b", "c"), DatabaseTools.getConnection(dataSource)); |
| 34 | + reporter.showParameterWindow(); |
| 35 | + SystemTools.sleep(4 * 1000); |
| 36 | + Assert.assertNotNull(reporter.getFrame()); |
| 37 | + reporter.getFrame().exit(); |
42 | 38 | }
|
43 |
| - } |
44 | 39 | }
|
0 commit comments