mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/validator/TestValidatorImpl.java
@Test
    public void testIllegalStateCantCreateSchema() throws JAXBException, ValidationFailedException, SAXException
    {
        //setup mocking
        m_Schema = mock(Schema.class);
        when(m_SchemaFactory.newSchema(any(URL.class))).thenThrow(new SAXException("blah"));
        
        final TestClass data = new TestClass();
        
        try
        {
            m_SUT.validate(data);
            fail("Expected exception because of mocking above");
        }
        catch (ValidationFailedException e)
        {
            //expected
        }
    }
/**
     * Verify illegal state exception if unable create schema.
     */
Verify illegal state exception if unable create schema.
Verify illegal state exception if unable create schema .
@Test
    public void testIllegalStateCantCreateSchema() throws JAXBException, ValidationFailedException, SAXException
    {
        m_Schema = mock(Schema.class);
        when(m_SchemaFactory.newSchema(any(URL.class))).thenThrow(new SAXException("blah"));
        final TestClass data = new TestClass();
        try
        {
            m_SUT.validate(data);
            fail("Expected exception because of mocking above");
        }
        catch (ValidationFailedException e)
        {
        }
    }
@ Test public void testIllegalStateCantCreateSchema ( ) throws JAXBException , ValidationFailedException , SAXException { m_Schema = mock ( Schema . class ) ; when ( m_SchemaFactory . newSchema ( any ( URL . class ) ) ) . thenThrow ( new SAXException ( "blah" ) ) ; final TestClass data = new TestClass ( ) ; try { m_SUT . validate ( data ) ; fail ( "Expected exception because of mocking above" ) ; } catch ( ValidationFailedException e ) { } }
Verify illegal state exception if unable create schema.
Verify illegal state exception if unable create schema .
//setup mocking //expected