KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > archive > update > ImageHeaderTest


1 /*
2  * Created on Oct 2, 2005
3  */

4 package com.openedit.archive.update;
5
6 import java.io.File JavaDoc;
7 import java.util.List JavaDoc;
8
9 import com.openedit.archive.Archive;
10 import com.openedit.store.Product;
11
12 public class ImageHeaderTest extends ArcUpdateTestCase
13 {
14     public ImageHeaderTest(String JavaDoc inArg0)
15     {
16         super(inArg0);
17     }
18     
19     public void testUpdate() throws Exception JavaDoc {
20         Product product = getStore().getProduct("acfanvent01tif1078102626");
21         final String JavaDoc expectedKey = product.getKeywords();
22         assertNotNull(product);
23
24         Archive archive = getArchive();
25         File JavaDoc original = archive.getOriginalDocument(product);
26         final String JavaDoc path = original.getAbsolutePath();
27         removeKeywords(path);
28         long mod = original.lastModified();
29
30         archive.updateHeaders(); // this updates all the headers
31
//FIXME ExifEdit returns success when it does not find the image file: ACUnits04.tif
32
//FIXME ExifEdit returns success when it does not find the image file: ACUnits04.tif
33
//FIXME ExifEdit returns success when it does not find the image file: ACUnits04.tif
34
//FIXME ExifEdit returns success when it does not find the image file: ACUnits04.tif
35

36         File JavaDoc updated = archive.getOriginalDocument(product);
37         List JavaDoc output = findKeywords(path).getOutput();
38         assertListContains(expectedKey, output);
39         assertTrue(updated.lastModified() > original.lastModified());
40     }
41
42 // public void xtestOriginalUpdate() throws Exception
43
// {
44
// Product product = getStore().getProduct("acfanvent01tif1078102626");
45
// assertNotNull(product);
46
//
47
// Archive archive = getArchive();
48
// File original = archive.getOriginalDocument(product);
49
// long mod = original.lastModified();
50
//
51
// archive.updateHeaders(); //this updates all the headers
52
//
53
//
54
// File updated = archive.getOriginalDocument(product);
55
//
56
// assertTrue(updated.lastModified() > original.lastModified() );
57
// //archive.getOriginalsRootDirectory()
58
// }
59

60 }
61
Popular Tags