Split camel-imapx library and merge into camel so that providers can be written on...
[platform/upstream/evolution-data-server.git] / camel / providers / imapx / test-imapx.c
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of version 2 of the GNU Lesser General Public
7  * License as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #include <camel/camel.h>
21
22 gint
23 main (gint argc,
24       gchar *argv[])
25 {
26         CamelSession *session;
27         gchar *uri = NULL;
28         CamelService *service;
29         CamelFolder *folder;
30
31         if (argc != 2) {
32                 printf ("Pass the account url argument \n");
33                 return -1;
34         }
35
36         uri = argv[1];
37         system ("rm -rf /tmp/test-camel-imapx");
38         camel_init ("/tmp/test-camel-imapx", TRUE);
39         camel_provider_init ();
40
41         session = g_object_new (
42                 CAMEL_TYPE_SESSION,
43                 "user-data-dir", "/tmp/test-camel-imapx", NULL);
44
45         service = camel_session_add_service (
46                 session, "text-imapx", uri, CAMEL_PROVIDER_STORE, NULL);
47         camel_service_connect_sync (service, NULL);
48
49         camel_store_get_folder_info_sync (
50                 CAMEL_STORE (service), "", 3, NULL, NULL);
51         folder = camel_store_get_folder_sync (
52                 CAMEL_STORE (service), "INBOX", 0, NULL, NULL);
53         camel_folder_refresh_info_sync (folder, NULL, NULL);
54
55         while (1)
56         {
57         }
58         return 0;
59 }