Search in sources :

Example 1 with StateMachine

use of org.jboss.hal.ballroom.form.StateMachine 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);
}
Also used : ExistingStateMachine(org.jboss.hal.ballroom.form.ExistingStateMachine) AddOnlyStateMachine(org.jboss.hal.ballroom.form.AddOnlyStateMachine) StateMachine(org.jboss.hal.ballroom.form.StateMachine) ReadOnlyStateMachine(org.jboss.hal.ballroom.form.ReadOnlyStateMachine) ExistingStateMachine(org.jboss.hal.ballroom.form.ExistingStateMachine) ResourceDescriptionBuilder(org.jboss.hal.core.mbui.ResourceDescriptionBuilder) Test(org.junit.Test)

Example 2 with StateMachine

use of org.jboss.hal.ballroom.form.StateMachine 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);
}
Also used : ExistingStateMachine(org.jboss.hal.ballroom.form.ExistingStateMachine) AddOnlyStateMachine(org.jboss.hal.ballroom.form.AddOnlyStateMachine) StateMachine(org.jboss.hal.ballroom.form.StateMachine) ReadOnlyStateMachine(org.jboss.hal.ballroom.form.ReadOnlyStateMachine) ResourceDescriptionBuilder(org.jboss.hal.core.mbui.ResourceDescriptionBuilder) AddOnlyStateMachine(org.jboss.hal.ballroom.form.AddOnlyStateMachine) ResourceDescriptionBuilder(org.jboss.hal.core.mbui.ResourceDescriptionBuilder) Test(org.junit.Test)

Example 3 with StateMachine

use of org.jboss.hal.ballroom.form.StateMachine 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);
}
Also used : ExistingStateMachine(org.jboss.hal.ballroom.form.ExistingStateMachine) AddOnlyStateMachine(org.jboss.hal.ballroom.form.AddOnlyStateMachine) StateMachine(org.jboss.hal.ballroom.form.StateMachine) ReadOnlyStateMachine(org.jboss.hal.ballroom.form.ReadOnlyStateMachine) ResourceDescriptionBuilder(org.jboss.hal.core.mbui.ResourceDescriptionBuilder) AddOnlyStateMachine(org.jboss.hal.ballroom.form.AddOnlyStateMachine) ResourceDescriptionBuilder(org.jboss.hal.core.mbui.ResourceDescriptionBuilder) Test(org.junit.Test)

Example 4 with StateMachine

use of org.jboss.hal.ballroom.form.StateMachine 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);
}
Also used : ReadOnlyStateMachine(org.jboss.hal.ballroom.form.ReadOnlyStateMachine) ExistingStateMachine(org.jboss.hal.ballroom.form.ExistingStateMachine) AddOnlyStateMachine(org.jboss.hal.ballroom.form.AddOnlyStateMachine) StateMachine(org.jboss.hal.ballroom.form.StateMachine) ReadOnlyStateMachine(org.jboss.hal.ballroom.form.ReadOnlyStateMachine) ResourceDescriptionBuilder(org.jboss.hal.core.mbui.ResourceDescriptionBuilder) ResourceDescriptionBuilder(org.jboss.hal.core.mbui.ResourceDescriptionBuilder) Test(org.junit.Test)

Aggregations

AddOnlyStateMachine (org.jboss.hal.ballroom.form.AddOnlyStateMachine)4 ExistingStateMachine (org.jboss.hal.ballroom.form.ExistingStateMachine)4 ReadOnlyStateMachine (org.jboss.hal.ballroom.form.ReadOnlyStateMachine)4 StateMachine (org.jboss.hal.ballroom.form.StateMachine)4 ResourceDescriptionBuilder (org.jboss.hal.core.mbui.ResourceDescriptionBuilder)4 Test (org.junit.Test)4