Permalink
Browse files

Merged local changes

  • Loading branch information...
1 parent 45e6717 commit 05402cd6f61aa2ab4898833385e1b01f8497ca99 @petrhosek petrhosek committed Jan 21, 2012
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectCodeStyleSettingsManager">
+ <option name="PER_PROJECT_SETTINGS">
+ <value>
+ <option name="LINE_SEPARATOR" value="&#10;" />
+ <XML>
+ <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
+ </XML>
+ </value>
+ </option>
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
+ </component>
+</project>
+
View
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="HighlightingAdvisor">
+ <option name="SUGGEST_TYPE_AWARE_HIGHLIGHTING" value="false" />
+ </component>
+</project>
+
View
@@ -2,8 +2,8 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
- <module fileurl="file://$PROJECT_DIR$/Colladoc.iml" filepath="$PROJECT_DIR$/Colladoc.iml" />
- <module fileurl="file://$PROJECT_DIR$/SBT-project.iml" filepath="$PROJECT_DIR$/SBT-project.iml" />
+ <module fileurl="file://$PROJECT_DIR$/.idea_modules/default.iml" filepath="$PROJECT_DIR$/.idea_modules/default.iml" />
+ <module fileurl="file://$PROJECT_DIR$/.idea_modules/project.iml" filepath="$PROJECT_DIR$/.idea_modules/project.iml" />
</modules>
</component>
</project>
@@ -0,0 +1,5 @@
+<component name="DependencyValidationManager">
+ <state>
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+ </state>
+</component>
View
@@ -22,20 +22,23 @@ libraryDependencies ++= {
libraryDependencies ++= Seq(
"joda-time" % "joda-time" % "1.6.2" % "compile",
- "org.eclipse.jetty" % "jetty-webapp" % "7.3.0.v20110203" % "test,container",
- "ch.qos.logback" % "logback-classic" % "0.9.26",
+ "org.eclipse.jetty" % "jetty-webapp" % "8.0.1.v20110908" % "test,container",
+ "javax.servlet" % "servlet-api" % "2.5" % "provided",
+ "ch.qos.logback" % "logback-classic" % "0.9.26" % "compile",
"junit" % "junit" % "4.8.2" % "test->default",
- "org.jmock" % "jmock-junit4" % "2.5.1" % "test->default",
- "org.jmock" % "jmock-legacy" %"2.5.1" % "test->default",
+ "org.mockito" % "mockito-all" % "1.9.0-rc1" % "test->default",
"cglib" % "cglib" %"2.1_3" % "test->default",
- "org.objenesis" % "objenesis" %"1.0" % "test->default",
- "org.scala-tools.testing" % "specs_2.8.1" % "1.6.6" % "test->default",
+ "org.specs2" % "specs2_2.9.0" % "1.5" % "test->default",
+ "org.specs2" % "specs2-scalaz-core_2.9.0" % "6.0.RC2" % "test->default",
"org.seleniumhq.selenium" % "selenium-firefox-driver" % "2.5.0" % "test->default",
"org.seleniumhq.selenium" % "selenium-server" % "2.5.0" % "test->default",
"com.h2database" % "h2" % "1.2.144" % "runtime",
"postgresql" % "postgresql" % "8.4-701.jdbc4" % "runtime"
- )
-
-resolvers += ScalaToolsSnapshots
-
-resolvers += "Java.net Repo" at "http://download.java.net/maven/2/"
+)
+
+resolvers ++= Seq(
+ "snapshots" at "http://scala-tools.org/repo-snapshots",
+ "releases" at "http://scala-tools.org/repo-releases",
+ "Jetty Repo" at "http://repo1.maven.org/maven2/org/mortbay/jetty",
+ "Java.net Repo" at "http://download.java.net/maven/2/"
+)
File renamed without changes.
2 scala
Submodule scala updated from 68bbb2 to e5b07e
@@ -179,13 +179,15 @@ class SearchIndex(rootPackage : Package, indexDirectory : Directory, commentToSt
// We could be dealing with a huge list here so it's important that we cons
// as efficiently as possible.
var remainingMembers = members.tail
- additionalMembers.foreach((m)=> {
- // Make sure that we do not try to index a member that we have indexed
- // already!
- if (!entityLookup.containsValue(m)) {
- remainingMembers = m :: remainingMembers
- }
- })
+ if (!additionalMembers.isEmpty) {
+ additionalMembers.foreach((m)=> {
+ // Make sure that we do not try to index a member that we have indexed
+ // already!
+ if (!entityLookup.containsValue(m)) {
+ remainingMembers = m :: remainingMembers
+ }
+ })
+ }
// Finally, the recursive step, index the remaining members...
// NOTE: Tail call recursion is REQUIRED here because of the depth of
@@ -1,21 +1,24 @@
package scala.tools.colladoc.integration
-import org.specs.Specification
+import org.specs2.mutable._
+import org.specs2.specification._
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.webapp.WebAppContext
import org.openqa.selenium.server.{RemoteControlConfiguration, SeleniumServer}
import com.thoughtworks.selenium.DefaultSelenium
import tools.colladoc.lib.DependencyFactory
import tools.colladoc.util.TestProps
-object SearchEndToEndTests extends Specification {
+trait SearchEndToEndTests extends Specification {
private val pageLoadTimeoutInMs = "30000"
private var server : Server = null
private var selenium : DefaultSelenium = null
private var seleniumServer : SeleniumServer = null
- doBeforeSpec {
+ override def map(fs: => Fragments) = Step(startSelenium) ^ fs ^ Step(stopSelenium)
+
+ def startSelenium = {
val GUI_PORT = 8080
val SELENIUM_SERVER_PORT = 4444
@@ -43,12 +46,20 @@ object SearchEndToEndTests extends Specification {
// Setting up the Selenium Client for the duration of the tests
selenium = new DefaultSelenium("localhost",
- SELENIUM_SERVER_PORT,
- "*firefox",
- "http://localhost:"+GUI_PORT+"/")
+ SELENIUM_SERVER_PORT,
+ "*firefox",
+ "http://localhost:"+GUI_PORT+"/")
selenium.start()
}
+ def stopSelenium = {
+ // Close everything when done
+ selenium.close()
+ selenium.stop()
+ server.stop()
+ seleniumServer.stop()
+ }
+
// TODO: setup selenium in the right way!
/*"a user" should {
// We want to share the same selenium objects throughout all examples.
@@ -88,14 +99,6 @@ object SearchEndToEndTests extends Specification {
}
}*/
- doAfterSpec {
- // Close everything when done
- selenium.close()
- selenium.stop()
- server.stop()
- seleniumServer.stop()
- }
-
private def enterSearchQuery(q : String) = {
selenium.`type`("svalue", q)
selenium.click("searchbtn")
@@ -1,13 +1,13 @@
package scala.tools.colladoc.model
-import org.specs.mock._
+import org.specs2.mock._
import tools.nsc.doc.model._
/**
* Mock for the Classes, traits and Objects
* @author: rumi
*/
-trait DocTemplateEntityMock extends AnyRef with JMocker with ClassMocker {
+trait DocTemplateEntityMock extends Mockito {
val mockClass = mock[Class]
val mockTrait = mock[Trait]
val mockObject = mock[Object]
@@ -22,19 +22,17 @@ trait DocTemplateEntityMock extends AnyRef with JMocker with ClassMocker {
val notTraitTemplateEntityName = "NotTestTrait"
def expectationsForDocTemplateEntity(mockEntity: DocTemplateEntity) {
- expect {
- one(mockEntity).linearizationTemplates willReturn (List[TemplateEntity](traitTemplateEntity, notTraitTemplateEntity))
+ there was one(mockEntity).linearizationTemplates returns (List[TemplateEntity](traitTemplateEntity, notTraitTemplateEntity))
- // From all TemplateEntities for the class(all with) get the name only for the one that are Traits
- // Make sure that if EntityTemplate is not a trait its name is not added
- one(traitTemplateEntity).name willReturn traitTemplateEntityName
- one(notTraitTemplateEntity).name willReturn notTraitTemplateEntityName
- allowing(traitTemplateEntity).isTrait willReturn true
- allowing(notTraitTemplateEntity).isTrait willReturn false
+ // From all TemplateEntities for the class(all with) get the name only for the one that are Traits
+ // Make sure that if EntityTemplate is not a trait its name is not added
+ there was one(traitTemplateEntity).name returns traitTemplateEntityName
+ there was one(notTraitTemplateEntity).name returns notTraitTemplateEntityName
+ traitTemplateEntity.isTrait returns true
+ notTraitTemplateEntity.isTrait returns false
- // Get the visibility of the class
- one(mockEntity).visibility willReturn mockVisibility
- one(mockVisibility).isPublic willReturn true
- }
+ // Get the visibility of the class
+ there was one(mockEntity).visibility returns mockVisibility
+ there was one(mockVisibility).isPublic returns true
}
}
@@ -1,6 +1,6 @@
package scala.tools.colladoc.model
-import org.specs.mock._
+import org.specs2.mock._
import tools.nsc.doc.model._
import tools.nsc.doc.model.comment.{Body, Comment}
import mapper.CommentToString
@@ -9,7 +9,7 @@ import mapper.CommentToString
* Mock for entity member.
* @author rumi
*/
-trait EntityMemberMock extends AnyRef with JMocker with ClassMocker {
+trait EntityMemberMock extends Mockito {
// Package
var mockPackage: Package = _
val packageName = "Mocked Package"
@@ -36,44 +36,34 @@ trait EntityMemberMock extends AnyRef with JMocker with ClassMocker {
}
def expectationsForEmptyPackage = {
- expect {
- defaultExpectationsForPackage()
- one(mockPackage).members willReturn (List[MemberEntity]())
- }
+ defaultExpectationsForPackage()
+ one(mockPackage).members willReturn (List[MemberEntity]())
}
def expectationsForPackageWithEntity(memberEntity: MemberEntity) = {
- expect {
- defaultExpectationsForPackage()
- one(mockPackage).members willReturn (List[MemberEntity](memberEntity))
- }
+ defaultExpectationsForPackage()
+ one(mockPackage).members willReturn (List[MemberEntity](memberEntity))
}
def expectationsForAnyMemberEntityWithUserComment(mockEntity: MemberEntity) = {
- expect {
- one(mockEntity).name willReturn entityName
- one(commentMapper).latestToString(mockEntity) willReturn (Some(defaultUserComment))
- allowingMatch("members")
- }
+ one(mockEntity).name willReturn entityName
+ one(commentMapper).latestToString(mockEntity) willReturn (Some(defaultUserComment))
+ allowingMatch("members")
}
def expectationsForAnyMemberEntityWithComment(mockEntity: MemberEntity) = {
val entityComment: Comment = new TestComment()
- expect {
- one(mockEntity).name willReturn entityName
- one(commentMapper).latestToString(mockEntity) willReturn (None)
- one(mockEntity).comment willReturn (Some(entityComment))
- allowingMatch("members")
- }
+ one(mockEntity).name willReturn entityName
+ one(commentMapper).latestToString(mockEntity) willReturn (None)
+ one(mockEntity).comment willReturn (Some(entityComment))
+ allowingMatch("members")
}
def expectationsForAnyMemberEntityWithoutComment(mockEntity: MemberEntity) = {
- expect {
- one(mockEntity).name willReturn entityName
- one(commentMapper).latestToString(mockEntity) willReturn (None)
- one(mockEntity).comment willReturn (None)
- allowingMatch("members")
- }
+ one(mockEntity).name willReturn entityName
+ one(commentMapper).latestToString(mockEntity) willReturn (None)
+ one(mockEntity).comment willReturn (None)
+ allowingMatch("members")
}
// Although Comment class can be mocked, expectations cannot be applied to the toString method
@@ -1,7 +1,7 @@
package scala.tools.colladoc.model
import tools.nsc.doc.model._
-import org.specs.SpecificationWithJUnit
+import org.specs2.SpecificationWithJUnit
import tools.nsc.doc.model.MemberEntity
import org.apache.lucene.store.{RAMDirectory, Directory}
import tools.nsc.doc.model.Package

0 comments on commit 05402cd

Please sign in to comment.