Giter Site home page Giter Site logo

wrdv / testme-idea Goto Github PK

View Code? Open in Web Editor NEW
161.0 17.0 64.0 1.84 MB

TestMe IntelliJ IDEA Plugin - Auto generates Unit Test code

Home Page: http://weirddev.com/testme

License: Other

Java 82.73% HTML 1.18% Groovy 13.72% Shell 0.03% Scala 2.26% Lex 0.10%
intellij-plugin unit-testing code-generation

testme-idea's Introduction

TestMe IntelliJ Plugin

Build Status coverage Downloads Rating Version

Auto Generate Unit Tests in Java, Groovy or Scala. No more boilerplate!

Main Features

  • Auto generate Java, Scala or Groovy test code with JUnit 4/5, TestNG, Spock or Specs2 frameworks
  • Auto generate Mockito mocks
  • Generate test params and assertion statements
  • Generate relevant mocked return statements
  • Integrates with IDEA menus: Code->TestMe, Code->Generate

For a more detailed documentation, please refer to https://weirddev.com/testme/

Installation/Usage

Installation available from JetBrains plugins repository:

  1. From IDEA menu: Preferences (Ctrl+Shift+S,⌘+,) -> Plugins -> Browse repositories... -> Search: TestMe -> Install Plugin
  2. Restart IDEA.

Issue Tracking

Issues and feature requests are welcomed at TestMe project forum

Contributing/Developing

Please refer to CONTRIBUTING.md file.

License

Copyright (c) 2017 - 2024 WeirdDev. Licensed for free usage under the terms and conditions of AGPLv3 - GNU Affero General Public License v3.

testme-idea's People

Contributors

huangliang992 avatar karlmatti avatar wuweiran avatar yaronyam avatar zhangfj88 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

testme-idea's Issues

@superbuilder(lombok) can make testme code generator error

@DaTa
@SuperBuilder
public class A {
private String name;
}

@DaTa
@SuperBuilder
public class B extends A {
private String name1;
}

// test class
public class TestCase {

public boolean testCase(String[] args) {
    B b = B.builder().name("name").name1("name1").build();
    return false;
}

}

The above situation will cause “testme” to make the following mistakes:

java.lang.NullPointerException: Cannot invoke "String.replace(java.lang.CharSequence, java.lang.CharSequence)" because "typeName" is null
at com.weirddev.testme.intellij.utils.ClassNameUtils.stripArrayVarargsDesignator(ClassNameUtils.java:40)
at com.weirddev.testme.intellij.template.context.Field.(Field.java:64)
at com.weirddev.testme.intellij.template.context.Type.resolveFields(Type.java:254)
at com.weirddev.testme.intellij.template.context.Type.resolveDependencies(Type.java:240)
at com.weirddev.testme.intellij.template.TypeDictionary.getTypeInternal(TypeDictionary.java:150)
at com.weirddev.testme.intellij.template.TypeDictionary.getType(TypeDictionary.java:135)
at com.weirddev.testme.intellij.builder.MethodFactory.resolveReturnType(MethodFactory.java:134)
at com.weirddev.testme.intellij.builder.MethodFactory.createMethod(MethodFactory.java:58)
at com.weirddev.testme.intellij.builder.MethodFactory.resolveCalledMethods(MethodFactory.java:118)
at com.weirddev.testme.intellij.builder.MethodFactory.resolveInternalReferences(MethodFactory.java:67)
at com.weirddev.testme.intellij.template.context.Type.resolveDependencies(Type.java:234)
at com.weirddev.testme.intellij.template.TypeDictionary.getTypeInternal(TypeDictionary.java:150)
at com.weirddev.testme.intellij.template.TypeDictionary.getType(TypeDictionary.java:126)
at com.weirddev.testme.intellij.generator.TestTemplateContextBuilder.build(TestTemplateContextBuilder.java:56)
at com.weirddev.testme.intellij.generator.TestMeGenerator.createTestClassFromCodeTemplate(TestMeGenerator.java:120)
at com.weirddev.testme.intellij.generator.TestMeGenerator.createTestClass(TestMeGenerator.java:110)
at com.weirddev.testme.intellij.generator.TestMeGenerator$1$1.compute(TestMeGenerator.java:66)
at com.weirddev.testme.intellij.generator.TestMeGenerator$1$1.compute(TestMeGenerator.java:61)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$runWriteAction$9(ApplicationImpl.java:1001)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:980)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1001)
at com.weirddev.testme.intellij.generator.TestMeGenerator$1.compute(TestMeGenerator.java:61)
at com.weirddev.testme.intellij.generator.TestMeGenerator$1.compute(TestMeGenerator.java:59)
at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.postponeFormattingInside(PostprocessReformattingAspectImpl.java:149)
at com.weirddev.testme.intellij.generator.TestMeGenerator.generateTest(TestMeGenerator.java:59)
at com.weirddev.testme.intellij.action.CreateTestMeAction$1.run(CreateTestMeAction.java:134)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:174)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:164)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:150)
at com.weirddev.testme.intellij.action.CreateTestMeAction.createTest(CreateTestMeAction.java:131)
at com.weirddev.testme.intellij.action.TestMeCreator.invoke(TestMeCreator.java:36)
at com.weirddev.testme.intellij.action.TestMeCreator.createTest(TestMeCreator.java:26)
at com.weirddev.testme.intellij.action.TestMeAdditionalAction.execute(TestMeAdditionalAction.java:53)
at com.weirddev.testme.intellij.ui.popup.TestMePopUpHandler.lambda$show$1(TestMePopUpHandler.java:127)
at com.intellij.openapi.ui.popup.PopupChooserBuilder.lambda$setItemChosenCallback$0(PopupChooserBuilder.java:207)
at com.intellij.ui.popup.AbstractPopup.lambda$dispose$18(AbstractPopup.java:1625)
at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$doWhenFocusSettlesDown$3(FocusManagerImpl.java:173)
at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:33)
at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.kt:210)
at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.kt:176)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:169)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:163)
at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1623)
at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:129)
at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:161)
at com.intellij.openapi.util.Disposer.dispose(Disposer.java:262)
at com.intellij.ui.popup.AbstractPopup.cancel(AbstractPopup.java:892)
at com.intellij.ui.popup.AbstractPopup.closeOk(AbstractPopup.java:827)
at com.intellij.openapi.ui.popup.PopupChooserBuilder.closePopup(PopupChooserBuilder.java:501)
at com.intellij.openapi.ui.popup.PopupChooserBuilder$2.actionPerformed(PopupChooserBuilder.java:490)
at java.desktop/javax.swing.JComponent$ActionStandin.actionPerformed(JComponent.java:3486)
at java.desktop/javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1810)
at java.desktop/javax.swing.JComponent.processKeyBinding(JComponent.java:2943)
at java.desktop/javax.swing.JComponent.processKeyBindings(JComponent.java:3005)
at java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2905)
at java.desktop/java.awt.Component.processEvent(Component.java:6434)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:886)
at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1166)
at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1023)
at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:849)
at com.intellij.ide.IdeKeyboardFocusManager.access$dispatchEvent$s1569605750(IdeKeyboardFocusManager.kt:18)
at com.intellij.ide.IdeKeyboardFocusManager$dispatchEvent$1.invoke(IdeKeyboardFocusManager.kt:25)
at com.intellij.ide.IdeKeyboardFocusManager$dispatchEvent$1.invoke(IdeKeyboardFocusManager.kt:25)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:992)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:992)
at com.intellij.ide.IdeKeyboardFocusManager.dispatchEvent(IdeKeyboardFocusManager.kt:25)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4904)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2808)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:794)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:766)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:764)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:763)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:685)
at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.kt:620)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:587)
at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:992)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:992)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

please help.

issues with test generation for single method

Found some issues with test generation for single method

1st issue
A. try to generate UT for method (cursor on method) that already has a UT that is not named as <className>Test -
error alert pops with NPE - PSB stack trace. empty test class generated
B. try to generate UT for method (cursor on method) that already has an empty UT class (without any methods or imports) getting error alert

2024-05-20 22:09:00,087 [  50197] SEVERE - com.weirddev.testme.intellij.generator.TestMeGenerator - error generating test class
java.lang.NullPointerException
	at java.base/java.util.Objects.requireNonNull(Objects.java:209)
	at java.base/java.util.ImmutableCollections$List12.<init>(ImmutableCollections.java:556)
	at java.base/java.util.List.of(List.java:812)
	at com.weirddev.testme.intellij.utils.TestFileUpdateUtil.getPsiTestFile(TestFileUpdateUtil.java:39)
	at com.weirddev.testme.intellij.utils.TestFileUpdateUtil.generateOrUpdateTestFile(TestFileUpdateUtil.java:53)
	at com.weirddev.testme.intellij.generator.TestMeGenerator.createTestClassFromCodeTemplate(TestMeGenerator.java:140)
	at com.weirddev.testme.intellij.generator.TestMeGenerator.createTestClass(TestMeGenerator.java:110)
	at com.weirddev.testme.intellij.generator.TestMeGenerator$1$1.compute(TestMeGenerator.java:66)
	at com.weirddev.testme.intellij.generator.TestMeGenerator$1$1.compute(TestMeGenerator.java:61)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$runWriteAction$9(ApplicationImpl.java:1001)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:980)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1001)
	at com.weirddev.testme.intellij.generator.TestMeGenerator$1.compute(TestMeGenerator.java:61)
	at com.weirddev.testme.intellij.generator.TestMeGenerator$1.compute(TestMeGenerator.java:59)
	at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.postponeFormattingInside(PostprocessReformattingAspectImpl.java:149)
	at com.weirddev.testme.intellij.generator.TestMeGenerator.generateTest(TestMeGenerator.java:59)
	at com.weirddev.testme.intellij.action.CreateTestMeAction$1.run(CreateTestMeAction.java:142)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:174)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:164)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:150)
	at com.weirddev.testme.intellij.action.CreateTestMeAction.invoke(CreateTestMeAction.java:139)
	at com.weirddev.testme.intellij.action.TestMeCreator.invoke(TestMeCreator.java:35)
	at com.weirddev.testme.intellij.action.TestMeCreator.createTest(TestMeCreator.java:25)
	at com.weirddev.testme.intellij.action.TestMeAdditionalAction.execute(TestMeAdditionalAction.java:49)
	at com.weirddev.testme.intellij.ui.popup.TestMePopUpHandler.lambda$show$1(TestMePopUpHandler.java:99)
	at com.intellij.openapi.ui.popup.PopupChooserBuilder.lambda$setItemChosenCallback$0(PopupChooserBuilder.java:207)

2nd issue
added test method doesn't consider target language. to reproduce: generate UT in lang A(i.e. Java) , place cursor on test method, select a template for lang B( i.e Groovy). test method in lang B added to UT in lang A.

also found this error in logs. didn't notice if it was raised right after test scenario described above

2024-05-20 22:16:59,163 [ 529273] SEVERE - com.weirddev.testme.intellij.generator.TestMeGenerator - error generating test class
java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 0
	at com.weirddev.testme.intellij.utils.TestFileUpdateUtil.getImportStartElementToAdd(TestFileUpdateUtil.java:201)
	at com.weirddev.testme.intellij.utils.TestFileUpdateUtil.generateOrUpdateTestFile(TestFileUpdateUtil.java:67)
	at com.weirddev.testme.intellij.generator.TestMeGenerator.createTestClassFromCodeTemplate(TestMeGenerator.java:140)
	at com.weirddev.testme.intellij.generator.TestMeGenerator.createTestClass(TestMeGenerator.java:110)
	at com.weirddev.testme.intellij.generator.TestMeGenerator$1$1.compute(TestMeGenerator.java:66)
	at com.weirddev.testme.intellij.generator.TestMeGenerator$1$1.compute(TestMeGenerator.java:61)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$runWriteAction$9(ApplicationImpl.java:1001)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:980)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1001)
	at com.weirddev.testme.intellij.generator.TestMeGenerator$1.compute(TestMeGenerator.java:61)
	at com.weirddev.testme.intellij.generator.TestMeGenerator$1.compute(TestMeGenerator.java:59)
	at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.postponeFormattingInside(PostprocessReformattingAspectImpl.java:149)
	at com.weirddev.testme.intellij.generator.TestMeGenerator.generateTest(TestMeGenerator.java:59)
	at com.weirddev.testme.intellij.action.CreateTestMeAction$1.run(CreateTestMeAction.java:142)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:174)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:164)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:150)
	at com.weirddev.testme.intellij.action.CreateTestMeAction.invoke(CreateTestMeAction.java:139)
	at com.weirddev.testme.intellij.action.TestMeCreator.invoke(TestMeCreator.java:35)
	at com.weirddev.testme.intellij.action.TestMeCreator.createTest(TestMeCreator.java:25)
	at com.weirddev.testme.intellij.action.TestMeAdditionalAction.execute(TestMeAdditionalAction.java:49)
	at com.weirddev.testme.intellij.ui.popup.TestMePopUpHandler.lambda$show$1(TestMePopUpHandler.java:99)
	at com.intellij.openapi.ui.popup.PopupChooserBuilder.lambda$setItemChosenCallback$0(PopupChooserBuilder.java:207)
	at com.intellij.ui.popup.AbstractPopup.lambda$dispose$18(AbstractPopup.java:1636)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$doWhenFocusSettlesDown$3(FocusManagerImpl.java:173)

