com.safedocs.testcase.TestFoo.java Source code

Java tutorial

Introduction

Here is the source code for com.safedocs.testcase.TestFoo.java

Source

package com.safedocs.testcase;

import com.safedocs.license.model.SafeDocsLicenseModel;
import com.safedocs.license.service.ISafeDocsLicenseService;
import junit.framework.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({ "classpath:application-context.xml" })
public class TestFoo {
    @Autowired
    @Qualifier(value = "safeDocsLicenseService")
    public ISafeDocsLicenseService<SafeDocsLicenseModel> licenseService;

    @Test
    public void testDAO() {
        System.out.println("ertet");

    }

    @Test
    public void testSafeDocsLicenseHibernate() {
        SafeDocsLicenseModel model = new SafeDocsLicenseModel();

        //      try {
        //         model.setUuid("sss3");
        //         model.setStatus(1);
        //         //model.setExpireperiod(1);
        //         licenseService.saveLicenseData(model);
        //            String uuid=model.getUuid();
        //         licenseService.updateLicenseData(model);
        //            Assert.assertEquals(uuid, licenseService.findLicenseData(model).getUuid());
        //
        //      } catch (Exception e) {
        //            Assert.fail();
        //         e.printStackTrace();
        //      }
        //      finally{
        //         //licenseService.delete(model);
        //
        //      }

    }

    @Test
    public void testFind() {

        SafeDocsLicenseModel model = new SafeDocsLicenseModel();
        try {
            model.setUuid("8608ef88-a797-4061-99fd-567becf32e2c");
            licenseService.findLicenseData(model);
            System.out.println(model);

        } catch (Exception e) {
            Assert.fail();
            e.printStackTrace();
        } finally {
            //licenseService.delete(model);

        }

    }

}