-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
ui/tests/src/test/java/org/jboss/forge/addon/ui/input/InputComponentsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright 2015 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Eclipse Public License version 1.0, available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
|
||
package org.jboss.forge.addon.ui.input; | ||
|
||
import java.util.Arrays; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.jboss.arquillian.junit.Arquillian; | ||
import org.jboss.forge.addon.convert.ConverterFactory; | ||
import org.jboss.forge.addon.ui.util.InputComponents; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* | ||
* @author <a href="mailto:ggastald@redhat.com">George Gastaldi</a> | ||
*/ | ||
@RunWith(Arquillian.class) | ||
public class InputComponentsTest | ||
{ | ||
@Inject | ||
private UISelectOne<String> values; | ||
|
||
@Inject | ||
private ConverterFactory converterFactory; | ||
|
||
@Test | ||
public void testUISelectOneShouldNotSetValueNotContainedInValueChoices() | ||
{ | ||
values.setValueChoices(Arrays.asList("A", "B", "C")); | ||
InputComponents.setValueFor(converterFactory, values, "D"); | ||
Assert.assertNull(values.getValue()); | ||
} | ||
} |