Skip to content

add xlsDataSetLoader#148

Open
yangjianzhou wants to merge 2 commits intospringtestdbunit:masterfrom
yangjianzhou:master
Open

add xlsDataSetLoader#148
yangjianzhou wants to merge 2 commits intospringtestdbunit:masterfrom
yangjianzhou:master

Conversation

@yangjianzhou
Copy link
Copy Markdown

1 . update .gitignore and ignore .iml . ipr and so on
2 . add xlsDataSetLoader and test it where XlsDataSetLoaderTest

Copy link
Copy Markdown

@ppodgorsek ppodgorsek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the inline comments, was there a reason to rename the context file?

*.iml
*.ipr
*.iws
*/*.iml
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already covered by *.iml

Suggested change
*/*.iml

*.ipr
*.iws
*/*.iml
*/*.iws
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already covered by *.iws

Suggested change
*/*.iws

*.iws
*/*.iml
*/*.iws
*/*.ipr
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already covered by *.ipr

Suggested change
*/*.ipr


@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@ContextConfiguration({"classpath:com/github/springtestdbunit/sample/service/applicationContext.xml"})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the existing configuration need to be changed?

Suggested change
@ContextConfiguration({"classpath:com/github/springtestdbunit/sample/service/applicationContext.xml"})
@ContextConfiguration

assertEquals(1, personList.size());
assertEquals("wu", personList.get(0).getLastName());
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also test testRemove() to be consistent with the above test class.

public class XlsDataSetLoader extends AbstractDataSetLoader {

@Override
protected IDataSet createDataSet(Resource resource) throws Exception {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
protected IDataSet createDataSet(Resource resource) throws Exception {
protected IDataSet createDataSet(final Resource resource) throws Exception {

import java.io.InputStream;

/**
* Created by yangjianzhou on 17-11-18.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Created by yangjianzhou on 17-11-18.
* {@link com.github.springtestdbunit.dataset.DataSetLoader DataSetLoader} for Excel (.xls) files.
*
* Created by yangjianzhou on 17-11-18.

import static org.junit.Assert.assertEquals;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath:com/github/springtestdbunit/sample/service/applicationContext.xml"})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@ContextConfiguration({"classpath:com/github/springtestdbunit/sample/service/applicationContext.xml"})
@ContextConfiguration

@ppodgorsek
Copy link
Copy Markdown

XLS support added in a maintained repository: https://github.com/ppodgorsek/spring-test-dbunit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants