details: https://code.openbravo.com/erp/devel/pi/rev/752c92d2f31a
changeset: 24158:752c92d2f31a
user: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
date: Mon Aug 04 18:26:03 2014 +0200
summary: related to bug 27274: fixed test case in MergePropertiesTest.
diffstat:
src-test/org/openbravo/test/modularity/MergePropertiesTest.java | 25 ++++++---
1 files changed, 17 insertions(+), 8 deletions(-)
diffs (105 lines):
diff -r 4882d76b8d6a -r 752c92d2f31a
src-test/org/openbravo/test/modularity/MergePropertiesTest.java
--- a/src-test/org/openbravo/test/modularity/MergePropertiesTest.java Mon Aug
04 14:47:58 2014 +0200
+++ b/src-test/org/openbravo/test/modularity/MergePropertiesTest.java Mon Aug
04 18:26:03 2014 +0200
@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2009-2010 Openbravo SLU
+ * All portions are Copyright (C) 2009-2014 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -38,12 +38,12 @@
private static String NEW_FILE = "test-new.properties";
/**
- * crates original properties file to be tested later
+ * creates original properties file to be tested later
*
* @throws FileNotFoundException
* @throws IOException
*/
- public void testCreateOriginalFile1() throws FileNotFoundException,
IOException {
+ private void createOriginalFile1() throws FileNotFoundException, IOException
{
Properties prop = new Properties();
prop.setProperty("test1", "value1.custom");
prop.setProperty("test2", "value2.custom");
@@ -56,7 +56,7 @@
* @throws FileNotFoundException
* @throws IOException
*/
- public void testCreateNewFile1() throws FileNotFoundException, IOException {
+ private void createNewFile1() throws FileNotFoundException, IOException {
Properties prop = new Properties();
prop.setProperty("test1", "value1.default");
prop.setProperty("test2", "value2.default");
@@ -71,6 +71,9 @@
* @throws IOException
*/
public void testMerge() throws FileNotFoundException, IOException {
+ createOriginalFile1();
+ createNewFile1();
+
boolean modified = Utility.mergeOpenbravoProperties(ORIGINAL_FILE,
NEW_FILE);
assertTrue("File has not been modified while it should be", modified);
@@ -82,12 +85,14 @@
prop.getProperty("test2").equals("value2.custom"));
assertTrue("Not correctly merged test3 property",
prop.getProperty("test3").equals("value3.default"));
+
+ deleteFiles1();
}
/**
* deletes testing files
*/
- public void testDeleteFiles1() {
+ private void deleteFiles1() {
assertTrue("couldn't delete " + ORIGINAL_FILE, new
File(ORIGINAL_FILE).delete());
assertTrue("couldn't delete " + ORIGINAL_FILE, new
File(NEW_FILE).delete());
}
@@ -98,7 +103,7 @@
* @throws FileNotFoundException
* @throws IOException
*/
- public void testCreateOriginalFile2() throws FileNotFoundException,
IOException {
+ private void createOriginalFile2() throws FileNotFoundException, IOException
{
Properties prop = new Properties();
prop.setProperty("test1", "value1.custom");
prop.setProperty("test2", "value2.custom");
@@ -111,7 +116,7 @@
* @throws FileNotFoundException
* @throws IOException
*/
- public void testCreateNewFile2() throws FileNotFoundException, IOException {
+ private void createNewFile2() throws FileNotFoundException, IOException {
Properties prop = new Properties();
prop.setProperty("test1", "value1.default");
prop.setProperty("test2", "value2.default");
@@ -126,6 +131,9 @@
* @throws IOException
*/
public void testMerge2() throws FileNotFoundException, IOException {
+ createOriginalFile2();
+ createNewFile2();
+
boolean modified = Utility.mergeOpenbravoProperties(ORIGINAL_FILE,
NEW_FILE);
assertFalse("File has been modified while it shouldn't be", modified);
@@ -136,12 +144,13 @@
assertTrue("Not correctly merged test2 property",
prop.getProperty("test2").equals("value2.custom"));
+ deleteFiles2();
}
/**
* deletes testing files
*/
- public void testDeleteFiles2() {
+ private void deleteFiles2() {
assertTrue("couldn't delete " + ORIGINAL_FILE, new
File(ORIGINAL_FILE).delete());
assertTrue("couldn't delete " + ORIGINAL_FILE, new
File(NEW_FILE).delete());
}
------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits