Package org.javalite.test.jspec

Examples of org.javalite.test.jspec.TestException



    protected void checkBeforeSave(Model m){
        beforeSaveCalled = true;
        if(m.getId() != null)
            throw new TestException("new model must not have an ID before save()");
    }
View Full Code Here


    }

    protected void checkBeforeCreate(Model m){
        beforeCreateCalled = true;
        if(m.getId() != null)
            throw new TestException("new model must not have an ID before insert()");
    }
View Full Code Here

    }

    protected void checkAfterCreate(Model m){
           afterCreateCalled = true;
           if(m.getId() == null)
               throw new TestException("new model must have an ID after insert()");
    }
View Full Code Here

    }
   
    protected void checkAfterSave(Model m){
        afterSaveCalled = true;
        if(m.getId() == null)
            throw new TestException("new model must have an ID after save()");
    }
View Full Code Here

    }

    protected void checkBeforeDelete(Model m){
        beforeDeleteCalled = true;
        if(m.isFrozen())
            throw new TestException("new model must not be frozen before delete()");

    }
View Full Code Here

    }
    protected void checkAfterDelete(Model m){
        afterDeleteCalled = true;
           if(!m.isFrozen())
            throw new TestException("new model must be frozen after delete()");
    }
View Full Code Here

    public boolean beforeValidationCalled = false, afterValidationCalled = false;
    protected void checkBeforeValidation(Model m){
        beforeValidationCalled = true;
           if(m.errors().size() != 0)
                throw new TestException("model before validation must not have errors");
    }
View Full Code Here

                throw new TestException("model before validation must not have errors");
    }
    protected void checkAfterValidation(Model m){
        afterValidationCalled = true;
        if(m.errors().size() == 0)
                throw new TestException("model after validation must have errors");
    }
View Full Code Here

        byte[] igor1Bytes = igor1.getBytes("content");
        assertEqual(igorBytes, igor1Bytes);
    }

    private void assertEqual(byte[] igor, byte[] igor1) {
        if(igor.length != igor1.length) throw new TestException("arrays not equal");
        for(int i = 0 ; i < igor.length ; i++){
            if(igor[i] != igor1[i])
                throw new TestException("arrays not equal");
        }
    }
View Full Code Here

TOP

Related Classes of org.javalite.test.jspec.TestException

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.