// Path: src/main/java/com/ksa/myanmarlottery/model/Result.java
// @Entity
// @NamedQueries({
//     @NamedQuery(
//         name = "result.findLatestResult",
//         query = "from Result r where r.resultFor in (select max(rr.resultFor) from Result rr where rr.type = :type)"
//     ),
//     @NamedQuery(
//         name = "result.findLatestResultSummary",
//         query = "Select r.numberOfTimes as numberOfTimes, r.resultFor as resultFor, r.type as type from Result r where r.type = :type"
//     ),
//     @NamedQuery(
//         name = "result.findByType",
//         query = "from Result r where r.type = :type"
//     )
// })
// @Table(name = "Lottery_result")
// public class Result implements Serializable {
//     
//     @Id
//     @Column(name = "RESULT_TYPE")
//     private int type = ConstantUtil.OLD_LOTTERY_TYPE;;
//     
//     private int numberOfTimes;
//     
//     @Temporal(TemporalType.DATE)
//     private Date createdDate = new Date();
//     
//     @Temporal(TemporalType.DATE)
//     private Date resultFor = new Date();
//     
//     private String dataProvider;
//     
//     private String companyName;
// 
//     @OneToMany(mappedBy = "result",fetch = FetchType.EAGER)
//     @Cascade(CascadeType.ALL)
//     private List<Prize> prizes = new ArrayList<Prize>();
//     
//     public Result() {
//     }
// 
//     public Result(int type, int numberOfTimes, Date createdDate, Date resultFor) {
//         this.type = type;
//         this.numberOfTimes = numberOfTimes;
//         this.resultFor = resultFor;
//     }
//     
//     public Result(int numberOfTimes, Date resultFor, int type) {
//         this.numberOfTimes = numberOfTimes;
//         this.resultFor = resultFor;
//         this.type = type;
//     }
//     
//     public int getNumberOfTimes() {
//         return numberOfTimes;
//     }
// 
//     public void setNumberOfTimes(int numberOfTimes) {
//         this.numberOfTimes = numberOfTimes;
//     }
// 
//     public Date getCreatedDate() {
//         return createdDate;
//     }
// 
//     public void setCreatedDate(Date createdDate) {
//         this.createdDate = createdDate;
//     }
// 
//     public Date getResultFor() {
//         return resultFor;
//     }
// 
//     public void setResultFor(Date resultFor) {
//         this.resultFor = resultFor;
//     }
// 
//     public List<Prize> getPrizes() {
//         return prizes;
//     }
// 
//     public void setPrizes(List<Prize> prizes) {
//         this.prizes = prizes;
//     }
// 
//     public int getType() {
//         return type;
//     }
// 
//     public void setType(int type) {
//         this.type = type;
//     }
// 
//     public String getDataProvider() {
//         return dataProvider;
//     }
// 
//     public void setDataProvider(String dataProvider) {
//         this.dataProvider = dataProvider;
//     }
// 
//     public String getCompanyName() {
//         return companyName;
//     }
// 
//     public void setCompanyName(String companyName) {
//         this.companyName = companyName;
//     }
// 
//     @Override
//     public String toString() {
//         return "Result{" +"numberOfTimes=" + numberOfTimes + ", createdDate=" + createdDate + ", type=" + type + ", resultFor=" + resultFor + ", prizes=" + prizes + '}';
//     }
// }
// 
// Path: src/main/java/com/ksa/myanmarlottery/service/parser/FileParser.java
// public interface FileParser {
//     List<Result> getResult(InputStream in) throws FileNotFoundException, IOException, ParseException;
// }


import com.google.common.io.Files;
import com.ksa.myanmarlottery.model.Result;
import com.ksa.myanmarlottery.service.parser.FileParser;
import java.io.File;
import java.io.FileInputStream;
import java.util.List;
import org.junit.Assert;
import static org.junit.Assert.assertEquals;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ksa.myanmarlottery.parser;


/**
 *
 * @author Admin
 */
//@Ignore
@RunWith(SpringRunner.class)
@SpringBootTest
public class TestExcelPraser {
    
    private static final String FILE_NAME = "D:\\Myanma Lottery\\project\\MyanmarLotteryV1.4\\Copy of Lottery_result (1).xlsx";

