Permalink
Browse files

formatting chnages

  • Loading branch information...
1 parent 6e5a5be commit e6e62b5cbd6659ac4c28138a39ebcca96f4c9d73 Chapalamadugu Muralikrishna committed Jul 3, 2013
@@ -11,7 +11,6 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests
import org.testng.annotations.Test
import scala.beans.BeanProperty
-import scala.Some
@ContextConfiguration(loader = classOf[AnnotationConfigContextLoader], classes = Array(classOf[AtsSpringDataConfig]))
@@ -30,9 +29,9 @@ class AtsRepositoryTest extends AbstractTestNGSpringContextTests with TestNGSuit
var requestHistoricalDataRepository: RequestHistoricalDataRepository = _;
- var marketData:RequestMarketData=_;
+ var marketData: RequestMarketData = _;
- @Test(dependsOnGroups = Array("addContract"),groups=Array("addRequestMarketData"))
+ @Test(dependsOnGroups = Array("addContract"), groups = Array("addRequestMarketData"))
def testAddRequestMarketData() {
val contract = AtsContractUtil.makeContract("BAC", "STK", null, null, null, null, "SMART", "USD", null, null, false, null, null)
contractRepository.saveAndFlush(contract);
@@ -42,19 +41,17 @@ class AtsRepositoryTest extends AbstractTestNGSpringContextTests with TestNGSuit
}
- @Test(dependsOnGroups = Array("addContract"),groups=Array("addRequestMarketData"))
+ @Test(dependsOnGroups = Array("addContract"), groups = Array("addRequestMarketData"))
def testAddRequestHistoricalData() {
val contract = AtsContractUtil.makeContract("BAC", "STK", null, null, null, null, "SMART", "USD", null, null, false, null, null)
contractRepository.saveAndFlush(contract);
- val data: RequestHistoricalData = RequestHistoricalDataUtil.makeRequestHistoricalData(contract,"ENDDATE","DURATION","BARSIZE","whattoshow",1,1);
+ val data: RequestHistoricalData = RequestHistoricalDataUtil.makeRequestHistoricalData(contract, "ENDDATE", "DURATION", "BARSIZE", "whattoshow", 1, 1);
val histData = requestHistoricalDataRepository.saveAndFlush(data)
assert(true)
}
-
-
@Test(groups = Array("addContract"))
def testAddContract() {
val contract = AtsContractUtil.makeContract("BAC", "STK", null, null, null, null, "SMART", "USD", null, null, false, null, null)
@@ -71,7 +68,7 @@ class AtsRepositoryTest extends AbstractTestNGSpringContextTests with TestNGSuit
assert(true)
}
- @Test(groups = Array("deleteSingleContract"),dependsOnGroups = Array("addContract","addRequestMarketData"))
+ @Test(groups = Array("deleteSingleContract"), dependsOnGroups = Array("addContract", "addRequestMarketData"))
def testDeleteOneRequestMarketData() {
this.requestMarketDataRepository.delete(marketData.getId);
assert(true)
@@ -84,7 +81,7 @@ class AtsRepositoryTest extends AbstractTestNGSpringContextTests with TestNGSuit
}
@Test
- def testfindByContractM_symbol(){
+ def testfindByContractM_symbol() {
val contracts = requestMarketDataRepository.findByContractMSymbol("BAC")
logger.debug(new XStream().toXML(contracts));
assert(true)
@@ -1,11 +1,12 @@
-package com.ats.service;
+package com.ats.service
+
+;
import com.ib.client.Contract
import org.testng.annotations.Test
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests
import org.springframework.test.context.ContextConfiguration
import org.scalatest.testng.TestNGSuite
-import com.ats.app.config.spring.SpringUtil
/**
@@ -27,10 +28,10 @@ class MarketDataServiceTest extends AbstractTestNGSpringContextTests with TestNG
@Test(groups = Array("marketDataService"))
def testAdd() {
- var contract:Contract = new Contract
+ var contract: Contract = new Contract
//contract.
- //item: RequestMarketData = new RequestMarketData(1,)
- //this.service.save();
+ //item: RequestMarketData = new RequestMarketData(1,)
+ //this.service.save();
}
}
@@ -1,4 +1,4 @@
-import com.ats.api.model.{AtsContract,AtsContractRepository, PortifolioItem, PortifolioItemRepository, PortifolioRepository}
+import com.ats.api.model.{AtsContract, AtsContractRepository, PortifolioItem, PortifolioItemRepository, PortifolioRepository}
import com.ats.app.config.spring.AtsSpringDataConfig
import java.lang.{Iterable, Long}
import java.util
@@ -8,7 +8,6 @@ import org.springframework.data.domain.{Sort, Page, Pageable}
import org.springframework.test.context.ContextConfiguration
import org.springframework.test.context.support.AnnotationConfigContextLoader
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests
-import org.springframework.transaction.annotation.Transactional
import org.testng.annotations.Test
import scala.beans.BeanProperty
@@ -88,6 +87,4 @@ class PortifolioRepositoryTest extends AbstractTestNGSpringContextTests with Tes
def exists(id: Long): Boolean = ???
-
-
}
@@ -16,13 +16,17 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader
*/
@ContextConfiguration(loader = classOf[AnnotationConfigContextLoader], classes = Array(classOf[AtsSpringDataConfig]))
-class TwsOrderSystemSpecs extends FeatureSpec with GivenWhenThen with BeforeAndAfterAll {
+class TwsOrderSystemSpecs extends FeatureSpec with GivenWhenThen with BeforeAndAfterAll {
new TestContextManager(this.getClass()).prepareTestInstance(this)
- feature("System can place order"){
- scenario("System places a order to BUY STOCK with SYMBOL BAC, QTY 100") {
- Given("The STOCK BAC,QTY 100")
+
+
+ feature("System can place order") {
+
+ scenario("System places a order to BUY STOCK") {
+ Given("The Broker is TWS")
+ Given("The STOCK to buy BAC and quantity 100")
//(pending)
When("placing order ")
//(pending)
@@ -34,7 +38,7 @@ class TwsOrderSystemSpecs extends FeatureSpec with GivenWhenThen with BeforeAndA
}
-
+ /**
override def beforeAll(configMap: Map[String, Any]) {
@@ -47,6 +51,8 @@ class TwsOrderSystemSpecs extends FeatureSpec with GivenWhenThen with BeforeAndA
override def afterAll(configMap: Map[String, Any]) {
}
+ * */
+ }
}
@@ -1,9 +1,9 @@
-package com.ats.impl.tws;
+package com.ats.impl.tws
+
+;
-import scala.collection.mutable.ListBuffer
import org.testng.annotations.Test
-import akka.actor.Props
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests
import org.springframework.test.context.ContextConfiguration
@@ -24,7 +24,7 @@ class TwsStarterTest extends AbstractTestNGSpringContextTests {
@Test(groups = Array("twsstarterinit"))
def testIfReceivingSameActor() {
- val starter:TwsStarter = new TwsStarter
+ val starter: TwsStarter = new TwsStarter
starter.init()
}
@@ -1,19 +1,11 @@
package com.ats.impl.tws.actor
-import org.scalatest.Assertions
-import scala.collection.mutable.ListBuffer
import org.testng.annotations.Test
-import com.ib.client.{EClientSocket, EWrapper,Contract}
-import com.ats.impl.tws.EWrapperImpl
-import akka.actor.{Props, ActorRef}
+import com.ib.client.Contract
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests
import org.springframework.test.context.ContextConfiguration
import org.scalatest.testng.TestNGSuite
-import akka.actor.Kill
-import akka.actor.PoisonPill
-import com.ats.api.model.RequestMarketData
-import com.ats.impl.tws.messages.TWSConnect
/**
* Created with IntelliJ IDEA.
@@ -23,40 +15,39 @@ import com.ats.impl.tws.messages.TWSConnect
* To change this template use File | Settings | File Templates.
*/
@ContextConfiguration(locations = Array("classpath:spring/applicationContext.xml"))
-class TWSPubTest extends AbstractTestNGSpringContextTests with TestNGSuite
- {
+class TWSPubTest extends AbstractTestNGSpringContextTests with TestNGSuite {
def initialize() {
- logger.debug("Comes here")
+ logger.debug("Comes here")
}
@Test(groups = Array("twspublish"))
def testReceiveConnect() {
-// twsPublisher ! new TWSConnect
-// Thread.sleep(20000);
-// twsPublisher ! Kill
+ // twsPublisher ! new TWSConnect
+ // Thread.sleep(20000);
+ // twsPublisher ! Kill
}
@Test(groups = Array("twspublish"))
def testIfReceivingSameActor() {
-// val twsPublisher1= TwsSupervisor.find(Props[TwsAdapterActorPublisher],classOf[TwsAdapterActorPublisher].getName());
-// val twsPublisher2= TwsSupervisor.find(Props[TwsAdapterActorPublisher],classOf[TwsAdapterActorPublisher].getName());
-// assert(twsPublisher1.path.name==twsPublisher2.path.name)
-// twsPublisher1 ! Kill
+ // val twsPublisher1= TwsSupervisor.find(Props[TwsAdapterActorPublisher],classOf[TwsAdapterActorPublisher].getName());
+ // val twsPublisher2= TwsSupervisor.find(Props[TwsAdapterActorPublisher],classOf[TwsAdapterActorPublisher].getName());
+ // assert(twsPublisher1.path.name==twsPublisher2.path.name)
+ // twsPublisher1 ! Kill
}
@Test(groups = Array("twspublish"))
def testSendingMarketRequestData() {
-// val twsPublisher= TwsSupervisor.find(Props[TwsAdapterActorPublisher],classOf[TwsAdapterActorPublisher].getName());
- val contract:Contract = new Contract
- contract.m_currency="USD"
- contract.m_exchange="SMART"
- contract.m_secType="STOCK"
- contract.m_symbol="BAC";
-// val item:RequestMarketData = new RequestMarketData(1,contract,"101")
- // twsPublisher ! item
- // Thread.sleep(100000)
- // twsPublisher ! Kill
+ // val twsPublisher= TwsSupervisor.find(Props[TwsAdapterActorPublisher],classOf[TwsAdapterActorPublisher].getName());
+ val contract: Contract = new Contract
+ contract.m_currency = "USD"
+ contract.m_exchange = "SMART"
+ contract.m_secType = "STOCK"
+ contract.m_symbol = "BAC";
+ // val item:RequestMarketData = new RequestMarketData(1,contract,"101")
+ // twsPublisher ! item
+ // Thread.sleep(100000)
+ // twsPublisher ! Kill
}
}

0 comments on commit e6e62b5

Please sign in to comment.