mil.dod.th.ose.datastream/test/mil/dod/th/ose/datastream/TestDataStreamServiceImpl.java
@Test
    public void testCreateStreamProfileWithInvalidProductType() throws StreamProfileException, InvalidSyntaxException
    {
        Map<String, Object> props = new HashMap<String, Object>();
        props.put(DataStreamServiceConfig.CONFIG_PROP_MULTICAST_HOST, "225.1.2.3");
        props.put(DataStreamServiceConfig.CONFIG_PROP_START_PORT, 5004);
        
        m_SUT.activate(Collections.unmodifiableMap(props), m_BundleContext);
        
        try
        {
            m_SUT.createStreamProfile("filler", "name", new HashMap<String, Object>());
            fail("Expecting failure because product type name is invalid");
        }
        catch (IllegalArgumentException e)
        {
            verify(m_WakeLock, never()).activate();
            verify(m_WakeLock, never()).cancel();
        }
    }
/**
     * Verify an invalid product type will cause an exception.
     */
Verify an invalid product type will cause an exception.
Verify an invalid product type will cause an exception .
@Test
    public void testCreateStreamProfileWithInvalidProductType() throws StreamProfileException, InvalidSyntaxException
    {
        Map<String, Object> props = new HashMap<String, Object>();
        props.put(DataStreamServiceConfig.CONFIG_PROP_MULTICAST_HOST, "225.1.2.3");
        props.put(DataStreamServiceConfig.CONFIG_PROP_START_PORT, 5004);
        m_SUT.activate(Collections.unmodifiableMap(props), m_BundleContext);
        try
        {
            m_SUT.createStreamProfile("filler", "name", new HashMap<String, Object>());
            fail("Expecting failure because product type name is invalid");
        }
        catch (IllegalArgumentException e)
        {
            verify(m_WakeLock, never()).activate();
            verify(m_WakeLock, never()).cancel();
        }
    }
@ Test public void testCreateStreamProfileWithInvalidProductType ( ) throws StreamProfileException , InvalidSyntaxException { Map < String , Object > props = new HashMap < String , Object > ( ) ; props . put ( DataStreamServiceConfig . CONFIG_PROP_MULTICAST_HOST , "225.1.2.3" ) ; props . put ( DataStreamServiceConfig . CONFIG_PROP_START_PORT , 5004 ) ; m_SUT . activate ( Collections . unmodifiableMap ( props ) , m_BundleContext ) ; try { m_SUT . createStreamProfile ( "filler" , "name" , new HashMap < String , Object > ( ) ) ; fail ( "Expecting failure because product type name is invalid" ) ; } catch ( IllegalArgumentException e ) { verify ( m_WakeLock , never ( ) ) . activate ( ) ; verify ( m_WakeLock , never ( ) ) . cancel ( ) ; } }
Verify an invalid product type will cause an exception.
Verify an invalid product type will cause an exception .