This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rabbitmqclient; | |
import junit.framework.Test; | |
import junit.framework.TestCase; | |
import junit.framework.TestSuite; | |
import org.springframework.amqp.core.*; | |
import org.springframework.amqp.rabbit.core.*; | |
import org.springframework.amqp.rabbit.support.*; | |
import org.springframework.context.support.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:rabbit="http://www.springframework.org/schema/rabbit" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd | |
http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit.xsd"> | |
<rabbit:connection-factory id="connectionFactory" addresses="localhost:5672,localhost:5673" publisher-confirms="true"/> | |
<rabbit:template id="amqpTemplate" connection-factory="connectionFactory"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{mnesia, [{dump_log_write_threshold, 1000}]}, | |
{rabbit, [{tcp_listeners, [5673]}]}, | |
{rabbitmq_management, | |
[{listener, [{port, 15673}, | |
{ip, "127.0.0.1"} | |
]} | |
]} | |
]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I am a complete /etc/rabbitmq/rabbitmq-env.conf file. | |
# Comment lines start with a hash character. | |
# This is a /bin/sh script file - use ordinary envt var syntax | |
NODENAME=mir_node_2@localhost | |
NODE_PORT=5673 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Go to /etc/apt. Create the file apt.conf if you don't have it there. Write the following lines there. | |
Acquire::http::proxy "http://username:password@proxyserver:port/"; | |
Acquire::https::proxy "https://username:password@proxyserver:port/"; | |
Acquire::socks::proxy "socks://username:password@proxyserver:port/"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<!-- WARNING: Eclipse auto-generated file. | |
Any modifications will be overwritten. | |
To include a user specific buildfile here, simply create one in the same | |
directory with the processing instruction <?eclipse.ant.import?> | |
as the first entry and export the buildfile again. --> | |
<project basedir="." default="build" name="SomeLegacyCode" xmlns:sonar="antlib:org.sonar.ant" xmlns:jacoco="antlib:org.jacoco.ant"> | |
<property environment="env" /> | |
<property name="ECLIPSE_HOME" value="../../" /> | |
<property name="debuglevel" value="source,lines,vars" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package functions | |
object BasicFunctions { | |
def main(args: Array[String]) = { | |
val person = personInfo(100) | |
println(person._1, person._2, person._3, person._4) | |
// Another way of creating a simple Tuple. This creates a key, value pair | |
val data = "red" -> 1900 | |
println(data._1, data._2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ShoppingCart { | |
private AuditGateway auditGateway; | |
private User user; | |
public void applyDiscount(int productId) { | |
// find the product which has been already been added to the cart | |
Product product = getProduct(productId); | |
if (product == null || user == null) { | |
throw new IllegalArgumentException("Either product or user is invalid"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ShoppingCartUTest { | |
ShoppingCart shoppingCart; | |
private MockProduct mockProduct; | |
private MockUser mockUser; | |
@Before | |
public void setUp() throws Exception { | |
shoppingCart = new ShoppingCart(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ShoppingCartITest { | |
ShoppingCart shoppingCart; | |
private Product product; | |
private User user; | |
@Before | |
public void setUp() throws Exception { | |
shoppingCart = new ShoppingCart(); | |
} |
OlderNewer