package com.beagle.informix.service.impl;

import com.beagle.informix.BaseApplication;
import com.beagle.informix.service.InformixService;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.io.ResourceLoader;
import org.springframework.stereotype.Service;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.sql.*;
import java.util.Properties;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = BaseApplication.class)
class InformixServiceTest {

    @Resource(name = "informixJdbcService")
    private InformixService informixJdbcService;

    @Resource(name = "informixJdbcProxyService")
    private InformixService informixJdbcProxyService;
    @Resource(name = "informixHibernateService")
    private InformixService informixHibernateService;
//    @Resource(name = "informixIbatisService")
//    private InformixService informixIbatisService;
    @Resource(name = "informixMybatisService")
    private InformixService informixMybatisService;
    @Test
     void testJdbcInfo() {
        try {
            informixJdbcService.doConnectJob();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    @Test
    void testJdbcProxyInfo() {
        try {
            informixJdbcProxyService.doConnectJob();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    @Test
    void testHibernateInfo() {
        try {
            informixHibernateService.doConnectJob();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Test
     void testMybatisInfo() {
        try {
            informixMybatisService.doConnectJob();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
