本文整理汇总了Java中junitx.framework.FileAssert.assertEquals方法的典型用法代码示例。如果您正苦于以下问题:Java FileAssert.assertEquals方法的具体用法?Java FileAssert.assertEquals怎么用?Java FileAssert.assertEquals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类junitx.framework.FileAssert
的用法示例。
在下文中一共展示了FileAssert.assertEquals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test
import junitx.framework.FileAssert; //导入方法依赖的package包/类
@Test
public void test() {
this.jdbc.execute(conn, "INSERT INTO " + schema + "." + table + " (INT1, STR1, DATE1, TIMESTAMP1) " +
"VALUES (1, 'val1', '2017-01-01', '2016-02-02 22:22:22.2')");
this.jdbc.execute(conn, "INSERT INTO " + schema + "." + table + " (INT1, STR1, DATE1, TIMESTAMP1) " +
"VALUES (2, null, '2017-02-02', null)");
this.jdbc.execute(conn, "INSERT INTO " + schema + "." + table + " (INT1, STR1, DATE1, TIMESTAMP1) " +
"VALUES (null, 'val\\3', null, '2016-03-03 22:22:22.2')");
AquaRevengArgs args = new AquaRevengArgs();
args.setDbTypeStr("H2");
args.setJdbcUrl(url);
args.setDriverClass(org.h2.Driver.class.getName());
args.setDbSchema(schema);
args.setTables(new String[] {table});
args.setUsername("sa");
args.setPassword("");
File outputPath = new File("./target/csvoutput");
args.setOutputPath(outputPath);
CsvStaticDataWriter.start(args, new File("./target/csvoutputwork"));
FileAssert.assertEquals(new File("./src/test/resources/CsvStaticDataWriter/TABLE1.expected.csv"), new File(outputPath, "staticdata/TABLE1.csv"));
}
示例2: testActivatePropertyFileExistsOverwriteDisabled
import junitx.framework.FileAssert; //导入方法依赖的package包/类
@Test
public void testActivatePropertyFileExistsOverwriteDisabled() throws IOException, URISyntaxException {
/* Prepare data. */
assertEquals(0, this.baseDir.list().length);
createTempFiles(SYNC_CONFIG_FN);
this.props.remove(InitialRegistrationImpl.PROP_SYNC_ONCE_TYPE);
this.props.put(InitialRegistrationImpl.PROP_OVERWRITE_CONFIG_FILES, true);
/* Invoke method. */
this.initialRegistration.activate(this.props);
/* Check its results. */
FileAssert.assertEquals(getResource("data3-config.properties"), this.generatedConfigFile);
FileAssert.assertEquals(getResource("data1-filter.xml"), this.generatedFilterFile);
verify(this.serviceSettings, times(1)).addSyncRoot(this.baseDir, 3000l);
}
示例3: testActivatePropertyFileExistsDirWithContentsOverwrite
import junitx.framework.FileAssert; //导入方法依赖的package包/类
@Test
public void testActivatePropertyFileExistsDirWithContentsOverwrite() throws IOException, URISyntaxException {
/* Prepare data. */
assertEquals(0, this.baseDir.list().length);
createTempFiles("README.md", SYNC_CONFIG_FN);
this.props.put(InitialRegistrationImpl.PROP_OVERWRITE_CONFIG_FILES, true);
this.props.put(InitialRegistrationImpl.PROP_SYNC_ONCE_EXPECTED_TIME, 3001l);
/* Invoke method. */
this.initialRegistration.activate(this.props);
/* Check its results. */
FileAssert.assertEquals(getResource("data2-config.properties"), this.generatedConfigFile);
FileAssert.assertEquals(getResource("data1-filter.xml"), this.generatedFilterFile);
verify(this.serviceSettings, times(1)).addSyncRoot(this.baseDir, 3001l);
}
示例4: assertDirectoriesEqual
import junitx.framework.FileAssert; //导入方法依赖的package包/类
/**
* Primitive DB comparison method
* We just compare file names, not the subdirecory structure also
* (so this would fail if multiple subdirectories had the same file name)
*/
public static void assertDirectoriesEqual(File expected, File actual) {
MutableList<File> expectedFiles = FastList.newList(FileUtils.listFiles(expected, new WildcardFileFilter("*"),
DIR_FILE_FILTER));
expectedFiles = expectedFiles.sortThisBy(toRelativePath(expected));
MutableList<File> actualFiles = FastList.newList(FileUtils.listFiles(actual, new WildcardFileFilter("*"),
DIR_FILE_FILTER));
actualFiles = actualFiles.sortThisBy(toRelativePath(actual));
assertEquals(
String.format("Directories did not have same # of files:\nExpected: %1$s\nbut was: %2$s",
expectedFiles.makeString("\n"), actualFiles.makeString("\n")),
expectedFiles.size(), actualFiles.size());
for (int i = 0; i < expectedFiles.size(); i++) {
File expectedFile = expectedFiles.get(i);
File actualFile = actualFiles.get(i);
String expectedFilePath = getRelativePath(expectedFile, expected);
String actualFilePath = getRelativePath(actualFile, actual);
System.out.println("Comparing" + expectedFilePath + " vs " + actualFilePath);
assertEquals("File " + i + " [" + expectedFile + " vs " + actualFile
+ " does not match paths relative from their roots", expectedFilePath, actualFilePath);
FileAssert.assertEquals("Mismatch on file " + expectedFile.getAbsolutePath(), expectedFile, actualFile);
}
}
示例5: testVeraChecksOnProject
import junitx.framework.FileAssert; //导入方法依赖的package包/类
@Test
public void testVeraChecksOnProject() throws Exception
{
final File testDir = new File( getClass().getResource( "/compute-pi-vera-test/compute-pi" ).getPath() );
final Verifier verifier = new Verifier( testDir.getAbsolutePath() );
addPropertiesToVerifier( verifier );
verifier.getSystemProperties().setProperty( MSBuildMojoITHelper.MSBUILD_PLUGIN_TOOLS_ENABLE, "true" );
verifier.setMavenDebug( true );
verifier.executeGoal( GROUPID + ":" + ARTIFACTID + ":" + VeraMojo.MOJO_NAME );
verifier.verifyErrorFreeLog();
FileAssert.assertEquals(
new File( testDir, "expected/vera-report-compute-pi-Win32-Debug.xml" ),
new File( testDir, "checkstyle-reports/vera-report-compute-pi-Win32-Debug.xml" ) );
FileAssert.assertEquals(
new File( testDir, "expected/vera-report-compute-pi-Win32-Release.xml" ),
new File( testDir, "checkstyle-reports/vera-report-compute-pi-Win32-Release.xml" ) );
}
示例6: solutionCheck
import junitx.framework.FileAssert; //导入方法依赖的package包/类
@Test
public void solutionCheck() throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(),
"/hello-world-cppcheck-test" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
addPropertiesToVerifier( verifier );
verifier.getSystemProperties().setProperty( MSBuildMojoITHelper.MSBUILD_PLUGIN_TOOLS_ENABLE, "true" );
verifier.executeGoal( GROUPID + ":" + ARTIFACTID + ":" + CppCheckMojo.MOJO_NAME );
verifier.verifyErrorFreeLog();
FileAssert.assertEquals(
new File( testDir, "expected\\cppcheck-report-hello-world-Win32-Debug.xml" ),
new File( testDir, "hello-world\\cppcheck-reports\\cppcheck-report-hello-world-Win32-Debug.xml" ) );
FileAssert.assertEquals(
new File( testDir, "expected\\cppcheck-report-hello-world-Win32-Release.xml" ),
new File( testDir, "hello-world\\cppcheck-reports\\cppcheck-report-hello-world-Win32-Release.xml" ) );
}
示例7: projectCheck
import junitx.framework.FileAssert; //导入方法依赖的package包/类
@Test
public void projectCheck() throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(),
"/hello-world-cppcheck-test/hello-world" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
addPropertiesToVerifier( verifier );
verifier.getSystemProperties().setProperty( MSBuildMojoITHelper.MSBUILD_PLUGIN_TOOLS_ENABLE, "true" );
verifier.executeGoal( GROUPID + ":" + ARTIFACTID + ":" + CppCheckMojo.MOJO_NAME );
verifier.verifyErrorFreeLog();
FileAssert.assertEquals(
new File( testDir, "expected\\cppcheck-report-hello-world-Win32-Debug.xml" ),
new File( testDir, "cppcheck-reports\\cppcheck-report-hello-world-Win32-Debug.xml" ) );
FileAssert.assertEquals(
new File( testDir, "expected\\cppcheck-report-hello-world-Win32-Release.xml" ),
new File( testDir, "cppcheck-reports\\cppcheck-report-hello-world-Win32-Release.xml" ) );
}
示例8: simpleConfig
import junitx.framework.FileAssert; //导入方法依赖的package包/类
/**
* Test simple configuration with no CppCheck or CxxTest
* @throws Exception if there is a problem setting up and running Maven
*/
@Test
public void simpleConfig() throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(),
"/sonar-config-test" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
addPropertiesToVerifier( verifier );
verifier.executeGoal( SONAR_GOAL );
verifier.verifyErrorFreeLog();
FileAssert.assertEquals(
new File( testDir, "expected\\sonar-simple-Win32-Debug.properties" ),
new File( testDir, "target\\sonar-configuration-Win32-Debug.properties" ) );
FileAssert.assertEquals(
new File( testDir, "expected\\sonar-simple-Win32-Release.properties" ),
new File( testDir, "target\\sonar-configuration-Win32-Release.properties" ) );
}
示例9: simpleConfigWithCppCheckCxxTest
import junitx.framework.FileAssert; //导入方法依赖的package包/类
/**
* Test config generation when CppCheck and CxxTest are availabe
* @throws Exception if there is a problem setting up and running Maven
*/
@Test
public void simpleConfigWithCppCheckCxxTest() throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(),
"/sonar-config-test" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
addPropertiesToVerifier( verifier );
verifier.getSystemProperties().setProperty( MSBuildMojoITHelper.MSBUILD_PLUGIN_TOOLS_ENABLE, "true" );
verifier.executeGoal( SONAR_GOAL );
verifier.verifyErrorFreeLog();
FileAssert.assertEquals(
new File( testDir, "expected\\sonar-simpleplus-Win32-Debug.properties" ),
new File( testDir, "target\\sonar-configuration-Win32-Debug.properties" ) );
FileAssert.assertEquals(
new File( testDir, "expected\\sonar-simpleplus-Win32-Release.properties" ),
new File( testDir, "target\\sonar-configuration-Win32-Release.properties" ) );
}
示例10: excludes
import junitx.framework.FileAssert; //导入方法依赖的package包/类
/**
* Test excludeProjectRegex setting
* @throws Exception if there is a problem setting up and running Maven
*/
@Test
public void excludes() throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(),
"/sonar-config-test" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
addPropertiesToVerifier( verifier );
verifier.addCliOption( "-f excludes-pom.xml" );
verifier.executeGoal( SONAR_GOAL );
verifier.verifyErrorFreeLog();
FileAssert.assertEquals(
new File( testDir, "expected\\sonar-excludes-Win32-Debug.properties" ),
new File( testDir, "target\\sonar-configuration-Win32-Debug.properties" ) );
FileAssert.assertEquals(
new File( testDir, "expected\\sonar-excludes-Win32-Release.properties" ),
new File( testDir, "target\\sonar-configuration-Win32-Release.properties" ) );
}
示例11: links
import junitx.framework.FileAssert; //导入方法依赖的package包/类
/**
* Test that configured links are written out
* @throws Exception if there is a problem setting up and running Maven
*/
@Test
public void links() throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(),
"/sonar-config-test" );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
addPropertiesToVerifier( verifier );
verifier.addCliOption( "-f links-pom.xml" );
verifier.executeGoal( SONAR_GOAL );
verifier.verifyErrorFreeLog();
FileAssert.assertEquals(
new File( testDir, "expected\\sonar-links-Win32-Release.properties" ),
new File( testDir, "target\\sonar-configuration-Win32-Release.properties" ) );
}
示例12: testGetProteinSequences
import junitx.framework.FileAssert; //导入方法依赖的package包/类
/**
* Test of getProteinSequences method, of class GeneFeatureHelper. Used gff3 file that was modified from the volvox
* gff version. Do not have the reference protein that is generated from each CDS record so subject to being
* incorrect without a validated test case. Could not find anyone providing a gff3 test case with expected protein
* output.
*/
public void testGetProteinSequences() throws Exception {
LinkedHashMap<String, ChromosomeSequence> chromosomeSequenceList = GeneFeatureHelper
.loadFastaAddGeneFeaturesFromGmodGFF3(new File("src/test/resources/volvox_all.fna"), new File(
"src/test/resources/volvox.gff3"), false);
LinkedHashMap<String, ProteinSequence> proteinSequenceList = GeneFeatureHelper
.getProteinSequences(chromosomeSequenceList.values());
// for(ProteinSequence proteinSequence : proteinSequenceList.values()){
// logger.info("Output={}", proteinSequence.getSequenceAsString());
// }
File tmp = File.createTempFile("volvox_all", "faa");
tmp.deleteOnExit();
FastaWriterHelper.writeProteinSequence(tmp, proteinSequenceList.values());
FileAssert.assertEquals("volvox_all_reference.faa and volvox_all.faa are not equal", new File(
"src/test/resources/volvox_all_reference.faa"), tmp);
}
示例13: testActivateEmptyDir
import junitx.framework.FileAssert; //导入方法依赖的package包/类
@Test
public void testActivateEmptyDir() throws URISyntaxException {
/* Prepare data. */
this.baseDir.delete();
assertEquals(false, this.baseDir.exists());
/* Invoke method. */
this.initialRegistration.activate(this.props);
/* Check its results. */
FileAssert.assertEquals(getResource("data1-config.properties"), this.generatedConfigFile);
FileAssert.assertEquals(getResource("data1-filter.xml"), this.generatedFilterFile);
verify(this.serviceSettings, times(1)).addSyncRoot(this.baseDir, 3000l);
}
示例14: testActivateEmptyDirDisabled1
import junitx.framework.FileAssert; //导入方法依赖的package包/类
@Test
public void testActivateEmptyDirDisabled1() throws URISyntaxException {
/* Prepare data. */
this.baseDir.delete();
assertEquals(false, this.baseDir.exists());
this.props.remove(InitialRegistrationImpl.PROP_SYNC_ONCE_TYPE);
/* Invoke method. */
this.initialRegistration.activate(this.props);
/* Check its results. */
FileAssert.assertEquals(getResource("data3-config.properties"), this.generatedConfigFile);
FileAssert.assertEquals(getResource("data1-filter.xml"), this.generatedFilterFile);
verify(this.serviceSettings, times(1)).addSyncRoot(this.baseDir, 3000l);
}
示例15: testActivateEmptyDirDisabled2
import junitx.framework.FileAssert; //导入方法依赖的package包/类
@Test
public void testActivateEmptyDirDisabled2() throws URISyntaxException {
/* Prepare data. */
this.baseDir.delete();
assertEquals(false, this.baseDir.exists());
this.props.put(InitialRegistrationImpl.PROP_SYNC_ONCE_TYPE, InitialRegistrationImpl.SYNC_ONCE_DISABLED);
/* Invoke method. */
this.initialRegistration.activate(this.props);
/* Check its results. */
FileAssert.assertEquals(getResource("data3-config.properties"), this.generatedConfigFile);
FileAssert.assertEquals(getResource("data1-filter.xml"), this.generatedFilterFile);
verify(this.serviceSettings, times(1)).addSyncRoot(this.baseDir, 3000l);
}