2
2
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
3
3
*/
4
4
5
- package com .lightbend .paradox .unidoc
5
+ package com .lightbend .paradox .apidoc
6
6
7
7
import com .lightbend .paradox .markdown .Writer
8
8
9
- class UnidocPluginSpec extends MarkdownBaseSpec {
9
+ class ApidocPluginSpec extends MarkdownBaseSpec {
10
10
val rootPackage = " akka"
11
11
12
12
val allClasses = Array (
@@ -35,7 +35,7 @@ class UnidocPluginSpec extends MarkdownBaseSpec {
35
35
verbatimSerializers = Writer .defaultVerbatims,
36
36
serializerPlugins = Writer .defaultPlugins(
37
37
Writer .defaultDirectives ++ Seq (
38
- (_ : Writer .Context ) => new UnidocDirective (allClasses)
38
+ (_ : Writer .Context ) => new ApidocDirective (allClasses)
39
39
)
40
40
)
41
41
)
@@ -47,8 +47,8 @@ class UnidocPluginSpec extends MarkdownBaseSpec {
47
47
" javadoc.akka.http.base_url" -> " https://doc.akka.io/japi/akka-http/current" ,
48
48
)
49
49
50
- " Unidoc directive" should " generate markdown correctly when there is only one match" in {
51
- markdown(" @unidoc [Envelope]" ) shouldEqual
50
+ " Apidoc directive" should " generate markdown correctly when there is only one match" in {
51
+ markdown(" @apidoc [Envelope]" ) shouldEqual
52
52
html(
53
53
""" <p><span class="group-scala">
54
54
|<a href="https://doc.akka.io/api/akka/2.5/akka/dispatch/Envelope.html">Envelope</a></span><span class="group-java">
@@ -58,14 +58,14 @@ class UnidocPluginSpec extends MarkdownBaseSpec {
58
58
}
59
59
60
60
it should " throw an exception when there is no match" in {
61
- val thrown = the[IllegalStateException ] thrownBy markdown(" @unidoc [ThereIsNoSuchClass]" )
61
+ val thrown = the[IllegalStateException ] thrownBy markdown(" @apidoc [ThereIsNoSuchClass]" )
62
62
thrown.getMessage shouldEqual
63
63
" No matches found for ThereIsNoSuchClass"
64
64
}
65
65
66
66
67
67
it should " generate markdown correctly when 2 matches found and their package names include javadsl/scaladsl" in {
68
- markdown(" @unidoc [Flow]" ) shouldEqual
68
+ markdown(" @apidoc [Flow]" ) shouldEqual
69
69
html(
70
70
""" <p><span class="group-java">
71
71
|<a href="https://doc.akka.io/japi/akka/2.5/?akka/stream/javadsl/Flow.html">Flow</a></span><span class="group-scala">
@@ -75,13 +75,13 @@ class UnidocPluginSpec extends MarkdownBaseSpec {
75
75
}
76
76
77
77
it should " throw an exception when two matches found but javadsl/scaladsl is not in their packages" in {
78
- val thrown = the[IllegalStateException ] thrownBy markdown(" @unidoc [ActorRef]" )
78
+ val thrown = the[IllegalStateException ] thrownBy markdown(" @apidoc [ActorRef]" )
79
79
thrown.getMessage shouldEqual
80
- " 2 matches found for ActorRef, but not javadsl/scaladsl: akka.actor.ActorRef, akka.actor.typed.ActorRef. You may want to use the fully qualified class name as @unidoc [fqcn] instead of @unidoc [ActorRef]."
80
+ " 2 matches found for ActorRef, but not javadsl/scaladsl: akka.actor.ActorRef, akka.actor.typed.ActorRef. You may want to use the fully qualified class name as @apidoc [fqcn] instead of @apidoc [ActorRef]."
81
81
}
82
82
83
- it should " generate markdown correctly when fully qualified class name (fqcn) is specified as @unidoc [fqcn]" in {
84
- markdown(" @unidoc [akka.actor.ActorRef]" ) shouldEqual
83
+ it should " generate markdown correctly when fully qualified class name (fqcn) is specified as @apidoc [fqcn]" in {
84
+ markdown(" @apidoc [akka.actor.ActorRef]" ) shouldEqual
85
85
html(
86
86
""" <p><span class="group-scala">
87
87
|<a href="https://doc.akka.io/api/akka/2.5/akka/actor/ActorRef.html">ActorRef</a></span><span class="group-java">
@@ -91,13 +91,13 @@ class UnidocPluginSpec extends MarkdownBaseSpec {
91
91
}
92
92
93
93
it should " throw an exception when `.` is in the [label], but the label is not fqcn" in {
94
- val thrown = the[IllegalStateException ] thrownBy markdown(" @unidoc [actor.typed.ActorRef]" )
94
+ val thrown = the[IllegalStateException ] thrownBy markdown(" @apidoc [actor.typed.ActorRef]" )
95
95
thrown.getMessage shouldEqual
96
- " fqcn not found by @unidoc [actor.typed.ActorRef]"
96
+ " fqcn not found by @apidoc [actor.typed.ActorRef]"
97
97
}
98
98
99
99
it should " generate markdown correctly for a companion object" in {
100
- markdown(" @unidoc [ClusterClient$]" ) shouldEqual
100
+ markdown(" @apidoc [ClusterClient$]" ) shouldEqual
101
101
html(
102
102
""" <p><span class="group-scala">
103
103
|<a href="https://doc.akka.io/api/akka/2.5/akka/cluster/client/ClusterClient$.html">ClusterClient</a></span><span class="group-java">
@@ -107,7 +107,7 @@ class UnidocPluginSpec extends MarkdownBaseSpec {
107
107
}
108
108
109
109
it should " generate markdown correctly for type parameter and wildcard" in {
110
- markdown(" @unidoc [Source[ServerSentEvent, \\ _]]" ) shouldEqual
110
+ markdown(" @apidoc [Source[ServerSentEvent, \\ _]]" ) shouldEqual
111
111
html(
112
112
""" <p><span class="group-java">
113
113
|<a href="https://doc.akka.io/japi/akka/2.5/?akka/stream/javadsl/Source.html">Source<ServerSentEvent, ?></a></span><span class="group-scala">
@@ -117,7 +117,7 @@ class UnidocPluginSpec extends MarkdownBaseSpec {
117
117
}
118
118
119
119
it should " generate markdown correctly for type parameters with concrete names" in {
120
- markdown(" @unidoc [Flow[Message, Message, Mat]]" ) shouldEqual
120
+ markdown(" @apidoc [Flow[Message, Message, Mat]]" ) shouldEqual
121
121
html(
122
122
""" <p><span class="group-java">
123
123
|<a href="https://doc.akka.io/japi/akka/2.5/?akka/stream/javadsl/Flow.html">Flow<Message, Message, Mat></a></span><span class="group-scala">
@@ -127,7 +127,7 @@ class UnidocPluginSpec extends MarkdownBaseSpec {
127
127
}
128
128
129
129
it should " generate markdown correctly for nested type parameters" in {
130
- markdown(" @unidoc [Marshaller[Try[A], B]]" ) shouldEqual
130
+ markdown(" @apidoc [Marshaller[Try[A], B]]" ) shouldEqual
131
131
html(
132
132
""" <p><span class="group-java">
133
133
|<a href="https://doc.akka.io/japi/akka-http/current/?akka/http/javadsl/marshalling/Marshaller.html">Marshaller<Try<A>, B></a></span><span class="group-scala">
0 commit comments