Package ch.qos.logback.core

Examples of ch.qos.logback.core.ContextBase


  PropertyAction propertyAction;
  DummyAttributes atts = new DummyAttributes();
 
  @Before
  public void setUp() throws Exception {
    context = new ContextBase();
    ec = new InterpretationContext(context, null);
    propertyAction = new PropertyAction();
    propertyAction.setContext(context);
  }
View Full Code Here


import ch.qos.logback.core.ContextBase;

public class SizeBasedTriggeringPolicyTest extends TestCase {

  public void testStringToLong() {
    Context context = new ContextBase();
    SizeBasedTriggeringPolicy policy = new SizeBasedTriggeringPolicy();
    policy.setContext(context);

    Long result;

    {
      result = policy.toFileSize("123");
      assertEquals(new Long("123"), result);
    }
    {
      result = policy.toFileSize("123KB");
      // = 123 * 1024
      assertEquals(new Long("125952"), result);
    }
    {
      result = policy.toFileSize("123MB");
      // = 123 * 1024 * 1024
      assertEquals(new Long("128974848"), result);
    }
    {
      result = policy.toFileSize("123GB");
      // = 123 * 1024 * 1024 * 1024
      assertEquals(new Long("132070244352"), result);
    }

    {
      result = policy.toFileSize("123xxxx");
      // = 123 * 1024 * 1024 * 1024
      assertEquals(new Long(SizeBasedTriggeringPolicy.DEFAULT_MAX_FILE_SIZE),
          result);
      assertEquals(2, context.getStatusManager().getCount());
    }

  }
View Full Code Here

    }
  }

  @Test
  public void testTail2() throws Exception {
    SimpleRuleStore srs = new SimpleRuleStore(new ContextBase());
    srs.addRule(new ElementSelector("*/c"), new XAction());

    for (String s : cc.combinations("a/b/c")) {
      List<Action> r = srs.matchActions(new ElementPath(s));
      assertNotNull(r);
View Full Code Here

  private SSLParametersConfiguration configuration =
      new SSLParametersConfiguration();
  @Before
  public void setUp() throws Exception {
    configuration.setContext(new ContextBase());
  }
View Full Code Here

import ch.qos.logback.core.ContextBase;

public class Barebones {

  public static void main(String[] args) {
    Context context = new ContextBase();
    for(int i = 0; i < 3; i++) {
      SenderRunnable senderRunnable = new SenderRunnable(""+i);
      context.getExecutorService().execute(senderRunnable);
    }
    System.out.println("done");
    //System.exit(0);
  }
View Full Code Here

  PreSerializationTransformer<ILoggingEvent> pst = new LoggingEventPreSerializationTransformer();
 

  @Before
  public void setUp() throws Exception {
    context = new ContextBase();
    appender = new JMSTopicAppender();
    appender.setContext(context);
    appender.setName("jmsTopic");
    appender.tcfBindingName = "topicCnxFactory";
    appender.topicBindingName = "testTopic";
View Full Code Here

  JMSQueueAppender appender;
  PreSerializationTransformer<ILoggingEvent> pst = new LoggingEventPreSerializationTransformer();
 
  @Override
  protected void setUp() throws Exception {
    context = new ContextBase();
    appender = new JMSQueueAppender();
    appender.setContext(context);
    appender.setName("jmsQueue");
    appender.qcfBindingName = "queueCnxFactory";
    appender.queueBindingName = "testQueue";
View Full Code Here

* @author Ceki G&uuml;ulc&uuml;
*/
public class NewRuleCalculator {
  public static void main(String[] args) throws Exception {

    Context context = new ContextBase();

    Map<ElementSelector, Action> ruleMap = new HashMap<ElementSelector, Action>();

    // we start with the rule for the top-most (root) element
    ruleMap.put(new ElementSelector("*/computation"), new ComputationAction1());
View Full Code Here

    // Associate "hello-world" pattern with HelloWorldAction
    ruleMap.put(new ElementSelector("hello-world"), new HelloWorldAction());

    // Joran needs to work within a context.
    Context context = new ContextBase();
    SimpleConfigurator simpleConfigurator = new SimpleConfigurator(ruleMap);
    // link the configurator with its context
    simpleConfigurator.setContext(context);

    simpleConfigurator.doConfigure(args[0]);
View Full Code Here

* @author Ceki G&uuml;ulc&uuml;
*/
public class Calculator1 {

  public static void main(String[] args) throws Exception {
    Context context = new ContextBase();

    Map<ElementSelector, Action> ruleMap = new HashMap<ElementSelector, Action>();

    // Associate "/computation" pattern with ComputationAction1
    ruleMap.put(new ElementSelector("/computation"), new ComputationAction1());
View Full Code Here

TOP

Related Classes of ch.qos.logback.core.ContextBase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.