/**
* Tests {@link TensorValues#parameter(String)}.
*/
@Test
public void testParameter() {
final ParameterValueGroup group = create();
assertValueEquals("num_row", 3, group.parameter("num_row"));
assertValueEquals("num_col", 3, group.parameter("num_col"));
assertValueEquals("elt_0_0", 1.0, group.parameter("elt_0_0"));
assertValueEquals("elt_2_2", 1.0, group.parameter("elt_2_2"));
group.parameter("elt_2_2").setValue(8);
group.parameter("elt_0_1").setValue(6);
assertValueEquals("elt_2_2", 8.0, group.parameter("elt_2_2"));
assertValueEquals("elt_0_1", 6.0, group.parameter("elt_0_1"));
/*
* If we reduce the matrix size, than it shall not be possible
* anymore to get the descriptor in the row that we removed.
*/
group.parameter("num_col").setValue(2);
try {
group.parameter("elt_2_2");
fail("elt_2_2 should not exist.");
} catch (ParameterNotFoundException e) {
final String message = e.getMessage();
assertTrue(message, message.contains("elt_2_2"));
assertTrue(message, message.contains(GROUP_NAME));