Package com.mysema.query.jpa.domain8

Source Code of com.mysema.query.jpa.domain8.DomainExporter8Test

package com.mysema.query.jpa.domain8;

import java.io.File;
import java.io.IOException;

import com.mysema.query.jpa.codegen.CompileUtils;
import com.mysema.query.jpa.codegen.HibernateDomainExporter;
import com.mysema.util.FileUtils;
import org.hibernate.cfg.Configuration;
import org.junit.Test;
import static org.junit.Assert.assertTrue;

public class DomainExporter8Test {

    @Test
    public void Execute() throws IOException {
        File gen = new File("target/" + getClass().getSimpleName());
        FileUtils.delete(gen);
        Configuration config = new Configuration();
        config.addFile(new File("src/test/resources/com/mysema/query/jpa/domain8/domain.hbm.xml"));
        HibernateDomainExporter exporter = new HibernateDomainExporter("Q", gen, config);
        exporter.execute();
       
        assertTrue(new File(gen, "com/mysema/query/jpa/domain8/QA.java").exists());
        assertTrue(new File(gen, "com/mysema/query/jpa/domain8/QB.java").exists());

        CompileUtils.compile(gen.getAbsolutePath());
    }
   
}
TOP

Related Classes of com.mysema.query.jpa.domain8.DomainExporter8Test

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.