• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Scala JUnitSuite类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Scala中org.scalatest.junit.JUnitSuite的典型用法代码示例。如果您正苦于以下问题:Scala JUnitSuite类的具体用法?Scala JUnitSuite怎么用?Scala JUnitSuite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了JUnitSuite类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Scala代码示例。

示例1: ReturnGamesTest

//设置package包名称以及导入依赖的类
package info.armado.ausleihe.remote

import info.armado.ausleihe.remote.dataobjects.entities.GameData
import info.armado.ausleihe.remote.dataobjects.inuse.NotInUse
import info.armado.ausleihe.remote.requests.ReturnGameRequest
import info.armado.ausleihe.remote.results.{IncorrectBarcode, LendingEntityInUse, LendingEntityNotExists, ReturnGameSuccess}
import org.arquillian.ape.rdbms.{ShouldMatchDataSet, UsingDataSet}
import org.jboss.arquillian.extension.rest.client.ArquillianResteasyResource
import org.jboss.arquillian.junit.Arquillian
import org.junit.Test
import org.junit.runner.RunWith
import org.scalatest.Matchers.{convertToAnyShouldWrapper, equal}
import org.scalatest.junit.JUnitSuite

object ReturnGamesTest extends WebDeployment

@RunWith(classOf[Arquillian])
class ReturnGamesTest extends JUnitSuite {
  
  @Test
  @UsingDataSet(Array("datasets/initial.xml"))
  @ShouldMatchDataSet(Array("datasets/initial.xml"))
  def incorrectBarcodeReturnGame(@ArquillianResteasyResource returnGamesService: ReturnGames): Unit = {
    returnGamesService.returnGame(ReturnGameRequest("11000013")) should equal(IncorrectBarcode("11000013"))
  }

} 
开发者ID:Spielekreis-Darmstadt,项目名称:lending,代码行数:28,代码来源:ReturnGamesTest.scala


示例2: HashCodeTest

//设置package包名称以及导入依赖的类
package org.epl_lang.bytecode.tree

import org.junit.Assert._
import org.junit.Test
import org.scalatest.junit.JUnitSuite


class HashCodeTest extends JUnitSuite {
  @Test def codeTest(): Unit = {
    assertEquals(Code.empty.##, Code.empty.##)
    assertNotEquals(1234.##, Code.empty.##)
  }

  @Test def parameterTest(): Unit = {
    assertEquals(new Parameter(0, "myParam").##, new Parameter(0, "myParam").##)
    assertNotEquals(1234.##, new Parameter(0, "myParam").##)
    assertNotEquals(new Parameter(0, "myParam").##, new Parameter(0, "myParam2").##)
  }

  @Test def argumentTest(): Unit = {
    assertEquals(new Argument(0).##, new Argument(0).##)
    assertNotEquals(new Argument(0).##, 1234.##)
    assertNotEquals(new Argument(0).##, new Argument(1).##)
  }

  @Test def typeTest(): Unit = {
    assertEquals(Fn("myFn").##, Fn("myFn").##)
    assertNotEquals(1234.##, Fn("myFn").##)
    assertNotEquals(Fn("myFn").##, Fn("myFn2").##)
  }

  @Test def typeAnnotationTest(): Unit = {
    assertEquals(new TypeAnnotation(0).##, new TypeAnnotation(0).##)
    assertNotEquals(1234.##, new TypeAnnotation(0).##)
    assertNotEquals(new TypeAnnotation(0).##, new TypeAnnotation(1).##)
  }

  @Test def typeSignatureTest(): Unit = {
    assertEquals(new TypeSignature("MySignature").##, new TypeSignature("MySignature").##)
    assertNotEquals(1234.##, new TypeSignature("MySignature").##)
    assertNotEquals(new TypeSignature("MySignature").##, new TypeSignature("MySignature2").##)
  }

  @Test def typeParameterTest(): Unit = {
    assertEquals(new TypeParameter(0, "T").##, new TypeParameter(0, "T").##)
    assertNotEquals(1234.##, new TypeParameter(0, "T").##)
    assertNotEquals(new TypeParameter(0, "T").##, new TypeParameter(0, "V").##)
  }
} 
开发者ID:epl-lang,项目名称:epl-compiler,代码行数:50,代码来源:HashCodeTest.scala


示例3: EqualityTest

//设置package包名称以及导入依赖的类
package org.epl_lang.bytecode.tree

import org.junit.Assert._
import org.junit.Test
import org.scalatest.junit.JUnitSuite


class EqualityTest extends JUnitSuite {
  @Test def codeTest(): Unit = {
    assertEquals(Code.empty, Code.empty)
    assertNotEquals(Code.empty, 1234)
  }

  @Test def parameterTest(): Unit = {
    assertEquals(new Parameter(0, "myParam"), new Parameter(0, "myParam"))
    assertNotEquals(new Parameter(0, "myParam"), 1234)
    assertNotEquals(new Parameter(0, "myParam"), new Parameter(0, "myParam2"))
  }

  @Test def argumentTest(): Unit = {
    assertEquals(new Argument(0), new Argument(0))
    assertNotEquals(new Argument(0), 1234)
    assertNotEquals(new Argument(0), new Argument(1))
  }

  @Test def typeTest(): Unit = {
    assertEquals(Fn("myFn"), Fn("myFn"))
    assertNotEquals(Fn("myFn"), 1234)
    assertNotEquals(Fn("myFn"), Fn("myFn2"))
  }

  @Test def typeAnnotationTest(): Unit = {
    assertEquals(new TypeAnnotation(0), new TypeAnnotation(0))
    assertNotEquals(new TypeAnnotation(0), 1234)
    assertNotEquals(new TypeAnnotation(0), new TypeAnnotation(1))
  }

  @Test def typeSignatureTest(): Unit = {
    assertEquals(new TypeSignature("MySignature"), new TypeSignature("MySignature"))
    assertNotEquals(new TypeSignature("MySignature"), 1234)
    assertNotEquals(new TypeSignature("MySignature"), new TypeSignature("MySignature2"))
  }

  @Test def typeParameterTest(): Unit = {
    assertEquals(new TypeParameter(0, "T"), new TypeParameter(0, "T"))
    assertNotEquals(new TypeParameter(0, "T"), 1234)
    assertNotEquals(new TypeParameter(0, "T"), new TypeParameter(0, "V"))
  }
} 
开发者ID:epl-lang,项目名称:epl-compiler,代码行数:50,代码来源:EqualityTest.scala


示例4: IndexedMapIteratorTest

//设置package包名称以及导入依赖的类
package org.epl_lang.bytecode.util

import java.util.NoSuchElementException

import org.junit.Assert._
import org.junit.Test
import org.scalatest.junit.JUnitSuite


class IndexedMapIteratorTest extends JUnitSuite {
  @Test def validMapTest(): Unit = {
    val map = Map(0 -> 12, 1 -> "abc", 2 -> null)
    IndexedMapIterator(map).foreach { value => }
  }

  @Test def invalidMapTest(): Unit = {
    val map = Map(0 -> 12, 1 -> "abc", 3 -> null)
    try {
      IndexedMapIterator(map).foreach { value => }
      throw new IllegalStateException("Failed to throw a NoSuchElementException")
    } catch {
      case e: Throwable => assertEquals(e.getClass, classOf[NoSuchElementException])
    }
  }
} 
开发者ID:epl-lang,项目名称:epl-compiler,代码行数:26,代码来源:IndexedMapIteratorTest.scala


示例5: TypeReaderTest

//设置package包名称以及导入依赖的类
package org.epl_lang.bytecode

import org.epl_lang.bytecode.tree.{Class, Fn, Type}
import org.epl_lang.bytecode.util.{TypeBound, TypeOperation, TypeVariance}
import org.junit.Assert._
import org.junit.Test
import org.scalatest.junit.JUnitSuite


class TypeReaderTest extends JUnitSuite {
  @Test def inheritanceWriterTest(): Unit = {
    val c = Class("ParentClass")
    c.visitParameter(0, "name")
    c.visitParameter(1, "type")
    val ta = c.visitTypeAnnotation(0)
    ta.visitType("BaseClass")
    ta.visitArgument(0).visitName("name")
    ta.visitArgument(1).visitName("type")
    validateBytecode(c)
  }

  @Test def parentTypeMemberWriterTest(): Unit = {
    val c = Class("ParentClass")
    val fn = Fn("withName")
    c += fn
    validateBytecode(c)
    validateBytecode(fn)
  }

  @Test def genericFunctionWriterTest(): Unit = {
    val fn = Fn("withName")
    val t = fn.visitTypeParameter(0, "T")
    t.visitVariance(TypeVariance.CONTRAVARIANCE)
    val bound = t.visitBound("BaseType", TypeBound.LOWER_BOUND)
    bound.visitOperand("BaseType2", TypeOperation.INTERSECTION)
    fn.visitTypeParameter(1, "V")
    fn.visitParameter(0, "name").visitType("List").visitArgument(0, fn.typeParameters(0).name)
    fn.visitTypeAnnotation(0).visitType("Set").visitArgument(0, fn.typeParameters(1).name)
    validateBytecode(fn)
  }

  private def validateBytecode(t: Type): Unit = {
    val writer = new TypeWriter
    t.accept(writer)
    val data = writer.toByteArray
    val reader = new TypeReader(data)
    val newType = new Type
    reader.accept(newType)
    assertEquals(t, newType)
  }
} 
开发者ID:epl-lang,项目名称:epl-compiler,代码行数:52,代码来源:TypeReaderTest.scala


示例6: TSValueTest

//设置package包名称以及导入依赖的类
package ch.shastick

import org.junit.Test
import org.scalatest.junit.JUnitSuite
import ch.shastick.immutable.TSValue

class TSValueTest extends JUnitSuite {
  
  @Test def test() {
    assert(!TSValue("",10).validAt(valueTime=0, atTime= -1))
    assert(TSValue("",10).validAt(valueTime=0, atTime= 0))
    assert(TSValue("",10).validAt(valueTime=0, atTime= 9))
    assert(!TSValue("",10).validAt(valueTime=0, atTime= 10))
  }
  
  @Test def testToEntry() {
    assert(TSValue("",10).toEntry(0).timestamp == 0)
    assert(TSValue("",10).toEntry(0).validity == 10)
    assert(TSValue("Bob",10).toEntry(0).value == "Bob")
  }
} 
开发者ID:Shastick,项目名称:scala-timeseries-lib,代码行数:22,代码来源:TSValueTest.scala


示例7: GstTestSuite

//设置package包名称以及导入依赖的类
import one.niu.outcome.gst.GeneralSuffixTree
import one.niu.outcome.gst.traits.InsertableGeneralSuffixTree
import org.junit.{Before, Test}
import org.scalatest.junit.JUnitSuite


class GstTestSuite extends JUnitSuite {

//  @Before def initialize(): Unit = {
//    gst = new GeneralSuffixTree[Char]
//  }

  @Test def gstSingleStringBuild(): Unit = {
    var gst: InsertableGeneralSuffixTree[Char] = null
    gst = new GeneralSuffixTree[Char]
    gst.insert("xyzxyaxyz".toCharArray)
  }

  @Test def gstSingleIntArrayBuild(): Unit = {
    var gst: InsertableGeneralSuffixTree[Int] = null
    gst = new GeneralSuffixTree[Int]
    gst.insert(Array(1,2,3,1,2,24,1,2,3))
  }


} 
开发者ID:Esquive,项目名称:outcome,代码行数:27,代码来源:GstTestSuite.scala



注:本文中的org.scalatest.junit.JUnitSuite类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Scala RootActorPath类代码示例发布时间:2022-05-23
下一篇:
Scala OAuth2BearerToken类代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap