/*
 * Copyright (c) 2007-2014, Kaazing Corporation. All rights reserved.
 */
package org.kaazing.qpid.amqp_1_0.jms;

import static javax.jms.Session.AUTO_ACKNOWLEDGE;

import org.apache.qpid.amqp_1_0.jms.Connection;
import org.apache.qpid.amqp_1_0.jms.ConnectionFactory;
import org.apache.qpid.amqp_1_0.jms.Session;
import org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl;
import org.junit.Rule;
import org.junit.Test;
import org.kaazing.robot.junit.annotation.Robotic;
import org.kaazing.robot.junit.rules.RobotRule;

public class TopicProducerIT {

    @Rule
    public RobotRule robot = new RobotRule().setScriptRoot("org/kaazing/robot/scripts/amqp_1_0/jms/topic/producer");

    @Robotic(script = "create")
    @Test(timeout = 1000)
    public void shouldCreateProducer() throws Exception {
        ConnectionFactory factory = new ConnectionFactoryImpl("localhost", 5672, null, null, "clientID");
        Connection connection = factory.createConnection();
        connection.start();
        Session session = connection.createSession(false, AUTO_ACKNOWLEDGE);
        session.createProducer(session.createTopic("topic-A"));
        robot.join();
    }
}

@@ -264,16 +264,69 @@
 actory;%0A
+import org.apache.qpid.amqp_1_0.jms.MessageProducer;%0A
 import o
@@ -358,24 +358,24 @@
 ms.Session;%0A
-
 import org.a
@@ -761,16 +761,27 @@
  %22create
+.then.close
 %22)%0A    @
@@ -1137,16 +1137,43 @@
 %0A       
+ MessageProducer producer =
  session
@@ -1218,12 +1218,99 @@
 opic
--A%22)
+://topic-A%22));%0A        producer.close();%0A        session.close();%0A        connection.close(
 );%0A 

Refactor producer behavior to include close.