1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.javascript.configuration;
16
17 import static org.junit.Assert.assertFalse;
18 import static org.junit.Assert.assertTrue;
19
20 import org.htmlunit.javascript.HtmlUnitScriptable;
21 import org.junit.Test;
22
23
24
25
26
27
28
29
30 public class ClassConfigurationTest {
31
32
33
34
35 @Test
36 public void forJSFlagTrue() throws Exception {
37 final ClassConfiguration config1 = new ClassConfiguration(ConfigTestClass.class, null, true, null, "");
38 assertTrue("JSObject Flag should have been set", config1.isJsObject());
39 }
40
41
42
43
44 @Test
45 public void forJSFlagFalse() throws Exception {
46 final ClassConfiguration config1 = new ClassConfiguration(ConfigTestClass.class, null, false, null, "");
47 assertFalse("JSObject Flag should not have been set", config1.isJsObject());
48 }
49
50
51
52
53 protected class ConfigTestClass extends HtmlUnitScriptable {
54 private boolean test_ = false;
55
56
57
58
59 public void function() {
60 }
61
62
63
64
65 public boolean jsxGet_test() {
66 return test_;
67 }
68
69
70
71
72 public boolean jsxGet_getterOnly() {
73 return test_;
74 }
75
76
77
78
79 public void jsxSet_test(final Boolean testFlag) {
80 test_ = testFlag;
81 }
82 }
83 }