simply renaming parameters on CLI

This commit is contained in:
Clebert Suconic 2015-06-26 11:01:24 -04:00
parent 048173d0e2
commit 63a17adbdf
8 changed files with 27 additions and 27 deletions

View File

@ -17,17 +17,17 @@
package org.apache.activemq.artemis.cli.commands;
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.Session;
import io.airlift.airline.Command;
import io.airlift.airline.Option;
import org.apache.activemq.artemis.cli.commands.util.ConsumerThread;
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
@Command(name = "browse", description = "It will send consume messages from an instance")
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.Session;
@Command(name = "browser", description = "It will send consume messages from an instance")
public class Browse extends DestAbstract
{
@Option(name = "--filter", description = "filter to be used with the consumer")

View File

@ -27,7 +27,7 @@ import org.apache.activemq.artemis.cli.commands.util.ConsumerThread;
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
@Command(name = "consume", description = "It will send consume messages from an instance")
@Command(name = "consumer", description = "It will send consume messages from an instance")
public class Consumer extends DestAbstract
{
@ -35,11 +35,11 @@ public class Consumer extends DestAbstract
@Option(name = "--durable", description = "It will use durable subscription in case of client")
boolean durable = false;
@Option(name = "--breakOnNull", description = "It will break on null messages")
@Option(name = "--break-on-null", description = "It will break on null messages")
boolean breakOnNull = false;
@Option(name = "--receiveTimeout", description = "Time used on receive(timeout)")
int receiveTimeout;
@Option(name = "--receive-timeout", description = "Time used on receive(timeout)")
int receiveTimeout = 3000;
@Option(name = "--filter", description = "filter to be used with the consumer")
String filter;

View File

@ -27,7 +27,7 @@ public class DestAbstract extends ActionAbstract
@Option(name = "--destination", description = "Destination to be used. it could be prefixed with queue:// or topic:: (Default: queue://TEST")
String destination = "queue://TEST";
@Option(name = "--messageCount", description = "Number of messages to act on (Default: 1000)")
@Option(name = "--message-count", description = "Number of messages to act on (Default: 1000)")
int messageCount = 1000;
@Option(name = "--user", description = "User used to connect")
@ -39,7 +39,7 @@ public class DestAbstract extends ActionAbstract
@Option(name = "--sleep", description = "Time wait between each message")
int sleep = 0;
@Option(name = "--txSize", description = "TX Batch Size")
@Option(name = "--txt-size", description = "TX Batch Size")
int txBatchSize;
@Option(name = "--threads", description = "Number of Threads to be used (Default: 1)")

View File

@ -27,17 +27,17 @@ import org.apache.activemq.artemis.cli.commands.util.ProducerThread;
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
@Command(name = "produce", description = "It will send messages to an instance")
@Command(name = "producer", description = "It will send messages to an instance")
public class Producer extends DestAbstract
{
@Option(name = "--nonPersistent", description = "It will send messages non persistently")
@Option(name = "--non-persistent", description = "It will send messages non persistently")
boolean nonpersistent = false;
@Option(name = "--messageSize", description = "Size of each byteMessage (The producer will use byte message on this case)")
@Option(name = "--message-size", description = "Size of each byteMessage (The producer will use byte message on this case)")
int messageSize = 0;
@Option(name = "--textSize", description = "Size of each textNessage (The producer will use text message on this case)")
@Option(name = "--text-size", description = "Size of each textNessage (The producer will use text message on this case)")
int textMessageSize;
@Option(name = "--msgttl", description = "TTL for each message")

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.test;
package org.apache.activemq.cli.test;
import javax.jms.Connection;
import javax.jms.MessageProducer;
@ -76,8 +76,8 @@ public class ArtemisTest
System.setProperty("artemis.instance", temporaryFolder.getRoot().getAbsolutePath());
// Some exceptions may happen on the initialization, but they should be ok on start the basic core protocol
Artemis.main("run");
Assert.assertEquals(Integer.valueOf(70), Artemis.execute("produce", "--txSize", "50", "--messageCount", "70", "--verbose"));
Assert.assertEquals(Integer.valueOf(70), Artemis.execute("consume", "--txSize", "50", "--verbose", "--breakOnNull", "--receiveTimeout", "100"));
Assert.assertEquals(Integer.valueOf(70), Artemis.execute("producer", "--txt-size", "50", "--message-count", "70", "--verbose"));
Assert.assertEquals(Integer.valueOf(70), Artemis.execute("consumer", "--txt-size", "50", "--verbose", "--break-on-null", "--receive-timeout", "100"));
ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616");
Connection connection = cf.createConnection();
@ -99,20 +99,20 @@ public class ArtemisTest
connection.close();
cf.close();
Assert.assertEquals(Integer.valueOf(1), Artemis.execute("browse", "--txSize", "50", "--verbose", "--filter", "fruit='banana'"));
Assert.assertEquals(Integer.valueOf(1), Artemis.execute("browser", "--txt-size", "50", "--verbose", "--filter", "fruit='banana'"));
Assert.assertEquals(Integer.valueOf(100), Artemis.execute("browse", "--txSize", "50", "--verbose", "--filter", "fruit='orange'"));
Assert.assertEquals(Integer.valueOf(100), Artemis.execute("browser", "--txt-size", "50", "--verbose", "--filter", "fruit='orange'"));
Assert.assertEquals(Integer.valueOf(101), Artemis.execute("browse", "--txSize", "50", "--verbose"));
Assert.assertEquals(Integer.valueOf(101), Artemis.execute("browser", "--txt-size", "50", "--verbose"));
// should only receive 10 messages on browse as I'm setting messageCount=10
Assert.assertEquals(Integer.valueOf(10), Artemis.execute("browse", "--txSize", "50", "--verbose", "--messageCount", "10"));
Assert.assertEquals(Integer.valueOf(10), Artemis.execute("browser", "--txt-size", "50", "--verbose", "--message-count", "10"));
// Nothing was consumed until here as it was only browsing, check it's receiving again
Assert.assertEquals(Integer.valueOf(1), Artemis.execute("consume", "--txSize", "50", "--verbose", "--breakOnNull", "--receiveTimeout", "100", "--filter", "fruit='banana'"));
Assert.assertEquals(Integer.valueOf(1), Artemis.execute("consumer", "--txt-size", "50", "--verbose", "--break-on-null", "--receive-timeout", "100", "--filter", "fruit='banana'"));
// Checking it was acked before
Assert.assertEquals(Integer.valueOf(100), Artemis.execute("consume", "--txSize", "50", "--verbose", "--breakOnNull", "--receiveTimeout", "100"));
Assert.assertEquals(Integer.valueOf(100), Artemis.execute("consumer", "--txt-size", "50", "--verbose", "--break-on-null", "--receive-timeout", "100"));
Artemis.execute("stop");
Assert.assertTrue(Run.latchRunning.await(5, TimeUnit.SECONDS));

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.test;
package org.apache.activemq.cli.test;
import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
import org.apache.activemq.artemis.dto.ServerDTO;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.activemq.artemis.test;
package org.apache.activemq.cli.test;
import java.io.InputStream;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.test;
package org.apache.activemq.cli.test;
import java.net.URI;
import java.net.URISyntaxException;