NEMOparser implements NEMOparserConstants { static final public String abstractFlow(UpdateTemplateDefinitionLang definition) throws ParseException { Token objFlowNameToken = null; Token objFlowMatchItem = null; Token objFlowMatchItem1 = null; Token objPropertyNameToken = null; Token objPropertyNameToken1 = null; LinkedHashMap<String,LinkedHashMap<String,String>> matchItems = new LinkedHashMap<String,LinkedHashMap<String,String>>(); LinkedHashMap<String,LinkedHashMap<String,String>> properties = new LinkedHashMap<String,LinkedHashMap<String,String>>(); objFlowNameToken = jj_consume_token(ID); jj_consume_token(MATCH); objFlowMatchItem = jj_consume_token(ID); jj_consume_token(COLON); LinkedHashMap<String,String> match = property(); matchItems.put(objFlowMatchItem.image, match); label_15: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: jj_la1[40] = jj_gen; break label_15; } jj_consume_token(COMMA); objFlowMatchItem1 = jj_consume_token(ID); jj_consume_token(COLON); LinkedHashMap<String,String> match1 = property(); matchItems.put(objFlowMatchItem1.image, match1); } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PROPERTY: jj_consume_token(PROPERTY); objPropertyNameToken = jj_consume_token(ID); jj_consume_token(COLON); LinkedHashMap<String,String> property = property(); properties.put(objPropertyNameToken.image, property); label_16: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: jj_la1[41] = jj_gen; break label_16; } jj_consume_token(COMMA); objPropertyNameToken1 = jj_consume_token(ID); jj_consume_token(COLON); LinkedHashMap<String,String> property1 = property(); properties.put(objPropertyNameToken1.image, property1); } break; default: jj_la1[42] = jj_gen; ; } jj_consume_token(SEMICOLON); {if (true) return definition.createAbstractFlow(objFlowNameToken.image, matchItems, properties);}; throw new Error("Missing return statement in function"); } NEMOparser(java.io.InputStream stream);  NEMOparser(java.io.InputStream stream, String encoding);  NEMOparser(java.io.Reader stream);  NEMOparser(NEMOparserTokenManager tm); String parseNEMO(UserId userId,String strNEMO, DataBroker dataBroker, TenantManage tenantManage); static final String NEMO(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String UpdateIntent(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String DeleteIntent(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String UpdateNode(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String UpdateConnection(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String UpdateFlow(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String UpdateOperation(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String NodeModel(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String abstractNode(UpdateTemplateDefinitionLang definition); static final String abstractConnection(UpdateTemplateDefinitionLang definition); static final String abstractFlow(UpdateTemplateDefinitionLang definition); static final String abstractOperation(UpdateTemplateDefinitionLang definition); static final String DeleteNode(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String DeleteConnection(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String DeleteFlow(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String DeleteOperation(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String Query(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final LinkedHashMap<String,String> conditionTarget(); static final LinkedHashMap<String,String> property(); static final LinkedHashMap<String,String> nodeMultiProperty(); static void ReInit(java.io.InputStream stream); static void ReInit(java.io.InputStream stream, String encoding); static void ReInit(java.io.Reader stream); void ReInit(NEMOparserTokenManager tm); static final Token getNextToken(); static final Token getToken(int index); static ParseException generateParseException(); static final void enable_tracing(); static final void disable_tracing(); static public NEMOparserTokenManager token_source; static public Token token; static public Token jj_nt; }
@Test public void testAbstractFlow() throws Exception { UpdateTemplateDefinitionLang definition = mock(UpdateTemplateDefinitionLang.class); Field field_jj_ntk = class1.getDeclaredField("jj_ntk"); field_jj_ntk.setAccessible(true); Field field_token = class1.getDeclaredField("token"); field_token.setAccessible(true); Token token = new Token(); Token token_ID = new Token(); token_ID.kind = NEMOparserConstants.ID; token_ID.image = "test"; Token token_MATCH = new Token(); token_MATCH.kind = NEMOparserConstants.MATCH; Token token_ID1 = new Token(); token_ID1.kind = NEMOparserConstants.ID; Token token_COLON = new Token(); token_COLON.kind = NEMOparserConstants.COLON; Token token_PROPERTY = new Token(); token_PROPERTY.kind = NEMOparserConstants.PROPERTY; Token token_ID2 = new Token(); token_ID2.kind = NEMOparserConstants.ID; Token token_COLON1 = new Token(); token_COLON1.kind = NEMOparserConstants.COLON; Token token_SEMICOLON = new Token(); token_SEMICOLON.kind = NEMOparserConstants.SEMICOLON; token.next = token_ID; token_ID.next = token_MATCH; token_MATCH.next = token_ID1; token_ID1.next = token_COLON; token_COLON.next = token_PROPERTY; token_PROPERTY.next = token_ID2; token_ID2.next = token_COLON1; token_COLON1.next = token_SEMICOLON; field_jj_ntk.set(class1, NEMOparserConstants.PROPERTY); field_token.set(class1, token); PowerMockito.mockStatic(NEMOparser.class); PowerMockito.when(NEMOparser.property()).thenReturn(new LinkedHashMap<String, String>()); when(definition.createAbstractFlow(any(String.class), any(LinkedHashMap.class), any(LinkedHashMap.class))).thenReturn("test"); Assert.assertTrue(NEMOparser.abstractFlow(definition) == null); }