use of org.jboss.hal.core.mbui.ResourceDescriptionBuilder in project console by hal.
the class ModelNodeFormTest method defaultStateMachine.
@Test
public void defaultStateMachine() {
StateMachine stateMachine = new ModelNodeForm.Builder("defaultStateMachine", metadata(new ResourceDescriptionBuilder().attributes())).stateMachine();
Assert.assertTrue(stateMachine instanceof ExistingStateMachine);
}
use of org.jboss.hal.core.mbui.ResourceDescriptionBuilder in project console by hal.
the class ModelNodeFormTest method noRuntime.
@Test
public void noRuntime() throws Exception {
ModelNodeForm<ModelNode> form = builder("noRuntime", new ResourceDescriptionBuilder().storage(ImmutableMap.of("foo", CONFIGURATION, "bar", RUNTIME))).build();
Iterable<FormItem> formItems = form.getFormItems();
Iterator<FormItem> iterator = formItems.iterator();
assertEquals(1, Iterables.size(formItems));
assertEquals("foo", iterator.next().getName());
}
use of org.jboss.hal.core.mbui.ResourceDescriptionBuilder in project console by hal.
the class ModelNodeFormTest method createResourceStateMachine.
// ------------------------------------------------------ verify different state machines
@Test
public void createResourceStateMachine() {
StateMachine stateMachine = new ModelNodeForm.Builder("createResourceStateMachine", metadata(new ResourceDescriptionBuilder().requestProperties(Collections.emptyMap()))).fromRequestProperties().stateMachine();
Assert.assertTrue(stateMachine instanceof AddOnlyStateMachine);
}
use of org.jboss.hal.core.mbui.ResourceDescriptionBuilder in project console by hal.
the class ModelNodeFormTest method editOnlyStateMachine.
@Test
public void editOnlyStateMachine() {
StateMachine stateMachine = new ModelNodeForm.Builder("editOnlyStateMachine", metadata(new ResourceDescriptionBuilder().attributes())).fromRequestProperties().stateMachine();
Assert.assertTrue(stateMachine instanceof AddOnlyStateMachine);
}
use of org.jboss.hal.core.mbui.ResourceDescriptionBuilder in project console by hal.
the class ModelNodeFormTest method viewOnlyStateMachine.
@Test
public void viewOnlyStateMachine() {
StateMachine stateMachine = new ModelNodeForm.Builder("viewOnlyStateMachine", metadata(new ResourceDescriptionBuilder().attributes())).readOnly().stateMachine();
Assert.assertTrue(stateMachine instanceof ReadOnlyStateMachine);
}
Aggregations