Search in sources :

Example 1 with ElecCompService

use of com.cas.sim.tis.services.ElecCompService in project TeachingInSimulation by ScOrPiOzzy.

the class RMITest method testGetObject.

@Test
public void testGetObject() throws Exception {
    UserService userService = (UserService) userServiceFactory.getObject();
    Assert.assertNotNull(userService);
    userService.findAll().forEach(System.out::println);
    ResourceService resourceService = (ResourceService) resourceServiceFactory.getObject();
    Assert.assertNotNull(resourceService);
    resourceService.findAll().forEach(System.out::println);
    ElecCompService elecCompService = (ElecCompService) elecCompServiceFactory.getObject();
    Assert.assertNotNull(elecCompService);
    elecCompService.findAll().forEach(System.out::println);
}
Also used : UserService(com.cas.sim.tis.services.UserService) ResourceService(com.cas.sim.tis.services.ResourceService) ElecCompService(com.cas.sim.tis.services.ElecCompService) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test)

Example 2 with ElecCompService

use of com.cas.sim.tis.services.ElecCompService in project TeachingInSimulation by ScOrPiOzzy.

the class CircuitTest method testParseCfg.

@Test
public void testParseCfg() throws Exception {
    ElecCompService service = (ElecCompService) elecCompServiceFactory.getObject();
    // ID:10\11
    // ElecComp elecComp = service.findById(10);
    ElecComp elecComp = service.findBy("model", "CJX2-12");
    String cfgPath = util.getFullPath(elecComp.getCfgPath());
    URL url = new URL(cfgPath);
    ElecCompDef elecCompDef = JaxbUtil.converyToJavaBean(url, ElecCompDef.class);
    System.out.println(elecCompDef);
    System.out.println(JaxbUtil.convertToXml(elecCompDef));
}
Also used : ElecCompDef(com.cas.circuit.vo.ElecCompDef) ElecComp(com.cas.sim.tis.entity.ElecComp) ElecCompService(com.cas.sim.tis.services.ElecCompService) URL(java.net.URL) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

ElecCompService (com.cas.sim.tis.services.ElecCompService)2 Test (org.junit.Test)2 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2 ElecCompDef (com.cas.circuit.vo.ElecCompDef)1 ElecComp (com.cas.sim.tis.entity.ElecComp)1 ResourceService (com.cas.sim.tis.services.ResourceService)1 UserService (com.cas.sim.tis.services.UserService)1 URL (java.net.URL)1