diff --git a/.gitignore b/.gitignore index 736cd18..9a71849 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,17 @@ # Git Ignore for Yaaic # Compiled and generated files -bin/ -gen/ -R.java +**/bin/ +**/gen/ +**/R.java + +# Ignore the key file. + +application/keystore # Build files -local.properties +# local.properties ant.properties -build.xml +# build.xml proguard.cfg -# Maven -target/ - diff --git a/CHANGELOG b/CHANGELOG index 647e0cf..8778101 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,18 @@ +------------------------------------------------------------------------------- +Atomic 1.1 - 2014-04-4 - AKA "Hydrogen" +------------------------------------------------------------------------------- + +Atomic is a fork of yaaic. We've changed some things: + +* Color schemes! +* compactness! +* Auto-complete-y + +I cleaned up the translations, mostly because I need to go and change things +and make sure the translations are correct. + +Awesome. + -------------------------------------------------------------------------------- Yaaic 1.0 - 2012-07-29 - 89 commits, 685 files changed, 7 authors -------------------------------------------------------------------------------- diff --git a/README b/README index 2adecfa..48b9706 100644 --- a/README +++ b/README @@ -35,6 +35,20 @@ Current/future features/changes: * Selecting a message copies it to the clipboard * Option to not scroll when a new message appears in a channel +------------------------------------------------------------------- + +Building Atomic: + +You will need to generate a keystore for Atomic: + + keytool -genkey -keystore application/keystore -alias + +and go and add the following to application/ant.properties + + key.store=keystore + key.alias= + key.store.password= + key.alias.password= -------------------------------------------------------------------- diff --git a/application/build.xml b/application/build.xml new file mode 100644 index 0000000..9655e59 --- /dev/null +++ b/application/build.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/local.properties b/application/local.properties new file mode 100644 index 0000000..2be10c0 --- /dev/null +++ b/application/local.properties @@ -0,0 +1,10 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. + +# location of the SDK. This is only used by Ant +# For customization when using a Version Control System, please read the +# header note. +sdk.dir=/home/indrora/opt/adt-x86_64/sdk diff --git a/application/pom_old.xml b/application/pom_old.xml deleted file mode 100644 index 0d22ac2..0000000 --- a/application/pom_old.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - 4.0.0 - - indrora.atomic - yaaic - 1.1-SNAPSHOT - apk - - yaaic - - Yaaic is as the full name (Yet another Android IRC - client) already says an Internet Relay Chat (IRC) client for - Android devices. - - http://www.yaaic.org - 2009 - - - https://github.com/pocmo/Yaaic - scm:git:git://github.com/pocmo/Yaaic.git - - scm:git:git@github.com:pocmo/Yaaic.git - - - - - - Sebastian Kaspari - sebastian@yaaic.org - pocmo - http://www.androidzeitgeist.com - - developer - - - - - - GitHub Issues - https://github.com/pocmo/Yaaic/issues - - - - - com.google.android - android - 4.1.1.4 - provided - - - - com.actionbarsherlock - library - 4.2.0 - apklib - - - - com.viewpagerindicator - library - 2.3.1 - apklib - - - - - - UTF-8 - - - - ${project.artifactId} - src - - - - com.jayway.maven.plugins.android.generation2 - 3.5.0 - android-maven-plugin - true - - - 17 - - - - - - - diff --git a/application/proguard-project.txt b/application/proguard-project.txt new file mode 100644 index 0000000..f2fe155 --- /dev/null +++ b/application/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/application/project.properties b/application/project.properties index 1dda423..0d2c956 100644 --- a/application/project.properties +++ b/application/project.properties @@ -8,6 +8,6 @@ # project structure. # Project target. -target=android-15 +target=android-14 android.library.reference.1=../libs/ViewPagerIndicator android.library.reference.2=../libs/ActionBarSherlock diff --git a/libs/ActionBarSherlock/build.xml b/libs/ActionBarSherlock/build.xml new file mode 100644 index 0000000..56bc652 --- /dev/null +++ b/libs/ActionBarSherlock/build.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/ActionBarSherlock/local.properties b/libs/ActionBarSherlock/local.properties new file mode 100644 index 0000000..2be10c0 --- /dev/null +++ b/libs/ActionBarSherlock/local.properties @@ -0,0 +1,10 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. + +# location of the SDK. This is only used by Ant +# For customization when using a Version Control System, please read the +# header note. +sdk.dir=/home/indrora/opt/adt-x86_64/sdk diff --git a/libs/ActionBarSherlock/pom.xml b/libs/ActionBarSherlock/pom.xml deleted file mode 100644 index 3b6ce40..0000000 --- a/libs/ActionBarSherlock/pom.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - 4.0.0 - - actionbarsherlock - ActionBarSherlock - apklib - - - com.actionbarsherlock - parent - 4.2.0 - ../pom.xml - - - - - com.google.android - android - provided - - - com.google.android - support-v4 - - - - junit - junit - test - - - - - src - test - - - - com.jayway.maven.plugins.android.generation2 - android-maven-plugin - true - - ignored - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - true - - - - - com.google.code.maven-replacer-plugin - maven-replacer-plugin - 1.4.0 - - - process-sources - - replace - - - - - false - target/generated-sources/r/com/actionbarsherlock/R.java - target/generated-sources/r/com/actionbarsherlock/R.java - false - static final int - static int - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - ../checkstyle.xml - - - - verify - - checkstyle - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.7 - - - package - - attach-artifact - - - - - jar - ${project.build.directory}/${project.build.finalName}.jar - - - - - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - com.google.code.maven-replacer-plugin - maven-replacer-plugin - [1.4.0,) - - replace - - - - - - - - - - - - - - diff --git a/libs/ActionBarSherlock/proguard-project.txt b/libs/ActionBarSherlock/proguard-project.txt new file mode 100644 index 0000000..f2fe155 --- /dev/null +++ b/libs/ActionBarSherlock/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/libs/ViewPagerIndicator/build.xml b/libs/ViewPagerIndicator/build.xml new file mode 100644 index 0000000..c185ece --- /dev/null +++ b/libs/ViewPagerIndicator/build.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/ViewPagerIndicator/local.properties b/libs/ViewPagerIndicator/local.properties new file mode 100644 index 0000000..2be10c0 --- /dev/null +++ b/libs/ViewPagerIndicator/local.properties @@ -0,0 +1,10 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. + +# location of the SDK. This is only used by Ant +# For customization when using a Version Control System, please read the +# header note. +sdk.dir=/home/indrora/opt/adt-x86_64/sdk diff --git a/libs/ViewPagerIndicator/pom.xml b/libs/ViewPagerIndicator/pom.xml deleted file mode 100644 index a6e0cc1..0000000 --- a/libs/ViewPagerIndicator/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - 4.0.0 - - com.viewpagerindicator - library - Android-ViewPagerIndicator - apklib - - - com.viewpagerindicator - parent - 2.3.1 - ../pom.xml - - - - - com.google.android - android - provided - - - - com.google.android - support-v4 - provided - - - - - src - - - - com.jayway.maven.plugins.android.generation2 - android-maven-plugin - true - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - ../checkstyle.xml - - - - verify - - checkstyle - - - - - - - diff --git a/libs/ViewPagerIndicator/proguard-project.txt b/libs/ViewPagerIndicator/proguard-project.txt new file mode 100644 index 0000000..f2fe155 --- /dev/null +++ b/libs/ViewPagerIndicator/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/libs/ViewPagerIndicator/project.properties b/libs/ViewPagerIndicator/project.properties index 96db742..5ca7d62 100644 --- a/libs/ViewPagerIndicator/project.properties +++ b/libs/ViewPagerIndicator/project.properties @@ -9,4 +9,4 @@ android.library=true # Project target. -target=android-4 +target=android-14 diff --git a/test/.classpath b/test/.classpath deleted file mode 100644 index 3308b2e..0000000 --- a/test/.classpath +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/test/.project b/test/.project deleted file mode 100644 index 9b7d0f6..0000000 --- a/test/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - 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 deleted file mode 100644 index 64211ad..0000000 --- a/test/AndroidManifest.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/test/build.xml b/test/build.xml new file mode 100644 index 0000000..faf2688 --- /dev/null +++ b/test/build.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/libs/robotium-solo-3.5.1.jar b/test/libs/robotium-solo-3.5.1.jar deleted file mode 100644 index 972b259..0000000 Binary files a/test/libs/robotium-solo-3.5.1.jar and /dev/null differ diff --git a/test/local.properties b/test/local.properties new file mode 100644 index 0000000..2be10c0 --- /dev/null +++ b/test/local.properties @@ -0,0 +1,10 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. + +# location of the SDK. This is only used by Ant +# For customization when using a Version Control System, please read the +# header note. +sdk.dir=/home/indrora/opt/adt-x86_64/sdk diff --git a/test/pom.xml b/test/pom.xml deleted file mode 100644 index 581e73b..0000000 --- a/test/pom.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - 4.0.0 - - org.yaaic - yaaic-test - 1.1-SNAPSHOT - apk - - yaaic test - - Test automation project for Yaaic. - - http://www.yaaic.org - 2009 - - - https://github.com/pocmo/Yaaic - scm:git:git://github.com/pocmo/Yaaic.git - - scm:git:git@github.com:pocmo/Yaaic.git - - - - - Sebastian Kaspari - sebastian@yaaic.org - pocmo - http://www.androidzeitgeist.com - - developer - - - - - - GitHub Issues - https://github.com/pocmo/Yaaic/issues - - - - - com.google.android - android - 4.1.1.4 - provided - - - - com.google.android - android-test - 4.1.1.4 - provided - - - - org.yaaic - yaaic - apk - 1.1-SNAPSHOT - - - - org.yaaic - yaaic - jar - provided - 1.1-SNAPSHOT - - - - com.actionbarsherlock - library - 4.1.0 - apklib - provided - - - - com.viewpagerindicator - library - 2.3.1 - apklib - provided - - - - com.jayway.android.robotium - robotium-solo - 3.5.1 - - - - - - UTF-8 - - - - ${project.artifactId} - src - - - - com.jayway.maven.plugins.android.generation2 - 3.3.0 - android-maven-plugin - true - - - 14 - - - - - - - diff --git a/test/proguard-project.txt b/test/proguard-project.txt new file mode 100644 index 0000000..f2fe155 --- /dev/null +++ b/test/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/test/project.properties b/test/project.properties deleted file mode 100644 index 8da376a..0000000 --- a/test/project.properties +++ /dev/null @@ -1,11 +0,0 @@ -# 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, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-15 diff --git a/test/res/drawable/icon.png b/test/res/drawable/icon.png deleted file mode 100644 index a07c69f..0000000 Binary files a/test/res/drawable/icon.png and /dev/null differ diff --git a/test/res/layout/main.xml b/test/res/layout/main.xml deleted file mode 100644 index 3a5f117..0000000 --- a/test/res/layout/main.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/test/res/values/strings.xml b/test/res/values/strings.xml deleted file mode 100644 index f4ff21a..0000000 --- a/test/res/values/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - Hello World! - YaaicTest - diff --git a/test/src/org/yaaic/test/AllTests.java b/test/src/org/yaaic/test/AllTests.java deleted file mode 100644 index 70a7cb3..0000000 --- a/test/src/org/yaaic/test/AllTests.java +++ /dev/null @@ -1,43 +0,0 @@ -/* -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()); - suite.addTest(org.yaaic.test.scenario.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 deleted file mode 100644 index b60e84f..0000000 --- a/test/src/org/yaaic/test/model/AllTests.java +++ /dev/null @@ -1,48 +0,0 @@ -/* -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 deleted file mode 100644 index 688b310..0000000 --- a/test/src/org/yaaic/test/model/BroadcastTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* -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 deleted file mode 100644 index 66c0be5..0000000 --- a/test/src/org/yaaic/test/model/ChannelTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -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 deleted file mode 100644 index 3378c40..0000000 --- a/test/src/org/yaaic/test/model/IdentityTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -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 deleted file mode 100644 index bb8036e..0000000 --- a/test/src/org/yaaic/test/model/MessageTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* -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() - { - Message message = new Message(""); - - message.setTimestamp(1270505773862l); - - assertEquals("[00:16] ", message.renderTimeStamp(false)); - assertEquals("[00:16] ", message.renderTimeStamp(true)); - - message.setTimestamp(1270908275000l); - - assertEquals("[04:04] ", message.renderTimeStamp(false)); - assertEquals("[16:04] ", message.renderTimeStamp(true)); - } -} diff --git a/test/src/org/yaaic/test/model/QueryTest.java b/test/src/org/yaaic/test/model/QueryTest.java deleted file mode 100644 index c927dcb..0000000 --- a/test/src/org/yaaic/test/model/QueryTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* -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 deleted file mode 100644 index 303b2ba..0000000 --- a/test/src/org/yaaic/test/model/ScrollbackTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* -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 deleted file mode 100644 index 2af8ad1..0000000 --- a/test/src/org/yaaic/test/model/ServerInfoTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* -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 deleted file mode 100644 index 22c4543..0000000 --- a/test/src/org/yaaic/test/model/ServerTest.java +++ /dev/null @@ -1,177 +0,0 @@ -/* -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.addConversation(channel); - assertEquals(2, server.getConversations().size()); - assertNotNull(server.getConversation("#yaaic")); - - // ignore case - assertNotNull(server.getConversation("#yAAic")); - - server.addConversation(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 deleted file mode 100644 index e1b27b4..0000000 --- a/test/src/org/yaaic/test/receiver/AllTests.java +++ /dev/null @@ -1,41 +0,0 @@ -/* -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 deleted file mode 100644 index 9d8c68a..0000000 --- a/test/src/org/yaaic/test/receiver/ConversationReceiverTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/* -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; - } - - @Override - public void onTopicChanged(String topic) - { - // XXX: Implement me! - } -} diff --git a/test/src/org/yaaic/test/scenario/AllTests.java b/test/src/org/yaaic/test/scenario/AllTests.java deleted file mode 100644 index 9bc4e23..0000000 --- a/test/src/org/yaaic/test/scenario/AllTests.java +++ /dev/null @@ -1,41 +0,0 @@ -/* -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.scenario; - -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * All scenario tests - * - * @author Sebastian Kaspari - */ -public class AllTests { - public static Test suite() { - TestSuite suite = new TestSuite("Scenario-Tests"); - //$JUnit-BEGIN$ - suite.addTestSuite(ServerListScenarios.class); - suite.addTestSuite(ConnectionScenarios.class); - suite.addTestSuite(ChannelScenarios.class); - //$JUnit-END$ - return suite; - } -} diff --git a/test/src/org/yaaic/test/scenario/ChannelScenarios.java b/test/src/org/yaaic/test/scenario/ChannelScenarios.java deleted file mode 100644 index 2b814e0..0000000 --- a/test/src/org/yaaic/test/scenario/ChannelScenarios.java +++ /dev/null @@ -1,97 +0,0 @@ -/* -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.scenario; - - - -import android.test.ActivityInstrumentationTestCase2; -import android.util.Log; - -import com.jayway.android.robotium.solo.Solo; - -/** - * Scenarios regarding channels of a server - * - * @author Sebastian Kaspari - */ -@SuppressWarnings("rawtypes") -public class ChannelScenarios extends ActivityInstrumentationTestCase2 -{ - private Solo solo; - private ScenarioHelper helper; - - /** - * Create a new ChannelScenario instance - * - * @throws ClassNotFoundException - */ - @SuppressWarnings("unchecked") - public ChannelScenarios() throws ClassNotFoundException - { - super( - "org.yaaic", - Class.forName("org.yaaic.activity.ServersActivity") - ); - } - - /** - * Setup test case - */ - @Override - protected void setUp() - { - if (solo == null) { - solo = new Solo(getInstrumentation(), getActivity()); - helper = new ScenarioHelper(solo); - } - - helper.createTestServer(); - helper.connectToServer(); - } - - /** - * Cleanup after test - */ - @Override - protected void tearDown() - { - helper.disconnectFromServer(); - helper.deleteTestServer(); - - solo.finishOpenedActivities(); - } - - /** - * Scenario: Write a channel message - * - * - Connect to server - * - Join test channel - * - Write a message - * - The message is displayed in the view - */ - public void testSendingChannelMessage() - { - helper.joinTestChannel(); - - helper.send("Hello Test-World"); - assertTrue(solo.searchText(" Hello Test-World")); - } -} diff --git a/test/src/org/yaaic/test/scenario/ConnectionScenarios.java b/test/src/org/yaaic/test/scenario/ConnectionScenarios.java deleted file mode 100644 index 7729e9d..0000000 --- a/test/src/org/yaaic/test/scenario/ConnectionScenarios.java +++ /dev/null @@ -1,101 +0,0 @@ -/* -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.scenario; - - - -import android.test.ActivityInstrumentationTestCase2; -import android.util.Log; - -import com.jayway.android.robotium.solo.Solo; - -/** - * Test scenarios including connecting to a server - * - * @author Sebastian Kaspari - */ -@SuppressWarnings("rawtypes") -public class ConnectionScenarios extends ActivityInstrumentationTestCase2 -{ - private ScenarioHelper helper; - private Solo solo; - - /** - * Create a new ConnectionScenario instance - * - * @throws ClassNotFoundException - */ - @SuppressWarnings("unchecked") - public ConnectionScenarios() throws ClassNotFoundException - { - super( - "org.yaaic", - Class.forName("org.yaaic.activity.ServersActivity") - ); - } - - /** - * Setup test case - */ - @Override - protected void setUp() - { - if (solo == null) { - solo = new Solo(getInstrumentation(), getActivity()); - helper = new ScenarioHelper(solo); - } - - helper.createTestServer(); - helper.connectToServer(); - } - - /** - * Cleanup after test - */ - @Override - protected void tearDown() - { - helper.disconnectFromServer(); - helper.deleteTestServer(); - - solo.finishOpenedActivities(); - } - - /** - * Scenario: Join a channel - * - * - Connect to server - * - Enter command: /j #yaaic-test - * - A new conversation with text #yaaic-test appears - * - Disconnect - */ - public void testJoiningChannel() - { - // Join channel - solo.enterText(0, "/j #yaaic-test"); - solo.sendKey(Solo.ENTER); - - solo.sleep(1500); - - // Assert channel joined - assertTrue(solo.searchText("#yaaic-test")); - } -} diff --git a/test/src/org/yaaic/test/scenario/ScenarioHelper.java b/test/src/org/yaaic/test/scenario/ScenarioHelper.java deleted file mode 100644 index 9282757..0000000 --- a/test/src/org/yaaic/test/scenario/ScenarioHelper.java +++ /dev/null @@ -1,174 +0,0 @@ -/* -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.scenario; - -import org.yaaic.R; -import org.yaaic.activity.ConversationActivity; -import org.yaaic.activity.ServersActivity; - -import android.view.View; -import android.widget.EditText; - -import com.jayway.android.robotium.solo.Solo; - -/** - * Scenario helper for performing common actions - * - * @author Sebastian Kaspari - */ -public class ScenarioHelper -{ - private Solo solo; - - public ScenarioHelper(Solo solo) - { - this.solo = solo; - } - - /** - * Create a test server (RobotiumTest) - * - * Starting Point: ServersActivity - * Ending Point: ServersActivity - * - * @param solo - */ - public void createTestServer() - { - if (!solo.searchText("RobotiumTest")) { - solo.assertCurrentActivity("Starting at ServersActivity", "ServersActivity"); - - View view = solo.getView(R.id.add); - assert view != null; - - solo.clickOnView(view); - - solo.waitForActivity("AddServerActivity"); - solo.assertCurrentActivity("Switched to AddServerActivity", "AddServerActivity"); - - solo.enterText(0, "RobotiumTest"); - solo.enterText(1, "irc.epd-me.net"); - - solo.enterText(4, "YaaicBotium"); - - // Somehow robotium doesn't detect the field when using index 5 - EditText realname = (EditText) solo.getView(R.id.realname); - solo.enterText(realname, "Robotium and Yaaic"); - - solo.clickOnButton(solo.getString(R.string.server_save)); - - solo.waitForActivity("ServersActivity", 2000); - } - } - - /** - * Connect to the test server - * - * Starting Point: ServersActivity - * Ending Point: ConversationsActivity - * - * @param solo - */ - public void connectToServer() - { - solo.clickOnText("RobotiumTest"); - - solo.waitForActivity("ConversationActivity", 3000); - solo.assertCurrentActivity("Assert is ConversationActivity", ConversationActivity.class); - - solo.waitForText(solo.getString(R.string.message_login_done)); - } - - /** - * Disconnect from the test server - * - * Starting Point: ConversationsActivity - * Ending Point: ServersActivity - * - * @param solo - */ - public void disconnectFromServer() - { - // Go back - solo.goBack(); - solo.waitForActivity("ServersActivity", 2000); - solo.assertCurrentActivity("Assert is ServersActivity", ServersActivity.class); - - // Disconnect - solo.clickLongOnText("RobotiumTest"); - solo.clickOnText("Disconnect"); - - solo.waitForActivity("ServersActivity", 1000); - solo.assertCurrentActivity("Assert is ServersActivity", ServersActivity.class); - } - - /** - * Delete the test server (RobotiumTest) - * - * Starting Point: ServersActivity - * Ending Point: ServersActivity - * - * @param solo - */ - public void deleteTestServer() - { - if (solo.searchText("RobotiumTest")) { - // Delete server again - solo.clickLongOnText("RobotiumTest"); - solo.clickOnText("Delete"); - - solo.waitForActivity("ServersActivity", 1000); - solo.assertCurrentActivity("Assert is ServersActivity", ServersActivity.class); - } - } - - /** - * Join the test channel - * - * Starting Point: ConversationsActivity - * Ending Point: ConversationsActivity - * - * @param solo - */ - public void joinTestChannel() - { - // Send join command - send("/j #yaaic-test"); - - // Wait for channel joined - solo.waitForText("#yaaic-test"); - } - - /** - * Send a message via the command line - * - * Starting Point: ConversationsActivity - * Ending Point: ConversationsActivity - * - * @param solo - * @param message - */ - public void send(String message) - { - solo.enterText(0, message); - solo.sendKey(Solo.ENTER); - } -} diff --git a/test/src/org/yaaic/test/scenario/ServerListScenarios.java b/test/src/org/yaaic/test/scenario/ServerListScenarios.java deleted file mode 100644 index d0ba19b..0000000 --- a/test/src/org/yaaic/test/scenario/ServerListScenarios.java +++ /dev/null @@ -1,131 +0,0 @@ -/* -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.scenario; - -import org.yaaic.R; -import org.yaaic.activity.ServersActivity; - -import android.test.ActivityInstrumentationTestCase2; -import android.view.View; -import android.widget.EditText; - -import com.jayway.android.robotium.solo.Solo; - -/** - * Scenario Tests for the ServersActivity - * - * @author Sebastian Kaspari - */ -@SuppressWarnings("rawtypes") -public class ServerListScenarios extends ActivityInstrumentationTestCase2 -{ - private Solo solo; - private ScenarioHelper helper; - - /** - * Create a new ServerListScenarios instance - * - * @throws ClassNotFoundException - */ - @SuppressWarnings("unchecked") - public ServerListScenarios() throws ClassNotFoundException - { - super("org.yaaic", ServersActivity.class); - } - - /** - * Setup test case - */ - @Override - protected void setUp() - { - if (solo == null) { - solo = new Solo(getInstrumentation(), getActivity()); - helper = new ScenarioHelper(solo); - } - } - - /** - * Cleanup after run - */ - @Override - protected void tearDown() - { - solo.finishOpenedActivities(); - } - - /** - * Test-Scenario: - * - * Add server: - * - Select "Add server" from the menu - * - Add all necessary information - * - Click on Save - * - The new server appears in the list - * - * Remove server: - * - Long press on the server in the list - * - Select delete - * - The server is no longer in the list - */ - public void testAddingAndRemovingServer() - { - // Delete Testserver if already exists - helper.deleteTestServer(); - - // Assert server does not exist - assertFalse(solo.searchText("RobotiumTest")); - - // Add server - View view = solo.getView(R.id.add); - assert view != null; - solo.clickOnView(view); - - solo.waitForActivity("AddServerActivity", 2000); - - solo.assertCurrentActivity("Switched to AddServerActivity", "AddServerActivity"); - - solo.enterText(0, "RobotiumTest"); - solo.enterText(1, "irc.epd-me.net"); - - solo.enterText(4, "YaaicBotium"); - - // Somehow robotium doesn't detect the field when using index 5 - EditText realname = (EditText) solo.getView(R.id.realname); - solo.enterText(realname, "Robotium and Yaaic"); - - solo.clickOnButton(solo.getString(R.string.server_save)); - - solo.waitForActivity("ServersActivity", 1000); - solo.assertCurrentActivity("Switched back to ServersActivity", "ServersActivity"); - - // Assert new server exists - assertTrue(solo.searchText("RobotiumTest")); - - // Remove new server again - solo.clickLongOnText("RobotiumTest"); - - solo.clickOnText("Delete"); - - solo.waitForActivity("ServersActivity", 1000); - solo.assertCurrentActivity("Switched back to ServersActivity", "ServersActivity"); - } -} diff --git a/tools/check_languages.rb b/tools/check_languages.rb deleted file mode 100755 index 48dba45..0000000 --- a/tools/check_languages.rb +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/ruby -# 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 . - -# TODO: Use a XML parser instead of reading lines - -base_path = "#{File.dirname(__FILE__)}/../application/res/" -original_file = "#{base_path}values/strings.xml" -languages = [] -items = {} -pattern = Regexp.new '([^<]+)' -lang_pattern = Regexp.new 'values-([a-zA-Z_-]+)' -show_keys = false - -show_keys = true if ARGV.length == 1 && ARGV[0] == '--show-keys' - -# Scan for languages -Dir.new(base_path).entries.each { |directory| - result = lang_pattern.match directory - if !result.nil? then - languages.push result[1] - end -} - -puts "Found #{languages.length} language(s): #{languages.inspect}" - -# Grab all keys from the original file -file = File.new(original_file, 'r') -while line = file.gets - result = pattern.match line - if !result.nil? then - items[result[1]] = result[2] - end -end -file.close - -puts "Found #{items.length} items in strings.xml" -puts - -# Check all langauges files for keys -languages.each { |language| - keys = 0 - check = items.clone - untranslated = {} - unused = {} - language_file = "#{base_path}values-#{language}/strings.xml" - - file = File.new(language_file, 'r') - while line = file.gets - result = pattern.match line - if !result.nil? then - key = result[1] - value = result[2] - - check.delete key - if items[key].nil? then - unused[key] = value - else - untranslated[key] = value if items[key] == value - end - keys += 1 - end - end - - translated = items.length - untranslated.length - check.length - translated_percent = sprintf('%.2f', 100.to_f / items.length.to_f * translated.to_f) - keys_percent = sprintf('%.2f', 100.to_f / items.length.to_f * keys.to_f) - - puts "Language #{language}" - puts " * Keys: #{keys.to_s.rjust 5}/#{items.length.to_s.ljust 5} #{keys_percent.to_s.rjust 6}%" - puts " * Translated: #{translated.to_s.rjust 5}/#{items.length.to_s.ljust 5} #{translated_percent.to_s.rjust 6}%" - - if show_keys then - if check.length > 0 then - puts " * Missing keys:" - check.each { |key,value| puts " * #{key}" } - end - - if untranslated.length > 0 then - puts " * Untranslated keys:" - untranslated.each { |key,value| puts " * #{key}" } - end - - if unused.length > 0 then - puts " * Unused keys:" - unused.each { |key,value| puts " * #{key}" } if unused.length > 0 - end - end - - puts -} -