Null pointer exception

29 views
Skip to first unread message

Sreekanth .Reddy

unread,
Jun 18, 2014, 6:21:55 AM6/18/14
to subs...@googlegroups.com
Hi,

     I was trying to use substep implementation 
      so I added this dependency
                  <dependency>
<groupId>com.technophobia.substeps</groupId>
<artifactId>substeps-bom</artifactId>
<version>1.1.0</version>
<type>pom</type>
</dependency>
Then I've created a feature file Xcreation.feature int he feature folder

 Feature: Create Special Group Markets
    As a Football Product Owner
    I want to create Group markets for Football Daily markets of different classes
    In order to profit from offering customers additional daily markets

    Scenario: Create Football Matches from different event classes and add them to the same group
        Given system under test is 'SYS'
        Given system under test is 'PP3'

and a substep Xcreation.substeps file in the substep folder
Define: Given system under test is 'SYS'
        load "SYS" 

Define: Given system under test is 'PP3'         
        load "PP3"    

The below is my runner class
@SubStepsConfiguration(featureFile = "./target/test-classes/features/XCreation.feature", 
                       subStepsFile = "./target/test-classes/substep/XCreation.substeps",
      stepImplementations = {CreateFdmSubSteps.class})
@RunWith(JunitFeatureRunner.class)
public class XCreationTestRunner {

}

The below one is the substep class
@StepImplementations
public class CreateFdmSubSteps {

@Step("load \"(.*?)\"")
public void systemUnderTestIs(String environment) throws Throwable {
   System.out.println(String.format("Given system under test %s",environment));
this.sutEnvironment = environment;
   Assert.assertNull(this.enqueueMessage);
   this.enqueueMessage = EnqueueMessage.factory();
   this.enqueueMessage.setBroker(this.properties.getProperty(this.sutEnvironment +".brokerUrl"));
   this.enqueueMessage.setQueue(this.properties.getProperty(this.sutEnvironment +".queueName"));
   Assert.assertNotNull(this.enqueueMessage);
}




For some reason I'm getting initialization error


com.technophobia.substeps.model.exception.SubstepsConfigurationException: com.technophobia.substeps.model.exception.UnimplementedStepException: Given system under test is 'SYS' is not a recognised step or substep implementation
at com.technophobia.substeps.runner.builder.ScenarioNodeBuilder.buildRunnableScenarioNode(ScenarioNodeBuilder.java:95)
at com.technophobia.substeps.runner.builder.ScenarioNodeBuilder.build(ScenarioNodeBuilder.java:60)
at com.technophobia.substeps.runner.builder.FeatureNodeBuilder.buildRunnableFeatureNode(FeatureNodeBuilder.java:74)
at com.technophobia.substeps.runner.builder.FeatureNodeBuilder.build(FeatureNodeBuilder.java:55)
at com.technophobia.substeps.runner.builder.ExecutionNodeTreeBuilder.buildExecutionNodeTree(ExecutionNodeTreeBuilder.java:49)
at com.technophobia.substeps.runner.ExecutionNodeRunner.prepareExecutionConfig(ExecutionNodeRunner.java:103)
at com.technophobia.substeps.runner.JunitFeatureRunner.init(JunitFeatureRunner.java:164)
at com.technophobia.substeps.runner.JunitFeatureRunner.<init>(JunitFeatureRunner.java:107)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:29)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:21)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: com.technophobia.substeps.model.exception.UnimplementedStepException: Given system under test is 'SYS' is not a recognised step or substep implementation
at com.technophobia.substeps.model.Syntax.getStrictStepimplementation(Syntax.java:228)
at com.technophobia.substeps.model.Syntax.getStepImplementationsInternal(Syntax.java:186)
at com.technophobia.substeps.model.Syntax.getStepImplementations(Syntax.java:172)
at com.technophobia.substeps.runner.builder.SubstepNodeBuilder.pickImplToExecute(SubstepNodeBuilder.java:256)
at com.technophobia.substeps.runner.builder.SubstepNodeBuilder.buildStepImplementationNode(SubstepNodeBuilder.java:211)
at com.technophobia.substeps.runner.builder.SubstepNodeBuilder.buildStepNode(SubstepNodeBuilder.java:104)
at com.technophobia.substeps.runner.builder.ScenarioNodeBuilder.buildBasicScenarioNode(ScenarioNodeBuilder.java:145)
at com.technophobia.substeps.runner.builder.ScenarioNodeBuilder.buildRunnableScenarioNode(ScenarioNodeBuilder.java:80)
... 25 more


Help Please

Ian Moore

unread,
Jun 23, 2014, 5:10:56 AM6/23/14
to subs...@googlegroups.com
Hi,

I think if you're running on an OS with case sensitive filenames then you have a typo: Xcreation.feature and XCreation.feature, post back though if you still have a problem.

cheers
Ian

Sreekanth .Reddy

unread,
Jun 23, 2014, 9:56:02 AM6/23/14
to subs...@googlegroups.com
Hi Ian,
                I guess that was something to do with the version, because when the changed the sub-step version from 1.1.0 to 1.1.2 , it started working without any issue.

Thanks
Sreekanth
Reply all
Reply to author
Forward
0 new messages