X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Ftest%2FBasicSupportTest.java;h=a3f5221df5c62db03b1e1e970074e036dbdec59a;hb=8958119f5e935859636d797df67cb34fb8a70875;hp=f989663e24b0ae142f03448c1dc7d592b7204ba6;hpb=793f1071fae48daed3b545a03a286c85e527d244;p=fanfix.git
diff --git a/src/be/nikiroo/fanfix/test/BasicSupportTest.java b/src/be/nikiroo/fanfix/test/BasicSupportTest.java
index f989663..a3f5221 100644
--- a/src/be/nikiroo/fanfix/test/BasicSupportTest.java
+++ b/src/be/nikiroo/fanfix/test/BasicSupportTest.java
@@ -15,20 +15,22 @@ import be.nikiroo.fanfix.data.Paragraph;
import be.nikiroo.fanfix.data.Paragraph.ParagraphType;
import be.nikiroo.fanfix.data.Story;
import be.nikiroo.fanfix.supported.BasicSupport;
-import be.nikiroo.fanfix.supported.BasicSupport.SupportType;
+import be.nikiroo.fanfix.supported.BasicSupport_Deprecated;
+import be.nikiroo.fanfix.supported.SupportType;
import be.nikiroo.utils.IOUtils;
+import be.nikiroo.utils.Progress;
import be.nikiroo.utils.test.TestCase;
import be.nikiroo.utils.test.TestLauncher;
-public class BasicSupportTest extends TestLauncher {
+class BasicSupportTest extends TestLauncher {
// quote chars
- private char openQuote = Instance.getTrans().getChar(
+ private char openQuote = Instance.getTrans().getCharacter(
StringId.OPEN_SINGLE_QUOTE);
- private char closeQuote = Instance.getTrans().getChar(
+ private char closeQuote = Instance.getTrans().getCharacter(
StringId.CLOSE_SINGLE_QUOTE);
- private char openDoubleQuote = Instance.getTrans().getChar(
+ private char openDoubleQuote = Instance.getTrans().getCharacter(
StringId.OPEN_DOUBLE_QUOTE);
- private char closeDoubleQuote = Instance.getTrans().getChar(
+ private char closeDoubleQuote = Instance.getTrans().getCharacter(
StringId.CLOSE_DOUBLE_QUOTE);
public BasicSupportTest(String[] args) {
@@ -60,13 +62,13 @@ public class BasicSupportTest extends TestLauncher {
List
Line 2
Line 3
"); + "Line 1Line 2
Line 3
", null); assertEquals(5, paras.size()); assertEquals("Line 1", paras.get(0).getContent()); assertEquals(ParagraphType.BLANK, paras.get(1) @@ -77,7 +79,7 @@ public class BasicSupportTest extends TestLauncher { assertEquals("Line 3", paras.get(4).getContent()); paras = support.makeParagraphs(null, - "Line1
Line2
Line3
"); + "Line1
Line2
Line3
", null); assertEquals(6, paras.size()); } }); @@ -95,34 +97,39 @@ public class BasicSupportTest extends TestLauncher { ListLine1
Line2
Line3
Line1
Line2
Line3
Line1
Line2
Line3
Line1
Line2
Line3
* * *
2"); + paras = support.makeParagraphs(null, "1
* * *
2", + null); assertEquals(3, paras.size()); assertEquals(ParagraphType.BREAK, paras.get(1) .getType()); paras = support.makeParagraphs(null, - "1
* * *
2"); + "1
* * *
2", null); assertEquals(3, paras.size()); assertEquals(ParagraphType.BREAK, paras.get(1) .getType()); paras = support.makeParagraphs(null, - "1
* * *
2"); + "1
* * *
2", null); assertEquals(3, paras.size()); assertEquals(ParagraphType.BREAK, paras.get(1) .getType()); paras = support.makeParagraphs(null, - "1
* * *
2"); + "1
* * *
2", null);
assertEquals(3, paras.size());
assertEquals(ParagraphType.BREAK, paras.get(1)
.getType());
@@ -174,7 +181,7 @@ public class BasicSupportTest extends TestLauncher {
public void setUp() throws Exception {
super.setUp();
- };
+ }
@Override
public void tearDown() throws Exception {
@@ -249,10 +256,10 @@ public class BasicSupportTest extends TestLauncher {
public void test() throws Exception {
BasicSupportEmpty support = new BasicSupportEmpty();
- char openDoubleQuote = Instance.getTrans().getChar(
- StringId.OPEN_DOUBLE_QUOTE);
- char closeDoubleQuote = Instance.getTrans().getChar(
- StringId.CLOSE_DOUBLE_QUOTE);
+ char openDoubleQuote = Instance.getTrans()
+ .getCharacter(StringId.OPEN_DOUBLE_QUOTE);
+ char closeDoubleQuote = Instance.getTrans()
+ .getCharacter(StringId.CLOSE_DOUBLE_QUOTE);
String content = null;
Paragraph para = null;
@@ -319,20 +326,19 @@ public class BasicSupportTest extends TestLauncher {
+ "Fanfan." + "\n" + "\n"
+ "Chapter 2: Chap2" + "\n" + "\n" //
+ "Tulipe." + "\n");
- };
+ }
@Override
public void tearDown() throws Exception {
tmp.delete();
- };
+ }
@Override
public void test() throws Exception {
- BasicSupport support = BasicSupport
- .getSupport(SupportType.TEXT);
+ BasicSupport support = BasicSupport.getSupport(
+ SupportType.TEXT, tmp.toURI().toURL());
- Story story = support
- .process(tmp.toURI().toURL(), null);
+ Story story = support.process(null);
assertEquals(2, story.getChapters().size());
assertEquals(1, story.getChapters().get(1)
@@ -362,20 +368,19 @@ public class BasicSupportTest extends TestLauncher {
+ "Fanfan." + "\n" + "\n"
+ "Chapter 2: Chap2" + "\n" + "\n" //
+ "Tulipe." + "\n");
- };
+ }
@Override
public void tearDown() throws Exception {
tmp.delete();
- };
+ }
@Override
public void test() throws Exception {
- BasicSupport support = BasicSupport
- .getSupport(SupportType.TEXT);
+ BasicSupport support = BasicSupport.getSupport(
+ SupportType.TEXT, tmp.toURI().toURL());
- Story story = support
- .process(tmp.toURI().toURL(), null);
+ Story story = support.process(null);
assertEquals(2, story.getChapters().size());
assertEquals(1, story.getChapters().get(1)
@@ -388,7 +393,7 @@ public class BasicSupportTest extends TestLauncher {
});
}
- private class BasicSupportEmpty extends BasicSupport {
+ private class BasicSupportEmpty extends BasicSupport_Deprecated {
@Override
protected String getSourceName() {
return null;
@@ -417,21 +422,21 @@ public class BasicSupportTest extends TestLauncher {
@Override
protected List