diff --git a/README b/README index b2bce7f..09fdded 100644 --- a/README +++ b/README @@ -13,9 +13,9 @@ our repository at github: http://github.com/pocmo/Yaaic -See also the "test package" for unit tests & co.: - -http://github.com/pocmo/Yaaic-Test +The application project is located in application/ while the test/ +folder contains unit and scenario tests. (They are two separate +projects!) -------------------------------------------------------------------- diff --git a/.classpath b/application/.classpath similarity index 100% rename from .classpath rename to application/.classpath index 6efcbb7..609aa00 100644 --- a/.classpath +++ b/application/.classpath @@ -1,7 +1,7 @@ - + diff --git a/.project b/application/.project similarity index 100% rename from .project rename to application/.project diff --git a/AndroidManifest.xml b/application/AndroidManifest.xml similarity index 100% rename from AndroidManifest.xml rename to application/AndroidManifest.xml diff --git a/build.properties b/application/build.properties similarity index 56% rename from build.properties rename to application/build.properties index ca1cb41..d624cd9 100644 --- a/build.properties +++ b/application/build.properties @@ -1,2 +1,2 @@ # Output directory for builds -out.dir=./builds/ant/ +out.dir=../builds/ant/ diff --git a/build.xml b/application/build.xml similarity index 100% rename from build.xml rename to application/build.xml diff --git a/default.properties b/application/default.properties similarity index 100% rename from default.properties rename to application/default.properties diff --git a/res/drawable/action.png b/application/res/drawable/action.png similarity index 100% rename from res/drawable/action.png rename to application/res/drawable/action.png diff --git a/res/drawable/background.png b/application/res/drawable/background.png similarity index 100% rename from res/drawable/background.png rename to application/res/drawable/background.png diff --git a/res/drawable/connected.png b/application/res/drawable/connected.png similarity index 100% rename from res/drawable/connected.png rename to application/res/drawable/connected.png diff --git a/res/drawable/connecting.png b/application/res/drawable/connecting.png similarity index 100% rename from res/drawable/connecting.png rename to application/res/drawable/connecting.png diff --git a/res/drawable/disconnected.png b/application/res/drawable/disconnected.png similarity index 100% rename from res/drawable/disconnected.png rename to application/res/drawable/disconnected.png diff --git a/res/drawable/error.png b/application/res/drawable/error.png similarity index 100% rename from res/drawable/error.png rename to application/res/drawable/error.png diff --git a/res/drawable/icon.png b/application/res/drawable/icon.png similarity index 100% rename from res/drawable/icon.png rename to application/res/drawable/icon.png diff --git a/res/drawable/info.png b/application/res/drawable/info.png similarity index 100% rename from res/drawable/info.png rename to application/res/drawable/info.png diff --git a/res/drawable/join.png b/application/res/drawable/join.png similarity index 100% rename from res/drawable/join.png rename to application/res/drawable/join.png diff --git a/res/drawable/menu_users.png b/application/res/drawable/menu_users.png similarity index 100% rename from res/drawable/menu_users.png rename to application/res/drawable/menu_users.png diff --git a/res/drawable/op.png b/application/res/drawable/op.png similarity index 100% rename from res/drawable/op.png rename to application/res/drawable/op.png diff --git a/res/drawable/part.png b/application/res/drawable/part.png similarity index 100% rename from res/drawable/part.png rename to application/res/drawable/part.png diff --git a/res/drawable/quit.png b/application/res/drawable/quit.png similarity index 100% rename from res/drawable/quit.png rename to application/res/drawable/quit.png diff --git a/res/drawable/voice.png b/application/res/drawable/voice.png similarity index 100% rename from res/drawable/voice.png rename to application/res/drawable/voice.png diff --git a/res/drawable/warning.png b/application/res/drawable/warning.png similarity index 100% rename from res/drawable/warning.png rename to application/res/drawable/warning.png diff --git a/res/layout/about.xml b/application/res/layout/about.xml similarity index 100% rename from res/layout/about.xml rename to application/res/layout/about.xml diff --git a/res/layout/addserveritem.xml b/application/res/layout/addserveritem.xml similarity index 100% rename from res/layout/addserveritem.xml rename to application/res/layout/addserveritem.xml diff --git a/res/layout/aliasadd.xml b/application/res/layout/aliasadd.xml similarity index 100% rename from res/layout/aliasadd.xml rename to application/res/layout/aliasadd.xml diff --git a/res/layout/aliasitem.xml b/application/res/layout/aliasitem.xml similarity index 100% rename from res/layout/aliasitem.xml rename to application/res/layout/aliasitem.xml diff --git a/res/layout/channeladd.xml b/application/res/layout/channeladd.xml similarity index 100% rename from res/layout/channeladd.xml rename to application/res/layout/channeladd.xml diff --git a/res/layout/channeldialog.xml b/application/res/layout/channeldialog.xml similarity index 100% rename from res/layout/channeldialog.xml rename to application/res/layout/channeldialog.xml diff --git a/res/layout/channelitem.xml b/application/res/layout/channelitem.xml similarity index 100% rename from res/layout/channelitem.xml rename to application/res/layout/channelitem.xml diff --git a/res/layout/commandadd.xml b/application/res/layout/commandadd.xml similarity index 100% rename from res/layout/commandadd.xml rename to application/res/layout/commandadd.xml diff --git a/res/layout/commanditem.xml b/application/res/layout/commanditem.xml similarity index 100% rename from res/layout/commanditem.xml rename to application/res/layout/commanditem.xml diff --git a/res/layout/conversations.xml b/application/res/layout/conversations.xml similarity index 100% rename from res/layout/conversations.xml rename to application/res/layout/conversations.xml diff --git a/res/layout/join.xml b/application/res/layout/join.xml similarity index 100% rename from res/layout/join.xml rename to application/res/layout/join.xml diff --git a/res/layout/message.xml b/application/res/layout/message.xml similarity index 100% rename from res/layout/message.xml rename to application/res/layout/message.xml diff --git a/res/layout/rounded.xml b/application/res/layout/rounded.xml similarity index 100% rename from res/layout/rounded.xml rename to application/res/layout/rounded.xml diff --git a/res/layout/serveradd.xml b/application/res/layout/serveradd.xml similarity index 100% rename from res/layout/serveradd.xml rename to application/res/layout/serveradd.xml diff --git a/res/layout/serveritem.xml b/application/res/layout/serveritem.xml similarity index 100% rename from res/layout/serveritem.xml rename to application/res/layout/serveritem.xml diff --git a/res/layout/servers.xml b/application/res/layout/servers.xml similarity index 100% rename from res/layout/servers.xml rename to application/res/layout/servers.xml diff --git a/res/layout/user.xml b/application/res/layout/user.xml similarity index 100% rename from res/layout/user.xml rename to application/res/layout/user.xml diff --git a/res/layout/useritem.xml b/application/res/layout/useritem.xml similarity index 100% rename from res/layout/useritem.xml rename to application/res/layout/useritem.xml diff --git a/res/layout/users.xml b/application/res/layout/users.xml similarity index 100% rename from res/layout/users.xml rename to application/res/layout/users.xml diff --git a/res/menu/conversations.xml b/application/res/menu/conversations.xml similarity index 100% rename from res/menu/conversations.xml rename to application/res/menu/conversations.xml diff --git a/res/menu/servers.xml b/application/res/menu/servers.xml similarity index 100% rename from res/menu/servers.xml rename to application/res/menu/servers.xml diff --git a/res/values-de/strings.xml b/application/res/values-de/strings.xml similarity index 100% rename from res/values-de/strings.xml rename to application/res/values-de/strings.xml diff --git a/res/values-es/strings.xml b/application/res/values-es/strings.xml similarity index 100% rename from res/values-es/strings.xml rename to application/res/values-es/strings.xml diff --git a/res/values-fr/strings.xml b/application/res/values-fr/strings.xml similarity index 100% rename from res/values-fr/strings.xml rename to application/res/values-fr/strings.xml diff --git a/res/values-ja/strings.xml b/application/res/values-ja/strings.xml similarity index 100% rename from res/values-ja/strings.xml rename to application/res/values-ja/strings.xml diff --git a/res/values-zh/strings.xml b/application/res/values-zh/strings.xml similarity index 100% rename from res/values-zh/strings.xml rename to application/res/values-zh/strings.xml diff --git a/res/values/application.xml b/application/res/values/application.xml similarity index 100% rename from res/values/application.xml rename to application/res/values/application.xml diff --git a/res/values/arrays.xml b/application/res/values/arrays.xml similarity index 100% rename from res/values/arrays.xml rename to application/res/values/arrays.xml diff --git a/res/values/charsets.xml b/application/res/values/charsets.xml similarity index 100% rename from res/values/charsets.xml rename to application/res/values/charsets.xml diff --git a/res/values/settings.xml b/application/res/values/settings.xml similarity index 100% rename from res/values/settings.xml rename to application/res/values/settings.xml diff --git a/res/values/strings.xml b/application/res/values/strings.xml similarity index 100% rename from res/values/strings.xml rename to application/res/values/strings.xml diff --git a/res/xml/preferences.xml b/application/res/xml/preferences.xml similarity index 100% rename from res/xml/preferences.xml rename to application/res/xml/preferences.xml diff --git a/src/org/jibble/pircbot/Colors.java b/application/src/org/jibble/pircbot/Colors.java similarity index 100% rename from src/org/jibble/pircbot/Colors.java rename to application/src/org/jibble/pircbot/Colors.java diff --git a/src/org/jibble/pircbot/DccChat.java b/application/src/org/jibble/pircbot/DccChat.java similarity index 100% rename from src/org/jibble/pircbot/DccChat.java rename to application/src/org/jibble/pircbot/DccChat.java diff --git a/src/org/jibble/pircbot/DccFileTransfer.java b/application/src/org/jibble/pircbot/DccFileTransfer.java similarity index 100% rename from src/org/jibble/pircbot/DccFileTransfer.java rename to application/src/org/jibble/pircbot/DccFileTransfer.java diff --git a/src/org/jibble/pircbot/DccManager.java b/application/src/org/jibble/pircbot/DccManager.java similarity index 100% rename from src/org/jibble/pircbot/DccManager.java rename to application/src/org/jibble/pircbot/DccManager.java diff --git a/src/org/jibble/pircbot/IdentServer.java b/application/src/org/jibble/pircbot/IdentServer.java similarity index 100% rename from src/org/jibble/pircbot/IdentServer.java rename to application/src/org/jibble/pircbot/IdentServer.java diff --git a/src/org/jibble/pircbot/InputThread.java b/application/src/org/jibble/pircbot/InputThread.java similarity index 100% rename from src/org/jibble/pircbot/InputThread.java rename to application/src/org/jibble/pircbot/InputThread.java diff --git a/src/org/jibble/pircbot/IrcException.java b/application/src/org/jibble/pircbot/IrcException.java similarity index 100% rename from src/org/jibble/pircbot/IrcException.java rename to application/src/org/jibble/pircbot/IrcException.java diff --git a/src/org/jibble/pircbot/NickAlreadyInUseException.java b/application/src/org/jibble/pircbot/NickAlreadyInUseException.java similarity index 100% rename from src/org/jibble/pircbot/NickAlreadyInUseException.java rename to application/src/org/jibble/pircbot/NickAlreadyInUseException.java diff --git a/src/org/jibble/pircbot/OutputThread.java b/application/src/org/jibble/pircbot/OutputThread.java similarity index 100% rename from src/org/jibble/pircbot/OutputThread.java rename to application/src/org/jibble/pircbot/OutputThread.java diff --git a/src/org/jibble/pircbot/PircBot.java b/application/src/org/jibble/pircbot/PircBot.java similarity index 100% rename from src/org/jibble/pircbot/PircBot.java rename to application/src/org/jibble/pircbot/PircBot.java diff --git a/src/org/jibble/pircbot/Queue.java b/application/src/org/jibble/pircbot/Queue.java similarity index 100% rename from src/org/jibble/pircbot/Queue.java rename to application/src/org/jibble/pircbot/Queue.java diff --git a/src/org/jibble/pircbot/ReplyConstants.java b/application/src/org/jibble/pircbot/ReplyConstants.java similarity index 100% rename from src/org/jibble/pircbot/ReplyConstants.java rename to application/src/org/jibble/pircbot/ReplyConstants.java diff --git a/src/org/jibble/pircbot/User.java b/application/src/org/jibble/pircbot/User.java similarity index 100% rename from src/org/jibble/pircbot/User.java rename to application/src/org/jibble/pircbot/User.java diff --git a/src/org/yaaic/Yaaic.java b/application/src/org/yaaic/Yaaic.java similarity index 100% rename from src/org/yaaic/Yaaic.java rename to application/src/org/yaaic/Yaaic.java diff --git a/src/org/yaaic/activity/AboutActivity.java b/application/src/org/yaaic/activity/AboutActivity.java similarity index 100% rename from src/org/yaaic/activity/AboutActivity.java rename to application/src/org/yaaic/activity/AboutActivity.java diff --git a/src/org/yaaic/activity/AddAliasActivity.java b/application/src/org/yaaic/activity/AddAliasActivity.java similarity index 100% rename from src/org/yaaic/activity/AddAliasActivity.java rename to application/src/org/yaaic/activity/AddAliasActivity.java diff --git a/src/org/yaaic/activity/AddChannelActivity.java b/application/src/org/yaaic/activity/AddChannelActivity.java similarity index 100% rename from src/org/yaaic/activity/AddChannelActivity.java rename to application/src/org/yaaic/activity/AddChannelActivity.java diff --git a/src/org/yaaic/activity/AddCommandsActivity.java b/application/src/org/yaaic/activity/AddCommandsActivity.java similarity index 100% rename from src/org/yaaic/activity/AddCommandsActivity.java rename to application/src/org/yaaic/activity/AddCommandsActivity.java diff --git a/src/org/yaaic/activity/AddServerActivity.java b/application/src/org/yaaic/activity/AddServerActivity.java similarity index 100% rename from src/org/yaaic/activity/AddServerActivity.java rename to application/src/org/yaaic/activity/AddServerActivity.java diff --git a/src/org/yaaic/activity/ConversationActivity.java b/application/src/org/yaaic/activity/ConversationActivity.java similarity index 100% rename from src/org/yaaic/activity/ConversationActivity.java rename to application/src/org/yaaic/activity/ConversationActivity.java diff --git a/src/org/yaaic/activity/JoinActivity.java b/application/src/org/yaaic/activity/JoinActivity.java similarity index 100% rename from src/org/yaaic/activity/JoinActivity.java rename to application/src/org/yaaic/activity/JoinActivity.java diff --git a/src/org/yaaic/activity/MessageActivity.java b/application/src/org/yaaic/activity/MessageActivity.java similarity index 100% rename from src/org/yaaic/activity/MessageActivity.java rename to application/src/org/yaaic/activity/MessageActivity.java diff --git a/src/org/yaaic/activity/ServersActivity.java b/application/src/org/yaaic/activity/ServersActivity.java similarity index 100% rename from src/org/yaaic/activity/ServersActivity.java rename to application/src/org/yaaic/activity/ServersActivity.java diff --git a/src/org/yaaic/activity/SettingsActivity.java b/application/src/org/yaaic/activity/SettingsActivity.java similarity index 100% rename from src/org/yaaic/activity/SettingsActivity.java rename to application/src/org/yaaic/activity/SettingsActivity.java diff --git a/src/org/yaaic/activity/UserActivity.java b/application/src/org/yaaic/activity/UserActivity.java similarity index 100% rename from src/org/yaaic/activity/UserActivity.java rename to application/src/org/yaaic/activity/UserActivity.java diff --git a/src/org/yaaic/activity/UsersActivity.java b/application/src/org/yaaic/activity/UsersActivity.java similarity index 100% rename from src/org/yaaic/activity/UsersActivity.java rename to application/src/org/yaaic/activity/UsersActivity.java diff --git a/src/org/yaaic/adapter/DeckAdapter.java b/application/src/org/yaaic/adapter/DeckAdapter.java similarity index 100% rename from src/org/yaaic/adapter/DeckAdapter.java rename to application/src/org/yaaic/adapter/DeckAdapter.java diff --git a/src/org/yaaic/adapter/MessageListAdapter.java b/application/src/org/yaaic/adapter/MessageListAdapter.java similarity index 100% rename from src/org/yaaic/adapter/MessageListAdapter.java rename to application/src/org/yaaic/adapter/MessageListAdapter.java diff --git a/src/org/yaaic/adapter/ServerListAdapter.java b/application/src/org/yaaic/adapter/ServerListAdapter.java similarity index 100% rename from src/org/yaaic/adapter/ServerListAdapter.java rename to application/src/org/yaaic/adapter/ServerListAdapter.java diff --git a/src/org/yaaic/command/BaseHandler.java b/application/src/org/yaaic/command/BaseHandler.java similarity index 100% rename from src/org/yaaic/command/BaseHandler.java rename to application/src/org/yaaic/command/BaseHandler.java diff --git a/src/org/yaaic/command/CommandParser.java b/application/src/org/yaaic/command/CommandParser.java similarity index 100% rename from src/org/yaaic/command/CommandParser.java rename to application/src/org/yaaic/command/CommandParser.java diff --git a/src/org/yaaic/command/handler/AMsgHandler.java b/application/src/org/yaaic/command/handler/AMsgHandler.java similarity index 100% rename from src/org/yaaic/command/handler/AMsgHandler.java rename to application/src/org/yaaic/command/handler/AMsgHandler.java diff --git a/src/org/yaaic/command/handler/AwayHandler.java b/application/src/org/yaaic/command/handler/AwayHandler.java similarity index 100% rename from src/org/yaaic/command/handler/AwayHandler.java rename to application/src/org/yaaic/command/handler/AwayHandler.java diff --git a/src/org/yaaic/command/handler/CloseHandler.java b/application/src/org/yaaic/command/handler/CloseHandler.java similarity index 100% rename from src/org/yaaic/command/handler/CloseHandler.java rename to application/src/org/yaaic/command/handler/CloseHandler.java diff --git a/src/org/yaaic/command/handler/DCCHandler.java b/application/src/org/yaaic/command/handler/DCCHandler.java similarity index 100% rename from src/org/yaaic/command/handler/DCCHandler.java rename to application/src/org/yaaic/command/handler/DCCHandler.java diff --git a/src/org/yaaic/command/handler/DeopHandler.java b/application/src/org/yaaic/command/handler/DeopHandler.java similarity index 100% rename from src/org/yaaic/command/handler/DeopHandler.java rename to application/src/org/yaaic/command/handler/DeopHandler.java diff --git a/src/org/yaaic/command/handler/DevoiceHandler.java b/application/src/org/yaaic/command/handler/DevoiceHandler.java similarity index 100% rename from src/org/yaaic/command/handler/DevoiceHandler.java rename to application/src/org/yaaic/command/handler/DevoiceHandler.java diff --git a/src/org/yaaic/command/handler/EchoHandler.java b/application/src/org/yaaic/command/handler/EchoHandler.java similarity index 100% rename from src/org/yaaic/command/handler/EchoHandler.java rename to application/src/org/yaaic/command/handler/EchoHandler.java diff --git a/src/org/yaaic/command/handler/HelpHandler.java b/application/src/org/yaaic/command/handler/HelpHandler.java similarity index 100% rename from src/org/yaaic/command/handler/HelpHandler.java rename to application/src/org/yaaic/command/handler/HelpHandler.java diff --git a/src/org/yaaic/command/handler/JoinHandler.java b/application/src/org/yaaic/command/handler/JoinHandler.java similarity index 100% rename from src/org/yaaic/command/handler/JoinHandler.java rename to application/src/org/yaaic/command/handler/JoinHandler.java diff --git a/src/org/yaaic/command/handler/KickHandler.java b/application/src/org/yaaic/command/handler/KickHandler.java similarity index 100% rename from src/org/yaaic/command/handler/KickHandler.java rename to application/src/org/yaaic/command/handler/KickHandler.java diff --git a/src/org/yaaic/command/handler/MeHandler.java b/application/src/org/yaaic/command/handler/MeHandler.java similarity index 100% rename from src/org/yaaic/command/handler/MeHandler.java rename to application/src/org/yaaic/command/handler/MeHandler.java diff --git a/src/org/yaaic/command/handler/ModeHandler.java b/application/src/org/yaaic/command/handler/ModeHandler.java similarity index 100% rename from src/org/yaaic/command/handler/ModeHandler.java rename to application/src/org/yaaic/command/handler/ModeHandler.java diff --git a/src/org/yaaic/command/handler/MsgHandler.java b/application/src/org/yaaic/command/handler/MsgHandler.java similarity index 100% rename from src/org/yaaic/command/handler/MsgHandler.java rename to application/src/org/yaaic/command/handler/MsgHandler.java diff --git a/src/org/yaaic/command/handler/NamesHandler.java b/application/src/org/yaaic/command/handler/NamesHandler.java similarity index 100% rename from src/org/yaaic/command/handler/NamesHandler.java rename to application/src/org/yaaic/command/handler/NamesHandler.java diff --git a/src/org/yaaic/command/handler/NickHandler.java b/application/src/org/yaaic/command/handler/NickHandler.java similarity index 100% rename from src/org/yaaic/command/handler/NickHandler.java rename to application/src/org/yaaic/command/handler/NickHandler.java diff --git a/src/org/yaaic/command/handler/NoticeHandler.java b/application/src/org/yaaic/command/handler/NoticeHandler.java similarity index 100% rename from src/org/yaaic/command/handler/NoticeHandler.java rename to application/src/org/yaaic/command/handler/NoticeHandler.java diff --git a/src/org/yaaic/command/handler/OpHandler.java b/application/src/org/yaaic/command/handler/OpHandler.java similarity index 100% rename from src/org/yaaic/command/handler/OpHandler.java rename to application/src/org/yaaic/command/handler/OpHandler.java diff --git a/src/org/yaaic/command/handler/PartHandler.java b/application/src/org/yaaic/command/handler/PartHandler.java similarity index 100% rename from src/org/yaaic/command/handler/PartHandler.java rename to application/src/org/yaaic/command/handler/PartHandler.java diff --git a/src/org/yaaic/command/handler/QueryHandler.java b/application/src/org/yaaic/command/handler/QueryHandler.java similarity index 100% rename from src/org/yaaic/command/handler/QueryHandler.java rename to application/src/org/yaaic/command/handler/QueryHandler.java diff --git a/src/org/yaaic/command/handler/QuitHandler.java b/application/src/org/yaaic/command/handler/QuitHandler.java similarity index 100% rename from src/org/yaaic/command/handler/QuitHandler.java rename to application/src/org/yaaic/command/handler/QuitHandler.java diff --git a/src/org/yaaic/command/handler/RawHandler.java b/application/src/org/yaaic/command/handler/RawHandler.java similarity index 100% rename from src/org/yaaic/command/handler/RawHandler.java rename to application/src/org/yaaic/command/handler/RawHandler.java diff --git a/src/org/yaaic/command/handler/TopicHandler.java b/application/src/org/yaaic/command/handler/TopicHandler.java similarity index 100% rename from src/org/yaaic/command/handler/TopicHandler.java rename to application/src/org/yaaic/command/handler/TopicHandler.java diff --git a/src/org/yaaic/command/handler/VoiceHandler.java b/application/src/org/yaaic/command/handler/VoiceHandler.java similarity index 100% rename from src/org/yaaic/command/handler/VoiceHandler.java rename to application/src/org/yaaic/command/handler/VoiceHandler.java diff --git a/src/org/yaaic/command/handler/WhoisHandler.java b/application/src/org/yaaic/command/handler/WhoisHandler.java similarity index 100% rename from src/org/yaaic/command/handler/WhoisHandler.java rename to application/src/org/yaaic/command/handler/WhoisHandler.java diff --git a/src/org/yaaic/db/AliasConstants.java b/application/src/org/yaaic/db/AliasConstants.java similarity index 100% rename from src/org/yaaic/db/AliasConstants.java rename to application/src/org/yaaic/db/AliasConstants.java diff --git a/src/org/yaaic/db/ChannelConstants.java b/application/src/org/yaaic/db/ChannelConstants.java similarity index 100% rename from src/org/yaaic/db/ChannelConstants.java rename to application/src/org/yaaic/db/ChannelConstants.java diff --git a/src/org/yaaic/db/CommandConstants.java b/application/src/org/yaaic/db/CommandConstants.java similarity index 100% rename from src/org/yaaic/db/CommandConstants.java rename to application/src/org/yaaic/db/CommandConstants.java diff --git a/src/org/yaaic/db/Database.java b/application/src/org/yaaic/db/Database.java similarity index 100% rename from src/org/yaaic/db/Database.java rename to application/src/org/yaaic/db/Database.java diff --git a/src/org/yaaic/db/IdentityConstants.java b/application/src/org/yaaic/db/IdentityConstants.java similarity index 100% rename from src/org/yaaic/db/IdentityConstants.java rename to application/src/org/yaaic/db/IdentityConstants.java diff --git a/src/org/yaaic/db/ServerConstants.java b/application/src/org/yaaic/db/ServerConstants.java similarity index 100% rename from src/org/yaaic/db/ServerConstants.java rename to application/src/org/yaaic/db/ServerConstants.java diff --git a/src/org/yaaic/exception/CommandException.java b/application/src/org/yaaic/exception/CommandException.java similarity index 100% rename from src/org/yaaic/exception/CommandException.java rename to application/src/org/yaaic/exception/CommandException.java diff --git a/src/org/yaaic/exception/ValidationException.java b/application/src/org/yaaic/exception/ValidationException.java similarity index 100% rename from src/org/yaaic/exception/ValidationException.java rename to application/src/org/yaaic/exception/ValidationException.java diff --git a/src/org/yaaic/irc/IRCBinder.java b/application/src/org/yaaic/irc/IRCBinder.java similarity index 100% rename from src/org/yaaic/irc/IRCBinder.java rename to application/src/org/yaaic/irc/IRCBinder.java diff --git a/src/org/yaaic/irc/IRCConnection.java b/application/src/org/yaaic/irc/IRCConnection.java similarity index 100% rename from src/org/yaaic/irc/IRCConnection.java rename to application/src/org/yaaic/irc/IRCConnection.java diff --git a/src/org/yaaic/irc/IRCService.java b/application/src/org/yaaic/irc/IRCService.java similarity index 100% rename from src/org/yaaic/irc/IRCService.java rename to application/src/org/yaaic/irc/IRCService.java diff --git a/src/org/yaaic/layout/NonScalingBackgroundDrawable.java b/application/src/org/yaaic/layout/NonScalingBackgroundDrawable.java similarity index 100% rename from src/org/yaaic/layout/NonScalingBackgroundDrawable.java rename to application/src/org/yaaic/layout/NonScalingBackgroundDrawable.java diff --git a/src/org/yaaic/listener/ConversationClickListener.java b/application/src/org/yaaic/listener/ConversationClickListener.java similarity index 100% rename from src/org/yaaic/listener/ConversationClickListener.java rename to application/src/org/yaaic/listener/ConversationClickListener.java diff --git a/src/org/yaaic/listener/ConversationListener.java b/application/src/org/yaaic/listener/ConversationListener.java similarity index 100% rename from src/org/yaaic/listener/ConversationListener.java rename to application/src/org/yaaic/listener/ConversationListener.java diff --git a/src/org/yaaic/listener/ConversationSelectedListener.java b/application/src/org/yaaic/listener/ConversationSelectedListener.java similarity index 100% rename from src/org/yaaic/listener/ConversationSelectedListener.java rename to application/src/org/yaaic/listener/ConversationSelectedListener.java diff --git a/src/org/yaaic/listener/MessageClickListener.java b/application/src/org/yaaic/listener/MessageClickListener.java similarity index 100% rename from src/org/yaaic/listener/MessageClickListener.java rename to application/src/org/yaaic/listener/MessageClickListener.java diff --git a/src/org/yaaic/listener/ServerListener.java b/application/src/org/yaaic/listener/ServerListener.java similarity index 100% rename from src/org/yaaic/listener/ServerListener.java rename to application/src/org/yaaic/listener/ServerListener.java diff --git a/src/org/yaaic/listener/SpeechClickListener.java b/application/src/org/yaaic/listener/SpeechClickListener.java similarity index 100% rename from src/org/yaaic/listener/SpeechClickListener.java rename to application/src/org/yaaic/listener/SpeechClickListener.java diff --git a/src/org/yaaic/model/Broadcast.java b/application/src/org/yaaic/model/Broadcast.java similarity index 100% rename from src/org/yaaic/model/Broadcast.java rename to application/src/org/yaaic/model/Broadcast.java diff --git a/src/org/yaaic/model/Channel.java b/application/src/org/yaaic/model/Channel.java similarity index 100% rename from src/org/yaaic/model/Channel.java rename to application/src/org/yaaic/model/Channel.java diff --git a/src/org/yaaic/model/Conversation.java b/application/src/org/yaaic/model/Conversation.java similarity index 100% rename from src/org/yaaic/model/Conversation.java rename to application/src/org/yaaic/model/Conversation.java diff --git a/src/org/yaaic/model/Extra.java b/application/src/org/yaaic/model/Extra.java similarity index 100% rename from src/org/yaaic/model/Extra.java rename to application/src/org/yaaic/model/Extra.java diff --git a/src/org/yaaic/model/Identity.java b/application/src/org/yaaic/model/Identity.java similarity index 100% rename from src/org/yaaic/model/Identity.java rename to application/src/org/yaaic/model/Identity.java diff --git a/src/org/yaaic/model/Message.java b/application/src/org/yaaic/model/Message.java similarity index 100% rename from src/org/yaaic/model/Message.java rename to application/src/org/yaaic/model/Message.java diff --git a/src/org/yaaic/model/Query.java b/application/src/org/yaaic/model/Query.java similarity index 100% rename from src/org/yaaic/model/Query.java rename to application/src/org/yaaic/model/Query.java diff --git a/src/org/yaaic/model/Scrollback.java b/application/src/org/yaaic/model/Scrollback.java similarity index 100% rename from src/org/yaaic/model/Scrollback.java rename to application/src/org/yaaic/model/Scrollback.java diff --git a/src/org/yaaic/model/Server.java b/application/src/org/yaaic/model/Server.java similarity index 100% rename from src/org/yaaic/model/Server.java rename to application/src/org/yaaic/model/Server.java diff --git a/src/org/yaaic/model/ServerInfo.java b/application/src/org/yaaic/model/ServerInfo.java similarity index 100% rename from src/org/yaaic/model/ServerInfo.java rename to application/src/org/yaaic/model/ServerInfo.java diff --git a/src/org/yaaic/model/Settings.java b/application/src/org/yaaic/model/Settings.java similarity index 100% rename from src/org/yaaic/model/Settings.java rename to application/src/org/yaaic/model/Settings.java diff --git a/src/org/yaaic/model/Status.java b/application/src/org/yaaic/model/Status.java similarity index 100% rename from src/org/yaaic/model/Status.java rename to application/src/org/yaaic/model/Status.java diff --git a/src/org/yaaic/receiver/ConversationReceiver.java b/application/src/org/yaaic/receiver/ConversationReceiver.java similarity index 100% rename from src/org/yaaic/receiver/ConversationReceiver.java rename to application/src/org/yaaic/receiver/ConversationReceiver.java diff --git a/src/org/yaaic/receiver/ServerReceiver.java b/application/src/org/yaaic/receiver/ServerReceiver.java similarity index 100% rename from src/org/yaaic/receiver/ServerReceiver.java rename to application/src/org/yaaic/receiver/ServerReceiver.java diff --git a/src/org/yaaic/ssl/NaiveTrustManager.java b/application/src/org/yaaic/ssl/NaiveTrustManager.java similarity index 100% rename from src/org/yaaic/ssl/NaiveTrustManager.java rename to application/src/org/yaaic/ssl/NaiveTrustManager.java diff --git a/src/org/yaaic/view/ConversationSwitcher.java b/application/src/org/yaaic/view/ConversationSwitcher.java similarity index 100% rename from src/org/yaaic/view/ConversationSwitcher.java rename to application/src/org/yaaic/view/ConversationSwitcher.java diff --git a/src/org/yaaic/view/MessageListView.java b/application/src/org/yaaic/view/MessageListView.java similarity index 100% rename from src/org/yaaic/view/MessageListView.java rename to application/src/org/yaaic/view/MessageListView.java diff --git a/test/.classpath b/test/.classpath new file mode 100644 index 0000000..1e7f2c0 --- /dev/null +++ b/test/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/test/.project b/test/.project new file mode 100644 index 0000000..9b7d0f6 --- /dev/null +++ b/test/.project @@ -0,0 +1,34 @@ + + + Yaaic-Test + + + Yaaic + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/test/AndroidManifest.xml b/test/AndroidManifest.xml new file mode 100644 index 0000000..587713a --- /dev/null +++ b/test/AndroidManifest.xml @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/test/default.properties b/test/default.properties new file mode 100644 index 0000000..4513a1e --- /dev/null +++ b/test/default.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "build.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-3 diff --git a/test/res/drawable/icon.png b/test/res/drawable/icon.png new file mode 100644 index 0000000..a07c69f Binary files /dev/null and b/test/res/drawable/icon.png differ diff --git a/test/res/layout/main.xml b/test/res/layout/main.xml new file mode 100644 index 0000000..3a5f117 --- /dev/null +++ b/test/res/layout/main.xml @@ -0,0 +1,12 @@ + + + + diff --git a/test/res/values/strings.xml b/test/res/values/strings.xml new file mode 100644 index 0000000..f4ff21a --- /dev/null +++ b/test/res/values/strings.xml @@ -0,0 +1,5 @@ + + + Hello World! + YaaicTest + diff --git a/test/src/org/yaaic/test/AllTests.java b/test/src/org/yaaic/test/AllTests.java new file mode 100644 index 0000000..eb24284 --- /dev/null +++ b/test/src/org/yaaic/test/AllTests.java @@ -0,0 +1,42 @@ +/* +Yaaic - Yet Another Android IRC Client + +Copyright 2009-2010 Sebastian Kaspari + +This file is part of Yaaic. + +Yaaic is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Yaaic is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Yaaic. If not, see . +*/ +package org.yaaic.test; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * All tests for Yaaic (org.yaaic.test.*) + * + * @author Sebastian Kaspari + */ +public class AllTests { + + public static Test suite() { + TestSuite suite = new TestSuite("Test for org.yaaic.test"); + //$JUnit-BEGIN$ + suite.addTest(org.yaaic.test.model.AllTests.suite()); + suite.addTest(org.yaaic.test.receiver.AllTests.suite()); + //$JUnit-END$ + return suite; + } + +} diff --git a/test/src/org/yaaic/test/model/AllTests.java b/test/src/org/yaaic/test/model/AllTests.java new file mode 100644 index 0000000..b60e84f --- /dev/null +++ b/test/src/org/yaaic/test/model/AllTests.java @@ -0,0 +1,48 @@ +/* +Yaaic - Yet Another Android IRC Client + +Copyright 2009-2010 Sebastian Kaspari + +This file is part of Yaaic. + +Yaaic is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Yaaic is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Yaaic. If not, see . +*/ +package org.yaaic.test.model; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * All tests in org.yaaic.test.model + * + * @author Sebastian Kaspari + */ +public class AllTests +{ + public static Test suite() { + TestSuite suite = new TestSuite("Test for org.yaaic.test.model"); + //$JUnit-BEGIN$ + suite.addTestSuite(BroadcastTest.class); + suite.addTestSuite(ChannelTest.class); + suite.addTestSuite(IdentityTest.class); + suite.addTestSuite(MessageTest.class); + suite.addTestSuite(QueryTest.class); + suite.addTestSuite(ServerInfoTest.class); + suite.addTestSuite(ServerTest.class); + suite.addTestSuite(ScrollbackTest.class); + //$JUnit-END$ + return suite; + } + +} diff --git a/test/src/org/yaaic/test/model/BroadcastTest.java b/test/src/org/yaaic/test/model/BroadcastTest.java new file mode 100644 index 0000000..688b310 --- /dev/null +++ b/test/src/org/yaaic/test/model/BroadcastTest.java @@ -0,0 +1,65 @@ +/* +Yaaic - Yet Another Android IRC Client + +Copyright 2009-2010 Sebastian Kaspari + +This file is part of Yaaic. + +Yaaic is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Yaaic is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Yaaic. If not, see . +*/ +package org.yaaic.test.model; + +import org.yaaic.model.Broadcast; +import org.yaaic.model.Extra; + +import android.content.Intent; +import junit.framework.TestCase; + +/** + * Test case for org.yaaic.model.Broadcast + * + * @author Sebastian Kaspari + */ +public class BroadcastTest extends TestCase +{ + public void testConversationIntentHelper() + { + String broadcastType = Broadcast.CONVERSATION_MESSAGE; + int serverId = 99; + String conversationName = "#foobar"; + + Intent intent = Broadcast.createConversationIntent(broadcastType, serverId, conversationName); + + assertEquals(broadcastType, intent.getAction()); + + assertTrue(intent.hasExtra(Extra.SERVER)); + assertEquals(serverId, intent.getExtras().getInt(Extra.SERVER)); + + assertTrue(intent.hasExtra(Extra.CONVERSATION)); + assertEquals(conversationName, intent.getExtras().getString(Extra.CONVERSATION)); + } + + public void testServerIntentHelper() + { + String broadcastType = Broadcast.SERVER_UPDATE; + int serverId = 42; + + Intent intent = Broadcast.createServerIntent(broadcastType, serverId); + + assertEquals(broadcastType, intent.getAction()); + + assertTrue(intent.hasExtra(Extra.SERVER)); + assertEquals(serverId, intent.getExtras().getInt(Extra.SERVER)); + } +} diff --git a/test/src/org/yaaic/test/model/ChannelTest.java b/test/src/org/yaaic/test/model/ChannelTest.java new file mode 100644 index 0000000..66c0be5 --- /dev/null +++ b/test/src/org/yaaic/test/model/ChannelTest.java @@ -0,0 +1,68 @@ +/* +Yaaic - Yet Another Android IRC Client + +Copyright 2009-2010 Sebastian Kaspari + +This file is part of Yaaic. + +Yaaic is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Yaaic is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Yaaic. If not, see . +*/ +package org.yaaic.test.model; + +import org.yaaic.model.Channel; +import org.yaaic.model.Conversation; + +import junit.framework.TestCase; + +/** + * Test case for org.yaaic.model.Channel + * + * @author Sebastian Kaspari + */ +public class ChannelTest extends TestCase +{ + private Channel channel; + + @Override + protected void setUp() + { + this.channel = new Channel("#yaaic"); + } + + public void testGetType() + { + assertEquals(Conversation.TYPE_CHANNEL, channel.getType()); + } + + public void testGetName() + { + assertEquals("#yaaic", channel.getName()); + } + + public void testSetAndGetTopic() + { + assertEquals("", channel.getTopic()); + + String topic = "This is a topic"; + channel.setTopic(topic); + + assertEquals(topic, channel.getTopic()); + } + + + public void testInheritance() + { + assertTrue(channel instanceof Conversation); + } +} diff --git a/test/src/org/yaaic/test/model/IdentityTest.java b/test/src/org/yaaic/test/model/IdentityTest.java new file mode 100644 index 0000000..3378c40 --- /dev/null +++ b/test/src/org/yaaic/test/model/IdentityTest.java @@ -0,0 +1,68 @@ +/* +Yaaic - Yet Another Android IRC Client + +Copyright 2009-2010 Sebastian Kaspari + +This file is part of Yaaic. + +Yaaic is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Yaaic is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Yaaic. If not, see . +*/ +package org.yaaic.test.model; + +import org.yaaic.model.Identity; + +import junit.framework.TestCase; + +/** + * Test case for org.yaaic.model.Identity + * + * @author Sebastian Kaspari + */ +public class IdentityTest extends TestCase +{ + private Identity identity; + + @Override + protected void setUp() + { + this.identity = new Identity(); + } + + public void testSetAndGetNickname() + { + assertNull(identity.getNickname()); + + String nickname = "InvaderZim"; + identity.setNickname(nickname); + assertEquals(nickname, identity.getNickname()); + } + + public void testSetAndGetIdent() + { + assertNull(identity.getIdent()); + + String ident = "invader"; + identity.setIdent(ident); + assertEquals(ident, identity.getIdent()); + } + + public void testSetAndGetRealName() + { + assertNull(identity.getRealName()); + + String realname = "Invader Zim"; + identity.setRealName(realname); + assertEquals(realname, identity.getRealName()); + } +} diff --git a/test/src/org/yaaic/test/model/MessageTest.java b/test/src/org/yaaic/test/model/MessageTest.java new file mode 100644 index 0000000..473fe49 --- /dev/null +++ b/test/src/org/yaaic/test/model/MessageTest.java @@ -0,0 +1,71 @@ +/* +Yaaic - Yet Another Android IRC Client + +Copyright 2009-2010 Sebastian Kaspari + +This file is part of Yaaic. + +Yaaic is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Yaaic is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Yaaic. If not, see . +*/ +package org.yaaic.test.model; + +import org.yaaic.model.Message; + +import junit.framework.TestCase; + +/** + * Test case for org.yaaic.model.Message + * + * @author Sebastian Kaspari + */ +public class MessageTest extends TestCase +{ + private Message message; + private String text = " Hello World!"; + + @Override + protected void setUp() + { + this.message = new Message(text); + } + + public void testSetAndGetIcon() + { + assertEquals(-1, message.getIcon()); + + message.setIcon(25); // Normally we use an ressource id + assertEquals(25, message.getIcon()); + + message.setIcon(-1); // The message class uses -1 as "no icon" + assertEquals(-1, message.getIcon()); + } + + public void testGetText() + { + assertEquals(text, message.getText()); + } + + public void testTimestamp() + { + String timestamp1 = Message.generateTimestamp(1270505773862l, false); + assertEquals("[00:16] ", timestamp1); + String timestamp2 = Message.generateTimestamp(1270505773862l, true); + assertEquals("[00:16] ", timestamp2); + + String timestamp3 = Message.generateTimestamp(1270908275000l, false); + assertEquals("[04:04] ", timestamp3); + String timestamp4 = Message.generateTimestamp(1270908275000l, true); + assertEquals("[16:04] ", timestamp4); + } +} diff --git a/test/src/org/yaaic/test/model/QueryTest.java b/test/src/org/yaaic/test/model/QueryTest.java new file mode 100644 index 0000000..c927dcb --- /dev/null +++ b/test/src/org/yaaic/test/model/QueryTest.java @@ -0,0 +1,52 @@ +/* +Yaaic - Yet Another Android IRC Client + +Copyright 2009-2010 Sebastian Kaspari + +This file is part of Yaaic. + +Yaaic is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Yaaic is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Yaaic. If not, see . +*/ +package org.yaaic.test.model; + +import org.yaaic.model.Query; +import org.yaaic.model.Conversation; + +import junit.framework.TestCase; + +/** + * Test case for org.yaaic.model.Query + * + * @author Sebastian Kaspari + */ +public class QueryTest extends TestCase +{ + private Query query; + + @Override + protected void setUp() + { + this.query = new Query("pocmo"); + } + + public void testGetType() + { + assertEquals(Conversation.TYPE_QUERY, query.getType()); + } + + public void testInheritance() + { + assertTrue(query instanceof Conversation); + } +} diff --git a/test/src/org/yaaic/test/model/ScrollbackTest.java b/test/src/org/yaaic/test/model/ScrollbackTest.java new file mode 100644 index 0000000..303b2ba --- /dev/null +++ b/test/src/org/yaaic/test/model/ScrollbackTest.java @@ -0,0 +1,84 @@ +/* +Yaaic - Yet Another Android IRC Client + +Copyright 2009-2010 Sebastian Kaspari + +This file is part of Yaaic. + +Yaaic is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Yaaic is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Yaaic. If not, see . +*/ +package org.yaaic.test.model; + +import org.yaaic.model.Scrollback; + +import junit.framework.TestCase; + +/** + * Test case for org.yaaic.model.Scrollback + * + * @author Sebastian Kaspari + */ +public class ScrollbackTest extends TestCase +{ + private Scrollback scrollback; + + @Override + public void setUp() + { + scrollback = new Scrollback(); + } + + public void testEmptyHistoryBack() + { + assertNull(scrollback.goBack()); + assertNull(scrollback.goBack()); + } + + public void testEmptyHistoryForward() + { + assertEquals("", scrollback.goForward()); + assertEquals("", scrollback.goForward()); + } + + public void testHistory() + { + scrollback.addMessage("Message One"); + + assertEquals("Message One", scrollback.goBack()); + assertEquals("Message One", scrollback.goBack()); + + assertEquals("", scrollback.goForward()); + + scrollback.addMessage("Message Two"); + assertEquals("Message Two", scrollback.goBack()); + assertEquals("Message One", scrollback.goBack()); + + assertEquals("Message Two", scrollback.goForward()); + assertEquals("", scrollback.goForward()); + + scrollback.addMessage("Message Three"); + scrollback.addMessage("Message Four"); + + assertEquals("Message Four", scrollback.goBack()); + assertEquals("Message Three", scrollback.goBack()); + assertEquals("Message Two", scrollback.goBack()); + assertEquals("Message One", scrollback.goBack()); + assertEquals("Message One", scrollback.goBack()); + + assertEquals("Message Two", scrollback.goForward()); + assertEquals("Message Three", scrollback.goForward()); + assertEquals("Message Four", scrollback.goForward()); + assertEquals("", scrollback.goForward()); + } +} diff --git a/test/src/org/yaaic/test/model/ServerInfoTest.java b/test/src/org/yaaic/test/model/ServerInfoTest.java new file mode 100644 index 0000000..2af8ad1 --- /dev/null +++ b/test/src/org/yaaic/test/model/ServerInfoTest.java @@ -0,0 +1,52 @@ +/* +Yaaic - Yet Another Android IRC Client + +Copyright 2009-2010 Sebastian Kaspari + +This file is part of Yaaic. + +Yaaic is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Yaaic is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Yaaic. If not, see . +*/ +package org.yaaic.test.model; + +import org.yaaic.model.ServerInfo; +import org.yaaic.model.Conversation; + +import junit.framework.TestCase; + +/** + * Test case for org.yaaic.model.ServerInfo + * + * @author Sebastian Kaspari + */ +public class ServerInfoTest extends TestCase +{ + private ServerInfo serverInfo; + + @Override + protected void setUp() + { + this.serverInfo = new ServerInfo(); + } + + public void testGetType() + { + assertEquals(Conversation.TYPE_SERVER, serverInfo.getType()); + } + + public void testInheritance() + { + assertTrue(serverInfo instanceof Conversation); + } +} diff --git a/test/src/org/yaaic/test/model/ServerTest.java b/test/src/org/yaaic/test/model/ServerTest.java new file mode 100644 index 0000000..a8ea64b --- /dev/null +++ b/test/src/org/yaaic/test/model/ServerTest.java @@ -0,0 +1,177 @@ +/* +Yaaic - Yet Another Android IRC Client + +Copyright 2009-2010 Sebastian Kaspari + +This file is part of Yaaic. + +Yaaic is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Yaaic is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Yaaic. If not, see . +*/ +package org.yaaic.test.model; + +import org.yaaic.model.Channel; +import org.yaaic.model.Conversation; +import org.yaaic.model.Identity; +import org.yaaic.model.Query; +import org.yaaic.model.Server; +import org.yaaic.model.ServerInfo; +import org.yaaic.model.Status; + +import junit.framework.TestCase; + +/** + * Test case for org.yaaic.model.Server + * + * @author Sebastian Kaspari + */ +public class ServerTest extends TestCase +{ + private Server server; + + @Override + public void setUp() + { + this.server = new Server(); + } + + public void testInstance() + { + assertEquals(1, server.getConversations().size()); + + assertNotNull(server.getConversation(ServerInfo.DEFAULT_NAME)); + assertEquals(Conversation.TYPE_SERVER, server.getConversation(ServerInfo.DEFAULT_NAME).getType()); + } + + public void testSetAndGetHost() + { + assertNull(server.getHost()); + + server.setHost("irc.epd-me.net"); + assertEquals("irc.epd-me.net", server.getHost()); + } + + public void testSetAndGetIdentity() + { + assertNull(server.getIdentity()); + + Identity identity = new Identity(); + identity.setNickname("ServerTest"); + server.setIdentity(identity); + + assertEquals("ServerTest", server.getIdentity().getNickname()); + } + + public void testSetAndGetId() + { + assertEquals(0, server.getId()); + + server.setId(42); + assertEquals(42, server.getId()); + + server.setId(23); + assertEquals(23, server.getId()); + } + + public void testSetAndGetPassword() + { + assertEquals(null, server.getPassword()); + + server.setPassword("secret"); + assertEquals("secret", server.getPassword()); + } + + public void testSetAndGetTitle() + { + assertEquals(null, server.getTitle()); + + server.setTitle("MyServer"); + assertEquals("MyServer", server.getTitle()); + } + + public void testSetAndGetPort() + { + assertEquals(0, server.getPort()); + + server.setPort(12345); + assertEquals(12345, server.getPort()); + } + + public void testSetAndGetCharset() + { + assertNull(server.getCharset()); + + server.setCharset("UTF-16"); + assertEquals("UTF-16", server.getCharset()); + } + + public void testSetAndGetStatus() + { + assertEquals(Status.DISCONNECTED, server.getStatus()); + assertTrue(server.isDisconnected()); + assertFalse(server.isConnected()); + + server.setStatus(Status.PRE_CONNECTING); + assertEquals(Status.PRE_CONNECTING, server.getStatus()); + assertFalse(server.isDisconnected()); + assertFalse(server.isConnected()); + + server.setStatus(Status.CONNECTING); + assertEquals(Status.CONNECTING, server.getStatus()); + assertFalse(server.isDisconnected()); + assertFalse(server.isConnected()); + + server.setStatus(Status.CONNECTED); + assertEquals(Status.CONNECTED, server.getStatus()); + assertFalse(server.isDisconnected()); + assertTrue(server.isConnected()); + } + + public void testConversationHandling() + { + Channel channel = new Channel("#yaaic"); + + server.addConversationl(channel); + assertEquals(2, server.getConversations().size()); + assertNotNull(server.getConversation("#yaaic")); + + // ignore case + assertNotNull(server.getConversation("#yAAic")); + + server.addConversationl(new Query("pocmo")); + assertEquals(3, server.getConversations().size()); + + // test order + String[] names = { ServerInfo.DEFAULT_NAME, "#yaaic", "pocmo" }; + int i = 0; + for (Conversation conversation : server.getConversations()) { + assertEquals(names[i], conversation.getName()); + i++; + } + + server.removeConversation("#yaaic"); + assertEquals(2, server.getConversations().size()); + + String[] names2 = { ServerInfo.DEFAULT_NAME, "pocmo" }; + int j = 0; + for (Conversation conversation : server.getConversations()) { + assertEquals(names2[j], conversation.getName()); + j++; + } + + // There's a new ServerInfo object after clear + server.clearConversations(); + assertEquals(1, server.getConversations().size()); + assertNotNull(server.getConversation(ServerInfo.DEFAULT_NAME)); + } +} \ No newline at end of file diff --git a/test/src/org/yaaic/test/receiver/AllTests.java b/test/src/org/yaaic/test/receiver/AllTests.java new file mode 100644 index 0000000..e1b27b4 --- /dev/null +++ b/test/src/org/yaaic/test/receiver/AllTests.java @@ -0,0 +1,41 @@ +/* +Yaaic - Yet Another Android IRC Client + +Copyright 2009-2010 Sebastian Kaspari + +This file is part of Yaaic. + +Yaaic is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Yaaic is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Yaaic. If not, see . +*/ +package org.yaaic.test.receiver; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * All tests in org.yaaic.test.receiver + * + * @author Sebastian Kaspari + */ +public class AllTests +{ + public static Test suite() { + TestSuite suite = new TestSuite("Test for org.yaaic.test.receiver"); + //$JUnit-BEGIN$ + suite.addTestSuite(ConversationReceiverTest.class); + //$JUnit-END$ + return suite; + } + +} \ No newline at end of file diff --git a/test/src/org/yaaic/test/receiver/ConversationReceiverTest.java b/test/src/org/yaaic/test/receiver/ConversationReceiverTest.java new file mode 100644 index 0000000..b5b9124 --- /dev/null +++ b/test/src/org/yaaic/test/receiver/ConversationReceiverTest.java @@ -0,0 +1,107 @@ +/* +Yaaic - Yet Another Android IRC Client + +Copyright 2009-2010 Sebastian Kaspari + +This file is part of Yaaic. + +Yaaic is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Yaaic is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Yaaic. If not, see . +*/ +package org.yaaic.test.receiver; + +import org.yaaic.listener.ConversationListener; +import org.yaaic.model.Broadcast; +import org.yaaic.receiver.ConversationReceiver; + +import android.content.Intent; +import android.test.AndroidTestCase; + +/** + * Test case for org.yaaic.receiver.ConversationReceiver + * + * @author Sebastian Kaspari + */ +public class ConversationReceiverTest extends AndroidTestCase implements ConversationListener +{ + private boolean onConversationMessageCalled; + private boolean onNewConversationCalled; + private boolean onRemoveConversationCalled; + + private ConversationReceiver receiver; + private String testTarget = "#unittest"; + private int serverId = 42; + + public void setUp() + { + onConversationMessageCalled = false; + onNewConversationCalled = false; + onRemoveConversationCalled = false; + + receiver = new ConversationReceiver(serverId, this); + } + + public void testMessageBroadcast() + { + Intent intent = Broadcast.createConversationIntent(Broadcast.CONVERSATION_MESSAGE, serverId, testTarget); + receiver.onReceive(getContext(), intent); + + assertTrue(onConversationMessageCalled); + assertFalse(onNewConversationCalled); + assertFalse(onRemoveConversationCalled); + } + + public void testNewBroadcast() + { + Intent intent = Broadcast.createConversationIntent(Broadcast.CONVERSATION_NEW, serverId, testTarget); + receiver.onReceive(getContext(), intent); + + assertFalse(onConversationMessageCalled); + assertTrue(onNewConversationCalled); + assertFalse(onRemoveConversationCalled); + } + + public void testRemoveBroadcast() + { + Intent intent = Broadcast.createConversationIntent(Broadcast.CONVERSATION_REMOVE, serverId, testTarget); + receiver.onReceive(getContext(), intent); + + assertFalse(onConversationMessageCalled); + assertFalse(onNewConversationCalled); + assertTrue(onRemoveConversationCalled); + } + + @Override + public void onConversationMessage(String target) + { + assertEquals(testTarget, target); + + onConversationMessageCalled = true; + } + + @Override + public void onNewConversation(String target) + { + assertEquals(testTarget, target); + + onNewConversationCalled = true; + } + + @Override + public void onRemoveConversation(String target) + { + assertEquals(testTarget, target); + + onRemoveConversationCalled = true; + } +}