Bumped into other issues as well...but could not reproduce after clearing some UT's on simple setting. More testing required on more use cases. also think it would be very useful to add integration testing.
As mentioned previously, UX feels awkward when behavior is different if cursor is on/off a test method name and if UT exists or not. think it would be good to support this feature as an Intention
FYI @huangliang992 Thanks

when "Declare exceptions thrown by tested class" setting is on - test code exceptions should be taken into account

When Setting "Declare exceptions thrown by tested class" is set and no exception declared by tested method - still need to consider exceptions declared by test code methods
For instance, this Powermock SDK method - org.powermock.api.mockito.expectation.PowerMockitoStubber#when(T, java.lang.String, java.lang.Object...) - declares an exception

image

can be tested with com.weirddev.testme.intellij.generator.TestMeGeneratorJunit4PowerMockTest#testRenderInternalMethodCallStubs
we probably need to add some logic in Mock builder to decide if throws Exception should be declared even though tested method does not.

related to #29
FYI @zhangfj88

Prioritize Custom Templates in Template Selection

I propose prioritizing custom templates over default ones in the template selection process within the plugin. Currently, when creating a test for a .java class, the available templates are listed with default ones appearing first, followed by custom templates. This arrangement necessitates an additional step to select frequently used custom templates from the bottom of the list.

By reordering the sorting so that custom templates appear first, users can quickly access their preferred templates without the need for extra navigation. This adjustment would streamline the template selection process and enhance user efficiency.

I am prepared to implement this change and submit a pull request upon approval.

Improving CONTRIBUTING.md for Generating Proper JAR File

Hi there,

I've been using this plugin for a few months and now I want to contribute to the project. But, I'm stuck trying to build the right JAR file needed for local use. Can someone please update the CONTRIBUTING.md file to explain how to do this?

Right now, the instructions say to run a task called runIdea, but it doesn't exist. The closest thing I found is runIde, but I'm not sure if that's what I need because I just want to create the JAR file, not download a new version of IntelliJ.

There's also a task called buildNeeded which seems close to what I need, but it needs some extra stuff like META-INF to be a working version.

Thanks for any help you can provide!

v6.4.1 incompatible with IDEA 2024.2.EAP

following compilation issues of latest version against IDEA 2024.2 EAP:

Invocation of unresolved constructor DefaultTemplate.<init>(String, String, URL, URL) (2 problems)

  • Method FTFolderManager.loadDefaultsFromRoot() contains an invokespecial instruction referencing an unresolved constructor DefaultTemplate.<init>(String, String, URL, URL). This can lead to NoSuchMethodError exception at runtime.
  • Method FileTemplatesLoader.loadDefaultsFromRoot(...) contains an invokespecial instruction referencing an unresolved constructor DefaultTemplate.<init>(String, String, URL, URL). This can lead to NoSuchMethodError exception at runtime.

Invocation of unresolved method DefaultTemplate.getTemplateURL() (1 problem)

  • Method FTManager.createAndStoreBundledTemplate(...) contains an invokevirtual instruction referencing an unresolved method DefaultTemplate.getTemplateURL(). This can lead to NoSuchMethodError exception at runtime.

Exception Thrown When Generating Test Cases for an Interface

I encountered an exception while using the TestMe plugin to generate test cases for an interface.
Additionally, I would like to mention that this issue does not affect usability, but I am reporting it for further investigation and improvement.

The exception details are as follows:

  • TestMe(5.1.0)
  • IDEA Build #IU-231.9414.13, built on February 14, 2024

Thank you for your assistance!

java.lang.Throwable: Assertion failed: class org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GrMethodWrapper
	at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:258)
	at com.intellij.codeInsight.CodeInsightUtil.positionCursor(CodeInsightUtil.java:273)
	at com.weirddev.testme.intellij.generator.TestMeGenerator$1$1.compute(TestMeGenerator.java:72)
	at com.weirddev.testme.intellij.generator.TestMeGenerator$1$1.compute(TestMeGenerator.java:58)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$runWriteAction$8(ApplicationImpl.java:965)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:944)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:965)
	at com.weirddev.testme.intellij.generator.TestMeGenerator$1.compute(TestMeGenerator.java:58)
	at com.weirddev.testme.intellij.generator.TestMeGenerator$1.compute(TestMeGenerator.java:56)
	at com.intellij.psi.impl.source.PostprocessReformattingAspect.postponeFormattingInside(PostprocessReformattingAspect.java:148)
	at com.weirddev.testme.intellij.generator.TestMeGenerator.generateTest(TestMeGenerator.java:56)
	at com.weirddev.testme.intellij.action.CreateTestMeAction$1.run(CreateTestMeAction.java:115)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:174)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:164)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:150)
	at com.weirddev.testme.intellij.action.CreateTestMeAction.invoke(CreateTestMeAction.java:112)
	at com.weirddev.testme.intellij.action.TestMeCreator.invoke(TestMeCreator.java:35)
	at com.weirddev.testme.intellij.action.TestMeCreator.createTest(TestMeCreator.java:25)
	at com.weirddev.testme.intellij.action.TestMeAdditionalAction.execute(TestMeAdditionalAction.java:49)
	at com.weirddev.testme.intellij.ui.popup.TestMePopUpHandler$3.run(TestMePopUpHandler.java:111)
	at com.intellij.ui.popup.AbstractPopup.lambda$dispose$17(AbstractPopup.java:1618)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$doWhenFocusSettlesDown$3(FocusManagerImpl.java:172)
	at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:33)
	at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.kt:187)
	at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.kt:153)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:168)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:162)
	at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1616)
	at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:127)
	at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:159)
	at com.intellij.openapi.util.Disposer.dispose(Disposer.java:264)
	at com.intellij.ui.popup.AbstractPopup.cancel(AbstractPopup.java:868)
	at com.intellij.ui.popup.AbstractPopup.closeOk(AbstractPopup.java:803)
	at com.intellij.openapi.ui.popup.PopupChooserBuilder.closePopup(PopupChooserBuilder.java:489)
	at com.intellij.openapi.ui.popup.PopupChooserBuilder$2.actionPerformed(PopupChooserBuilder.java:478)
	at java.desktop/javax.swing.JComponent$ActionStandin.actionPerformed(JComponent.java:3486)
	at java.desktop/javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1810)
	at java.desktop/javax.swing.JComponent.processKeyBinding(JComponent.java:2943)
	at java.desktop/javax.swing.JComponent.processKeyBindings(JComponent.java:3005)
	at java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2905)
	at java.desktop/java.awt.Component.processEvent(Component.java:6433)
	at java.desktop/java.awt.Container.processEvent(Container.java:2266)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
	at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1953)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:886)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1166)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1023)
	at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:849)
	at com.intellij.ide.IdeKeyboardFocusManager.access$dispatchEvent$s1569605750(IdeKeyboardFocusManager.kt:18)
	at com.intellij.ide.IdeKeyboardFocusManager$dispatchEvent$1.invoke(IdeKeyboardFocusManager.kt:25)
	at com.intellij.ide.IdeKeyboardFocusManager$dispatchEvent$1.invoke(IdeKeyboardFocusManager.kt:25)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:995)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:995)
	at com.intellij.ide.IdeKeyboardFocusManager.dispatchEvent(IdeKeyboardFocusManager.kt:25)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4903)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2804)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:793)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:738)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:730)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:765)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:763)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:762)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:667)
	at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.kt:602)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:569)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:68)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:349)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:348)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:348)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:343)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:995)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:995)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$4(IdeEventQueue.kt:343)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:829)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:385)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

V6.5.0.eap incompatible with IDEA 2024.1

on IDEA 2024.1 , intentions do not open.
related to #39 , due to usage of GenerateMissedTestsAction class that became final in 2024.1
logged error:

