tkarkk
|
1243
|
1
|
|
|
2
|
|
|
3
|
|
|
4
|
|
|
5
|
|
|
6
|
|
|
7
|
|
|
8
|
|
|
9
|
|
|
10
|
|
|
11
|
|
|
12
|
|
|
13
|
|
|
14
|
|
|
15
|
|
|
16
|
package jdave.wicket;
|
|
17
|
|
|
18
|
import jdave.Block;
|
|
19
|
import jdave.junit4.JDaveRunner;
|
|
20
|
import org.apache.wicket.markup.html.basic.Label;
|
|
21
|
import org.apache.wicket.model.IModel;
|
|
22
|
import org.apache.wicket.model.Model;
|
|
23
|
import org.junit.runner.RunWith;
|
|
24
|
|
|
25
|
|
|
26
|
|
|
27
|
|
|
28
|
@RunWith(JDaveRunner.class)
|
|
29
|
public class NonFormComponentSpec extends ComponentSpecification<Label, String> {
|
|
30
|
|
|
31
|
@Override
|
|
32
|
protected Label newComponent(final String id, final IModel<String> model) {
|
|
33
|
return new Label(id, model);
|
|
34
|
}
|
|
35
|
|
|
36
|
public class FormStarting {
|
|
37
|
public void makesNoSense() {
|
|
38
|
specify(
|
|
39
|
new Block() {
|
|
40
|
public void run() throws Throwable {
|
|
41
|
startForm(new Model<String>(), "");
|
|
42
|
}
|
|
43
|
},
|
|
44
|
must
|
|
45
|
.raise(
|
|
46
|
IllegalArgumentException.class,
|
|
47
|
"Your ComponentSpecification must be typed as <? extends Form<?>> if you want to start a form. Instead you are using org.apache.wicket.markup.html.basic.Label"));
|
|
48
|
}
|
|
49
|
}
|
|
50
|
|
|
51
|
}
|