diff --git a/ttool/src/test/java/tmltranslator/CompareTMLTests.java b/ttool/src/test/java/tmltranslator/CompareTMLTests.java index 446702812037db23def91569265d33fbb3607b24..a0c7b268820719d5d34c0e40f356ba8c681cb93c 100644 --- a/ttool/src/test/java/tmltranslator/CompareTMLTests.java +++ b/ttool/src/test/java/tmltranslator/CompareTMLTests.java @@ -23,9 +23,14 @@ public class CompareTMLTests { final static String COMMENT_AND_CONTEXT_4 = PATH_TO_TEST_COMPARE_FILE + "file7.tml"; + // Test true cases @Test public void onlyCommentAndEmptyTest () throws Exception { CompareTML ctml = new CompareTML(); + /* file 1 and file 2 + * file 1 includes only blank lines + * file 2 includes only comments + */ assertTrue("comparing between empty file and another file including only comment",ctml.compareTML(new File(EMPTY_FILE), new File(ONLY_COMMENT_1))); } @@ -33,6 +38,9 @@ public class CompareTMLTests { @Test public void onlyCommentAndOnlyComment () throws Exception { CompareTML ctml = new CompareTML(); + /* file 2 and file 3 + * file 2 and file 3 include only comments and blank lines + */ assertTrue("comparing between 2 files including only comment",ctml.compareTML(new File(ONLY_COMMENT_1), new File(ONLY_COMMENT_2))); } @@ -40,13 +48,20 @@ public class CompareTMLTests { @Test public void sameContextDifferentComment () throws Exception { CompareTML ctml = new CompareTML(); + /* file 4 and file 5 + * two files includes many comments, blank lines and white spaces before and after strings (comments or context) + */ assertTrue("comparing between 2 files including the same context but different comment",ctml.compareTML(new File(COMMENT_AND_CONTEXT_1), new File(COMMENT_AND_CONTEXT_2))); } + // Test false cases @Test public void DifferentContextDifferentComment () throws Exception { CompareTML ctml = new CompareTML(); + /* file 5 and file 6 + * adding white spaces between two words in file 6 in comparison with file 5 + */ assertFalse("comparing between 2 files including the same context but different comment",ctml.compareTML(new File(COMMENT_AND_CONTEXT_2), new File(COMMENT_AND_CONTEXT_3))); } @@ -54,6 +69,9 @@ public class CompareTMLTests { @Test public void DifferentContextSameComment () throws Exception { CompareTML ctml = new CompareTML(); + /* file 6 and file 7 + * adding context in file 7 in comparison with file 6 + */ assertFalse("comparing between 2 files including the same comment but different context", ctml.compareTML(new File(COMMENT_AND_CONTEXT_3), new File(COMMENT_AND_CONTEXT_4))); diff --git a/ttool/src/test/resources/tmltranslator/input/file1.tml b/ttool/src/test/resources/tmltranslator/input/file1.tml index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3f2ff2d6cc8f257ffcade7ead1ca4042c0e884b9 100644 --- a/ttool/src/test/resources/tmltranslator/input/file1.tml +++ b/ttool/src/test/resources/tmltranslator/input/file1.tml @@ -0,0 +1,5 @@ + + + + + diff --git a/ttool/src/test/resources/tmltranslator/input/file2.tml b/ttool/src/test/resources/tmltranslator/input/file2.tml index f8bba761c07edabf02290f3cde97274a5a8c952a..a7caaedad174b2d05ebbb292fa683dd90fb12107 100644 --- a/ttool/src/test/resources/tmltranslator/input/file2.tml +++ b/ttool/src/test/resources/tmltranslator/input/file2.tml @@ -1 +1,5 @@ -// comment 1 \ No newline at end of file +// comment 1 + + +// todo1 + diff --git a/ttool/src/test/resources/tmltranslator/input/file3.tml b/ttool/src/test/resources/tmltranslator/input/file3.tml index 01294e4cb7f164a7bd96f902c8ab2fc473707201..f197c765e8d9ea0ed71b34fac1d336e07a78af61 100644 --- a/ttool/src/test/resources/tmltranslator/input/file3.tml +++ b/ttool/src/test/resources/tmltranslator/input/file3.tml @@ -1 +1,6 @@ -// comment 2 \ No newline at end of file +// comment 2 + // todo1 + + +// todo2 + diff --git a/ttool/src/test/resources/tmltranslator/input/file4.tml b/ttool/src/test/resources/tmltranslator/input/file4.tml index 9d5f5aa294bbb08bf55e5ea0764d1cec4089622d..c5ff371547aedb329b11872b55fd195d7c28a30b 100644 --- a/ttool/src/test/resources/tmltranslator/input/file4.tml +++ b/ttool/src/test/resources/tmltranslator/input/file4.tml @@ -1,4 +1,14 @@ // File with comment + context 1 // Channels CHANNEL DIPLODOCUS_C_Design__channel BRBW 4 8 OUT DIPLODOCUS_C_Design__PrimitiveComp1 IN DIPLODOCUS_C_Design__PrimitiveComp2 -CHANNEL DIPLODOCUS_C_Design__channel_0 BRBW 4 8 OUT DIPLODOCUS_C_Design__PrimitiveComp1_0 IN DIPLODOCUS_C_Design__PrimitiveComp2_0 \ No newline at end of file + + +CHANNEL DIPLODOCUS_C_Design__channel_0 BRBW 4 8 OUT DIPLODOCUS_C_Design__PrimitiveComp1_0 IN DIPLODOCUS_C_Design__PrimitiveComp2_0 + + + + +//todo1 + +// todo2 + //todo3 \ No newline at end of file diff --git a/ttool/src/test/resources/tmltranslator/input/file5.tml b/ttool/src/test/resources/tmltranslator/input/file5.tml index a2b9bcce517d02d990b4fca462bb2bb3cced2218..0dccf9189134747618ddc9dff075f62661ce65d0 100644 --- a/ttool/src/test/resources/tmltranslator/input/file5.tml +++ b/ttool/src/test/resources/tmltranslator/input/file5.tml @@ -1,4 +1,16 @@ -// File with comment + context 2 -// Channels + // File with comment + context 2 + + + + // Channels CHANNEL DIPLODOCUS_C_Design__channel BRBW 4 8 OUT DIPLODOCUS_C_Design__PrimitiveComp1 IN DIPLODOCUS_C_Design__PrimitiveComp2 + + + + + + + + + CHANNEL DIPLODOCUS_C_Design__channel_0 BRBW 4 8 OUT DIPLODOCUS_C_Design__PrimitiveComp1_0 IN DIPLODOCUS_C_Design__PrimitiveComp2_0 \ No newline at end of file diff --git a/ttool/src/test/resources/tmltranslator/input/file6.tml b/ttool/src/test/resources/tmltranslator/input/file6.tml index 864b0d1e23d08f190251fceeda6ddeca3215da75..54427737b0fcccf3c3365d1ca17a1e087912fcec 100644 --- a/ttool/src/test/resources/tmltranslator/input/file6.tml +++ b/ttool/src/test/resources/tmltranslator/input/file6.tml @@ -1,4 +1,16 @@ -// File with comment + context 3 -// Channels -CHANNEL DIPLODOCUS_C_Design__channel BRBW 5 8 OUT DIPLODOCUS_C_Design__PrimitiveComp1 IN DIPLODOCUS_C_Design__PrimitiveComp2 -CHANNEL DIPLODOCUS_C_Design__channel_0 BRBW 4 8 OUT DIPLODOCUS_C_Design__PrimitiveComp1_0 IN DIPLODOCUS_C_Design__PrimitiveComp2_0 \ No newline at end of file + // File with comment + context 2 + + + + // Channels +CHANNEL DIPLODOCUS_C_Design__channel BRBW 4 8 OUT DIPLODOCUS_C_Design__PrimitiveComp1 IN DIPLODOCUS_C_Design__PrimitiveComp2 + + + + + + + + + +CHANNEL DIPLODOCUS_C_Design__channel_0 BRBW 4 8 OUT DIPLODOCUS_C_Design__PrimitiveComp1_0 IN DIPLODOCUS_C_Design__PrimitiveComp2_0 \ No newline at end of file diff --git a/ttool/src/test/resources/tmltranslator/input/file7.tml b/ttool/src/test/resources/tmltranslator/input/file7.tml index 58da6df298ffde1fea7e6095c023afd40ead0f5d..476f5ce835955923fa6cffdee9d6a84bb8a8e849 100644 --- a/ttool/src/test/resources/tmltranslator/input/file7.tml +++ b/ttool/src/test/resources/tmltranslator/input/file7.tml @@ -1,4 +1,30 @@ -// File with comment + context 3 -// Channels + // File with comment + context 2 + + + + // Channels CHANNEL DIPLODOCUS_C_Design__channel BRBW 4 8 OUT DIPLODOCUS_C_Design__PrimitiveComp1 IN DIPLODOCUS_C_Design__PrimitiveComp2 -CHANNEL DIPLODOCUS_C_Design__channel_0 BRBW 4 8 OUT DIPLODOCUS_C_Design__PrimitiveComp1_0 IN DIPLODOCUS_C_Design__PrimitiveComp2_0 \ No newline at end of file + + + + + + + + + +CHANNEL DIPLODOCUS_C_Design__channel_0 BRBW 4 8 OUT DIPLODOCUS_C_Design__PrimitiveComp1_0 IN DIPLODOCUS_C_Design__PrimitiveComp2_0 + + + + + +CHANNEL DIPLODOCUS_C_Design__channel_0 BRBW 4 8 OUT DIPLODOCUS_C_Design__PrimitiveComp1_0 IN DIPLODOCUS_C_Design__PrimitiveComp2_0 + + + // Event + + + EVENT + + EVENT