Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

l #1

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open

l #1

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8eb7e8e
updatelibs
Oct 18, 2018
3e985e6
Circle CI integration
SEG2105F18 Oct 23, 2018
8b269bf
CI Test
SEG2105F18 Oct 23, 2018
4226be6
Modifications to circle ci file
SEG2105F18 Oct 23, 2018
c0c0108
Mod to CIRCLE CI
SEG2105F18 Oct 23, 2018
cf93e94
Mod to CircleCI file
SEG2105F18 Oct 23, 2018
2113a0b
Mod to CircleCI file
SEG2105F18 Oct 23, 2018
673a8bf
Cicrle CI Test
SEG2105F18 Oct 23, 2018
9064da6
Cicrle CI Test
SEG2105F18 Oct 23, 2018
1d2914c
Cicrle CI Test
SEG2105F18 Oct 23, 2018
aada2be
Cicrle CI Test
SEG2105F18 Oct 23, 2018
0e5b49b
Cicrle CI Test
SEG2105F18 Oct 23, 2018
9de55d3
Cicrle CI Test
SEG2105F18 Oct 23, 2018
a0d5cfb
Circle CI updated
SEG2105F18 Oct 24, 2018
4bbc12f
Circle CI updated
SEG2105F18 Oct 24, 2018
21e6b66
Circle CI updated
SEG2105F18 Oct 24, 2018
a9fd968
Circle CI updated
SEG2105F18 Oct 24, 2018
1eb56e0
simple local tests
Oct 24, 2018
b4ea032
Testing unit tests with circle CI
SEG2105F18 Oct 24, 2018
06f980b
Testing unit tests with circle CI
SEG2105F18 Oct 25, 2018
c969ffb
Testing unit tests with circle CI
SEG2105F18 Oct 25, 2018
3363e05
Testing unit tests with circle CI
SEG2105F18 Oct 25, 2018
25b3a7e
Testing unit tests with circle CI
SEG2105F18 Oct 25, 2018
fa42d14
Testing unit tests with circle CI
SEG2105F18 Oct 25, 2018
ad58e96
Testing unit tests with circle CI
SEG2105F18 Oct 25, 2018
2e221f5
Testing unit tests with circle CI
SEG2105F18 Oct 25, 2018
77167ba
Create README.md
SEG2105F18 Nov 22, 2018
9c50e90
Update README.md
SEG2105F18 Nov 22, 2018
8769941
Update README.md
SEG2105F18 Nov 22, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2
jobs:
build:
working_directory: ~/ProductCatalog
docker:
- image: circleci/android:api-28-alpha
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Chmod permissions
command: sudo chmod +x ./gradlew
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Run UnitTest
command: ./gradlew test
- store_artifacts:
path: app/build/outputs/apk/debug/
destination: apks/
- store_test_results:
path: app/build/test-results

Binary file added .idea/caches/build_file_checksums.ser
Binary file not shown.
29 changes: 29 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 0 additions & 22 deletions .idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

28 changes: 10 additions & 18 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ProductCatalog
Build Status
[![Build Status](https://circleci.com/gh/SEG2105F18/ProductCatalog.png?branch=master)](https://circleci.com/gh/SEG2105F18/ProductCatalog)

26 changes: 13 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
compileSdkVersion 28
defaultConfig {
applicationId "mgarzon.createbest.productcatalog"
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -17,18 +17,18 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-database:10.0.1'
testCompile 'junit:junit:4.12'
}

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'

apply plugin: 'com.google.gms.google-services'
}
20 changes: 10 additions & 10 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
{
"project_info": {
"project_number": "767509833961",
"firebase_url": "https://productcatalog-d825a.firebaseio.com",
"project_id": "productcatalog-d825a",
"storage_bucket": "productcatalog-d825a.appspot.com"
"project_number": "549167445435",
"firebase_url": "https://productcatalogf18.firebaseio.com",
"project_id": "productcatalogf18",
"storage_bucket": "productcatalogf18.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:767509833961:android:aadfeba8c26d67fc",
"mobilesdk_app_id": "1:549167445435:android:aadfeba8c26d67fc",
"android_client_info": {
"package_name": "mgarzon.createbest.productcatalog"
}
},
"oauth_client": [
{
"client_id": "767509833961-6i2um8le0ig0dghdds1msdf8j909i4ie.apps.googleusercontent.com",
"client_id": "549167445435-bqkrnvemam2vlsbvo12db9e8f7o4kt2o.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "mgarzon.createbest.productcatalog",
"certificate_hash": "40cba294ec4e6b892de0a41c358747aba3d4eb1f"
"certificate_hash": "94a15cb9b346e4f7005039f06009b38c5c518158"
}
},
{
"client_id": "767509833961-lq1hebfu8a8q54uprv1o6dm9og3bfp20.apps.googleusercontent.com",
"client_id": "549167445435-oa6l951d32j9h3vqpa3vk2vd757in4ui.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDQ7OQ0R8lF4OAZvczE7cjNOWrdq9XBuKM"
"current_key": "AIzaSyBdcbJw4tB9eb0o9w1IcuCP6Pap_nphWPc"
}
],
"services": {
Expand All @@ -40,7 +40,7 @@
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "767509833961-lq1hebfu8a8q54uprv1o6dm9og3bfp20.apps.googleusercontent.com",
"client_id": "549167445435-oa6l951d32j9h3vqpa3vk2vd757in4ui.apps.googleusercontent.com",
"client_type": 3
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package mgarzon.createbest.productcatalog;


import android.support.test.filters.LargeTest;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import static android.support.test.espresso.Espresso.onData;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
import static android.support.test.espresso.action.ViewActions.typeText;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.CoreMatchers.anything;


@RunWith(AndroidJUnit4.class)
@LargeTest
public class FirstTest {

private String mStringToBetyped;
private String mNumberToBetyped;
@Rule
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(
MainActivity.class);

@Before
public void initValidString() {
// Specify a valid string.
mStringToBetyped = "Espresso";
mNumberToBetyped = "1234";
}

@Test
public void changeText_sameActivity() {
// Type text and then press the button.
onView(withId(R.id.editTextName))
.perform(typeText(mStringToBetyped), closeSoftKeyboard());
onView(withId(R.id.editTextPrice))
.perform(typeText(mNumberToBetyped), closeSoftKeyboard());

onView(withId(R.id.addButton)).perform(click());

// Check that the text was changed.
//onView(withId(R.id.listViewProducts))
// .check(matches(withText(mStringToBetyped)));
onData(anything()).inAdapterView(withId(R.id.listViewProducts)).atPosition(0).onChildView(withId(R.id.textViewName)).check(matches(withText("Hello")));

}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package mgarzon.createbest.productcatalog;
import static org.junit.Assert.*;
import org.junit.Test;

public class ProductTest {

@Test
public void checkProductName() {
Product aProduct = new Product("1", "DELL MONITOR", 180);
assertEquals("Check the name of the product", "DELL MONITOR", aProduct.getProductName());
}

@Test
public void checkProductId() {
Product aProduct = new Product("1", "DELL MONITOR", 180);
assertEquals("Check the id of the product", "1", aProduct.getId());
}

@Test
public void checkProductPrice() {
// I am making this test to fail
Product aProduct = new Product("1", "DELL MONITOR", 180);
assertEquals("Check the price of the product", "0", aProduct.getPrice());
}


}
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@

buildscript {
repositories {
google()
jcenter()

}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.android.tools.build:gradle:3.2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.google.gms:google-services:4.0.1'
}
}

allprojects {
repositories {
google()
jcenter()

}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun May 07 11:02:30 EDT 2017
#Thu Oct 18 15:38:05 EDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip