| package org.eclipse.nebula.widgets.nattable.core.layer.axis.impl.reorder |
| |
| import org.eclipse.nebula.widgets.nattable.core.layer.axis.Axis |
| import org.eclipse.nebula.widgets.nattable.core.layer.axis.impl.SimpleAxis |
| import org.junit.Before |
| import org.junit.Test |
| |
| import static org.eclipse.nebula.widgets.nattable.core.layer.AxisTest.* |
| |
| class ReorderSegmentAxisTest { |
| |
| Axis underlyingAxis |
| ReorderSegmentAxis reorderSegmentAxis |
| |
| @Before |
| def void before() { |
| underlyingAxis = new SimpleAxis(4, 100) |
| reorderSegmentAxis = new ReorderSegmentAxis(underlyingAxis) |
| } |
| |
| @Test |
| def void baseline() { |
| testAxis( |
| "underlyingAxis", |
| underlyingAxis, |
| #[ 0, 1, 2, 3 ], |
| #[ 0, 100, 200, 300, 400 ] |
| ) |
| |
| testAxis( |
| "reorderSegmentAxis", |
| reorderSegmentAxis, |
| #[ 0, 1, 2, 3 ], |
| #[ 0, 100, 200, 300, 400 ] |
| ) |
| } |
| |
| @Test |
| def void reorder() { |
| reorderSegmentAxis.moveSegment(0, 2) |
| |
| testAxis( |
| "reorderSegmentAxis", |
| reorderSegmentAxis, |
| #[ 1, 2, 0, 3 ], |
| #[ 0, 100, 200, 300, 400 ] |
| ) |
| } |
| |
| } |