diff --git a/IntelliQ/backend/build.gradle b/IntelliQ/backend/build.gradle index 7d1bf79..9566718 100644 --- a/IntelliQ/backend/build.gradle +++ b/IntelliQ/backend/build.gradle @@ -24,7 +24,7 @@ sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 dependencies { - //compile fileTree(dir: 'libs', include: ['*.jar']) + compile fileTree(dir: 'libs', include: ['*.jar']) appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.38' compile group: 'com.google.apis', name: 'google-api-services-oauth2', version: 'v1-rev120-1.22.0' @@ -42,6 +42,11 @@ dependencies { compile group: 'commons-fileupload', name: 'commons-fileupload', version: '1.3.2' compile 'javax.servlet:servlet-api:2.5' + + testCompile 'com.google.appengine:appengine-api-labs:1.9.8' + testCompile 'com.google.appengine:appengine-api-stubs:1.9.8' + testCompile 'com.google.appengine:appengine-testing:1.9.8' + testCompile 'junit:junit:4.12' } diff --git a/IntelliQ/backend/libs/slackmessagebuilder.jar b/IntelliQ/backend/libs/slackmessagebuilder.jar new file mode 100644 index 0000000..dec02a1 Binary files /dev/null and b/IntelliQ/backend/libs/slackmessagebuilder.jar differ diff --git a/IntelliQ/backend/src/test/java/com/intelliq/appengine/ExampleTest.java b/IntelliQ/backend/src/test/java/com/intelliq/appengine/ExampleTest.java new file mode 100644 index 0000000..171e4d6 --- /dev/null +++ b/IntelliQ/backend/src/test/java/com/intelliq/appengine/ExampleTest.java @@ -0,0 +1,14 @@ +package com.intelliq.appengine; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class ExampleTest { + + @Test + public void testAddition() { + assertEquals(4, 2 + 2); + } + +} \ No newline at end of file diff --git a/IntelliQ/backend/src/test/java/com/intelliq/appengine/MessageBuilderTest.java b/IntelliQ/backend/src/test/java/com/intelliq/appengine/MessageBuilderTest.java new file mode 100644 index 0000000..34d1a57 --- /dev/null +++ b/IntelliQ/backend/src/test/java/com/intelliq/appengine/MessageBuilderTest.java @@ -0,0 +1,55 @@ +package com.intelliq.appengine; + +import net.steppschuh.slackmessagebuilder.message.attachment.Attachment; +import net.steppschuh.slackmessagebuilder.message.attachment.AttachmentBuilder; +import net.steppschuh.slackmessagebuilder.message.attachment.AttachmentField; +import net.steppschuh.slackmessagebuilder.message.MessageBuilder; +import net.steppschuh.slackmessagebuilder.message.MessageLink; +import net.steppschuh.slackmessagebuilder.request.Webhook; + +public class MessageBuilderTest { + + //@Test + public void builder_exampleMessage() throws Exception { + // create a webhook + String hookUrl = "https://hooks.slack.com/services/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"; + Webhook webhook = new Webhook(hookUrl); + + // create some content + MessageLink gitHubLink = new MessageLink("https://github.com/Steppschuh/SlackMessageBuilder", "GitHub repo"); + + // create a message + MessageBuilder messageBuilder = new MessageBuilder() + .setChannel("#log") + .setUsername("Slack Message Builder") + .setIconEmoji(":+1:") + .setText("I'm the message text with a link to a " + gitHubLink + " :octocat:"); + + // add some attachments + int attachmentCount = 3; + for (int index = 1; index <= attachmentCount; index++) { + messageBuilder.addAttachment(generateMessageAttachment(index)); + } + + // send message + webhook.postMessageSynchronous(messageBuilder.build()); + } + + public static Attachment generateMessageAttachment(int index) { + AttachmentBuilder attachmentBuilder = new AttachmentBuilder() + .setTitle("Attachment #" + index) + .setText("This is the main text in message attachment " + index + ", and can contain standard message markup.") + .setColor(getHexCode(index)) + .addField(new AttachmentField("User", System.getProperty("user.name"))) + .addField(new AttachmentField("Index", String.valueOf(index))) + .setFooter("Created by " + MessageBuilderTest.class.getSimpleName()); + + return attachmentBuilder.build(); + } + + public static String getHexCode(int index) { + String[] colors = {"#00BCD4", "#2196F3", "#673AB7", "#E91E63", "#795548"}; + return colors[Math.abs(index % (colors.length - 1))]; + } + +} \ No newline at end of file diff --git a/IntelliQ/mobile/build.gradle b/IntelliQ/mobile/build.gradle index b496cfd..c5743f5 100755 --- a/IntelliQ/mobile/build.gradle +++ b/IntelliQ/mobile/build.gradle @@ -7,7 +7,7 @@ android { defaultConfig { applicationId "com.steppschuh.intelliq" minSdkVersion 16 - targetSdkVersion 24 + targetSdkVersion 23 versionCode 1 versionName "1.0" multiDexEnabled true @@ -53,18 +53,18 @@ dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) wearApp project(':wear') testCompile 'junit:junit:4.12' - compile 'com.android.support:multidex:1.0.1' - compile 'com.android.support:appcompat-v7:24.2.0' compile 'com.google.android.gms:play-services:9.4.0' - compile 'com.android.support:design:24.2.0' - compile 'com.android.support:support-v4:24.2.0' - compile 'com.android.support:cardview-v7:24.2.0' + compile 'com.android.support:multidex:1.0.1' + compile 'com.android.support:appcompat-v7:23.4.0' + compile 'com.android.support:design:23.4.0' + compile 'com.android.support:support-v4:23.4.0' + compile 'com.android.support:cardview-v7:23.4.0' + compile 'com.android.support:palette-v7:23.4.0' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.google.code.gson:gson:2.4' compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13' compile 'com.octo.android.robospice:robospice-spring-android:1.4.14' compile 'com.octo.android.robospice:robospice:1.4.14' - compile 'com.android.support:palette-v7:24.2.0' compile 'com.google.android.gms:play-services-ads:9.4.0' compile 'com.google.android.gms:play-services-analytics:9.4.0' compile 'com.google.android.gms:play-services-auth:9.4.0' diff --git a/IntelliQ/mobile/mobile.iml b/IntelliQ/mobile/mobile.iml index 9bf0689..6d2240a 100755 --- a/IntelliQ/mobile/mobile.iml +++ b/IntelliQ/mobile/mobile.iml @@ -123,21 +123,18 @@ - - - - + + + + + + - - - - - - - - - + + + + @@ -188,27 +185,28 @@ + + + + - - + - - - + @@ -216,19 +214,17 @@ - + - - - + @@ -240,6 +236,7 @@ + @@ -247,29 +244,28 @@ - + + + - + - - - - + diff --git a/IntelliQ/mobile/src/test/java/com/steppschuh/intelliq/ExampleUnitTest.java b/IntelliQ/mobile/src/test/java/com/steppschuh/intelliq/ExampleTest.java old mode 100755 new mode 100644 similarity index 90% rename from IntelliQ/mobile/src/test/java/com/steppschuh/intelliq/ExampleUnitTest.java rename to IntelliQ/mobile/src/test/java/com/steppschuh/intelliq/ExampleTest.java index de19a2c..1fa9d48 --- a/IntelliQ/mobile/src/test/java/com/steppschuh/intelliq/ExampleUnitTest.java +++ b/IntelliQ/mobile/src/test/java/com/steppschuh/intelliq/ExampleTest.java @@ -7,9 +7,11 @@ /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ -public class ExampleUnitTest { +public class ExampleTest { + @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } + } \ No newline at end of file diff --git a/IntelliQ/wear/wear.iml b/IntelliQ/wear/wear.iml index 4f3ae86..e44eb53 100755 --- a/IntelliQ/wear/wear.iml +++ b/IntelliQ/wear/wear.iml @@ -64,14 +64,6 @@ - - - - - - - - @@ -80,9 +72,19 @@ + + + + + + + + + + @@ -91,12 +93,20 @@ + + + + + + + + diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..7d4075a --- /dev/null +++ b/circle.yml @@ -0,0 +1,25 @@ +# +# Build configuration for Circle CI +# + +general: + artifacts: + - "IntelliQ/mobile/build/reports/tests/" + - "IntelliQ/backend/build/reports/tests/" + +machine: + environment: + ANDROID_HOME: /usr/local/android-sdk-linux + +dependencies: + override: + - echo y | android update sdk --no-ui --all --filter tools,platform-tools,android-23,extra-google-m2repository,extra-google-google_play_services,extra-android-support + - echo y | android update sdk --no-ui --all --filter build-tools-23.0.3 + - ANDROID_HOME=/usr/local/android-sdk-linux ./IntelliQ/gradlew dependencies + +test: + override: + - (cd IntelliQ && ./gradlew mobile:test): + timeout: 600 + - (cd IntelliQ && ./gradlew backend:test): + timeout: 600 \ No newline at end of file