Skip to content

Commit

Permalink
Merge pull request #251 from norbert-radyk/remove-passed-info
Browse files Browse the repository at this point in the history
Removed the test completion affirmation/logging using explicit passed…
  • Loading branch information
xuwei-k committed Jun 2, 2018
2 parents 4daa6d8 + 5b2b88d commit b5ad13b
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 173 deletions.
4 changes: 0 additions & 4 deletions src/test/scala/org/squeryl/framework/QueryTester.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ trait QueryTester extends Matchers {
if(validateFirstAndExit >= 0)
validateFirstAndExit += 1
}

def passed(s: Symbol) = {} //println(s )
}



object SingleTestRun extends org.scalatest.Tag("SingleTestRun")
42 changes: 1 addition & 41 deletions src/test/scala/org/squeryl/test/musicdb/MusicDb.scala
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest

val r = q.map(q0 => (q0.key._1, q0.measures)).toSet
r shouldBe Set((herbyHancock.id, 1), (ponchoSanchez.id,1), (mongoSantaMaria.id,1), (alainCaron.id, 0), (hossamRamzy.id, 0))
passed('testJoinWithCompute)
}

test("OuterJoinWithSubQuery"){
Expand All @@ -147,8 +146,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest

val artistIdsWithSongs = q.filter(_._2 != None).map(_._1.id).toSet
artistIdsWithSongs shouldBe Set(herbyHancock.id,ponchoSanchez.id,mongoSantaMaria.id)

passed('testOuterJoinWithSubQuery)
}

test("OuterJoinInOuter", SingleTestRun){
Expand All @@ -171,8 +168,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
select(a, j2)
on(a.id === j2_.map(_._1.id))
).toList

passed('testOuterJoinInOuter)
}

lazy val songsFeaturingPoncho =
Expand Down Expand Up @@ -493,8 +488,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
val expected = List(mongoSantaMaria.firstName, ponchoSanchez.firstName).map(s=> s.toUpperCase + s.toLowerCase)

expected shouldBe q.toList

passed('testUpperAndLowerFuncs)
}
catch {
case e: UnsupportedOperationException => println("testUpperAndLowerFuncs: regex not supported by database adapter")
Expand All @@ -515,8 +508,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
val expected = List(mongoSantaMaria.firstName, ponchoSanchez.firstName).map(s=> s + "zozo")

expected shouldBe q.toList

passed('testConcatFunc)
}

test("Timestamp"){
Expand Down Expand Up @@ -550,8 +541,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
).headOption

assert(mustBeSome != None, "testTimestamp failed");

passed('testTimestamp)
}

private def _truncateTimestampInTimeOfLastUpdate(p: Person) = {
Expand Down Expand Up @@ -610,8 +599,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
//val res = mongo.timeOfLastUpdate

cal.getTime shouldBe res

passed('testTimestampPartialUpdate)
}

test("TimestampDownToMillis"){
Expand Down Expand Up @@ -642,8 +629,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
if(!dbAdapter.isInstanceOf[MySQLAdapter]) {
tX2 shouldBe mongo.timeOfLastUpdate
}

passed('testTimestampDownToMillis)
}
}

Expand Down Expand Up @@ -673,7 +658,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
artists.update(ac)
ac = artists.where(a=> a.id === alainCaron.id).single
assert(ac.lastName == "Karon", 'testUpdate1 + " failed, expected Karon, got " + ac.lastName)
passed('testUpdate1 )
}

test("KeyedEntityImplicitLookup"){
Expand All @@ -682,7 +666,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
val ac = artists.lookup(alainCaron.id).get

assert(ac.id == alainCaron.id, "expected " + alainCaron.id + " got " + ac.id)
passed('testKeyedEntityImplicitLookup)
}

test("DeleteVariations"){
Expand All @@ -699,8 +682,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
assert(c == 1, "deleteWhere failed, expected 1 row delete count, got " + c)

assert(artists.lookup(artistForDelete.id) == None, "object still exist after delete")

passed('testDeleteVariations)
}

def inhibitedArtistsInQuery(inhibit: Boolean) =
Expand Down Expand Up @@ -728,10 +709,7 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest

val ponchoSongs = List(besameMama.title, freedomSound.title, watermelonMan.title)

validateQuery('songsNotInhibited, songsNotInhibited, (s:Song)=>s.title,
ponchoSongs)

passed('testDynamicQuery1)
validateQuery('songsNotInhibited, songsNotInhibited, (s:Song)=>s.title, ponchoSongs)
}

def inhibitedSongsInQuery(inhibit: Boolean) =
Expand Down Expand Up @@ -764,8 +742,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
validateQuery('inhibitedSongsInQuery, songArtistsTuples, (t:(Option[Song],Person)) => (t._1.get.id, t._2.id),
expected.toList
)

passed('testDynamicQuery2)
}

test("PaginatedQuery1"){
Expand All @@ -787,8 +763,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
assertionFailed('testPaginatedQuery1, p1, ep1)
assertionFailed('testPaginatedQuery1, p2, ep2)
assertionFailed('testPaginatedQuery1, p3, ep3)

passed('testPaginatedQuery1)
}


Expand All @@ -813,8 +787,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
assertionFailed('testBetweenOperator, p1, ep1)
assertionFailed('testBetweenOperator, p2, ep2)
assertionFailed('testBetweenOperator, p3, ep3)

passed('testBetweenOperator)
}

// test("leakTest"){
Expand Down Expand Up @@ -943,8 +915,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
wmm = songs.where(_.id === watermelonMan.id).single

Some(Genre.Latin) shouldBe wmm.secondaryGenre

passed('testEnums)
}

test("DynamicWhereClause1"){
Expand All @@ -963,8 +933,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest

Set(ponchoSanchez.id) shouldBe q3.map(_.id).toSet

passed('testDynamicWhereClause1)

/// Non compilation Test (should not compile):
// val z1 = from(artists)(a => select(&(nvl(a.age,a.age)))).toList : List[Option[Int]]

Expand All @@ -986,8 +954,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
val q = artists.where(_.firstName in Nil).toList

Nil shouldBe q

passed('testInTautology)
}

test("NotInTautology"){
Expand All @@ -997,8 +963,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
val q = artists.where(_.firstName notIn Nil).map(_.id).toSet

allArtists shouldBe q

passed('testNotInTautology)
}

test("AggregateQueryOnRightHandSideOfInOperator"){
Expand Down Expand Up @@ -1031,8 +995,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest

//shouldn't compile :
//artists.where(_.age in from(artists)(a=> compute(max(a.name))))

passed('testAggregateQueryOnRightHandSideOfInOperator)
}

test("AggregateComputeInSubQuery"){
Expand Down Expand Up @@ -1065,8 +1027,6 @@ abstract class MusicDbTestRun extends SchemaTester with QueryTester with RunTest
)
// should run without exception against the Db :
q4.toList

passed('testAggregateComputeInSubQuery)
}

test("OptionalOuterJoin"){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ abstract class SchoolDb2MetableRelations extends SchemaTester with QueryTester w
professeurTournesol.courses.dissociateAll shouldBe 0

courseAssignments.Count.toLong shouldBe 0

passed('testMany2ManyAssociationFromLeftSide)
}

test("Many2ManyAssociationFromRightSide"){
Expand Down Expand Up @@ -166,8 +164,6 @@ abstract class SchoolDb2MetableRelations extends SchemaTester with QueryTester w

physicsCourse.professors.dissociate(professeurTournesol) shouldBe true
physicsCourse.professors.dissociate(professeurTournesol) shouldBe false

passed('testMany2ManyAssociationsFromRightSide)
}

test("OneToMany"){
Expand Down Expand Up @@ -231,7 +227,5 @@ abstract class SchoolDb2MetableRelations extends SchemaTester with QueryTester w

// 2) philosophyCourse3PMFriday.subject points to the proper subject
computationTheory.name shouldBe philosophyCourse3PMFriday.subject.one.get.name

passed('testOneToMany)
}
}
Loading

0 comments on commit b5ad13b

Please sign in to comment.