Skip to content

Instantly share code, notes, and snippets.

@suapapa
Created April 12, 2012 05:04
Show Gist options
  • Save suapapa/2364697 to your computer and use it in GitHub Desktop.
Save suapapa/2364697 to your computer and use it in GitHub Desktop.
Diagrams for MediaScannerClient of Android base framework and it's test
#!/bin/bash
PLANTUML="java -jar `realpath ~/apps/plantuml/plantuml.jar` -o `pwd`"
$PLANTUML MediaScannerClient.puml
$PLANTUML MediaScannerClient_test.puml
@startuml
"startFile()" --> ===B1===
--> "addStringTag(name, value)"
if "" then
-right->[value is ASCII] "handleStringTag()"
-down-> ===B2===
else
-down-> "push name & value to mName & mValue"
-down-> ===B2===
endif
-down-> "endFile()"
if "check mName & mValue" then
-right->[not empty] "bitwise AND all possibleEncodings(value)" #ff4500
-up-> "convertValues(encodings & mLocaleEncoding)" #ff4500
--> "handleStringTag()"
endif
@enduml
@startuml
package libgtest
class "testing::Test" {
#{abstract} SetUp()
#{abstract} TearDown()
}
end package
package libmedia
class MediaScannerClient {
#convertValues(encoding)
#mNames
#mValue
#mLocaleEncoding
+setLocale(locale)
+beginFile()
+addStringTag(name, value)
+endFile()
+{abstract} handleStringTag(name, value)
}
end package
package MediaScannerClient_test #43768E
class TestableMediaScannerClient {
-_results
-_isResultSorted
+addStringTagWithIdx(idx, value)
+addNativeTagWithIdx(idx, value)
+initResults()
+releseResults()
+getResult(idx)
+handleStringTag(name, value)
}
class MediaScannerClientTest {
#client
#SetUp()
#TearDown()
}
end package
"testing::Test" <|-- MediaScannerClientTest
MediaScannerClient <|-- TestableMediaScannerClient
MediaScannerClientTest *- TestableMediaScannerClient : client
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment