Package isi.pasco2.handler

Examples of isi.pasco2.handler.CountingCacheHandler


        return new TestSuite(TestDOSTime.class);
    }
   
  public void testHexLittleEndian() {
    String hex = "F788F41E";
    DOSTime ft = DOSTime.parseLittleEndianHex(hex);
    //Sat, 30 September 2000 14:46:43  GMT
    assertEquals("1995-07-20T17:07:46.000Z", ft.toString());
   
    //Wed, 26 April 2000 22:58:55  GMT
    assertEquals("2000-01-31T15:21:44.000Z", DOSTime.parseLittleEndianHex("B67A3F28").toString());
    //Sat, 30 March 2002 05:15:11  GMT
    assertEquals("2001-10-12T22:10:02.000Z", DOSTime.parseLittleEndianHex("41B14C2B").toString());
View Full Code Here


    assertEquals("2001-10-12T22:10:02.000Z", DOSTime.parseLittleEndianHex("41B14C2B").toString());
  }
 
  public void testCorrectLocal() {
   
    DOSTime ft = new DOSTime(13404, 1075);
    //Sat, 30 September 2000 14:46:43  GMT
    assertEquals("2006-02-28T00:33:38.000Z", ft.toString());
  }
View Full Code Here

      assertEquals(4, st.wHour.getValue());
      assertEquals(35, st.wMinute.getValue());
      assertEquals(17, st.wSecond.getValue());
      assertEquals(625, st.wMilliseconds.getValue());

      FileTime nonSystemFileTime = new FileTime(lowValue, highValue);
      assertEquals("2006-02-21T04:35:17.625Z", nonSystemFileTime.toXSDString());

    } catch (Exception e) {
      fail();
    }
  }
View Full Code Here

      CDLL dll = CDLL.LoadLibrary("kernel32.dll");
      CFunction getSystemTimeAsFileTime = dll
          .loadFunction("GetSystemTimeAsFileTime");

      String hex = "40B3B13FED2AC001";
      FileTime f = FileTime.parseLittleEndianHex(hex);

      FILETIME ft = new FILETIME();
      ft.dwLowDateTime.setValue((int) f.getLow());
      ft.dwHighDateTime.setValue((int) f.getHigh());

      CFunction fileTimeToSystemTime = dll.loadFunction("FileTimeToSystemTime");
      SYSTEMTIME st = new SYSTEMTIME();
      Object[] ary1 = { ft, st };
View Full Code Here

   
    handler.record((int) currrecoff, rec);

    long low = fr.readUIntAtOffset(currrecoff + 8);
    long high = fr.readLittleEndianUInt();
    FileTime modTime = new FileTime(low, high);

    low = fr.readUIntAtOffset(currrecoff + 16);
    high = fr.readLittleEndianUInt();
    FileTime accessTime = new FileTime(low, high);

    StringBuffer url = readURL(fr, currrecoff);
    StringBuffer filename = readFileName(fr, currrecoff);
    String dirname = readDirName(fr, currrecoff);
    StringBuffer httpheaders = readHTTPHeaders(fr, currrecoff, reclen);
View Full Code Here

    fr.read(rec, 0, reclen);
    handler.record((int) currrecoff, rec);

    long low = indexFile.readUIntAtOffset(currrecoff + 8);
    long high = fr.readLittleEndianUInt();
    FileTime modTime = new FileTime(low, high);

    low = indexFile.readUIntAtOffset(currrecoff + 16);
    high = fr.readLittleEndianUInt();
    FileTime accessTime = new FileTime(low, high);

    int date = indexFile.readShortAtOffset(currrecoff + 0x50);
    int time = indexFile.readShortAtOffset(currrecoff + 0x52);
    DOSTime lastAccessTime = new DOSTime(date, time);
View Full Code Here

    }
   
  public void testFileTime() {
    long low = -543274336;
    long high = 29744990;
    FileTime ft = new FileTime(low, high);
    long millis = ft.getTimeAsMillis();
    //assertEquals(1130902272657L, millis);
   
    Date d = ft.asDate();
    assertEquals("Wed Nov 02 13:31:12 EST 2005", d.toString());
    assertEquals("2005-11-02T03:31:12.657Z", ft.toString());
  }
View Full Code Here

    assertEquals(1068610368,low);
  }
 
  public void testHexLittleEndian() {
    String hex = "40B3B13FED2AC001";
    FileTime ft = FileTime.parseLittleEndianHex(hex);
    //Sat, 30 September 2000 14:46:43  GMT
    assertEquals("2000-09-30T14:46:43.060Z", ft.toString());
   
    //Wed, 26 April 2000 22:58:55  GMT
    assertEquals("2000-04-26T22:58:55.899Z", FileTime.parseLittleEndianHex("39B1C8FFD2AFBF01").toString());
    //Sat, 30 March 2002 05:15:11  GMT
    assertEquals("2002-03-30T05:15:11.620Z", FileTime.parseLittleEndianHex("69D8F2DDA9D7C101").toString());
View Full Code Here

    assertEquals("2005-10-17T02:59:22.147Z", FileTime.parseLittleEndianHex("308F41C6C6D2C501").toString());
  }
 
  public void testHexBigEndian() {
    String hex = "01C1D7A9DDF2D869";
    FileTime ft = FileTime.parseBigEndianHex(hex);
    //Sat, 30 March 2002 05:15:11  GMT
    assertEquals("2002-03-30T05:15:11.620Z", ft.toString());
   
    // Sun, 10 March 2002 06:07:32  GMT
    assertEquals("2002-03-10T06:07:32.813Z", FileTime.parseBigEndianHex("01C1C7F9DDFBD86F").toString());
    // Tue, 20 January 2004 04:58:58  GMT
    assertEquals("2004-01-20T04:58:58.985Z", FileTime.parseBigEndianHex("01C3DF121D432432").toString());
View Full Code Here

    for (int i=0 ; i < 4 ; i++) {
      bytesHigh[i] = (byte) (intsHigh[i] & 0xFF);
    }
    long high = StructConverter.bytesIntoUInt(bytesHigh, 0);

    FileTime ft = new FileTime(low, high);
    assertEquals("2005-10-17T02:59:22.147Z", ft.toString());
   


  }
View Full Code Here

TOP

Related Classes of isi.pasco2.handler.CountingCacheHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.