Search in sources :

Example 56 with FirebaseDatabase

use of com.google.firebase.database.FirebaseDatabase in project SEProject by NicholasBarreyre.

the class MapsActivityUnitTests method teardownTestLoc.

@AfterClass
public static void teardownTestLoc() {
    FirebaseDatabase db = FirebaseDatabase.getInstance();
    DatabaseReference myRef = db.getReference("user_locations");
    myRef.child(TEST_FRIEND).setValue(null);
}
Also used : FirebaseDatabase(com.google.firebase.database.FirebaseDatabase) DatabaseReference(com.google.firebase.database.DatabaseReference) AfterClass(org.junit.AfterClass)

Example 57 with FirebaseDatabase

use of com.google.firebase.database.FirebaseDatabase in project SEProject by NicholasBarreyre.

the class TestingHelper method resetTestUserGoals.

/**
 * Test helper to reset the testuser's goals list
 */
public static void resetTestUserGoals() {
    FirebaseDatabase database = FirebaseDatabase.getInstance();
    DatabaseReference usersReference = database.getReference("users/testuser");
    usersReference.child("userGoals").setValue(null);
}
Also used : FirebaseDatabase(com.google.firebase.database.FirebaseDatabase) DatabaseReference(com.google.firebase.database.DatabaseReference)

Example 58 with FirebaseDatabase

use of com.google.firebase.database.FirebaseDatabase in project SEProject by NicholasBarreyre.

the class TestingHelper method resetTestTeam.

public static void resetTestTeam() {
    FirebaseDatabase database = FirebaseDatabase.getInstance();
    DatabaseReference teamsReference = database.getReference("teams");
    teamsReference.child("testteam").setValue(null);
}
Also used : FirebaseDatabase(com.google.firebase.database.FirebaseDatabase) DatabaseReference(com.google.firebase.database.DatabaseReference)

Example 59 with FirebaseDatabase

use of com.google.firebase.database.FirebaseDatabase in project SEProject by NicholasBarreyre.

the class TestingHelper method addTestUserExercises.

/**
 * Test helper to add test exercises to testuser
 */
public static void addTestUserExercises() {
    FirebaseDatabase database = FirebaseDatabase.getInstance();
    DatabaseReference usersReference = database.getReference("users/testuser");
    ArrayList<Exercise> testExercises = new ArrayList<>();
    testExercises.add(testExercise1);
    testExercises.add(testExercise2);
    testExercises.add(testExercise3);
    usersReference.child("userExercises").setValue(testExercises);
}
Also used : FirebaseDatabase(com.google.firebase.database.FirebaseDatabase) Exercise(ca.dal.cs.athletemonitor.athletemonitor.Exercise) DatabaseReference(com.google.firebase.database.DatabaseReference) ArrayList(java.util.ArrayList)

Example 60 with FirebaseDatabase

use of com.google.firebase.database.FirebaseDatabase in project SEProject by NicholasBarreyre.

the class TestingHelper method resetTestUserWorkouts.

/**
 * Test helper to reset the testuser's workout list
 */
public static void resetTestUserWorkouts() {
    FirebaseDatabase database = FirebaseDatabase.getInstance();
    DatabaseReference usersReference = database.getReference("users/testuser");
    usersReference.child("userWorkouts").setValue(null);
}
Also used : FirebaseDatabase(com.google.firebase.database.FirebaseDatabase) DatabaseReference(com.google.firebase.database.DatabaseReference)

Aggregations

FirebaseDatabase (com.google.firebase.database.FirebaseDatabase)66 DatabaseReference (com.google.firebase.database.DatabaseReference)62 DatabaseError (com.google.firebase.database.DatabaseError)36 DataSnapshot (com.google.firebase.database.DataSnapshot)34 ValueEventListener (com.google.firebase.database.ValueEventListener)30 ArrayList (java.util.ArrayList)10 ListView (android.widget.ListView)7 Intent (android.content.Intent)6 FirebaseUser (com.google.firebase.auth.FirebaseUser)6 Test (org.junit.Test)5 View (android.view.View)4 TextView (android.widget.TextView)4 ChildEventListener (com.google.firebase.database.ChildEventListener)4 AdapterView (android.widget.AdapterView)3 Button (android.widget.Button)3 Query (com.google.firebase.database.Query)3 Provides (dagger.Provides)3 SharedPreferences (android.content.SharedPreferences)2 TeamsAdapter (ca.dal.cs.athletemonitor.athletemonitor.adapters.TeamsAdapter)2 Product (com.example.asus.onlinecanteen.model.Product)2