Changeset 8141160


Ignore:
Timestamp:
Feb 15, 2011 6:26:01 AM (9 years ago)
Author:
dev <dev@…>
Branches:
master
Children:
c1d7182b
Parents:
a6686cb (diff), b2433d0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge of '36411afd84e961f271fd1d09a2d7f227f633af4c'

and 'a441ad8880324b5e5e9deb63487986976daf06a8'

Location:
core/java
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • core/java/build.xml

    ra6686cb r8141160  
    5050            <fileset dir="./build/obj">
    5151                <include name="**/*.class"/>
     52                <exclude name="**/*Test.class" />
    5253            </fileset>
    5354        </cobertura-instrument>
  • core/java/src/net/i2p/data/DataHelper.java

    ra6686cb r8141160  
    180180     * @return new offset
    181181     */
     182    @Deprecated
    182183    public static int toProperties(byte target[], int offset, Properties props) throws DataFormatException, IOException {
    183184        if (props != null) {
     
    220221     * @return new offset
    221222     */
     223    @Deprecated
    222224    public static int fromProperties(byte source[], int offset, Properties target) throws DataFormatException, IOException {
    223225        int size = (int)fromLong(source, offset, 2);
     
    255257     * @throws RuntimeException if either is too long.
    256258     */
     259    @Deprecated
    257260    public static byte[] toProperties(Properties opts) {
    258261        try {
     
    545548
    546549    /** @deprecated unused */
     550    @Deprecated
    547551    public static byte[] toDate(Date date) throws IllegalArgumentException {
    548552        if (date == null)
     
    679683     * @deprecated unused
    680684     */
     685    @Deprecated
    681686    public static void writeBoolean(OutputStream out, Boolean bool)
    682687        throws DataFormatException, IOException {
     
    690695   
    691696    /** @deprecated unused */
     697    @Deprecated
    692698    public static Boolean fromBoolean(byte data[], int offset) {
    693699        if (data[offset] == BOOLEAN_TRUE)
     
    700706   
    701707    /** @deprecated unused */
     708    @Deprecated
    702709    public static void toBoolean(byte data[], int offset, boolean value) {
    703710        data[offset] = (value ? BOOLEAN_TRUE : BOOLEAN_FALSE);
     
    705712
    706713    /** @deprecated unused */
     714    @Deprecated
    707715    public static void toBoolean(byte data[], int offset, Boolean value) {
    708716        if (value == null)
     
    713721   
    714722    /** deprecated - used only in DatabaseLookupMessage */
     723    @Deprecated
    715724    public static final byte BOOLEAN_TRUE = 0x1;
    716725    /** deprecated - used only in DatabaseLookupMessage */
     726    @Deprecated
    717727    public static final byte BOOLEAN_FALSE = 0x0;
    718728    /** @deprecated unused */
     729    @Deprecated
    719730    public static final byte BOOLEAN_UNKNOWN = 0x2;
    720731    /** @deprecated unused */
     732    @Deprecated
    721733    public static final int BOOLEAN_LENGTH = 1;
    722734
     
    781793     * @deprecated inefficient
    782794     */
     795    @Deprecated
    783796    public final static boolean eq(int lhs, int rhs) {
    784797        return lhs == rhs;
     
    789802     * @deprecated inefficient
    790803     */
     804    @Deprecated
    791805    public final static boolean eq(long lhs, long rhs) {
    792806        return lhs == rhs;
     
    797811     * @deprecated inefficient
    798812     */
     813    @Deprecated
    799814    public final static boolean eq(byte lhs, byte rhs) {
    800815        return lhs == rhs;
     
    975990     *              newline was found
    976991     */
     992    @Deprecated
    977993    public static boolean readLine(InputStream in, StringBuffer buf) throws IOException {
    978994        return readLine(in, buf, null);
     
    9881004     * @deprecated use StringBuilder version
    9891005     */
     1006    @Deprecated
    9901007    public static boolean readLine(InputStream in, StringBuffer buf, Sha256Standalone hash) throws IOException {
    9911008        int c = -1;
  • core/java/test/net/i2p/data/LeaseSetTest.java

    ra6686cb r8141160  
    2626    }
    2727    public DataStructure createStructureToRead() { return new LeaseSet(); }
     28   
     29    public void testGetLeaseInvalid() {
     30        // create test subject
     31        LeaseSet subj = new LeaseSet();
     32       
     33        // should contain no leases now..
     34        try {
     35            assertNull(subj.getLease(0));
     36        } catch(RuntimeException exc) {
     37            // all good
     38        }
     39       
     40        // this shouldn't work either
     41        try {
     42            assertNull(subj.getLease(-1));
     43        } catch(RuntimeException exc) {
     44            // all good
     45        }
     46    }
     47   
     48    public void testAddLeaseNull() {
     49        // create test subject
     50        LeaseSet subj = new LeaseSet();
     51       
     52        // now add an null lease
     53        try {
     54            subj.addLease(null);
     55            fail("Failed at failing.");
     56        } catch(IllegalArgumentException exc) {
     57            // all good
     58        }
     59    }
     60   
     61    public void testAddLeaseInvalid() {
     62        // create test subject
     63        LeaseSet subj = new LeaseSet();
     64       
     65        // try to add completely invalid lease(ie. no data)
     66        try {
     67            subj.addLease(new Lease());
     68            fail("Failed at failing.");
     69        } catch(IllegalArgumentException exc) {
     70            // all good
     71        }
     72    }
     73           
    2874}
  • core/java/test/net/i2p/data/RouterAddressTest.java

    ra6686cb r8141160  
    5959        addr.setTransportStyle("Blah");
    6060        assertFalse(addr.equals(null));
     61        assertFalse(addr.equals(""));
    6162    }
    6263   
     
    7475        addr.setTransportStyle("Blah");
    7576        addr.toString();
     77        addr.setOptions(null);
     78        addr.toString();
    7679    }
    7780}
Note: See TracChangeset for help on using the changeset viewer.