// Path: BoincRpc/src/androidTest/java/edu/berkeley/boinc/testutil/TestSupport.java
// public class TestSupport {
// 
//     public static String readResource(int resourceId, int maxSize) {
//         InputStream stream = InstrumentationRegistry.getInstrumentation().getContext().getResources().openRawResource(resourceId);
//         assertNotNull(stream);
//         StringBuilder sb = new StringBuilder();
//         String strLine;
//         try {
//             BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
//             while ((strLine = reader.readLine()) != null) {
//                 sb.append(strLine);
//                 sb.append("\n");
//             }
//         }
//         catch (IOException e) {
//             fail("IOException");
//         }
//         // Truncate that last newline
//         if (sb.length() > 0) {
//             sb.setLength(sb.length() - 1);
//         }
//         if (maxSize > 0) {
//             if (sb.length() > maxSize) {
//                 sb.setLength(maxSize);
//             }
//         }
//         return sb.toString();
//     }
// 
//     public static String readResource(int resourceId) {
//         return readResource(resourceId, 0);
//     }
// }


import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import edu.berkeley.boinc.testutil.TestSupport;
import java.util.Vector;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.*;
/*
 * AndroBOINC - BOINC Manager for Android
 * Copyright (C) 2010 - 2016, Pavol Michalec
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

package edu.berkeley.boinc;





@RunWith(AndroidJUnit4.class)
@SmallTest
public class ProjectsParserTest {

    @Test
    public void parseNormal() {
// Path: BoincRpc/src/androidTest/java/edu/berkeley/boinc/testutil/TestSupport.java
// public class TestSupport {
// 
//     public static String readResource(int resourceId, int maxSize) {
//         InputStream stream = InstrumentationRegistry.getInstrumentation().getContext().getResources().openRawResource(resourceId);
//         assertNotNull(stream);
//         StringBuilder sb = new StringBuilder();
//         String strLine;
//         try {
//             BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
//             while ((strLine = reader.readLine()) != null) {
//                 sb.append(strLine);
//                 sb.append("\n");
//             }
//         }
//         catch (IOException e) {
//             fail("IOException");
//         }
//         // Truncate that last newline
//         if (sb.length() > 0) {
//             sb.setLength(sb.length() - 1);
//         }
//         if (maxSize > 0) {
//             if (sb.length() > maxSize) {
//                 sb.setLength(maxSize);
//             }
//         }
//         return sb.toString();
//     }
// 
//     public static String readResource(int resourceId) {
//         return readResource(resourceId, 0);
//     }
// }


// Path: BoincRpc/src/androidTest/java/edu/berkeley/boinc/ProjectsParserTest.java
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import edu.berkeley.boinc.testutil.TestSupport;
import java.util.Vector;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.*;

/*
 * AndroBOINC - BOINC Manager for Android
 * Copyright (C) 2010 - 2016, Pavol Michalec
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

package edu.berkeley.boinc;





@RunWith(AndroidJUnit4.class)
@SmallTest
public class ProjectsParserTest {

    @Test
    public void parseNormal() {
        final String received = TestSupport.readResource(edu.berkeley.boinc.test.R.raw.get_project_status_reply);