-
Notifications
You must be signed in to change notification settings - Fork 64
Doclet Type detection fix + tests #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
effd0da
50d123c
97031e6
675ed94
60f154e
99b4e87
3538b7a
fde965e
d2d85a3
8301bf6
21e82d3
f050780
fef5efe
b975f8e
f1b0ba7
937297a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,27 +30,20 @@ public void XmlDeclaration_FixedUpFromDocumentation() | |
| } | ||
|
|
||
| [Test] | ||
| public void XmlDeclaration_FixedUpFromApiXmlDocumentation() | ||
| public void XmlDeclaration_FixedUpFromApiXmlDocumentation () | ||
| { | ||
| string tempFile = null; | ||
|
|
||
| try | ||
| { | ||
| tempFile = Path.GetTempFileName(); | ||
| File.WriteAllText(tempFile, LoadString("ParameterFixupApiXmlDocs.xml")); | ||
| try { | ||
| tempFile = LoadToTempFile ("ParameterFixupApiXmlDocs.xml"); | ||
|
|
||
| AssertXmlDeclaration("Collection.class", "ParameterFixupFromDocs.xml", tempFile, Bytecode.JavaDocletType._ApiXml); | ||
| } | ||
| catch (Exception ex) | ||
| { | ||
| try | ||
| { | ||
| if (File.Exists(tempFile)) | ||
| File.Delete(tempFile); | ||
| AssertXmlDeclaration ("Collection.class", "ParameterFixupFromDocs.xml", tempFile); | ||
| } finally { | ||
| try { | ||
| if (File.Exists (tempFile)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shouldn't be in the |
||
| File.Delete (tempFile); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shouldn't need to be wrapped in try/catch. |
||
| } | ||
| catch { } | ||
|
|
||
| Assert.Fail("An unexpected exception was thrown : {0}", ex); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -63,6 +56,42 @@ public void XmlDeclaration_DoesNotThrowAnExceptionIfDocumentationNotFound () | |
| Assert.Fail ("An unexpected exception was thrown : {0}", ex); | ||
| } | ||
| } | ||
|
|
||
| [Test] | ||
| public void DocletType_ShouldDetectApiXml () | ||
| { | ||
| string tempFile = null; | ||
|
|
||
| try { | ||
| tempFile = LoadToTempFile ("ParameterFixupApiXmlDocs.xml"); | ||
|
|
||
| AssertDocletType (tempFile, Bytecode.JavaDocletType._ApiXml); | ||
| } finally { | ||
| try { | ||
| if (File.Exists (tempFile)) | ||
| File.Delete (tempFile); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We shouldn't need to wrap this in try/catch. |
||
| } | ||
| catch { } | ||
| } | ||
| } | ||
|
|
||
| [Test] | ||
| public void DocletType_ShouldDetectDroidDocs () | ||
| { | ||
| var androidSdkPath = Environment.GetEnvironmentVariable ("ANDROID_SDK_PATH"); | ||
| if (string.IsNullOrEmpty (androidSdkPath)) { | ||
| Assert.Ignore("The `ANDROID_SDK_PATH` environment variable isn't set; " + | ||
| "cannot test importing parameter names from HTML. Skipping..."); | ||
| return; | ||
| } | ||
|
|
||
| var droidDocsPath = Path.Combine (androidSdkPath, "docs", "reference"); | ||
|
|
||
| if (!Directory.Exists (droidDocsPath)) | ||
| Assert.Fail("The Android SDK Documentation path `{0}` was not found.", droidDocsPath); | ||
|
|
||
| AssertDocletType (droidDocsPath, Bytecode.JavaDocletType.DroidDoc2); | ||
| } | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be made
static, and moved toAndroidDocScraper.