Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xwiki-platform
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XWiki
xwiki-platform
Commits
c1912512
Commit
c1912512
authored
7 years ago
by
Vincent Massol
Browse files
Options
Downloads
Patches
Plain Diff
[Misc] Apply test best practices
parent
2050f822
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-parser/src/test/java/org/xwiki/rendering/internal/parser/DefaultContentParserTest.java
+5
-6
5 additions, 6 deletions
...i/rendering/internal/parser/DefaultContentParserTest.java
with
5 additions
and
6 deletions
xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-parser/src/test/java/org/xwiki/rendering/internal/parser/DefaultContentParserTest.java
+
5
−
6
View file @
c1912512
...
@@ -58,8 +58,7 @@ public class DefaultContentParserTest
...
@@ -58,8 +58,7 @@ public class DefaultContentParserTest
{
{
@Rule
@Rule
public
final
MockitoComponentMockingRule
<
ContentParser
>
mocker
=
public
final
MockitoComponentMockingRule
<
ContentParser
>
mocker
=
new
MockitoComponentMockingRule
<
ContentParser
>(
DefaultContentParser
.
class
);
new
MockitoComponentMockingRule
<>(
DefaultContentParser
.
class
);
@Rule
@Rule
public
ExpectedException
thrown
=
ExpectedException
.
none
();
public
ExpectedException
thrown
=
ExpectedException
.
none
();
...
@@ -78,7 +77,7 @@ public void configure() throws Exception
...
@@ -78,7 +77,7 @@ public void configure() throws Exception
}
}
@Test
@Test
public
void
test
NoMetadataSource
()
throws
Exception
public
void
parseHas
NoMetadataSource
()
throws
Exception
{
{
XDOM
xdom
=
mocker
.
getComponentUnderTest
().
parse
(
""
,
Syntax
.
PLAIN_1_0
);
XDOM
xdom
=
mocker
.
getComponentUnderTest
().
parse
(
""
,
Syntax
.
PLAIN_1_0
);
...
@@ -86,15 +85,15 @@ public void testNoMetadataSource() throws Exception
...
@@ -86,15 +85,15 @@ public void testNoMetadataSource() throws Exception
}
}
@Test
@Test
public
void
test
AddingMetadataSource
()
throws
Exception
public
void
parseIs
AddingMetadataSource
()
throws
Exception
{
{
XDOM
xdom
=
mocker
.
getComponentUnderTest
().
parse
(
""
,
Syntax
.
PLAIN_1_0
,
DOCUMENT_REFERENCE
);
XDOM
xdom
=
mocker
.
getComponentUnderTest
().
parse
(
""
,
Syntax
.
PLAIN_1_0
,
DOCUMENT_REFERENCE
);
assertThat
(
(
String
)
xdom
.
getMetaData
().
getMetaData
(
MetaData
.
SOURCE
),
equalTo
(
SOURCE
));
assertThat
(
xdom
.
getMetaData
().
getMetaData
(
MetaData
.
SOURCE
),
equalTo
(
SOURCE
));
}
}
@Test
@Test
public
void
testMissingParserException
()
throws
Exception
public
void
parseWhenNoParser
()
throws
Exception
{
{
thrown
.
expect
(
MissingParserException
.
class
);
thrown
.
expect
(
MissingParserException
.
class
);
thrown
.
expectMessage
(
"Failed to find a parser for syntax [XWiki 2.1]"
);
thrown
.
expectMessage
(
"Failed to find a parser for syntax [XWiki 2.1]"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment