java - Intellij Idea 15 Gradle project import Junit compile errors -


i having issue simple project's junit in intellij idea.

gradle (2.10) can run junits command line. import project intellij idea 15.0.3, try run junit in intellij throws compile errors if junit not on classpath. error:(1, 17) java: package org.junit not exist

checked project structure junit lib there, tried other method adivised - create test in intellij 'goto test > create new test >' still not luck.

build.gradle:

allprojects {     apply plugin: 'idea'     apply plugin: 'java'      sourcecompatibility = 1.7     group 'junit.fail'     version '1.0'      repositories {     mavencentral()     } }  subprojects {     dependencies {     testcompile 'junit:junit:4.12'     } }  dependencies {     compile project(':common')     compile project(':moda') } 

settings.gradle

rootproject.name = 'junit-fail' include 'common' include 'moda' 

simple code in module common

junit-fail\common\src\main\java

public class classa {     public string geta() {         return "a";     } } 

junit-fail\common\src\test\java

import org.junit.test; import static org.junit.assert.*;  public class classatest {     @test     public void testgeta() throws exception {         classa = new classa();         assertequals("a", a.geta());     } } 

moda can have similar test code.

able resolve issue moving .gradle c:\users\ c:\dev jdk8 ok jdk7 never worked - home dir network synced. may have been issue.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -