Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
Adapt toString methods #27
Browse files Browse the repository at this point in the history
  • Loading branch information
tdauth committed Apr 4, 2019
1 parent 36985aa commit 11c4112
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ package de.retest.guistatemachine.api

import de.retest.surili.commons.actions.Action

class ActionIdentifier(action: Action) extends HashIdentifier(action)
class ActionIdentifier(action: Action) extends HashIdentifier(action) {
val msg = s"ActionIdentifier[action=${action.toString}, hash=$hash]"
override def toString: String = msg
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class HashIdentifier(serializable: Serializable) extends scala.Serializable {

override def hashCode(): Int = hash.hashCode

override def toString: String = s"hash=$hash"
override def toString: String = s"HashIdentifier[hash=$hash]"

}

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/de/retest/guistatemachine/api/State.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ trait State {

override def hashCode(): Int = this.getSutStateIdentifier.hashCode()

override def toString: String = s"sutStateIdentifier=$getSutStateIdentifier"
override def toString: String = s"State[sutStateIdentifier=$getSutStateIdentifier]"

/**
* Adds a new transition to the state which is only allowed by calling the methods of [[GuiStateMachine]].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ package de.retest.guistatemachine.api

import de.retest.recheck.ui.descriptors.SutState

class SutStateIdentifier(sutState: SutState) extends HashIdentifier(sutState)
class SutStateIdentifier(sutState: SutState) extends HashIdentifier(sutState) {
val msg = s"SutStateIdentifier[sutState=${sutState.toString}, hash=$hash]"
override def toString: String = msg
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class StateImplSpec extends AbstractApiSpec {

"be converted into a string" in {
val s0 = StateImpl(sutStateAIdentifier)
s0.toString shouldEqual "sutStateIdentifier=hash=0e4fd44f14d365fae3a7f3579b7ef013e1167e0f4ef6de418367b81edc63450d"
s0.toString shouldEqual "State[sutStateIdentifier=SutStateIdentifier[sutState=State[descriptor=[]], hash=0e4fd44f14d365fae3a7f3579b7ef013e1167e0f4ef6de418367b81edc63450d]]"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class GuiStateMachineGMLSerializerSpec extends AbstractApiSpec with BeforeAndAft
| node
| [
| id 1
| label "hash=acd05dfba59670825451169c470d430727226dd0dec48c64961305a0c5ab1ecb"
| label "SutStateIdentifier[sutState=State[descriptor=[]], hash=acd05dfba59670825451169c470d430727226dd0dec48c64961305a0c5ab1ecb]"
| graphics
| [
| type "rectangle"
Expand All @@ -69,7 +69,7 @@ class GuiStateMachineGMLSerializerSpec extends AbstractApiSpec with BeforeAndAft
| node
| [
| id 2
| label "hash=c44472d3d18e4f62b073a232e3119de9d94d3c6242b65125f454d62aced7f84e"
| label "SutStateIdentifier[sutState=State[descriptor=[, , ]], hash=c44472d3d18e4f62b073a232e3119de9d94d3c6242b65125f454d62aced7f84e]"
| graphics
| [
| type "rectangle"
Expand All @@ -86,7 +86,7 @@ class GuiStateMachineGMLSerializerSpec extends AbstractApiSpec with BeforeAndAft
| id 3
| source 1
| target 2
| label "hash=240d08498736de4d893c146fd64b58b1ae1eda8c36a565919b035d86c6ee2084"
| label "ActionIdentifier[action=NavigateToAction(url=http://wikipedia.org), hash=240d08498736de4d893c146fd64b58b1ae1eda8c36a565919b035d86c6ee2084]"
| LabelGraphics
| [
| model "centered"
Expand All @@ -104,7 +104,7 @@ class GuiStateMachineGMLSerializerSpec extends AbstractApiSpec with BeforeAndAft
| id 4
| source 1
| target 2
| label "hash=fd00ea22cb50efd96c3ff59d8900685d0d64f2cee1e77873133e7e186afd2e7f"
| label "ActionIdentifier[action=NavigateToAction(url=http://google.com), hash=fd00ea22cb50efd96c3ff59d8900685d0d64f2cee1e77873133e7e186afd2e7f]"
| LabelGraphics
| [
| model "centered"
Expand All @@ -122,7 +122,7 @@ class GuiStateMachineGMLSerializerSpec extends AbstractApiSpec with BeforeAndAft
| id 5
| source 2
| target 1
| label "hash=240d08498736de4d893c146fd64b58b1ae1eda8c36a565919b035d86c6ee2084"
| label "ActionIdentifier[action=NavigateToAction(url=http://wikipedia.org), hash=240d08498736de4d893c146fd64b58b1ae1eda8c36a565919b035d86c6ee2084]"
| LabelGraphics
| [
| model "centered"
Expand All @@ -140,7 +140,7 @@ class GuiStateMachineGMLSerializerSpec extends AbstractApiSpec with BeforeAndAft
| id 6
| source 2
| target 1
| label "hash=fd00ea22cb50efd96c3ff59d8900685d0d64f2cee1e77873133e7e186afd2e7f"
| label "ActionIdentifier[action=NavigateToAction(url=http://google.com), hash=fd00ea22cb50efd96c3ff59d8900685d0d64f2cee1e77873133e7e186afd2e7f]"
| LabelGraphics
| [
| model "centered"
Expand Down

0 comments on commit 11c4112

Please sign in to comment.