diff --git a/markwon-html/src/test/java/ru/noties/markwon/html/impl/CssInlineStyleParserTest.java b/markwon-html/src/test/java/ru/noties/markwon/html/CssInlineStyleParserTest.java
similarity index 87%
rename from markwon-html/src/test/java/ru/noties/markwon/html/impl/CssInlineStyleParserTest.java
rename to markwon-html/src/test/java/ru/noties/markwon/html/CssInlineStyleParserTest.java
index a898d342..cc105137 100644
--- a/markwon-html/src/test/java/ru/noties/markwon/html/impl/CssInlineStyleParserTest.java
+++ b/markwon-html/src/test/java/ru/noties/markwon/html/CssInlineStyleParserTest.java
@@ -1,4 +1,4 @@
-package ru.noties.markwon.html.impl;
+package ru.noties.markwon.html;
import android.support.annotation.NonNull;
@@ -14,13 +14,9 @@ import java.util.Map;
import ix.Ix;
import ix.IxFunction;
-import ru.noties.markwon.html.CssInlineStyleParser;
-import ru.noties.markwon.html.CssProperty;
-import ru.noties.markwon.test.TestUtils;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static ru.noties.markwon.test.TestUtils.with;
@RunWith(RobolectricTestRunner.class)
@Config(manifest = Config.NONE)
@@ -42,7 +38,7 @@ public class CssInlineStyleParserTest {
assertEquals(1, list.size());
- with(list.get(0), new TestUtils.Action() {
+ with(list.get(0), new Action() {
@Override
public void apply(@NonNull CssProperty cssProperty) {
assertEquals("key", cssProperty.key());
@@ -60,7 +56,7 @@ public class CssInlineStyleParserTest {
assertEquals(2, list.size());
- with(list.get(0), new TestUtils.Action() {
+ with(list.get(0), new Action() {
@Override
public void apply(@NonNull CssProperty cssProperty) {
assertEquals("key1", cssProperty.key());
@@ -68,7 +64,7 @@ public class CssInlineStyleParserTest {
}
});
- with(list.get(1), new TestUtils.Action() {
+ with(list.get(1), new Action() {
@Override
public void apply(@NonNull CssProperty cssProperty) {
assertEquals("key2", cssProperty.key());
@@ -84,7 +80,7 @@ public class CssInlineStyleParserTest {
final List list = listProperties(input);
assertEquals(1, list.size());
- with(list.get(0), new TestUtils.Action() {
+ with(list.get(0), new Action() {
@Override
public void apply(@NonNull CssProperty cssProperty) {
assertEquals("key", cssProperty.key());
@@ -100,7 +96,7 @@ public class CssInlineStyleParserTest {
final List list = listProperties(input);
assertEquals(1, list.size());
- with(list.get(0), new TestUtils.Action() {
+ with(list.get(0), new Action() {
@Override
public void apply(@NonNull CssProperty cssProperty) {
assertEquals("key", cssProperty.key());
@@ -116,7 +112,7 @@ public class CssInlineStyleParserTest {
final List list = listProperties(input);
assertEquals(2, list.size());
- with(list.get(0), new TestUtils.Action() {
+ with(list.get(0), new Action() {
@Override
public void apply(@NonNull CssProperty cssProperty) {
assertEquals("key1", cssProperty.key());
@@ -124,7 +120,7 @@ public class CssInlineStyleParserTest {
}
});
- with(list.get(1), new TestUtils.Action() {
+ with(list.get(1), new Action() {
@Override
public void apply(@NonNull CssProperty cssProperty) {
assertEquals("key2", cssProperty.key());
@@ -149,7 +145,7 @@ public class CssInlineStyleParserTest {
final List list = listProperties(input);
assertEquals(1, list.size());
- with(list.get(0), new TestUtils.Action() {
+ with(list.get(0), new Action() {
@Override
public void apply(@NonNull CssProperty cssProperty) {
assertEquals("key4", cssProperty.key());
@@ -174,7 +170,7 @@ public class CssInlineStyleParserTest {
assertEquals(2, list.size());
- with(list.get(0), new TestUtils.Action() {
+ with(list.get(0), new Action() {
@Override
public void apply(@NonNull CssProperty cssProperty) {
assertEquals("key1", cssProperty.key());
@@ -182,7 +178,7 @@ public class CssInlineStyleParserTest {
}
});
- with(list.get(1), new TestUtils.Action() {
+ with(list.get(1), new Action() {
@Override
public void apply(@NonNull CssProperty cssProperty) {
assertEquals("key3", cssProperty.key());
@@ -211,14 +207,14 @@ public class CssInlineStyleParserTest {
}};
final StringBuilder builder = new StringBuilder();
- for (Map.Entry entry: map.entrySet()) {
+ for (Map.Entry entry : map.entrySet()) {
builder.append(entry.getKey())
.append(':')
.append(entry.getValue())
.append(';');
}
- for (CssProperty cssProperty: impl.parse(builder.toString())) {
+ for (CssProperty cssProperty : impl.parse(builder.toString())) {
final String value = map.remove(cssProperty.key());
assertNotNull(cssProperty.key(), value);
assertEquals(cssProperty.key(), value, cssProperty.value());
@@ -238,4 +234,13 @@ public class CssInlineStyleParserTest {
})
.toList();
}
+
+ public interface Action {
+ void apply(@NonNull T t);
+ }
+
+ private static void with(@NonNull T t, @NonNull Action action) {
+ action.apply(t);
+ }
+
}
\ No newline at end of file
diff --git a/markwon-html/src/test/java/ru/noties/markwon/html/impl/HtmlEmptyTagReplacementTest.java b/markwon-html/src/test/java/ru/noties/markwon/html/HtmlEmptyTagReplacementTest.java
similarity index 89%
rename from markwon-html/src/test/java/ru/noties/markwon/html/impl/HtmlEmptyTagReplacementTest.java
rename to markwon-html/src/test/java/ru/noties/markwon/html/HtmlEmptyTagReplacementTest.java
index 62333012..c54fab18 100644
--- a/markwon-html/src/test/java/ru/noties/markwon/html/impl/HtmlEmptyTagReplacementTest.java
+++ b/markwon-html/src/test/java/ru/noties/markwon/html/HtmlEmptyTagReplacementTest.java
@@ -1,12 +1,10 @@
-package ru.noties.markwon.html.impl;
+package ru.noties.markwon.html;
import org.junit.Before;
import org.junit.Test;
import java.util.Collections;
-import ru.noties.markwon.html.HtmlEmptyTagReplacement;
-import ru.noties.markwon.html.api.HtmlTag;
import ru.noties.markwon.html.HtmlTagImpl.InlineImpl;
import static org.junit.Assert.assertEquals;
diff --git a/markwon-html/src/test/java/ru/noties/markwon/html/impl/MarkwonHtmlParserImplTest.java b/markwon-html/src/test/java/ru/noties/markwon/html/MarkwonHtmlParserImplTest.java
similarity index 99%
rename from markwon-html/src/test/java/ru/noties/markwon/html/impl/MarkwonHtmlParserImplTest.java
rename to markwon-html/src/test/java/ru/noties/markwon/html/MarkwonHtmlParserImplTest.java
index 54adb09f..c614d36c 100644
--- a/markwon-html/src/test/java/ru/noties/markwon/html/impl/MarkwonHtmlParserImplTest.java
+++ b/markwon-html/src/test/java/ru/noties/markwon/html/MarkwonHtmlParserImplTest.java
@@ -1,4 +1,4 @@
-package ru.noties.markwon.html.impl;
+package ru.noties.markwon.html;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@@ -15,11 +15,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import ru.noties.markwon.html.HtmlEmptyTagReplacement;
-import ru.noties.markwon.html.MarkwonHtmlParserImpl;
-import ru.noties.markwon.html.api.HtmlTag;
-import ru.noties.markwon.html.api.MarkwonHtmlParser;
-
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -847,7 +842,7 @@ public class MarkwonHtmlParserImplTest {
"head #3
in custom-tag"
};
- for (String fragment: fragments) {
+ for (String fragment : fragments) {
impl.processFragment(output, fragment);
}
diff --git a/markwon-html/src/test/java/ru/noties/markwon/html/impl/TrimmingAppenderTest.java b/markwon-html/src/test/java/ru/noties/markwon/html/TrimmingAppenderTest.java
similarity index 96%
rename from markwon-html/src/test/java/ru/noties/markwon/html/impl/TrimmingAppenderTest.java
rename to markwon-html/src/test/java/ru/noties/markwon/html/TrimmingAppenderTest.java
index 3d5cf4db..ef82795e 100644
--- a/markwon-html/src/test/java/ru/noties/markwon/html/impl/TrimmingAppenderTest.java
+++ b/markwon-html/src/test/java/ru/noties/markwon/html/TrimmingAppenderTest.java
@@ -1,4 +1,4 @@
-package ru.noties.markwon.html.impl;
+package ru.noties.markwon.html;
import org.junit.Before;
import org.junit.Test;
diff --git a/markwon-html/src/test/java/ru/noties/markwon/html/impl/jsoup/nodes/CommonMarkEntitiesTest.java b/markwon-html/src/test/java/ru/noties/markwon/html/jsoup/nodes/CommonMarkEntitiesTest.java
similarity index 57%
rename from markwon-html/src/test/java/ru/noties/markwon/html/impl/jsoup/nodes/CommonMarkEntitiesTest.java
rename to markwon-html/src/test/java/ru/noties/markwon/html/jsoup/nodes/CommonMarkEntitiesTest.java
index 866b3352..3472d8d5 100644
--- a/markwon-html/src/test/java/ru/noties/markwon/html/impl/jsoup/nodes/CommonMarkEntitiesTest.java
+++ b/markwon-html/src/test/java/ru/noties/markwon/html/jsoup/nodes/CommonMarkEntitiesTest.java
@@ -1,24 +1,20 @@
-package ru.noties.markwon.html.impl.jsoup.nodes;
+package ru.noties.markwon.html.jsoup.nodes;
+import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
-import ru.noties.markwon.html.jsoup.nodes.CommonMarkEntities;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
@RunWith(RobolectricTestRunner.class)
@Config(manifest = Config.NONE)
public class CommonMarkEntitiesTest {
@Test
public void can_access_field() {
- assertTrue("&", CommonMarkEntities.isNamedEntity("amp"));
+ Assert.assertTrue("&", CommonMarkEntities.isNamedEntity("amp"));
final int[] codepoints = new int[1];
CommonMarkEntities.codepointsForName("amp", codepoints);
- assertEquals('&', codepoints[0]);
+ Assert.assertEquals('&', codepoints[0]);
}
}
\ No newline at end of file
diff --git a/markwon-html/src/test/java/ru/noties/markwon/html/impl/tag/ImageSizeParserImplTest.java b/markwon-html/src/test/java/ru/noties/markwon/html/tag/ImageSizeParserImplTest.java
similarity index 87%
rename from markwon-html/src/test/java/ru/noties/markwon/html/impl/tag/ImageSizeParserImplTest.java
rename to markwon-html/src/test/java/ru/noties/markwon/html/tag/ImageSizeParserImplTest.java
index c1549747..ffa9fdc6 100644
--- a/markwon-html/src/test/java/ru/noties/markwon/html/impl/tag/ImageSizeParserImplTest.java
+++ b/markwon-html/src/test/java/ru/noties/markwon/html/tag/ImageSizeParserImplTest.java
@@ -1,8 +1,9 @@
-package ru.noties.markwon.html.impl.tag;
+package ru.noties.markwon.html.tag;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -13,13 +14,8 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import ru.noties.markwon.html.tag.ImageSizeParserImpl;
+import ru.noties.markwon.html.CssInlineStyleParser;
import ru.noties.markwon.image.ImageSize;
-import ru.noties.markwon.renderer.html2.CssInlineStyleParser;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
@RunWith(RobolectricTestRunner.class)
@Config(manifest = Config.NONE)
@@ -36,7 +32,7 @@ public class ImageSizeParserImplTest {
@Test
public void nothing() {
- assertNull(impl.parse(Collections.emptyMap()));
+ Assert.assertNull(impl.parse(Collections.emptyMap()));
}
@Test
@@ -153,15 +149,15 @@ public class ImageSizeParserImplTest {
};
for (String dimension : dimensions) {
- assertNull(dimension, impl.dimension(dimension));
+ Assert.assertNull(dimension, impl.dimension(dimension));
}
}
private static void assertImageSize(@Nullable ImageSize expected, @Nullable ImageSize actual) {
if (expected == null) {
- assertNull(actual);
+ Assert.assertNull(actual);
} else {
- assertNotNull(actual);
+ Assert.assertNotNull(actual);
assertDimension("width", expected.width, actual.width);
assertDimension("height", expected.height, actual.height);
}
@@ -172,11 +168,11 @@ public class ImageSizeParserImplTest {
@Nullable ImageSize.Dimension expected,
@Nullable ImageSize.Dimension actual) {
if (expected == null) {
- assertNull(name, actual);
+ Assert.assertNull(name, actual);
} else {
- assertNotNull(name, actual);
- assertEquals(name, expected.value, actual.value, DELTA);
- assertEquals(name, expected.unit, actual.unit);
+ Assert.assertNotNull(name, actual);
+ Assert.assertEquals(name, expected.value, actual.value, DELTA);
+ Assert.assertEquals(name, expected.unit, actual.unit);
}
}
diff --git a/markwon/src/test/java/ru/noties/markwon/test/TestUtils.java b/markwon/src/test/java/ru/noties/markwon/test/TestUtils.java
deleted file mode 100644
index 4a8f3890..00000000
--- a/markwon/src/test/java/ru/noties/markwon/test/TestUtils.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package ru.noties.markwon.test;
-
-import android.support.annotation.NonNull;
-
-public abstract class TestUtils {
-
- public interface Action {
- void apply(@NonNull T t);
- }
-
- public static void with(@NonNull T t, @NonNull Action action) {
- action.apply(t);
- }
-
- private TestUtils() {
- }
-}