Coder Social home page Coder Social logo

junit-tools's People

Contributors

lotharrubenberger avatar robertstreng 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

junit-tools's Issues

Issue while trying run jUnit tools from eclipse

Java Model Exception: Java Model Status [Invalid name specified: ]
at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:786)
at org.eclipse.jdt.internal.core.CompilationUnit.createPackageDeclaration(CompilationUnit.java:440)
at org.junit.tools.generator.TestClassGenerator.generate(TestClassGenerator.java:173)
at org.junit.tools.base.MainController$1.run(MainController.java:174)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

Java Model Exception: Java Model Status [Invalid name specified: ]
at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:786)
at org.eclipse.jdt.internal.core.CompilationUnit.createPackageDeclaration(CompilationUnit.java:440)
at org.junit.tools.generator.TestClassGenerator.generate(TestClassGenerator.java:173)
at org.junit.tools.base.MainController$1.run(MainController.java:174)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

org.junit.tools.base.JUTException: Java Model Exception: Java Model Status [Invalid name specified: ]
at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:786)
at org.eclipse.jdt.internal.core.CompilationUnit.createPackageDeclaration(CompilationUnit.java:440)
at org.junit.tools.generator.TestClassGenerator.generate(TestClassGenerator.java:173)
at org.junit.tools.base.MainController$1.run(MainController.java:174)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

at org.junit.tools.base.MainController.generateTestclass(MainController.java:195)
at org.junit.tools.base.MainController.generateTestclass(MainController.java:102)
at org.junit.tools.handler.GenerateTestClassHandler.execute(GenerateTestClassHandler.java:49)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)
at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
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.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:282)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:264)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:488)
at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:433)
at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:454)
at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem$3.handleEvent(AbstractContributionItem.java:482)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4236)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3824)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)

@MethodRef annotation not found

I just installed this plugin on Eclipse Oxygen 3a (4.7.3a) (it was previously installed with the same bug, so I uninstalled/reinstalled thinking it was a setup issue).

When I generate a test class, it cannot organize the imports error pops up - claims it needs human interaction. When the file loads the @generated and @methodref annotations are not found - so I have to import the javax.annotation for the @generated - but there are no suggestions for the @methodref.

Also Deencapsulate does not compile, nor does it have any suggestions.

I am using gradle for my build/deploy, is there a library I should be adding for the testCompile/testRuntime? (Is this library available on one of the typical sites like jfrog? mavenCentral?) Something else? I reviewed the docs online and the existing issues - and I didn't see anything about resolving this issue.

Sharon

Create a Test-Case

When i try to create a test-case, junit-tools bring me return error, like you can seen in print screen in attach file.
error

How to generate bulk junit test cases

It's fortunate that I came across this JUNIT-Tools on the internet and it's a great tool.
This saved me a lot of time. I am using this to generate JUNIT test cases and I have to tell you this is a great tool.

I have two questions and if you could reply I would really appreciate it..

  1. I have a project and in my project i have around 100 java classes. Each java class has more than one method in it. I have to click on each java class and generate a junit test class. Is there a way to generate a test class for each java class in a single click? Something like selecting that folder of those 100 java classes and generating test-case classes. I am using eclipse.

  2. I do see an option to generate a mock-class for each java class. I am generating but didn't see anywhere in the project. Can you tell me where I can see those generated mock-classes and how I can use it? Where is that setting?

Again, really appreciate your efforts and its great tool. Looking forward to hearing from you.

Wierd Scroll Bar Glitch in Unit test-class generator

Hi everyone,
i don't really know if it's junit-tools' fault but when theming is enabled in Eclipse, Scrollbars in "methods" box in in Unit test-class generator (the window tha opens when CTRL+< are pressed) strangely glitches between "classics" toolbars and themed ones.

configuration per project

I just gave junit-tools a try but currently I can't use it for all projects. We keep junit-tests in the same project in a separate sourcefolder which is named inconsistent over all projects. This is for legitimate reasons I don't want to discuss here.

It would be great if junit-tools would provide the ability to define project-specific settings which override the global ones (like many other eclipse-settings allow). As they are typically stored in the project-folder this has the adittional benefit of being able to share them via scm with the whole team.

Error in test code generation

Hi, I have a Public class along with a default class in same Java source file and the default class has a method, which is invoked from public class, by creating an instance of default class in Public class. When I generated the test class, for the test method of default class, it created an instance of Public class and calling the test method with Public class instance. Let me illustrate here:
Public class A {
B b = new B();
main() {
A a = new A();
a.b.methodB();
}
}
class B {
public String methodB() {
return "methodB";
}
}

The test class which is generated has below code:
@methodref(name = "methodB", signature = "()QString;")
@test
public void testmethodB() throws Exception {
A testSubject;
String result;

	// default test
	testSubject = createTestSubject();
	result = testSubject.methodB();               //Compilation error, as methodB is part of class B, but we are invoking with A
}

}

Section not found in Documentation: "Generate test-cases"

_Test-case-generation

The code of the method under test will be analyzed to generate the test-cases with the corresponding values and assertions. If there are no test-cases found a default test-case with default values and assertions is produced. For for more informations see the section "Generate test-cases"._

The JUnit-tools documentation, the above-mentioned section "Generate test-cases" does not found. How to create heat cases using JUnit-tools. Help needed.

plans to upgrade to newer versions of jmockit?

Version 1.36 removed functionality (deprecated in 1.35) that is used by junit-tools:

Deprecated the "invoke" and "newInstance" methods from the Deencapsulation class. These are simple Reflection-backed convenience methods, which are no longer useful in the overall context of JMockit APIs.

The current version is 1.43, and 1.21 is delivered in the .zip file needed for the jar dependencies....any plans to upgrade (and obviously to replace that Deencapsulation functionality)?

Dependencies not documented; wrong code generated.

I tried to generate test for private method of an abstract class.

  1. Generated code uses constructor for abstract class, and it will never work. Instead, it should use mock-proxy, something like that.
  2. Generated code uses "Whitebox.invokeMethod()" and this is not documented, which JAR / version is that?

Thanks,

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.