Re: Warnings plugin extension: how to make it show up and to define input log file

2017-06-07 Thread Simon Matthews
I really appreciate the help you have given me.

However, my plugin extension is still not working.

I updated my git repository: https://github.com/SimonMatthews-BP/BPWarnings

The Jenkins log shows the following error:


Jun 07, 2017 6:54:02 PM
hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
WARNING: Failed to instantiate
Key[type=hudson.plugins.bluepearl.RunBluePearlParser,
annotation=[none]]; skipping this component
com.google.inject.ProvisionException: Unable to provision, see the
following errors:

1) Error injecting constructor, java.lang.NoSuchMethodError:
hudson.plugins.warnings.parser.Messages._Warnings_runbluepearl_ParserName()Lorg/jvnet/localizer/Localizable;
  at 
hudson.plugins.bluepearl.RunBluePearlParser.(RunBluePearlParser.java:44)

1 error
at 
com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
at 
hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:424)
at 
com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
at 
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:386)
at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:377)
at 
hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:477)
at hudson.ExtensionList.load(ExtensionList.java:365)
at hudson.ExtensionList.ensureLoaded(ExtensionList.java:303)
at hudson.ExtensionList.iterator(ExtensionList.java:157)
at 
hudson.plugins.warnings.parser.ParserRegistry.addParsersWithDeprecatedApi(ParserRegistry.java:69)
at hudson.plugins.warnings.parser.ParserRegistry.all(ParserRegistry.java:62)
at 
hudson.plugins.warnings.parser.ParserRegistry.getAllParsers(ParserRegistry.java:209)
at 
hudson.plugins.warnings.parser.ParserRegistry.getParsers(ParserRegistry.java:169)
at 
hudson.plugins.warnings.parser.ParserRegistry.getParsers(ParserRegistry.java:139)
at 
hudson.plugins.warnings.parser.ParserRegistry.exists(ParserRegistry.java:186)
at 
hudson.plugins.warnings.WarningsPublisher.replaceConsoleParsersWithChangedName(WarningsPublisher.java:214)
at 
hudson.plugins.warnings.WarningsPublisher.readResolve(WarningsPublisher.java:204)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callReadResolve(SerializationMethodInvoker.java:66)
at 
hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:271)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at 
com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at 
com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
at 
hudson.util.CopyOnWriteList$ConverterImpl.unmarshal(CopyOnWriteList.java:197)
at 
hudson.util.DescribableList$ConverterImpl.unmarshal(DescribableList.java:273)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at 
com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at 
hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:393)
at 
hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:331)
at 
hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:270)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at 
com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
at 

Re: Test failures on new plugin ** Update ** Still issue with @Override

2017-06-06 Thread Simon Matthews
Finally, I got it to pas the tests. I added the following to  the
dependencies in pom.xml:

  org.apache.httpcomponents
  httpclient
  4.5.1
  test


  org.apache.httpcomponents 
 httpcore 
  4.4.6
  test


However, it still won't accept the "@Override" for "getID()". I don't
know if this is a problem.

Simon

On Tue, Jun 6, 2017 at 3:22 PM, Simon M  wrote:
> I should also note, just in case it is related that it would not build
> unless I commented out the "@Override" statement for the "getID()" method.
> Could this be related?
>
> Failed to execute goal
> org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile)
> on project bluepearl: Compilation failure
> [ERROR]
> /home/simon/Plugins/BluePearlParser/src/main/java/hudson/plugins/bluepearl/RunBluePearlParser.java:[40,5]
> method does not override or implement a method from a supertype
>
> Line 40 is the @Override statement.
>
> Simon
>
> On Monday, June 5, 2017 at 5:45:51 PM UTC-7, Simon M wrote:
>>
>> I am in the process of writing a custom parser to work with the Warnings
>> plugin.
>>
>> For now, I have taken the second route described in the documentation:
>> "Writing a new standalone parser that will be deployed in a new plug-in". I
>> have written the appropriate code to extend RegexpLineParser. I may come
>> back to that later, but for now, I am working with extending
>> RegexpLineParser.
>>
>> This now compiles, but fails during test. I have not defined any tests: I
>> assume it's a default test that is run. Note that this is a different
>> approach to what I was trying to do last week.
>>
>> I would appreciate advice on what I need to do to resolve this.
>>
>>
>> The message is:
>> Running InjectedTest
>> Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 11.704 sec
>> <<< FAILURE! - in InjectedTest
>>
>> org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite(org.jvnet.hudson.test.junit.FailedTest)
>> Time elapsed: 0.016 sec  <<< ERROR!
>> java.lang.NoClassDefFoundError: org/apache/http/config/Lookup
>> at
>> com.gargoylesoftware.htmlunit.WebClient.createWebConnection(WebClient.java:1956)
>> at com.gargoylesoftware.htmlunit.WebClient.init(WebClient.java:236)
>> at com.gargoylesoftware.htmlunit.WebClient.(WebClient.java:211)
>> at
>> org.jvnet.hudson.test.HudsonTestCase$WebClient.(HudsonTestCase.java:1486)
>> at
>> org.jvnet.hudson.test.HudsonTestCase.createWebClient(HudsonTestCase.java:1473)
>> at
>> org.jvnet.hudson.test.HudsonTestCase.executeOnServer(HudsonTestCase.java:1458)
>> at
>> org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite.runGroupedTests(JellyTestSuiteBuilder.java:157)
>> at org.jvnet.hudson.test.junit.GroupedTest.run(GroupedTest.java:51)
>> at junit.framework.TestSuite.runTest(TestSuite.java:252)
>> at junit.framework.TestSuite.run(TestSuite.java:247)
>> at
>> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
>> at
>> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
>> at
>> org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
>> at
>> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
>> at
>> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
>> at
>> org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
>> at
>> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
>> at
>> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
>> Caused by: java.lang.ClassNotFoundException: org.apache.http.config.Lookup
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>> at
>> com.gargoylesoftware.htmlunit.WebClient.createWebConnection(WebClient.java:1956)
>> at com.gargoylesoftware.htmlunit.WebClient.init(WebClient.java:236)
>> at com.gargoylesoftware.htmlunit.WebClient.(WebClient.java:211)
>> at
>> org.jvnet.hudson.test.HudsonTestCase$WebClient.(HudsonTestCase.java:1486)
>> at
>> org.jvnet.hudson.test.HudsonTestCase.createWebClient(HudsonTestCase.java:1473)
>> at
>> org.jvnet.hudson.test.HudsonTestCase.executeOnServer(HudsonTestCase.java:1458)
>> at
>> org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite.runGroupedTests(JellyTestSuiteBuilder.java:157)
>> at org.jvnet.hudson.test.junit.GroupedTest.run(GroupedTest.java:51)
>> at junit.framework.TestSuite.runTest(TestSuite.java:252)
>> at junit.framework.TestSuite.run(TestSuite.java:247)
>> at
>>