1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.util.imagemaker; |
22 |
|
|
23 |
|
import static org.testng.Assert.assertEquals; |
24 |
|
|
25 |
|
import org.testng.annotations.Test; |
26 |
|
|
27 |
|
import jalview.bin.Cache; |
28 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (21) |
Complexity: 1 |
Complexity Density: 0.05 |
|
29 |
|
public class BitmapImageSizeTest |
30 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (20) |
Complexity: 1 |
Complexity Density: 0.05 |
1PASS
|
|
31 |
1 |
@Test(groups = { "Functional" })... |
32 |
|
public void testCacheSettingsRecovery() |
33 |
|
{ |
34 |
1 |
Cache.setPropsAreReadOnly(true); |
35 |
1 |
Cache.loadProperties("test/jalview/bin/testProps.jvprops"); |
36 |
|
|
37 |
1 |
Cache.removeProperty(BitmapImageSizing.BITMAP_HEIGHT); |
38 |
1 |
Cache.removeProperty(BitmapImageSizing.BITMAP_SCALE); |
39 |
1 |
Cache.removeProperty(BitmapImageSizing.BITMAP_WIDTH); |
40 |
|
|
41 |
1 |
BitmapImageSizing def = BitmapImageSizing.defaultBitmapImageSizing(); |
42 |
1 |
BitmapImageSizing zero = BitmapImageSizing.nullBitmapImageSizing(); |
43 |
|
|
44 |
1 |
assertEquals(def.height(), zero.height()); |
45 |
1 |
assertEquals(def.width(), zero.width()); |
46 |
1 |
assertEquals(def.scale(), zero.scale()); |
47 |
|
|
48 |
1 |
Cache.setProperty(BitmapImageSizing.BITMAP_HEIGHT, "120"); |
49 |
1 |
Cache.setProperty(BitmapImageSizing.BITMAP_SCALE, "24"); |
50 |
1 |
Cache.setProperty(BitmapImageSizing.BITMAP_WIDTH, "360"); |
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
1 |
assertEquals(def.height(), 120); |
56 |
1 |
assertEquals(def.width(), 360); |
57 |
1 |
assertEquals(def.scale(), 24f); |
58 |
|
|
59 |
1 |
Cache.removeProperty(BitmapImageSizing.BITMAP_WIDTH); |
60 |
|
|
61 |
|
|
62 |
1 |
assertEquals(def.height(), 120); |
63 |
1 |
assertEquals(def.width(), zero.width()); |
64 |
1 |
assertEquals(def.scale(), 24f); |
65 |
|
} |
66 |
|
} |