PageRenderTime 12ms CodeModel.GetById 1ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/Core/KSTicketTestBase.h

http://macfuse.googlecode.com/
C++ Header | 64 lines | 36 code | 5 blank | 23 comment | 0 complexity | 476fa3d4c519e3601c2847f24246d288 MD5 | raw file
 1// Copyright 2009 Google Inc.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#import <SenTestingKit/SenTestingKit.h>
16#import "KSOmahaServer.h"
17#import "KSTicket.h"
18
19// For many unit tests we'll need a group of tickets, some servers, etc.
20// Here's a common base class for that.  Since we don't have MI in objc,
21// this needs to derive from SenTestCase.  Finally, since it derives
22// from SenTestCase, otest thinks it's a test, so I added an empty test
23// to avoid confusion about the "zero unit tests run" message.
24@interface KSTicketTestBase : SenTestCase {
25  NSURL *fileURL_;
26  NSURL *httpURL_;
27  int size_;
28  NSMutableArray *fileTickets_;
29  NSMutableArray *httpTickets_;
30  KSOmahaServer *httpServer_;
31}
32
33// Helper to create a KSTicket with the given |url| and |count|.
34// |x| is used to make the productID/version unique.
35- (KSTicket *)ticketWithURL:(NSURL *)url count:(int)count;
36
37// Helper to make a ticket with a given |url| and |count|, and extra
38// bit of information.
39- (KSTicket *)ticketWithURL:(NSURL *)url count:(int)count
40                    tttoken:(NSString *)tttoken;
41- (KSTicket *)ticketWithURL:(NSURL *)url count:(int)count
42               creationDate:(NSDate *)creationDate;
43- (KSTicket *)ticketWithURL:(NSURL *)url count:(int)count
44                        tag:(NSString *)tag;
45- (KSTicket *)ticketWithURL:(NSURL *)url count:(int)count
46                  brandPath:(NSString *)brandPath
47                   brandKey:(NSString *)brandKey;
48- (KSTicket *)ticketWithURL:(NSURL *)url count:(int)count
49                versionPath:(NSString *)versionPath
50                 versionKey:(NSString *)versionKey
51                    version:(NSString *)version;
52
53// Designated enticketizer: Set a bunch of ticket knobs at one time.
54- (KSTicket *)ticketWithURL:(NSURL *)url
55                      count:(int)count
56                    tttoken:(NSString *)tttoken
57               creationDate:(NSDate *)creationDate
58                        tag:(NSString *)tag
59                  brandPath:(NSString *)brandPath
60                   brandKey:(NSString *)brandKey
61                versionPath:(NSString *)versionPath
62                 versionKey:(NSString *)versionKey
63                    version:(NSString *)version;
64@end