Skip to content

Instantly share code, notes, and snippets.

@minisu
minisu / TableLogTest.feature
Last active December 17, 2015 17:09
Gherkin TableLogTest
Scenario: A new TableLog should not have any rows
Given an open project without any agents
And a Fixed Rate Generator is connected to a TableLog
Then the TableLog should not contain any rows
Scenario: A TableLog should get rows when getting input
Given an open project without any agents
And a Fixed Rate Generator is connected to a TableLog
When the test is run for 3 seconds
Then the TableLog should contain rows
@minisu
minisu / JavaGWT.java
Last active December 17, 2015 17:09
Java GWT
@Category( IntegrationTest.class )
public class TableLogTest extends FxIntegrationTest
{
@Override
TestState getStartingState()
{
return ProjectLoadedWithoutAgentsState.STATE;
}
@Test
@Category( IntegrationTest.class )
public class TableLogTest extends FxIntegrationTest
{
@Override
TestState getStartingState()
{
return ProjectLoadedWithoutAgentsState.STATE;
}
void given()
@Category( IntegrationTest.class )
public class TableLogTest extends FxIntegrationTest
{
@Override
TestState getStartingState()
{
return ProjectLoadedWithoutAgentsState.STATE;
}
@Test
@Category( IntegrationTest.class )
public class TableLogTest extends FxIntegrationTest
{
@Test
public void shouldHaveRows() throws Exception
{
// GIVEN
enterState( ProjectLoadedWithoutAgentsState.STATE );
fixedRateGenerator_connectedTo_tableLog();
Given an open project without any agents
And a Fixed Rate Generator is connected to a TableLog on the canvas
When the test is run for 3 seconds
Then the TableLog contains rows
Given an open project without any agents
And a Fixed Rate Generator is on the project canvas
And a TableLog is on the project canvas
And the Fixed Rate Generator and the TableLog are connected # How does Cucumber know which Generator and TableLog to connect?
When the test is run for 3 seconds
Then the TableLog contains rows
@Category( IntegrationTest.class )
public class TableLogTest extends FxIntegrationTest
{
@Test
public void shouldHaveRows() throws Exception
{
// GIVEN
enterState( ProjectLoadedWithoutAgentsState.STATE );
ComponentHandle fixedRate = robot.createComponent( FIXED_RATE_GENERATOR );
ComponentHandle tableLog = robot.createComponent( TABLE_LOG );
@Category( IntegrationTest.class )
public class TableLogTest extends FxIntegrationTest
{
@Test
public void shouldHaveRows() throws Exception
{
// GIVEN
enterState( ProjectLoadedWithoutAgentsState.STATE );
ComponentHandle fixedRate = robot.createComponent( FIXED_RATE_GENERATOR );
ComponentHandle tableLog = robot.createComponent( TABLE_LOG );
@Category( IntegrationTest.class )
public class TableLogTest extends FxIntegrationTest
{
@Test
public void shouldHaveRows() throws Exception
{
// GIVEN
enterState( ProjectLoadedWithoutAgentsState.STATE );
ComponentHandle fixedRate = robot.createComponent( FIXED_RATE_GENERATOR );
ComponentHandle tableLog = robot.createComponent( TABLE_LOG );