Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add xlsDataSetLoader #148

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yangjianzhou
Copy link

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

Copy link

@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?

@@ -7,3 +7,9 @@ bin
.DS_Store
.idea
*.iml
*.ipr
*.iws
*/*.iml

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

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

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

@@ -18,7 +18,7 @@
import com.github.springtestdbunit.sample.entity.Person;

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

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());
}

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 {

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.

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"})

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

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