@@ -0,0 +1,2653 @@
+/*%0D%0A * Copyright 2012 Ryuji Yamashita%0D%0A *%0D%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0D%0A * you may not use this file except in compliance with the License.%0D%0A * You may obtain a copy of the License at%0D%0A *%0D%0A *      http://www.apache.org/licenses/LICENSE-2.0%0D%0A *%0D%0A * Unless required by applicable law or agreed to in writing, software%0D%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0D%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0D%0A * See the License for the specific language governing permissions and%0D%0A * limitations under the License.%0D%0A */%0D%0A%0D%0Apackage facebook4j;%0D%0A%0D%0Aimport java.util.HashMap;%0D%0Aimport java.util.Map;%0D%0A%0D%0Aimport org.junit.After;%0D%0Aimport org.junit.AfterClass;%0D%0Aimport org.junit.Before;%0D%0Aimport org.junit.BeforeClass;%0D%0Aimport org.junit.Test;%0D%0A%0D%0Aimport facebook4j.internal.org.json.JSONArray;%0D%0Aimport facebook4j.internal.org.json.JSONObject;%0D%0A%0D%0A/**%0D%0A * @author Ryuji Yamashita - roundrop at gmail.com%0D%0A * @see %3Ca href=%22https://developers.facebook.com/docs/reference/fql/%22%3EFacebook Query Language (FQL) - Facebook Developers%3C/a%3E%0D%0A */%0D%0Apublic class FQLMethodsTest extends FacebookTestBase %7B%0D%0A%0D%0A    @BeforeClass%0D%0A    public static void setUpBeforeClass() throws Exception %7B%0D%0A    %7D%0D%0A%0D%0A    @AfterClass%0D%0A    public static void tearDownAfterClass() throws Exception %7B%0D%0A    %7D%0D%0A%0D%0A    @Before%0D%0A    public void setUp() throws Exception %7B%0D%0A    %7D%0D%0A%0D%0A    @After%0D%0A    public void tearDown() throws Exception %7B%0D%0A    %7D%0D%0A%0D%0A    @Test%0D%0A    public void executeFQL() throws Exception %7B%0D%0A        String query = %22SELECT uid2 FROM friend WHERE uid1=me()%22;%0D%0A        JSONArray jsonArray = real.executeFQL(query);%0D%0A        for (int i = 0; i %3C jsonArray.length(); i++) %7B%0D%0A            JSONObject jsonObject = jsonArray.getJSONObject(i);%0D%0A            System.out.println(jsonObject.get(%22uid2%22));%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    @Test%0D%0A    public void executeMultiFQL() throws Exception %7B%0D%0A        Map%3CString, String%3E queries = new HashMap%3CString, String%3E();%0D%0A        queries.put(%22all friends%22, %22SELECT uid2 FROM friend WHERE uid1=me()%22);%0D%0A        queries.put(%22my name%22, %22SELECT name FROM user WHERE uid=me()%22);%0D%0A        Map%3CString, JSONArray%3E result = real.executeMultiFQL(queries);%0D%0A        JSONArray allFriendsJSONArray = result.get(%22all friends%22);%0D%0A        for (int i = 0; i %3C allFriendsJSONArray.length(); i++) %7B%0D%0A            JSONObject jsonObject = allFriendsJSONArray.getJSONObject(i);%0D%0A            System.out.println(jsonObject.get(%22uid2%22));%0D%0A        %7D%0D%0A        JSONArray myNameJSONArray = result.get(%22my name%22);%0D%0A        System.out.println(myNameJSONArray.getJSONObject(0).get(%22name%22));%0D%0A    %7D%0D%0A%0D%0A%7D%0D%0A

Test FQLMethods