当前位置: 首页>>代码示例>>Java>>正文


Java BusinessValueList类代码示例

本文整理汇总了Java中eu.atos.sla.datamodel.bean.BusinessValueList的典型用法代码示例。如果您正苦于以下问题:Java BusinessValueList类的具体用法?Java BusinessValueList怎么用?Java BusinessValueList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BusinessValueList类属于eu.atos.sla.datamodel.bean包,在下文中一共展示了BusinessValueList类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newGuaranteeTerm

import eu.atos.sla.datamodel.bean.BusinessValueList; //导入依赖的package包/类
public static IGuaranteeTerm newGuaranteeTerm(
		String kpiName, String constraint, List<IPenaltyDefinition> penalties) {
	
	GuaranteeTerm t = new GuaranteeTerm();
	t.setName(kpiName);
	t.setKpiName(kpiName);
	t.setServiceLevel(constraint);
	t.setPolicies(
		Arrays.<IPolicy>asList(new Policy(1, new Date(0)))
	);
	t.setViolations(new ArrayList<IViolation>());
	
	IBusinessValueList businessValueList = new BusinessValueList(0, penalties);
	t.setBusinessValueList(businessValueList);
	return t;
}
 
开发者ID:Atos-FiwareOps,项目名称:sla-framework,代码行数:17,代码来源:TestAgreementFactory.java

示例2: newGuaranteeTerm

import eu.atos.sla.datamodel.bean.BusinessValueList; //导入依赖的package包/类
public static IGuaranteeTerm newGuaranteeTerm(
        String kpiName, String constraint, List<IPenaltyDefinition> penalties) {
    
    GuaranteeTerm t = new GuaranteeTerm();
    t.setName(kpiName);
    t.setKpiName(kpiName);
    t.setServiceLevel(constraint);
    t.setPolicies(
        Arrays.<IPolicy>asList(new Policy(1, new Date(0)))
    );
    t.setViolations(new ArrayList<IViolation>());
    
    IBusinessValueList businessValueList = new BusinessValueList(0, penalties);
    t.setBusinessValueList(businessValueList);
    return t;
}
 
开发者ID:SeaCloudsEU,项目名称:SeaCloudsPlatform,代码行数:17,代码来源:TestAgreementFactory.java

示例3: save

import eu.atos.sla.datamodel.bean.BusinessValueList; //导入依赖的package包/类
@Test
	public void save() {

		String contractUUID = UUID.randomUUID().toString();

		Violation violation = new Violation();
		violation.setActualValue("value 1");
		violation.setContractUuid(contractUUID);
		violation.setDatetime(new Date(2323));
		violation.setExpectedValue("expected value 2");

		Breach breach = new Breach();
		breach.setKpiName("metric name");
		breach.setDatetime(new Date(12345));
		breach.setValue("6.0");
		breach.setAgreementUuid(contractUUID);

		String contractUUID2 = UUID.randomUUID().toString();

		IBreach breach2 = new Breach();
		breach2.setKpiName("metric name 2");
		breach2.setDatetime(new Date(12325));
		breach2.setValue("7.0");
		breach2.setAgreementUuid(contractUUID2);

		List<IBreach> breaches = new ArrayList<IBreach>();
		breaches.add(breach);
		breaches.add(breach2);

		IGuaranteeTerm guaranteeTerm = new GuaranteeTerm();
		guaranteeTerm.setName("name guarantee term");
//		guaranteeTerm.setBreaches(breaches);
		
		
		IPenaltyDefinition penalty = newPenalty(1, "%", "10");
		List<IPenaltyDefinition> compensations = Collections.singletonList(penalty);
		BusinessValueList bvl = new BusinessValueList(1, compensations);
		guaranteeTerm.setBusinessValueList(bvl);

		IGuaranteeTerm saved;
		saved = guaranteeTermDAO.save(guaranteeTerm);

		((GuaranteeTermDAOJpa)guaranteeTermDAO).getEntityManager().detach(guaranteeTerm);
		
		IGuaranteeTerm loaded = guaranteeTermDAO.getById(saved.getId());
		
		assertEquals(guaranteeTerm.getKpiName(), loaded.getKpiName());
		assertEquals(guaranteeTerm.getName(), loaded.getName());
		assertEquals(guaranteeTerm.getServiceLevel(), loaded.getServiceLevel());
		assertEquals(guaranteeTerm.getServiceName(), loaded.getServiceScope());
		assertEquals(guaranteeTerm.getServiceScope(), loaded.getServiceScope());
		
		assertEquals(guaranteeTerm.getBusinessValueList(), loaded.getBusinessValueList());

	}
 
开发者ID:Atos-FiwareOps,项目名称:sla-framework,代码行数:56,代码来源:GuaranteeTermDAOJpaTest.java

示例4: save

import eu.atos.sla.datamodel.bean.BusinessValueList; //导入依赖的package包/类
@Test
    public void save() {

        String contractUUID = UUID.randomUUID().toString();

        Violation violation = new Violation();
        violation.setActualValue("value 1");
        violation.setContractUuid(contractUUID);
        violation.setDatetime(new Date(2323));
        violation.setExpectedValue("expected value 2");

        Breach breach = new Breach();
        breach.setKpiName("metric name");
        breach.setDatetime(new Date(12345));
        breach.setValue("6.0");
        breach.setAgreementUuid(contractUUID);

        String contractUUID2 = UUID.randomUUID().toString();

        IBreach breach2 = new Breach();
        breach2.setKpiName("metric name 2");
        breach2.setDatetime(new Date(12325));
        breach2.setValue("7.0");
        breach2.setAgreementUuid(contractUUID2);

        List<IBreach> breaches = new ArrayList<IBreach>();
        breaches.add(breach);
        breaches.add(breach2);

        IGuaranteeTerm guaranteeTerm = new GuaranteeTerm();
        guaranteeTerm.setName("name guarantee term");
//        guaranteeTerm.setBreaches(breaches);
        
        
        IPenaltyDefinition penalty = newPenalty(1, "%", "10");
        List<IPenaltyDefinition> compensations = Collections.singletonList(penalty);
        BusinessValueList bvl = new BusinessValueList(1, compensations);
        guaranteeTerm.setBusinessValueList(bvl);

        IGuaranteeTerm saved;
        saved = guaranteeTermDAO.save(guaranteeTerm);

        ((GuaranteeTermDAOJpa)guaranteeTermDAO).getEntityManager().detach(guaranteeTerm);
        
        IGuaranteeTerm loaded = guaranteeTermDAO.getById(saved.getId());
        
        assertEquals(guaranteeTerm.getKpiName(), loaded.getKpiName());
        assertEquals(guaranteeTerm.getName(), loaded.getName());
        assertEquals(guaranteeTerm.getServiceLevel(), loaded.getServiceLevel());
        assertEquals(guaranteeTerm.getServiceName(), loaded.getServiceScope());
        assertEquals(guaranteeTerm.getServiceScope(), loaded.getServiceScope());
        
        assertEquals(guaranteeTerm.getBusinessValueList(), loaded.getBusinessValueList());

    }
 
开发者ID:SeaCloudsEU,项目名称:SeaCloudsPlatform,代码行数:56,代码来源:GuaranteeTermDAOJpaTest.java


注:本文中的eu.atos.sla.datamodel.bean.BusinessValueList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。