    @Autowired
// Path: src/main/java/com/ksa/myanmarlottery/model/Result.java
// @Entity
// @NamedQueries({
//     @NamedQuery(
//         name = "result.findLatestResult",
//         query = "from Result r where r.resultFor in (select max(rr.resultFor) from Result rr where rr.type = :type)"
//     ),
//     @NamedQuery(
//         name = "result.findLatestResultSummary",
//         query = "Select r.numberOfTimes as numberOfTimes, r.resultFor as resultFor, r.type as type from Result r where r.type = :type"
//     ),
//     @NamedQuery(
//         name = "result.findByType",
//         query = "from Result r where r.type = :type"
//     )
// })
// @Table(name = "Lottery_result")
// public class Result implements Serializable {
//     
//     @Id
//     @Column(name = "RESULT_TYPE")
//     private int type = ConstantUtil.OLD_LOTTERY_TYPE;;
//     
//     private int numberOfTimes;
//     
//     @Temporal(TemporalType.DATE)
//     private Date createdDate = new Date();
//     
//     @Temporal(TemporalType.DATE)
//     private Date resultFor = new Date();
//     
//     private String dataProvider;
//     
//     private String companyName;
// 
//     @OneToMany(mappedBy = "result",fetch = FetchType.EAGER)
//     @Cascade(CascadeType.ALL)
//     private List<Prize> prizes = new ArrayList<Prize>();
//     
//     public Result() {
//     }
// 
//     public Result(int type, int numberOfTimes, Date createdDate, Date resultFor) {
//         this.type = type;
//         this.numberOfTimes = numberOfTimes;
//         this.resultFor = resultFor;
//     }
//     
//     public Result(int numberOfTimes, Date resultFor, int type) {
//         this.numberOfTimes = numberOfTimes;
//         this.resultFor = resultFor;
//         this.type = type;
//     }
//     
//     public int getNumberOfTimes() {
//         return numberOfTimes;
//     }
// 
//     public void setNumberOfTimes(int numberOfTimes) {
//         this.numberOfTimes = numberOfTimes;
//     }
// 
//     public Date getCreatedDate() {
//         return createdDate;
//     }
// 
//     public void setCreatedDate(Date createdDate) {
//         this.createdDate = createdDate;
//     }
// 
//     public Date getResultFor() {
//         return resultFor;
//     }
// 
//     public void setResultFor(Date resultFor) {
//         this.resultFor = resultFor;
//     }
// 
//     public List<Prize> getPrizes() {
//         return prizes;
//     }
// 
//     public void setPrizes(List<Prize> prizes) {
//         this.prizes = prizes;
//     }
// 
//     public int getType() {
//         return type;
//     }
// 
//     public void setType(int type) {
//         this.type = type;
//     }
// 
//     public String getDataProvider() {
//         return dataProvider;
//     }
// 
//     public void setDataProvider(String dataProvider) {
//         this.dataProvider = dataProvider;
//     }
// 
//     public String getCompanyName() {
//         return companyName;
//     }
// 
//     public void setCompanyName(String companyName) {
//         this.companyName = companyName;
//     }
// 
//     @Override
//     public String toString() {
//         return "Result{" +"numberOfTimes=" + numberOfTimes + ", createdDate=" + createdDate + ", type=" + type + ", resultFor=" + resultFor + ", prizes=" + prizes + '}';
//     }
// }
// 
// Path: src/main/java/com/ksa/myanmarlottery/service/parser/FileParser.java
// public interface FileParser {
//     List<Result> getResult(InputStream in) throws FileNotFoundException, IOException, ParseException;
// }


// Path: src/test/java/com/ksa/myanmarlottery/parser/TestExcelPraser.java
import com.google.common.io.Files;
import com.ksa.myanmarlottery.model.Result;
import com.ksa.myanmarlottery.service.parser.FileParser;
import java.io.File;
import java.io.FileInputStream;
import java.util.List;
import org.junit.Assert;
import static org.junit.Assert.assertEquals;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ksa.myanmarlottery.parser;


/**
 *
 * @author Admin
 */
//@Ignore
@RunWith(SpringRunner.class)
@SpringBootTest
public class TestExcelPraser {
    
    private static final String FILE_NAME = "D:\\Myanma Lottery\\project\\MyanmarLotteryV1.4\\Copy of Lottery_result (1).xlsx";

    @Autowired
    private FileParser excelFileParser;