Last change
on this file since 9130 was 7938, checked in by bastiK, 9 years ago |
add more subversion property svn:eol=native
|
-
Property svn:eol-style
set to
native
|
File size:
995 bytes
|
Rev | Line | |
---|
[6671] | 1 | package org.openstreetmap.josm.data
|
---|
| 2 |
|
---|
[7081] | 3 | import java.awt.Color
|
---|
| 4 |
|
---|
| 5 | import org.openstreetmap.josm.JOSMFixture
|
---|
[6671] | 6 | import org.openstreetmap.josm.Main
|
---|
| 7 |
|
---|
| 8 | class PreferencesTest extends GroovyTestCase {
|
---|
| 9 | @Override
|
---|
| 10 | void setUp() {
|
---|
[7081] | 11 | JOSMFixture.createUnitTestFixture().init();
|
---|
[6671] | 12 | }
|
---|
| 13 |
|
---|
| 14 | void testColorName() {
|
---|
[6774] | 15 | assert Main.pref.getColorName("color.layer {5DE308C0-916F-4B5A-B3DB-D45E17F30172}.gpx") == "color.layer {5DE308C0-916F-4B5A-B3DB-D45E17F30172}.gpx"
|
---|
[6671] | 16 | }
|
---|
[6774] | 17 |
|
---|
| 18 | void testColorAlpha() {
|
---|
| 19 | assert Main.pref.getColor("foo", new Color(0x12345678, true)).alpha == 0x12
|
---|
| 20 | assert Main.pref.putColor("bar", new Color(0x12345678, true))
|
---|
| 21 | assert Main.pref.getColor("bar", null).alpha == 0x12
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | void testColorNameAlpha() {
|
---|
| 25 | assert Main.pref.getColor("foo", "bar", new Color(0x12345678, true)).alpha == 0x12
|
---|
| 26 | assert Main.pref.getDefaultColor("foo") == new Color(0x34, 0x56, 0x78, 0x12)
|
---|
| 27 | assert Main.pref.getDefaultColor("foo").alpha == 0x12
|
---|
| 28 | }
|
---|
[6671] | 29 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.