diff options
author | Vitaly Takmazov | 2016-07-07 11:52:56 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-07-07 11:52:56 +0300 |
commit | 01eada11aafcb712a366ce816c98c660f5ea6907 (patch) | |
tree | be34a296d2a35b24c360a17499c68a028cb88965 | |
parent | 201ed4cdb586c8516d1ec13b90cd615cc030a705 (diff) | |
parent | fbedd4f7784f0cb651cc8105c656a1c20da0e2d5 (diff) |
merge core develop
-rw-r--r-- | gradle/wrapper/gradle-wrapper.properties | 9 | ||||
-rw-r--r-- | gradlew.bat | 93 | ||||
-rw-r--r-- | src/main/java/com/juick/Message.java | 6 | ||||
-rw-r--r-- | src/main/java/com/juick/User.java | 24 | ||||
-rw-r--r-- | src/test/java/com/juick/tests/MessageTests.java | 18 |
5 files changed, 130 insertions, 20 deletions
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 65a9525c..b9757b96 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,15 @@ +<<<<<<< HEAD #Thu Oct 29 12:36:21 MSK 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
+======= +#Thu Oct 29 12:36:21 MSK 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip +>>>>>>> core/master diff --git a/gradlew.bat b/gradlew.bat index aec99730..eda1deb3 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,4 @@ +<<<<<<< HEAD @if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@@ -88,3 +89,95 @@ exit /b 1 if "%OS%"=="Windows_NT" endlocal
:omega
+======= +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega +>>>>>>> core/master diff --git a/src/main/java/com/juick/Message.java b/src/main/java/com/juick/Message.java index 1a690106..c128b4f2 100644 --- a/src/main/java/com/juick/Message.java +++ b/src/main/java/com/juick/Message.java @@ -80,6 +80,12 @@ public class Message implements Comparable { Recommendation = msg.Recommendation; } + public void parseTags(String strTags) { + if (strTags != null) { + Tags.addAll(Arrays.asList(strTags.split(" "))); + } + } + @Override public boolean equals(Object obj) { if (!(obj instanceof Message)) { diff --git a/src/main/java/com/juick/User.java b/src/main/java/com/juick/User.java index 13df2058..40a3df96 100644 --- a/src/main/java/com/juick/User.java +++ b/src/main/java/com/juick/User.java @@ -28,9 +28,9 @@ public class User { public Object Avatar = null; private String FullName = null; private String JID = null; - private int unreadCount; + public int MessagesCount = 0; private String AuthHash = null; - private boolean banned = false; + public boolean Banned = false; public User() { } @@ -41,9 +41,9 @@ public class User { Avatar = u.Avatar; setFullName(u.getFullName()); setJID(u.getJID()); - setUnreadCount(u.getUnreadCount()); + MessagesCount = u.MessagesCount; setAuthHash(u.getAuthHash()); - setBanned(u.isBanned()); + Banned = u.Banned; } @Override @@ -90,20 +90,4 @@ public class User { public void setAuthHash(String authHash) { AuthHash = authHash; } - - public int getUnreadCount() { - return unreadCount; - } - - public void setUnreadCount(int unreadCount) { - this.unreadCount = unreadCount; - } - - public boolean isBanned() { - return banned; - } - - public void setBanned(boolean banned) { - this.banned = banned; - } } diff --git a/src/test/java/com/juick/tests/MessageTests.java b/src/test/java/com/juick/tests/MessageTests.java new file mode 100644 index 00000000..0392c7b3 --- /dev/null +++ b/src/test/java/com/juick/tests/MessageTests.java @@ -0,0 +1,18 @@ +package com.juick.tests;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.juick.Message;
+
+public class MessageTests {
+ @Test
+ public void messageTagsParser() {
+ Message msg = new Message();
+ msg.parseTags("test test" + (char)0xA0 + "2 test3");
+ assertEquals("First tag must be", "test", msg.Tags.get(0));
+ assertEquals("Third tag must be", "test3", msg.Tags.get(2));
+ assertEquals("Count of tags must be", 3, msg.Tags.size());
+ }
+}
\ No newline at end of file |