com.intellij.diagnostic.PluginException: Cannot load class com.weirddev.testme.intellij.intention.CreateTestForMethodIntention (
  error: class com.weirddev.testme.intellij.intention.CreateTestForMethodIntention cannot inherit from final class com.intellij.testIntegration.createTest.GenerateMissedTestsAction,
  classLoader=PluginClassLoader(plugin=PluginDescriptor(name=TestMe, id=com.weirddev.testme, descriptorPath=plugin.xml, path=~\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\241.14494.240.plugins\TestMe, version=6.5.0.eap, package=null, isBundled=false), packagePrefix=null, state=active)
)
	at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.kt:331)
	at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.kt:178)
	at com.intellij.serviceContainer.ComponentManagerImplKt.doLoadClass(ComponentManagerImpl.kt:1466)
	at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClass(ComponentManagerImpl.kt:943)
	at com.intellij.serviceContainer.LazyExtensionInstance.createInstance(LazyExtensionInstance.java:55)
	at com.intellij.serviceContainer.LazyExtensionInstance.getInstance(LazyExtensionInstance.java:44)
	at com.intellij.serviceContainer.BaseKeyedLazyInstance.getInstance(BaseKeyedLazyInstance.java:38)
	at com.intellij.codeInsight.intention.impl.config.IntentionActionWrapper.getDelegate(IntentionActionWrapper.java:115)
	at com.intellij.codeInsight.intention.impl.config.IntentionActionWrapper.getFamilyName(IntentionActionWrapper.java:55)
	at com.intellij.codeInsight.intention.impl.config.IntentionActionMetaData.getFamily(IntentionActionMetaData.java:43)
	at com.intellij.codeInsight.intention.impl.config.IntentionsMetadataService.getUniqueMetadata(IntentionsMetadataService.kt:98)
	at com.intellij.codeInsight.intention.impl.config.IntentionManagerSettings.getMetaData(IntentionManagerSettings.kt:50)
	at com.intellij.codeInsight.intention.impl.config.IntentionManagerSettings$IntentionSearchableOptionContributor.processOptions(IntentionManagerSettings.kt:82)
	at com.intellij.ide.ui.search.SearchableOptionsRegistrarImpl.lambda$initialize$0(SearchableOptionsRegistrarImpl.java:137)
	at com.intellij.openapi.extensions.ExtensionPointName.forEachExtensionSafe(ExtensionPointName.kt:61)
	at com.intellij.ide.ui.search.SearchableOptionsRegistrarImpl.initialize(SearchableOptionsRegistrarImpl.java:137)
	at com.intellij.ide.ui.search.SearchableOptionsRegistrarImpl.getAcceptableDescriptions(SearchableOptionsRegistrarImpl.java:464)
	at com.intellij.ide.util.gotoByName.ActionAsyncProvider$optionsFlow$1.invokeSuspend(ActionAsyncProvider.kt:284)
	at com.intellij.ide.util.gotoByName.ActionAsyncProvider$optionsFlow$1.invoke(ActionAsyncProvider.kt)
	at com.intellij.ide.util.gotoByName.ActionAsyncProvider$optionsFlow$1.invoke(ActionAsyncProvider.kt)
	at kotlinx.coroutines.flow.ChannelFlowBuilder.collectTo$suspendImpl(Builders.kt:320)
	at kotlinx.coroutines.flow.ChannelFlowBuilder.collectTo(Builders.kt)
	at kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(ChannelFlow.kt:60)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by: java.lang.IncompatibleClassChangeError: class com.weirddev.testme.intellij.intention.CreateTestForMethodIntention cannot inherit from final class com.intellij.testIntegration.createTest.GenerateMissedTestsAction
	at java.base/java.lang.ClassLoader.defineClass2(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1108)
	at com.intellij.util.lang.UrlClassLoader.consumeClassData(UrlClassLoader.java:291)
	at com.intellij.util.lang.ZipResourceFile.findClass(ZipResourceFile.java:116)
	at com.intellij.util.lang.JarLoader.findClass(JarLoader.java:58)
	at com.intellij.util.lang.ClassPath.findClassInLoader(ClassPath.java:240)
	at com.intellij.util.lang.ClassPath.findClass(ClassPath.java:190)
	at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.kt:326)

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.