0
나는 내 스파크 셸에서 junit 작업을하기 위해 고심하고있다.스파크 셸에서 Junit 사용
scala> import org.junit.Assert._
<console>:23: error: object junit is not a member of package org
import org.junit.Assert._
이 고정 갖는 어떤 방법 :
나는 다음과 같은 오류 메시지가 geet의 JUnit에서 어설를 가져하려고 할 때? 스칼라 셸에서 org.junit을 어떻게 다운로드 할 수 있습니까? 하려고 할 때C:\spark>spark-shell --packages junit:junit:4.12
Ivy Default Cache set to: C:\xxx\.ivy2\cache
The jars for the packages stored in: C:\xxxx\.ivy2\jars
:: loading settings :: url = jar:file:/C:/spark/jars/ivy-2.4.0.jar!/org/apache/i
vy/core/settings/ivysettings.xml
junit#junit added as a dependency
:: resolving dependencies :: org.apache.spark#spark-submit-parent;1.0
confs: [default]
found junit#junit;4.12 in central
found org.hamcrest#hamcrest-core;1.3 in central
:: resolution report :: resolve 365ms :: artifacts dl 7ms
:: modules in use:
junit#junit;4.12 from central in [default]
org.hamcrest#hamcrest-core;1.3 from central in [default]
---------------------------------------------------------------------
| | modules || artifacts |
| conf | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
| default | 2 | 0 | 0 | 0 || 2 | 0 |
---------------------------------------------------------------------
:: retrieving :: org.apache.spark#spark-submit-parent
confs: [default]
0 artifacts copied, 2 already retrieved (0kB/20ms)
Setting default log level to "WARN".
Spark context Web UI available at http://xxxxx
Spark context available as 'sc' (master = local[*], app id = local-xxx
).
Spark session available as 'spark'.
Welcome to
____ __
/__/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\ version 2.0.0
/_/
그러나 여전히 같은 문제에 직면 :
편집 : 다음과 같은 출력으로 4.12 : JUnit을 : zsxwing의 권고가 다음 후, 내가 사용하고 스파크 쉘의 JUnit을 --packages to import org.junit.Assert._
많은 덕분에 당신의 응답을, 그러나 당신이 나를 설명 한 방법으로 pacakage를 설치 한 후, 나는 내 노트북 OS X에 의미가 있습니다 같은 오류 –
를 얻을 수 Windows 컴퓨터에서 확인할 필요가 없습니다. Windows에서이 기능이 작동하지 않기 때문일 수 있습니다. 그건 그렇고, 스파크 껍질에서 사람들이 junit을 사용하는 것을 본 것은 이번이 처음입니다. Spark shell에서 단위 테스트를해야하는 이유를 자세히 설명해 주시겠습니까? 그것을 위해 설계되지 않았습니다. – zsxwing