// @Test public void testAddServiceRouteConfig() throws Exception { Integer num = new Integer("-100000"); // 回参。 /* * 构造入参 */ JSONObject routeConfigInfo = new JSONObject(); String routeConfig = "{serviceId:'53',synAsyn:'Y',state:'Y',createStaff:'12345'," + "fromEndpoint:{endpointSpecId:'2',serviceId:'51',inDataTypeId:'1',outDateTypeId:'1'," + "endpointName:'lilin',endpointDesc:'lilin',state:'Y',enableInLog:'Y',enableOutLog:'Y'," + "endpointAttr:[{endpointSpecAttrId:'1001',attrValue:'test'}," + "{endpointSpecAttrId:'5',attrValue:'test1'}]}," + "toEndpoint:{endpointSpecId:'2',serviceId:'51',inDataTypeId:'1',outDateTypeId:'1'," + "endpointName:'lilin1',endpointDesc:'lilin1',state:'Y',enableInLog:'Y',enableOutLog:'Y'," + "endpointAttr:[{endpointSpecAttrId:'1001',attrValue:'test'}," + "{endpointSpecAttrId:'5',attrValue:'test1'}]}," + "routePolicy:{ruleStrategyId:'1',condEvaluatorId:'1',routeCondExpr:'fdsfsdf'," + "conditionFactors:[{condFactorCont:'fsdfsd',condFactorName:'testf',state:'Y'}]}}"; routeConfigInfo = JSONObject.fromObject(routeConfig); /* * 执行测试。 */ ServiceSMO smo = getSMO("serviceSMO"); num = smo.addServiceRouteConfig(routeConfigInfo); System.out.println(num); }
// @Test public void testFastRegisterAndPublishService() throws Exception { Integer num = new Integer("-100000"); // 回参。 /* * 构造入参 */ String routeConfig = "{serviceId:'53',synAsyn:'Y',state:'Y',createStaff:'12345'," + "fromEndpoint:{endpointSpecId:'2',serviceId:'51',inDataTypeId:'1',outDateTypeId:'1'," + "endpointName:'lilin',endpointDesc:'lilin',state:'Y',enableInLog:'Y',enableOutLog:'Y'," + "endpointAttr:[{endpointSpecAttrId:'1001',attrValue:'test'}," + "{endpointSpecAttrId:'5',attrValue:'test1'}]}," + "toEndpoint:{endpointSpecId:'2',serviceId:'51',inDataTypeId:'1',outDateTypeId:'1'," + "endpointName:'lilin1',endpointDesc:'lilin1',state:'Y',enableInLog:'Y',enableOutLog:'Y'," + "endpointAttr:[{endpointSpecAttrId:'1001',attrValue:'test'}," + "{endpointSpecAttrId:'5',attrValue:'test1'}]}," + "routePolicy:{ruleStrategyId:'1',condEvaluatorId:'1',routeCondExpr:'fdsfsdf'," + "conditionFactors:[{condFactorCont:'fsdfsd',condFactorName:'testf',state:'Y'}]}}"; String service = "{bizFunctionId:'4',serviceCnName:'registerService2',serviceEnName:'registerService2',serviceDesc:'registerService2',serviceCode:'registerService2',isPublished:'Y'}"; JSONObject serviceinfo = JSONObject.fromObject(service); JSONObject routeConfigInfo = JSONObject.fromObject(routeConfig); /* * 执行测试。 */ ServiceSMO smo = getSMO("serviceSMO"); num = smo.fastRegisterAndPublishService(serviceinfo, routeConfigInfo); System.out.println(num); }
// @Test public void testFindServcieByRunMode() throws Exception { Map<String, Service> map = null; ServiceSMO smo = getSMO("serviceSMO"); map = smo.findServcieByRunMode("lili"); System.out.println(); System.out.println(map); System.out.println(); }
// @Test public void testUpdateService() throws Exception { JSONObject serviceInfo = new JSONObject(); String service = "{serviceId:'53',bizFunctionId:'4',serviceCnName:'registerService111',serviceEnName:'registerService',serviceDesc:'registerService',serviceCode:'registerService',isPublished:'Y'}"; serviceInfo = JSONObject.fromObject(service); /* * 执行测试。 */ ServiceSMO smo = getSMO("serviceSMO"); smo.updateService(serviceInfo); }
// Test public void testRegisterService() throws Exception { Integer num = new Integer("-100000"); /* * 构造入参 */ JSONObject serviceInfo = new JSONObject(); String service = "{bizFunctionId:'4',serviceCnName:'registerService',serviceEnName:'registerService',serviceDesc:'registerService',serviceCode:'registerService',isPublished:'Y'}"; serviceInfo = JSONObject.fromObject(service); /* * 执行测试。 */ ServiceSMO smo = getSMO("serviceSMO"); num = smo.registerService(serviceInfo); System.out.println(num); }
@SuppressWarnings("unchecked") @Test public void testFindServcieByCondition() throws Exception { Map<String, Service> map = null; Map<String, String> condition = new HashMap<String, String>(); ServiceSMO smo = getSMO("serviceSMO"); // condition.put("name","政企客户资料同步"); // condition.put("serviceName", "vice"); // condition.put("state", "Y"); // condition.put("serviceCnName", "vice"); // condition.put("serviceEnName", "vice"); condition.put("serviceIdMinValue", "0"); condition.put("bizFunctionId", "1"); map = smo.findServcieByCondition(condition, 0, 4); Iterator it = map.entrySet().iterator(); System.out.println(); /* while (it.hasNext()) { Map.Entry<String, Service> entry = (Map.Entry<String, Service>) it.next(); Service service = entry.getValue(); System.out.println(entry.getKey() + " =========== " + service.getServiceId()+ " " + service.getBizFunctionName() + " " + service.getServiceCnName()); } System.out.println(); */ map = smo.findServcieByCondition(condition, null, null); it = map.entrySet().iterator(); System.out.println(); while (it.hasNext()) { Map.Entry<String, Service> entry = (Map.Entry<String, Service>) it.next(); Service service = entry.getValue(); System.out.println( entry.getKey() + " =========== " + service.getServiceId() + " " + service.getBizFunctionName() + " " + service.getServiceCnName()); } System.out.println(); }
// @Test public void testFastRegisterService() throws Exception { Integer num = new Integer("-100000"); /* * 构造入参 */ String service = "{bizFunctionId:'4',serviceCnName:'dfsadsafds',serviceEnName:'dfsadsafds',serviceDesc:'dfsadsafds',serviceCode:'dfsadsafds',isPublished:'Y',endpointSpecId:'101'}", intf = "{endpointSpecId:'2',endpointName:'testfff',inDataTypeId:'2',endpointAttr:[{endpointSpecAttrId:'1001',attrValue:'sfsdafsd'}]}"; JSONObject serviceInfo = JSONObject.fromObject(service); JSONObject intfInfo = JSONObject.fromObject(intf); /* * 执行测试。 */ ServiceSMO smo = getSMO("serviceSMO"); num = smo.fastRegisterService(serviceInfo, intfInfo); System.out.println(num); }
// @Test public void testFindServiceRouteConfigByServiceId() throws Exception { /* * 构造回参 */ List<ServiceRouteConfig> list = null; /* * 构造入参 */ Integer serviceId = new Integer("10001"); /* * 执行测试。 */ ServiceSMO smo = getSMO("serviceSMO"); list = smo.findServiceRouteConfigByServiceId(serviceId); for (ServiceRouteConfig scr : list) { System.out.println(scr.getRouteId()); } }
// @Test public void testUpdateServiceRouteConfig() throws Exception { /* * 构造入参 */ JSONObject routeConfigInfo = new JSONObject(); String routeConfig = "{routeId:'112',serviceId:'53',synAsyn:'Y',state:'N',createStaff:'12345'," + "fromEndpoint:{endpointId:'125',endpointSpecId:'2',serviceId:'51',inDataTypeId:'1',outDateTypeId:'1'," + "endpointName:'lilin',endpointDesc:'lilin',state:'Y',enableInLog:'Y',enableOutLog:'Y'," + "endpointAttr:[{endpointAttrValueId:'225',endpointSpecAttrId:'1001',attrValue:'test'}," + "{endpointAttrValueId:'226',endpointSpecAttrId:'5',attrValue:'test1'}]}," + "toEndpoint:{endpointId:'126',endpointSpecId:'2',serviceId:'51',inDataTypeId:'1',outDateTypeId:'1'," + "endpointName:'lilin1',endpointDesc:'lilin1',state:'Y',enableInLog:'Y',enableOutLog:'Y'," + "endpointAttr:[{endpointAttrValueId:'227',endpointSpecAttrId:'1001',attrValue:'test'}," + "{endpointAttrValueId:'228',endpointSpecAttrId:'5',attrValue:'test1'}]}," + "routePolicy:{routePolicyId:'212',ruleStrategyId:'1',condEvaluatorId:'1',routeCondExpr:'fdsfsdf'," + "conditionFactors:[{condFactorId:'411',condFactorCont:'fsdfsd',condFactorName:'testf',state:'Y'}]}}"; routeConfigInfo = JSONObject.fromObject(routeConfig); /* * 执行测试。 */ ServiceSMO smo = getSMO("serviceSMO"); smo.updateServiceRouteConfig(routeConfigInfo); }
// @Test public void testDeleteServiceRouteConfig() throws Exception { ServiceSMO smo = getSMO("serviceSMO"); smo.deleteServiceRouteConfig(new Integer("111")); }
// @Test public void testUnPublishService() throws Exception { ServiceSMO smo = getSMO("serviceSMO"); smo.unPublishService(new Integer("1")); }