repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/aview/TUISpec.scala
<reponame>sehirsig/malefiz package de.htwg.se.malefiz.aview import org.scalatest.wordspec.AnyWordSpec import org.scalatest.matchers.should.Matchers import de.htwg.se.malefiz.controller.controllerComponent._ import de.htwg.se.malefiz.controller.controllerComponent.controllerBaseImpl import de.htwg.se.malefiz.mode...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/cellComponent/Cell.scala
<reponame>sehirsig/malefiz<filename>src/main/scala/de/htwg/se/malefiz/model/cellComponent/Cell.scala package de.htwg.se.malefiz.model.cellComponent /** All cells needed for the Malefiz game. * * @author sehirsig & franzgajewski */ trait Cell { val cellStatus:String def isWalkable: Boolean = cellStatus ...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/gameboardComponent/gameboardAdvancedImpl/Gameboard.scala
package de.htwg.se.malefiz.model.gameboardComponent.gameboardAdvancedImpl import com.google.inject.Inject import com.google.inject.name.Named import de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl.{Gameboard => BaseGameboard} /** Extension of the base implementation of the game board. * Here the dimen...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/controller/controllerComponent/GameStatus.scala
<reponame>sehirsig/malefiz<gh_stars>1-10 package de.htwg.se.malefiz.controller.controllerComponent /** The status updates of the game. * * @author sehirsig & franzgajewski */ object GameStatus extends Enumeration { type GameStatus = Value type PlayerStatus = Value val WELCOME, LOADED, SAVED, GAMEWIN...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/gamefigureComponent/Gamefigure.scala
<filename>src/main/scala/de/htwg/se/malefiz/model/gamefigureComponent/Gamefigure.scala<gh_stars>1-10 package de.htwg.se.malefiz.model.gamefigureComponent import de.htwg.se.malefiz.model.playerComponent.Player /** Declaration of the game figures for the game. * * @author sehirsig & franzgajewski */ case class Game...
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/MalefizSpec.scala
package de.htwg.se.malefiz import de.htwg.se.malefiz.aview.TUI import de.htwg.se.malefiz.controller.controllerComponent.controllerBaseImpl import de.htwg.se.malefiz.controller.controllerComponent.controllerBaseImpl.Controller import de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl.{Gameboard, Setting...
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/util/CommandSpec.scala
package de.htwg.se.malefiz.util import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec class testCommand extends Command { var saved:Int = 0 override def doStep: Unit = saved += 1 override def undoStep: Unit = saved -= 1 override def redoStep: Unit = doStep } ...
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/model/gameboardComponent/gameboardBaseImpl/moveTypesSpec.scala
package de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec /** Test class for the base implementation of the moveTypes class. * * @author sehirsig & franzgajewski */ class moveTypesSpec extends AnyWordSpec ...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/util/UndoManager.scala
package de.htwg.se.malefiz.util /** Undo manager class. * * @author sehirsig & franzgajewski */ class UndoManager { /** List of all doable steps. */ private var undoStack: List[Command]= Nil /** List of all redoable steps. */ private var redoStack: List[Command]= Nil /** Do one step. ...
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/model/gameboardComponent/gameboardBaseImpl/SettingsSpec.scala
<gh_stars>1-10 package de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec /** Test class for the base implementation of the Settings class. * * @author sehirsig & franzgajewski */ class SettingsSpec extends...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/aview/TUIState.scala
package de.htwg.se.malefiz.aview import de.htwg.se.malefiz.Malefiz.controller /** State pattern for TUI.scala. * Main interface for our states. * * @author sehirsig & franzgajewski */ trait TUIState { def processing(input: String): TUIState } /** Initial state. Used to add players and start the ...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/util/BlockStrategy.scala
package de.htwg.se.malefiz.util import de.htwg.se.malefiz.model.gameboardComponent.GameboardInterface /** BlockStrategy pattern interface. * * @author sehirsig & franzgajewski */ trait BlockStrategy { /** Replace block * * @param spielbrett old game board * @return new game board */ def replace...
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/util/BlockStrategySpec.scala
package de.htwg.se.malefiz.util import de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl.checkCell._ import de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl.{Gameboard, Settings} import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec /** Test class for ...
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/model/gameboardComponent/gameboardBaseImpl/DiceSpec.scala
<reponame>sehirsig/malefiz package de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec /** Test class of the base implementation of the Dice class. * * @author sehirsig & franzgajewski */ case class DiceSpec...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/playerComponent/PlayerBuilder.scala
<reponame>sehirsig/malefiz<gh_stars>1-10 package de.htwg.se.malefiz.model.playerComponent /** Builder pattern for player class. * * @author sehirsig & franzgajewski */ trait PlayerBuilder { def setName(name: String): PlayerBuilder def setID(id: Int): PlayerBuilder def setStartingPos(pos: (Int, Int))...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/controller/controllerComponent/controllerBaseImpl/Controller.scala
<gh_stars>1-10 package de.htwg.se.malefiz.controller.controllerComponent.controllerBaseImpl import com.google.inject.{Guice, Inject} import de.htwg.se.malefiz.MalefizModule import de.htwg.se.malefiz.controller.controllerComponent.GameStatus._ import de.htwg.se.malefiz.controller.controllerComponent._ import de.h...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/gameComponent/Game.scala
package de.htwg.se.malefiz.model.gameComponent import de.htwg.se.malefiz.model.playerComponent.Player /** Game class. Here the players are stored. * * @author sehirsig & franzgajewski */ case class Game(var players: Vector[Player]) { def addPlayer(player: Player): Game = { val newPlayer = Vector(player) ...
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/model/cellComponent/CellSpec.scala
package de.htwg.se.malefiz.model.cellComponent import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec /** Test class for the Cell class. * * @author sehirsig & franzgajewski */ class CellSpec extends AnyWordSpec with Matchers { "A Cell" when { "Free" should { ...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/gameboardComponent/gameboardBaseImpl/moveTypes.scala
<gh_stars>1-10 package de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl /** Class to overwrite coordinates of a cell quickly to those of the next cell. * * @author sehirsig & franzgajewski */ object moveTypes { def goDown(oldcord: (Int, Int)): (Int, Int) = { (oldcord._1 + 1, oldcord._2) } d...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/MalefizModule.scala
package de.htwg.se.malefiz import com.google.inject.AbstractModule import com.google.inject.name.Names import net.codingwell.scalaguice.ScalaModule import de.htwg.se.malefiz.controller.controllerComponent._ import de.htwg.se.malefiz.model.cellComponent.InvalidCell import de.htwg.se.malefiz.model.gameboardCompon...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/gameboardComponent/gameboardBaseImpl/Gameboard.scala
package de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl import com.google.inject.Inject import de.htwg.se.malefiz.model.cellComponent._ import de.htwg.se.malefiz.model.gameboardComponent.GameboardInterface import de.htwg.se.malefiz.model.playerComponent.Player import de.htwg.se.malefiz.util.BlockSt...
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/model/gamefigureComponent/GamefigureSpec.scala
package de.htwg.se.malefiz.model.gamefigureComponent import de.htwg.se.malefiz.model.playerComponent.Player import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec /** Test class for the Gamefigure class. * * @author sehirsig & franzgajewski */ class GamefigureSpec extend...
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/model/playerComponent/PlayerSpec.scala
<reponame>sehirsig/malefiz package de.htwg.se.malefiz.model.playerComponent import de.htwg.se.malefiz.model.gamefigureComponent.Gamefigure import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec /** Test class for the Player class. * * @author sehirsig & franzgajewski */ ...
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/util/UndoManagerSpec.scala
package de.htwg.se.malefiz.util import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec /** Test class for the UndoManager class. * * @author sehirsig & franzgajewski */ class UndoManagerSpec extends AnyWordSpec with Matchers { "A UndoManager " should { val undoMa...
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/model/gameboardComponent/gameboardBaseImpl/GameboardSpec.scala
package de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl import de.htwg.se.malefiz.model.cellComponent._ import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec import scala.util.{Failure, Success} /** Test class for the base implementation of the Gameboard class....
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/fileIoComponent/fileIoXmlImpl/FileIO.scala
<filename>src/main/scala/de/htwg/se/malefiz/model/fileIoComponent/fileIoXmlImpl/FileIO.scala package de.htwg.se.malefiz.model.fileIoComponent.fileIoXmlImpl import com.google.inject.Guice import net.codingwell.scalaguice.InjectorExtensions._ import de.htwg.se.malefiz.MalefizModule import de.htwg.se.malefiz.model.c...
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/model/gameboardComponent/gameboardBaseImpl/checkCellSpec.scala
package de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl import de.htwg.se.malefiz.model.cellComponent.PlayerCell import de.htwg.se.malefiz.model.playerComponent.Player import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec /** Test class for base implementation of...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/playerComponent/Player.scala
package de.htwg.se.malefiz.model.playerComponent import de.htwg.se.malefiz.model.cellComponent.PlayerCell import de.htwg.se.malefiz.model.gamefigureComponent.Gamefigure /** Player class. * * @author sehirsig & franzgajewski */ case class Player(name: String, Playerid: Int, startingPos: (Int, Int)) { /** Define ...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/gameboardComponent/gameboardBaseImpl/BlockReplaceStrategy.scala
<gh_stars>1-10 package de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl import de.htwg.se.malefiz.model.cellComponent._ import de.htwg.se.malefiz.model.gameboardComponent.GameboardInterface import de.htwg.se.malefiz.util.BlockStrategy import scala.util.Random /** Blocked cell replace strategy of t...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/gameboardComponent/gameboardStubImpl/Gameboard.scala
package de.htwg.se.malefiz.model.gameboardComponent.gameboardStubImpl import de.htwg.se.malefiz.model.cellComponent._ import de.htwg.se.malefiz.model.gameboardComponent.GameboardInterface import de.htwg.se.malefiz.model.playerComponent.Player import scala.util.{Failure, Success, Try} /** Stub implementation of...
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/controller/controllerComponent/controllerStubImpl/ControllerSpec.scala
package de.htwg.se.malefiz.controller.controllerComponent.controllerStubImpl import de.htwg.se.malefiz.model.cellComponent.InvalidCell import de.htwg.se.malefiz.model.gameboardComponent.gameboardStubImpl.Gameboard import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec /** Test ...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/gameboardComponent/gameboardBaseImpl/settings.scala
package de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl /** Settings class of the base implementation. Many default settings are stored here. * * @author sehirsig & franzgajewski */ case class Settings() { val xDim = 18 val yDim = 19 val freeCells = Vector((2,1),(2,2),(2,3),(2,4),(2,5),(2,6),...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/gameboardComponent/gameboardBaseImpl/Dice.scala
package de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl import scala.util.Random /** Die for the base implementation. * Returns a number from 1 to 6. Returns -1 in case of an error. * Implemented as an option monad. * * @author sehirsig & franzgajewski */ object Dice { def diceRoll: ...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/gameboardComponent/lastSave.scala
<filename>src/main/scala/de/htwg/se/malefiz/model/gameboardComponent/lastSave.scala package de.htwg.se.malefiz.model.gameboardComponent import com.google.inject.Inject import de.htwg.se.malefiz.model.cellComponent.Cell /** The Information of the last move from the same player get saved here. * * @author sehirsig &...
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/controller/controllerComponent/controllerBaseImpl/ControllerSpec.scala
<filename>src/test/scala/de/htwg/se/malefiz/controller/controllerComponent/controllerBaseImpl/ControllerSpec.scala package de.htwg.se.malefiz.controller.controllerComponent.controllerBaseImpl import com.google.inject.Guice import de.htwg.se.malefiz.MalefizModule import de.htwg.se.malefiz.aview.{GameResetTUIState, ...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/util/Command.scala
<reponame>sehirsig/malefiz package de.htwg.se.malefiz.util /** Command pattern interface. * * @author sehirsig & franzgajewski */ trait Command { /** Do one step. */ def doStep:Unit /** Undo one step. */ def undoStep:Unit /** Redo one step. */ def redoStep:Unit }
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/controller/controllerComponent/PlayerState.scala
<filename>src/main/scala/de/htwg/se/malefiz/controller/controllerComponent/PlayerState.scala package de.htwg.se.malefiz.controller.controllerComponent /** State pattern for the management of which players turn is next. * * @author sehirsig & franzgajewski */ trait PlayerState { def nextPlayer(playerCount:Int): P...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/aview/TUI.scala
<reponame>sehirsig/malefiz package de.htwg.se.malefiz.aview import de.htwg.se.malefiz.controller.controllerComponent._ import scala.swing.Reactor /** Malefiz as text-based user interface. Game gets displayed in the console. * * @author sehirsig & franzgajewski */ case class TUI(controller: ControllerInte...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/controller/controllerComponent/controllerBaseImpl/MoveCommand.scala
package de.htwg.se.malefiz.controller.controllerComponent.controllerBaseImpl import de.htwg.se.malefiz.model.cellComponent._ import de.htwg.se.malefiz.util.Command /** Manages each individual movement. * Via the command pattern moves can be undone and redone. * * @author sehirsig & franzgajewski */ class MoveCom...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/gameboardComponent/gameboardBaseImpl/BlockRemoveStrategy.scala
package de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl import de.htwg.se.malefiz.model.gameboardComponent.GameboardInterface import de.htwg.se.malefiz.util.BlockStrategy /** Blocked cell remove strategy of the strategy pattern. * Permanently removes barricades from the game, when captured. * * @au...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/fileIoComponent/fileIoJsonImpl/FileIO.scala
<reponame>sehirsig/malefiz<gh_stars>1-10 package de.htwg.se.malefiz.model.fileIoComponent.fileIoJsonImpl import com.google.inject.Guice import net.codingwell.scalaguice.InjectorExtensions._ import de.htwg.se.malefiz.MalefizModule import de.htwg.se.malefiz.model.cellComponent.PlayerCell import de.htwg.se.malefiz....
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/Malefiz.scala
package de.htwg.se.malefiz import com.google.inject.Guice import de.htwg.se.malefiz.aview.GUI.SwingGui import de.htwg.se.malefiz.aview.TUI import de.htwg.se.malefiz.controller.controllerComponent.ControllerInterface import scala.io.StdIn.readLine /** Main file of the Malefiz game. * * @author sehirsig & ...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/aview/GUI/SwingGui.scala
package de.htwg.se.malefiz.aview.GUI import scala.swing._ import scala.swing.Swing.LineBorder import scala.swing.event._ import de.htwg.se.malefiz.controller.controllerComponent._ import java.awt.{Color, Font} import javax.swing.ImageIcon /** Malefiz game with graphical user interface. * * @author sehir...
sehirsig/malefiz
build.sbt
name := "malefiz" organization := "de.htwg.se" version := "0.0.1" scalaVersion := "2.13.3" libraryDependencies += "org.scalactic" %% "scalactic" % "3.2.7" libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.7" % "test" libraryDependencies += "org.scala-lang.modules" %% "scala-swing" % "3.0.0"...
sehirsig/malefiz
src/test/scala/de/htwg/se/malefiz/model/gameboardComponent/gameboardStubImpl/GameboardSpec.scala
package de.htwg.se.malefiz.model.gameboardComponent.gameboardStubImpl import de.htwg.se.malefiz.model.cellComponent.InvalidCell import de.htwg.se.malefiz.model.playerComponent.Player import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec /** Test class for the stub implementati...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/fileIoComponent/FileIOInterface.scala
package de.htwg.se.malefiz.model.fileIoComponent import de.htwg.se.malefiz.model.gameComponent.Game import de.htwg.se.malefiz.model.gameboardComponent.GameboardInterface /** Interface for the file IO implementation. * * @author sehirsig & franzgajewski */ trait FileIOInterface { /** Loads game board...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/model/gameboardComponent/gameboardBaseImpl/checkCell.scala
<gh_stars>1-10 package de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl import de.htwg.se.malefiz.model.cellComponent._ import de.htwg.se.malefiz.model.gameboardComponent.GameboardInterface import de.htwg.se.malefiz.model.gameboardComponent.gameboardBaseImpl.moveTypes._ import de.htwg.se.malefiz.mode...
sehirsig/malefiz
src/main/scala/de/htwg/se/malefiz/controller/controllerComponent/ControllerInterface.scala
package de.htwg.se.malefiz.controller.controllerComponent import de.htwg.se.malefiz.controller.controllerComponent.GameStatus.GameStatus import de.htwg.se.malefiz.model.cellComponent.Cell import de.htwg.se.malefiz.model.gameComponent.Game import de.htwg.se.malefiz.model.gameboardComponent.{GameboardInterface, lastSave...
niw/kestrel
project/Rpmbuild.scala
import com.twitter.sbt.GitProject._ import com.twitter.sbt.PackageDist._ import sbt.Keys._ import sbt._ import scala.util.control.Exception._ object Rpmbuild extends Plugin { private case class RpmbuildDirectories(base: File, sources: File, specs: File, srpms: File, rpms: File) private object RpmbuildDirectories...
niw/kestrel
build.sbt
com.twitter.sbt.StandardProject.newSettings com.twitter.scrooge.ScroogeSBT.newSettings Rpmbuild.newSettings name := "kestrel" organization := "net.lag" version := "2.4.2-SNAPSHOT" scalaVersion := "2.9.2" resolvers ++= Seq( "twitter" at "http://maven.twttr.com/", "sonatype" at "https://oss.sonatype.org/conten...
niw/kestrel
src/test/scala/net/lag/kestrel/load/Client.scala
/* * Copyright 2011 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
niw/kestrel
src/test/scala/net/lag/kestrel/config/QueueConfigSpec.scala
/* * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
niw/kestrel
project/build.sbt
<filename>project/build.sbt<gh_stars>0 Twirl.settings resolvers ++= Seq( "twitter" at "http://maven.twttr.com/" ) addSbtPlugin("com.twitter" %% "sbt-package-dist" % "1.1.0") addSbtPlugin("com.twitter" %% "scrooge-sbt-plugin" % "3.1.5")
niw/kestrel
project/project/build.sbt
resolvers ++= Seq( "spray" at "http://repo.spray.io" ) addSbtPlugin("io.spray" % "sbt-twirl" % "0.7.0")
sanyaa92/hbase
hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/datasources/HBaseTableCatalog.scala
<filename>hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/datasources/HBaseTableCatalog.scala /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. ...
NTCoding/playapitest
app/config/DependencyWiring.scala
package config import com.google.inject.AbstractModule import data.{DatabaseNotificationsRetriever, NotificationsRetriever} import slick.driver.MySQLDriver.api._ class DependencyWiring extends AbstractModule { override def configure() { bind(classOf[Database]).toInstance(Database.forConfig("chatroomz")) bin...
NTCoding/playapitest
test/api/configuration/TestDatabase.scala
<filename>test/api/configuration/TestDatabase.scala package api.configuration object TestDatabase { val username = "chatty" val password = "<PASSWORD>" val dbName = "apitests" val dbUrl = s"jdbc:mysql://localhost:3306" }
NTCoding/playapitest
test/api/configuration/APITest.scala
package api.configuration import java.io.StringReader import java.sql.DriverManager import api.configuration.TestDatabase._ import com.ibatis.common.jdbc.ScriptRunner import org.scalatest.{BeforeAndAfterAll, FreeSpecLike, Matchers} import play.api.Play import play.api.Play.current import play.api.test.{DefaultAwaitTi...
NTCoding/playapitest
test/api/notifications_latest.scala
<reponame>NTCoding/playapitest package api import api.configuration.APITest import play.api.Play.current import play.api.libs.json.{Format, Json} import play.api.libs.ws.WS class notifications_latest extends APITest { import TestData._ val dbScript = "/api/notifications.sql" "When requesting the latest notific...
NTCoding/playapitest
app/controllers/Notifications.scala
package controllers import javax.inject.Inject import data.{Notification, NotificationsRetriever} import play.api.libs.concurrent.Execution.Implicits._ import play.api.libs.json.{Format, Json} import play.api.mvc._ class Notifications @Inject() (retriever: NotificationsRetriever) extends Controller { implicit val ...
NTCoding/playapitest
build.sbt
name := """chatroomz""" version := "1.0-SNAPSHOT" lazy val root = (project in file(".")).enablePlugins(PlayScala) scalaVersion := "2.11.6" libraryDependencies ++= Seq( jdbc, cache, ws, "org.codehaus.jackson" % "jackson-mapper-asl" % "1.9.13", "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.5...
NTCoding/playapitest
app/data/NotificationsRetriever.scala
package data import com.google.inject.Inject import slick.driver.MySQLDriver.api._ import slick.jdbc.GetResult import scala.concurrent.Future class DatabaseNotificationsRetriever @Inject() (db: Database) extends NotificationsRetriever { implicit val parser: GetResult[Notification] = GetResult(r => Notificatio...
NTCoding/playapitest
test/api/configuration/CreateTestApplicationWithTestDB.scala
<gh_stars>0 package api.configuration import com.typesafe.config.ConfigFactory import play.api.inject._ import play.api.inject.guice.GuiceApplicationBuilder import play.api.test.TestServer import slick.driver.MySQLDriver.api._ import scala.collection.JavaConverters._ object CreateTestApplicationWithTestDB { import ...
ethicssystems/examples
legacy/aws-scala-sbt/build.sbt
import sbtassembly.Log4j2MergeStrategy import sbtrelease.Version name := "hello" resolvers += Resolver.sonatypeRepo("public") scalaVersion := "2.13.1" releaseNextVersion := { ver => Version(ver).map(_.bumpMinor.string).getOrElse("Error") } assemblyJarName in assembly := "hello.jar" libraryDependencies ++= Seq( "...
p44/Play-Kafka
app/com/processor44/tick/TickConsumer.scala
package com.processor44.tick import akka.actor.{Props, ActorLogging, Actor} import com.typesafe.config.ConfigFactory import java.util.Properties import kafka.consumer._ import kafka.message.MessageAndMetadata import play.api.Logger import play.api.libs.iteratee.Concurrent import play.api.libs.json.{Json, JsValue} /**...
p44/Play-Kafka
app/com/processor44/tick/TickSimpleConsumer.scala
<reponame>p44/Play-Kafka package com.processor44.tick import kafka.api.PartitionOffsetRequestInfo import kafka.common.{OffsetAndMetadata, TopicAndPartition} import kafka.javaapi.consumer.SimpleConsumer import kafka.javaapi.message.ByteBufferMessageSet import kafka.javaapi.{OffsetRequest, OffsetResponse} import kafka.m...
p44/Play-Kafka
app/com/processor44/PkGlobal.scala
<filename>app/com/processor44/PkGlobal.scala package com.processor44 import akka.actor.ActorPath import com.processor44.tick.TickConsumer import play.api._ import play.api.libs.concurrent.Akka import play.api.Play.current /** * Created by markwilson on 3/13/15. */ object PkGlobal { var pathTickConsumer = "/user/...
p44/Play-Kafka
build.sbt
<reponame>p44/Play-Kafka<gh_stars>1-10 name := """Play-Kafka""" version := "1.0-SNAPSHOT" lazy val root = (project in file(".")).enablePlugins(PlayScala) scalaVersion := "2.11.1" libraryDependencies ++= Seq( "org.apache.kafka" % "kafka_2.11" % "0.8.2.1" )
p44/Play-Kafka
app/controllers/Application.scala
<gh_stars>1-10 package controllers import com.processor44.models.{ViewModels, Msg, Tick} import com.processor44.tick.{TickSimpleConsumer, TickConsumer, TickProducer} import play.api._ import play.api.libs.EventSource import play.api.libs.iteratee.{Concurrent, Enumeratee} import play.api.libs.json.{JsValue, Json} impor...
p44/Play-Kafka
app/com/processor44/tick/TickProducer.scala
<reponame>p44/Play-Kafka<filename>app/com/processor44/tick/TickProducer.scala package com.processor44.tick import com.processor44.models.Tick import com.typesafe.config.ConfigFactory import java.util.Properties import kafka.producer.{KeyedMessage, ProducerConfig, Producer} import play.api.Logger import play.api.libs.j...
p44/Play-Kafka
app/Global.scala
import play.api.GlobalSettings import com.processor44.PkGlobal /** */ object Global extends GlobalSettings { override def onStart(app: play.api.Application) { println("Global.onStart") PkGlobal.onStart } override def onStop(app: play.api.Application) { println("Global.onStop") PkGlobal.onStop ...
mkoester/play_2.5.8_query_parameter_parsing_error
app/controllers/TestController.scala
package controllers import javax.inject.{Inject, Singleton} import play.api.mvc.{Action, Controller} @Singleton class TestController @Inject() extends Controller { def testOptionString(stringOption: Option[String]) = Action { Ok(stringOption.toString) } def testString(string: String) = Action { Ok(st...
armanbilge/ip4s
shared/src/main/scala-2/Literals.scala
<reponame>armanbilge/ip4s /* * Copyright 2018 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENS...
armanbilge/ip4s
test-kit/shared/src/main/scala/com/comcast/ip4s/Arbitraries.scala
/* * Copyright 2018 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless require...
armanbilge/ip4s
shared/src/main/scala/com/comcast/ip4s/Dns.scala
/* * Copyright 2018 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless require...
armanbilge/ip4s
js/src/main/scala/com/comcast/ip4s/DnsPlatform.scala
/* * Copyright 2018 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless require...
armanbilge/ip4s
test-kit/shared/src/test/scala/com/comcast/ip4s/DnsTest.scala
/* * Copyright 2018 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless require...
armanbilge/ip4s
jvm/src/main/scala/com/comcast/ip4s/DnsPlatform.scala
<gh_stars>100-1000 /* * Copyright 2018 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 ...
armanbilge/ip4s
test-kit/shared/src/test/scala/com/comcast/ip4s/MacAddressTest.scala
<reponame>armanbilge/ip4s<gh_stars>100-1000 /* * Copyright 2018 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.o...
armanbilge/ip4s
build.sbt
<reponame>armanbilge/ip4s import sbtcrossproject.CrossPlugin.autoImport.crossProject import sbtcrossproject.CrossPlugin.autoImport.CrossType import com.typesafe.tools.mima.core._ ThisBuild / baseVersion := "3.1" ThisBuild / organization := "com.comcast" ThisBuild / organizationName := "Comcast Cable Communications Ma...
armanbilge/ip4s
project/plugins.sbt
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.8.0") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0") addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.20.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") addSbtPlugin("com.codecommit" % "sbt-spiewak-sonatype" % "0.23.0") ad...
armanbilge/ip4s
shared/src/main/scala/com/comcast/ip4s/MacAddress.scala
/* * Copyright 2018 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless require...
wsargent/ReactiveCouchbase-core
driver/src/main/scala/org/reactivecouchbase/client/BucketAPI.scala
package org.reactivecouchbase.client import play.api.libs.json._ import scala.concurrent.{ Future, ExecutionContext } import com.couchbase.client.protocol.views.{ DesignDocument, SpatialView, View, Query } import play.api.libs.iteratee.Enumerator import net.spy.memcached.{ PersistTo, ReplicateTo } import org.reactivec...
wsargent/ReactiveCouchbase-core
driver/src/test/scala/NonExistentSpec.scala
<reponame>wsargent/ReactiveCouchbase-core import org.reactivecouchbase.CouchbaseRWImplicits.jsObjectToDocumentWriter import org.reactivecouchbase.ReactiveCouchbaseDriver import org.specs2.mutable.{Specification, Tags} import play.api.libs.json.{JsValue, JsObject, Json} import scala.concurrent.{Future, Await} import sc...
wsargent/ReactiveCouchbase-core
driver/src/test/scala/AtomicSpec.scala
import org.reactivecouchbase.ReactiveCouchbaseDriver import org.specs2.mutable._ import scala.concurrent._ import scala.concurrent.duration._ import scala.util.{Failure, Success} import akka.pattern.after import org.reactivecouchbase.CouchbaseExpiration._ class AtomicSpec extends Specification with Tags { sequential...
wsargent/ReactiveCouchbase-core
driver/src/main/scala/org/reactivecouchbase/N1QL.scala
package org.reactivecouchbase import scala.concurrent._ import play.api.libs.iteratee._ import play.api.libs.json._ import com.ning.http.client.{Response, AsyncCompletionHandler} import org.reactivecouchbase.client.ReactiveCouchbaseException /** * Container to run N1QL query against a Couchbase Server. Uses it's own...
wsargent/ReactiveCouchbase-core
driver/src/test/scala/AppendSpec.scala
import org.reactivecouchbase.{CouchbaseRWImplicits, ReactiveCouchbaseDriver} import org.reactivecouchbase.CouchbaseRWImplicits.documentAsJsObjectReader import org.reactivecouchbase.CouchbaseRWImplicits.jsObjectToDocumentWriter import org.specs2.mutable.{Tags, Specification} import play.api.libs.json.{JsArray, JsObject,...
wsargent/ReactiveCouchbase-core
driver/src/test/scala/ViewsSpec.scala
<gh_stars>0 import com.couchbase.client.protocol.views.{Stale, Query} import org.reactivecouchbase.experimental.{TypedViewRow, Views} import org.reactivecouchbase.ReactiveCouchbaseDriver import org.specs2.mutable._ import play.api.libs.iteratee.Iteratee import play.api.libs.json.Json import scala.concurrent._ class Vi...
wsargent/ReactiveCouchbase-core
project/Build.scala
import sbt._ import Keys._ object ApplicationBuild extends Build { val appName = "ReactiveCouchbase-core" val appVersion = "0.3-SNAPSHOT" val appScalaVersion = "2.11.1" //val appScalaBinaryVersion = "2.10" val appScalaCrossVersions = Seq("2.11.1", "2.10.4") val local: Def.Initialize[Option[s...
wsargent/ReactiveCouchbase-core
driver/src/test/scala/AliasSpec.scala
<filename>driver/src/test/scala/AliasSpec.scala import org.reactivecouchbase.ReactiveCouchbaseDriver import org.reactivecouchbase.CouchbaseRWImplicits.documentAsJsObjectReader import org.reactivecouchbase.CouchbaseRWImplicits.jsObjectToDocumentWriter import org.specs2.mutable.{Tags, Specification} import play.api.libs....
gaborh-da/daml
ledger/ledger-api-common/src/test/suite/scala/com/digitalasset/ledger/api/validation/CommandSubmissionRequestValidatorTest.scala
// Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. // SPDX-License-Identifier: Apache-2.0 package com.digitalasset.ledger.api.validation import java.time.Instant import com.digitalasset.api.util.TimestampConversion import com.digitalasset.daml.lf.command.{Commands => L...
gaborh-da/daml
ledger/ledger-api-integration-tests/src/test/itsuite/scala/com/digitalasset/platform/tests/integration/ledger/api/TransactionServiceIT.scala
<reponame>gaborh-da/daml // Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. // SPDX-License-Identifier: Apache-2.0 package com.digitalasset.platform.tests.integration.ledger.api import java.time.{Duration, Instant} import akka.Done import akka.stream.scaladsl.{Flow, Si...
gaborh-da/daml
ledger/ledger-api-integration-tests/src/test/lib/scala/com/digitalasset/platform/PlatformApplications.scala
<reponame>gaborh-da/daml // Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. // SPDX-License-Identifier: Apache-2.0 package com.digitalasset.platform import java.io.File import java.nio.file.Path import java.time.Duration import com.digitalasset.platform.common.LedgerId...
gaborh-da/daml
ledger/ledger-api-integration-tests/src/test/lib/scala/com/digitalasset/platform/apitesting/LedgerFactories.scala
<gh_stars>0 // Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. // SPDX-License-Identifier: Apache-2.0 package com.digitalasset.platform.apitesting import java.io.{BufferedInputStream, FileInputStream, InputStream} import java.nio.file.Path import com.digitalasset.daml....
gaborh-da/daml
daml-lf/data/src/test/scala/com/digitalasset/daml/lf/data/RefTest.scala
// Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. // SPDX-License-Identifier: Apache-2.0 package com.digitalasset.daml.lf.data import com.digitalasset.daml.lf.data.Ref.{DottedName, PackageId, Party, QualifiedName} import org.scalatest.{FreeSpec, Matchers} class RefTes...
gaborh-da/daml
ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/SandboxMain.scala
<reponame>gaborh-da/daml // Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. // SPDX-License-Identifier: Apache-2.0 package com.digitalasset.platform.sandbox import java.util.concurrent.atomic.AtomicBoolean import com.digitalasset.platform.sandbox.cli.Cli import org.slf...
gaborh-da/daml
ledger/sandbox/src/main/scala/com/digitalasset/ledger/server/LedgerApiServer/ApiServices.scala
// Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. // SPDX-License-Identifier: Apache-2.0 package com.digitalasset.ledger.server.LedgerApiServer import akka.stream.ActorMaterializer import com.digitalasset.api.util.TimeProvider import com.digitalasset.daml.lf.data.Ref i...
gaborh-da/daml
ledger/ledger-api-integration-tests/src/test/itsuite/scala/com/digitalasset/platform/tests/integration/ledger/api/PackageServiceIT.scala
<reponame>gaborh-da/daml // Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. // SPDX-License-Identifier: Apache-2.0 package com.digitalasset.platform.tests.integration.ledger.api import java.util.UUID import com.digitalasset.ledger.api.testing.utils.{ AkkaBeforeAndAft...
gaborh-da/daml
ledger/ledger-api-integration-tests/src/test/lib/scala/com/digitalasset/platform/apitesting/MultiLedgerFixture.scala
<filename>ledger/ledger-api-integration-tests/src/test/lib/scala/com/digitalasset/platform/apitesting/MultiLedgerFixture.scala // Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. // SPDX-License-Identifier: Apache-2.0 package com.digitalasset.platform.apitesting import c...
gaborh-da/daml
ledger/ledger-api-common/src/main/scala/com/digitalasset/platform/api/v1/event/EventOps.scala
// Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. // SPDX-License-Identifier: Apache-2.0 package com.digitalasset.platform.api.v1.event import com.digitalasset.ledger.api.domain.{ContractId, EventId} import com.digitalasset.ledger.api.v1.event.Event.Event.{Archived, Cr...