/**
 * The MIT License (MIT)
 * Copyright (c) 2012 David Carver
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
 * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package us.nineworlds.serenity.volley;

import static org.fest.assertions.api.Assertions.assertThat;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

import com.android.volley.RequestQueue;

@RunWith(RobolectricTestRunner.class)
@Config(reportSdk = 14, emulateSdk = 18)
public class VolleyUtilsTest {

	@Test
	public void assertThatVolleyRequestQueueIsNotNull() {
		RequestQueue queue = VolleyUtils
				.getRequestQueueInstance(Robolectric.application);
		assertThat(queue).isNotNull();
	}

	@Test
	public void assertThatVolleyRequestQueueIsSameInstance() {
		RequestQueue queue = VolleyUtils
				.getRequestQueueInstance(Robolectric.application);
		RequestQueue queue2 = VolleyUtils
				.getRequestQueueInstance(Robolectric.application);
		assertThat(queue).isEqualTo(queue2);

	}
}

@@ -513,17 +513,16 @@
 ions:%0A *
- 
 %0A * The 
@@ -649,17 +649,16 @@
 ware.%0A *
- 
 %0A * THE 
@@ -1239,16 +1239,41 @@
 tThat;%0A%0A
+import org.junit.Before;%0A
 import o
@@ -1320,16 +1320,44 @@
 unWith;%0A
+import org.mockito.Mockito;%0A
 import o
@@ -1473,16 +1473,51 @@
 onfig;%0A%0A
+import com.android.volley.Request;%0A
 import c
@@ -1547,16 +1547,52 @@
 stQueue;
+%0Aimport com.android.volley.Response;
 %0A%0A@RunWi
@@ -1696,16 +1696,146 @@
 Test %7B%0A%0A
+%09RequestQueue queue;%0A%0A%09@Before%0A%09public void setUp() %7B%0A%09%09queue = VolleyUtils.getRequestQueueInstance(Robolectric.application);%0A%09%7D%0A%0A
 %09@Test%0A%09
@@ -1886,37 +1886,24 @@
 tNull() %7B%0A%09%09
-RequestQueue 
 queue = Voll
@@ -1901,37 +1901,32 @@
 ue = VolleyUtils
-%0A%09%09%09%09
 .getRequestQueue
@@ -2068,98 +2068,8 @@
 ) %7B%0A
-%09%09RequestQueue queue = VolleyUtils%0A%09%09%09%09.getRequestQueueInstance(Robolectric.application);%0A
 %09%09Re
@@ -2198,10 +2198,621 @@
 2);%0A%0A%09%7D%0A
+%0A%09@Test%0A%09public void assertThatXmlRequestIsNotNull() %7B%0A%09%09Response.Listener rlistener = Mockito.mock(Response.Listener.class);%0A%09%09Request request = VolleyUtils.volleyXmlGetRequest(%0A%09%09%09%09%22http://www.example.com%22, rlistener,%0A%09%09%09%09new DefaultLoggingVolleyErrorListener());%0A%09%09assertThat(request).isNotNull();%0A%09%7D%0A%0A%09@Test%0A%09public void assertThatJsonRequestIsNotNull() %7B%0A%09%09Response.Listener rlistener = Mockito.mock(Response.Listener.class);%0A%09%09Request request = VolleyUtils.volleyJSonGetRequest(%0A%09%09%09%09%22http://www.example.com%22, rlistener,%0A%09%09%09%09new DefaultLoggingVolleyErrorListener());%0A%09%09assertThat(request).isNotNull();%0A%09%7D%0A%0A
 %7D%0A

Add tests for VolleyUtils.