Skip to content

Commit 6abb537

Browse files
add layout test for preference panel
1 parent 628099d commit 6abb537

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

sqldev/pom.xml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,22 @@
137137
<scope>system</scope>
138138
<systemPath>${sqldev.basedir}/jdev/extensions/oracle.jdeveloper.java.core.jar</systemPath>
139139
</dependency>
140-
<!-- SQL Developer specific dependencies part 2 (available in public maven repositories) -->
140+
<!-- SQL Developer specific dependencies part 2 (used for tests only) -->
141+
<dependency>
142+
<groupId>oracle</groupId>
143+
<artifactId>jewt4.jar</artifactId>
144+
<version>12.2.1</version>
145+
<scope>system</scope>
146+
<systemPath>${sqldev.basedir}/modules/oracle.bali.jewt/jewt4.jar</systemPath>
147+
</dependency>
148+
<dependency>
149+
<groupId>oracle</groupId>
150+
<artifactId>share.jar</artifactId>
151+
<version>12.2.1</version>
152+
<scope>system</scope>
153+
<systemPath>${sqldev.basedir}/modules/oracle.bali.share/share.jar</systemPath>
154+
</dependency>
155+
<!-- SQL Developer specific dependencies part 3 (available in public maven repositories) -->
141156
<dependency>
142157
<!-- SQL Developer is using this older version -->
143158
<groupId>org.osgi</groupId>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright 2018 Philipp Salvisberg <philipp.salvisberg@trivadis.com>
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.utplsql.sqldev.test.preference
17+
18+
import java.awt.Toolkit
19+
import javax.swing.JFrame
20+
import javax.swing.SwingUtilities
21+
import org.junit.Test
22+
import org.utplsql.sqldev.ui.preference.PreferencePanel
23+
24+
class PreferencePanelTest {
25+
26+
@Test
27+
def void layoutTest() {
28+
val frame = new JFrame("Preference Panel")
29+
SwingUtilities.invokeLater(new Runnable() {
30+
override run() {
31+
val panel = new PreferencePanel
32+
frame.add(panel)
33+
frame.pack
34+
val dim = Toolkit.getDefaultToolkit().getScreenSize();
35+
frame.setLocation(dim.width / 2 - frame.getSize().width / 2, dim.height / 2 - frame.getSize().height / 2);
36+
frame.setVisible(true)
37+
}
38+
});
39+
Thread.sleep(4 * 1000)
40+
frame.dispose
41+
}
42+
43+
}

0 commit comments

Comments
 (0)