Giter VIP home page Giter VIP logo

mockito-eclipse-tools's People

Contributors

michalborek avatar wojciechszymik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mockito-eclipse-tools's Issues

NullPointerException on hasLocalFieldWithName

I always get a NullPointerException if it trigger the quickfix on a field:

java.lang.NullPointerException
    at pl.greenpath.mockito.ide.refactoring.assisst.MocksQuickAssistProcessor.hasLocalFieldWithName(MocksQuickAssistProcessor.java:119)
    at pl.greenpath.mockito.ide.refactoring.assisst.MocksQuickAssistProcessor.isConvertToSpyPossile(MocksQuickAssistProcessor.java:102)
    at pl.greenpath.mockito.ide.refactoring.assisst.MocksQuickAssistProcessor.getAssists(MocksQuickAssistProcessor.java:43)

I am using Eclipse 4.3 and pl.greenpath.mockito.ide.refactoring_1.2.0.201403042101.jar

Project is could not be build because of the missing website.

  1. clone
  2. mvn clean install
  3. error ...

[INFO] Fetching content.jar from http://download.eclipse.org/technology/m2e/releases/1.4/1.4.1.20140328-1905/ (0B of 19,77kB at 0B/s)
[INFO] Fetching content.jar from http://download.eclipse.org/technology/m2e/releases/1.4/1.4.0.20130601-0317/ (0B of 20,04kB at 0B/s)
[INFO] Adding repository http://eclipse.greenpath.pl/testing-artifacts
[ERROR] Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'testing-artifacts' from location http://eclipse.greenpath.pl/testing-artifacts: HTTP Server 'Bad Gateway' : http://eclipse.greenpath.pl/testing-artifacts/content.xml: HttpComponents connection error response code 502. -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'testing-artifacts' from location http://eclipse.greenpath.pl/testing-artifacts
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:122)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
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 org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.RuntimeException: Failed to load p2 repository with ID 'testing-artifacts' from location http://eclipse.greenpath.pl/testing-artifacts
at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.loadMetadataRepository(TargetPlatformFactoryImpl.java:296)
at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.gatherExternalInstallableUnits(TargetPlatformFactoryImpl.java:266)
at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:164)
at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:117)
at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:1)
at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.computeTargetPlatform(P2TargetPlatformResolver.java:214)
at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.resolveProject(DefaultTychoDependencyResolver.java:100)
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:75)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:267)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
... 11 more
Caused by: org.eclipse.equinox.p2.core.ProvisionException: HTTP Server 'Bad Gateway' : http://eclipse.greenpath.pl/testing-artifacts/content.xml
at org.eclipse.equinox.internal.p2.repository.CacheManager.createCache(CacheManager.java:192)
at org.eclipse.tycho.p2.remote.RemoteRepositoryCacheManager.createCache(RemoteRepositoryCacheManager.java:66)
at org.eclipse.equinox.internal.p2.metadata.repository.SimpleMetadataRepositoryFactory.getLocalFile(SimpleMetadataRepositoryFactory.java:66)
at org.eclipse.equinox.internal.p2.metadata.repository.SimpleMetadataRepositoryFactory.load(SimpleMetadataRepositoryFactory.java:88)
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.factoryLoad(MetadataRepositoryManager.java:57)
at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:768)
at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:668)
at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:96)
at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.loadRepository(RemoteMetadataRepositoryManager.java:59)
at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.loadRepository(RemoteMetadataRepositoryManager.java:52)
at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.loadMetadataRepository(TargetPlatformFactoryImpl.java:292)
... 21 more
Caused by: org.eclipse.ecf.filetransfer.BrowseFileTransferException: HttpComponents connection error response code 502.
at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:293)
at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:69)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException

Improper convert to recording when nested methods are invoked

Improperly converted statement:

bindingResolver.resolve(Mockito.any(AbstractTypeDeclaration.class)); 

becomes:

when(Mockito.any(AbstractTypeDeclaration.class)).thenReturn();

should be:

when( bindingResolver.resolve(Mockito.any(AbstractTypeDeclaration.class))).thenReturn();

Convert local mock to field one.

It should be possible to convert

Object someMock = mock(Object.class);

into:

@Mock
Object someMock;

additionally it is good to have conversion from:

Object someMock = mock(Object.class, withSettings().extraInterfaces(A.class, B.class);

into:

@Mock(extraInterfaces = { A.class, B.class})
Object someMock;

Convert object to mock

It should be able to convert certain object to mock.

E.g.
Before: SomeClass object = new SomeClass();

after:
Either: @mock SomeClass object;
Or: SomeClass object = mock(SomeClass.class);

Introduce proper logging

Everything unusual should be logged. Now exceptional cases are printing out to the console which is not so pretty.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.