예제 #1
0
 @Override
 @After
 public void tearDown() throws Exception {
   super.tearDown();
   resultEndpoint.setMinimumExpectedMessageCount(1);
   assertMockEndpointsSatisfied();
 }
  @Override
  public void setUp() throws Exception {
    super.setUp();

    this.map = Hazelcast.getMap("foo");
    this.map.clear();
  }
  @Before
  @Override
  public void setUp() throws Exception {
    System.setProperty("skipStartingCamelContext", "true");
    System.setProperty("registerBlueprintCamelContextEager", "true");

    String symbolicName = getClass().getSimpleName();
    if (isCreateCamelContextPerClass()) {
      // test is per class, so only setup once (the first time)
      boolean first = threadLocalBundleContext.get() == null;
      if (first) {
        threadLocalBundleContext.set(createBundleContext());
      }
      bundleContext = threadLocalBundleContext.get();
    } else {
      bundleContext = createBundleContext();
    }

    super.setUp();

    // start context when we are ready
    log.debug("Staring CamelContext: {}", context.getName());
    context.start();

    // must wait for blueprint container to be published then the namespace parser is complete and
    // we are ready for testing
    log.debug("Waiting for BlueprintContainer to be published with symbolicName: {}", symbolicName);
    getOsgiService(
        BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=" + symbolicName + ")");
  }
 @Override
 protected void doPostSetup() throws Exception {
   super.doPostSetup();
   mock = getMockEndpoint(mockEndpoint);
   context.getEndpoint(startTest);
   resetMocks();
 }
 @AfterClass
 public static void tearDownAfterClass() throws Exception {
   if (threadLocalBundleContext.get() != null) {
     CamelBlueprintHelper.disposeBundleContext(threadLocalBundleContext.get());
     threadLocalBundleContext.remove();
   }
   CamelTestSupport.tearDownAfterClass();
 }
  @Before
  public void setUp() throws Exception {
    super.setUp();

    txTemplate = new TransactionTemplate(txMgr);
    txTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
    txTemplate.afterPropertiesSet();
  }
예제 #7
0
  @Override
  @Before
  public void setUp() throws Exception {
    startEndpointUri = componentName + ":queue:test.a";

    super.setUp();

    resultEndpoint = context.getEndpoint("mock:result", MockEndpoint.class);
  }
예제 #8
0
  @Override
  @After
  public void tearDown() throws Exception {
    Connection connection = createConnection();
    Statement statement = connection.createStatement();
    statement.execute("drop table ACCOUNT");
    connection.close();

    super.tearDown();
  }
 @Override
 public void setUp() throws Exception {
   deleteDirectory("target/data");
   repo = new LevelDBAggregationRepository("repo1", "target/data/leveldb.dat");
   // enable recovery
   repo.setUseRecovery(true);
   // check faster
   repo.setRecoveryInterval(500, TimeUnit.MILLISECONDS);
   super.setUp();
 }
예제 #10
0
  @Override
  @Before
  public void setUp() throws Exception {
    super.setUp();

    // lets create the database...
    Connection connection = createConnection();
    Statement statement = connection.createStatement();
    statement.execute(
        "create table ACCOUNT ( ACC_ID INTEGER , ACC_FIRST_NAME VARCHAR(255), ACC_LAST_NAME VARCHAR(255), ACC_EMAIL VARCHAR(255)  )");
    connection.close();
  }
예제 #11
0
  @Before
  public void setup() throws Exception {
    // set up the CamelContext (runtime system of Camel)
    super.setUp();

    // add all required routes
    context.addRoutes(new IntegrationRoute());

    // do some clean up to avoid unexpected results
    deleteDirectory("orders/inbox");
    deleteDirectory("orders/outbox");
  }
예제 #12
0
  @Before
  public void setUp() throws Exception {
    BrokerOptions options = new BrokerOptions();
    options.setConfigurationStoreType("memory");
    options.setInitialConfigurationLocation("src/test/resources/config.json");
    options.setLogConfigFileLocation("src/test/resources/log4j.xml");

    broker = new Broker();
    broker.startup(options);

    super.setUp();
    resultEndpoint = context.getEndpoint("mock:result", MockEndpoint.class);
  }
 @Override
 public void setUp() throws Exception {
   super.setUp();
   deleteDirectory("target/data");
   File file = new File("target/data/hawtdb.dat");
   hawtDBFile = new HawtDBFile();
   hawtDBFile.setFile(file);
   // use 16kb segments
   hawtDBFile.setMappingSegementSize(16 * 1024);
   // set 1mb as max file
   hawtDBFile.setMaxFileSize(1024 * 1024);
   hawtDBFile.start();
 }
예제 #14
0
  @Override
  public void setUp() throws Exception {
    deleteDirectory("target/data");
    repo = new HawtDBAggregationRepository("repo1", "target/data/hawtdb.dat");
    // enable recovery
    repo.setUseRecovery(true);
    // exhaust after at most 2 attempts
    repo.setMaximumRedeliveries(2);
    // and move to this dead letter channel
    repo.setDeadLetterUri("direct:dead");
    // check faster
    repo.setRecoveryInterval(1000, TimeUnit.MILLISECONDS);

    super.setUp();
  }
 @Before
 public void setup() throws Exception {
   super.setUp();
   context
       .getRouteDefinitions()
       .get(0)
       .adviceWith(
           context,
           new AdviceWithRouteBuilder() {
             @Override
             public void configure() throws Exception {
               replaceFromWith("direct:start");
               mockEndpointsAndSkip("*");
             }
           });
 }
  @After
  @Override
  public void tearDown() throws Exception {
    System.clearProperty("skipStartingCamelContext");
    System.clearProperty("registerBlueprintCamelContextEager");
    super.tearDown();
    if (isCreateCamelContextPerClass()) {
      // we tear down in after class
      return;
    }

    // unregister services
    if (bundleContext != null) {
      for (ServiceRegistration<?> reg : services) {
        bundleContext.ungetService(reg.getReference());
      }
    }
    CamelBlueprintHelper.disposeBundleContext(bundleContext);
  }
  @Override
  public void tearDown() throws Exception {
    super.tearDown();

    this.map.clear();
  }
예제 #18
0
 @Override
 public void tearDown() throws Exception {
   super.tearDown();
   broker.shutdown();
 }
  @After
  public void tearDown() throws Exception {
    super.tearDown();

    db.shutdown();
  }
 @Override
 public void setUp() throws Exception {
   deleteDirectory("target/mail/backup");
   super.setUp();
 }
 public void setUp() throws Exception {
   super.setUp();
   httpclient = HttpClientBuilder.create().build();
   jaxb = JAXBContext.newInstance(CustomerList.class, Customer.class, Order.class, Product.class);
 }
 @Override
 public void setUp() throws Exception {
   prepareMailbox();
   super.setUp();
 }
 @Override
 @Before
 public void setUp() throws Exception {
   port = AvailablePortFinder.getNextAvailable(16200);
   super.setUp();
 }
 @Override
 public void tearDown() throws Exception {
   hawtDBFile.stop();
   super.tearDown();
 }
예제 #25
0
 @Override
 @Before
 public void setUp() throws Exception {
   super.setUp();
   resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
 }
예제 #26
0
 @Override
 @Before
 public void setUp() throws Exception {
   super.setUp();
 }
 @Override
 public void setUp() throws Exception {
   deleteDirectory("target/order");
   super.setUp();
 }
 public void tearDown() throws Exception {
   super.tearDown();
   httpclient.close();
 }