-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0fd4b6f
commit 03c538c
Showing
3 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
paranamer/src/test/com/thoughtworks/paranamer/Issue39TestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.thoughtworks.paranamer; | ||
|
||
import org.junit.Test; | ||
|
||
import java.lang.reflect.Method; | ||
import java.time.LocalDate; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class Issue39TestCase { | ||
|
||
@Test | ||
public void jdk8u301_getParameterNames() throws Exception { | ||
Method method = LocalDate.class | ||
.getMethod("of", int.class, int.class, int.class); | ||
|
||
String[] names = JavadocParanamer.getParameterNames(method, "of", new Class[]{int.class, int.class, int.class}, "<!-- -->\n" + | ||
"</a>\n" + | ||
"<ul class=\"blockList\">\n" + | ||
"<li class=\"blockList\">\n" + | ||
"<h4>of</h4>\n" + | ||
"<pre>public static <a href=\"../../java/time/LocalDate.html\" title=\"class in java.time\">LocalDate</a> of(int year,\n" + | ||
" int month,\n" + | ||
" int dayOfMonth)</pre>\n" + | ||
"<div class=\"block\">Obtains an instance of <code>LocalDate</code> from a year, month and day.\n" + | ||
" <p>\n" + | ||
" This returns a <code>LocalDate</code> with the specified year, month and day-of-month.\n" + | ||
" The day must be valid for the year and month, otherwise an exception will be thrown.</div>\n" + | ||
"<dl>\n" + | ||
"<dt><span class=\"paramLabel\">Parameters:</span></dt>\n" + | ||
"<dd><code>year</code> - the year to represent, from MIN_YEAR to MAX_YEAR</dd>\n" + | ||
"<dd><code>month</code> - the month-of-year to represent, from 1 (January) to 12 (December)</dd>\n" + | ||
"<dd><code>dayOfMonth</code> - the day-of-month to represent, from 1 to 31</dd>\n" + | ||
"<dt><span class=\"returnLabel\">Returns:</span></dt>\n" + | ||
"<dd>the local date, not null</dd>\n" + | ||
"<dt><span class=\"throwsLabel\">Throws:</span></dt>\n" + | ||
"<dd><code><a href=\"../../java/time/DateTimeException.html\" title=\"class in java.time\">DateTimeException</a></code> - if the value of any field is out of range,\n" + | ||
" or if the day-of-month is invalid for the month-year</dd>\n" + | ||
"</dl>\n" + | ||
"</li>\n" + | ||
"</ul>\n" + | ||
"<a name=\"ofYearDay-int-int-\">\n" + | ||
"<!-- -->"); | ||
|
||
assertEquals(3, names.length); | ||
assertEquals("year", names[0]); | ||
assertEquals("month", names[1]); | ||
assertEquals("dayOfMonth", names[2]); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,8 +73,8 @@ | |
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.5.1</version> | ||
<configuration> | ||
<source>1.6</source> | ||
<target>1.6</target> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
paul-hammant
Author
Owner
|
||
</configuration> | ||
</plugin> | ||
<plugin> | ||
|
I have no qualms if you're ready to upgrade your library to Java 1.8 (1.6 is pretty ancient), though if this specific task is just for reading Java 8 Javadocs from HTML, it wouldn't matter if the library were still on an older version.