Commit 6083b6c2 by Yiming Liu

Disable cat in test

parent 52550468
package com.ctrip.apollo.cat;
import java.io.File;
import java.util.List;
import com.dianping.cat.configuration.ClientConfigManager;
import com.dianping.cat.configuration.client.entity.Domain;
import com.dianping.cat.configuration.client.entity.Server;
public class NullClientConfigManager implements ClientConfigManager{
@Override
public Domain getDomain() {
return null;
}
@Override
public int getMaxMessageLength() {
return 0;
}
@Override
public String getServerConfigUrl() {
return null;
}
@Override
public List<Server> getServers() {
return null;
}
@Override
public int getTaggedTransactionCacheSize() {
return 0;
}
@Override
public void initialize(File configFile) throws Exception {
}
@Override
public boolean isCatEnabled() {
return false;
}
@Override
public boolean isDumpLocked() {
return false;
}
@Override
public int getQueueSize() {
return 0;
}
}
\ No newline at end of file
package com.ctrip.apollo.cat;
import org.codehaus.plexus.logging.console.ConsoleLoggerManager;
public class NullLoggerManager extends ConsoleLoggerManager{
}
package com.ctrip.apollo.cat;
import org.codehaus.plexus.logging.LogEnabled;
import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
import org.unidal.lookup.ContainerHolder;
import com.dianping.cat.message.Message;
import com.dianping.cat.message.Transaction;
import com.dianping.cat.message.spi.MessageManager;
import com.dianping.cat.message.spi.MessageTree;
public class NullMessageManager extends ContainerHolder implements MessageManager, Initializable, LogEnabled{
@Override
public void enableLogging(Logger logger) {
}
@Override
public void initialize() throws InitializationException {
}
@Override
public void add(Message message) {
}
@Override
public void end(Transaction transaction) {
}
@Override
public Transaction getPeekTransaction() {
return null;
}
@Override
public MessageTree getThreadLocalMessageTree() {
return null;
}
@Override
public boolean hasContext() {
return false;
}
@Override
public boolean isMessageEnabled() {
return false;
}
@Override
public boolean isCatEnabled() {
return false;
}
@Override
public boolean isTraceMode() {
return false;
}
@Override
public void reset() {
}
@Override
public void setTraceMode(boolean traceMode) {
}
@Override
public void setup() {
}
@Override
public void start(Transaction transaction, boolean forked) {
}
@Override
public void bind(String tag, String title) {
}
@Override
public String getDomain() {
return null;
}
}
\ No newline at end of file
package com.ctrip.apollo.cat;
import java.util.Map;
import com.dianping.cat.message.internal.DefaultMessageProducer;
public class NullMessageProducer extends DefaultMessageProducer{
@Override
public void logError(Throwable cause) {
}
@Override
public void logError(String message, Throwable cause) {
}
@Override
public void logEvent(String type, String name) {
}
@Override
public void logTrace(String type, String name) {
}
@Override
public void logEvent(String type, String name, String status, String nameValuePairs) {
}
@Override
public void logTags(String scenario, Map<String, String> indexedTags,
Map<String, String> storedTags) {
}
@Override
public void logTrace(String type, String name, String status, String nameValuePairs) {
}
@Override
public void logHeartbeat(String type, String name, String status, String nameValuePairs) {
}
@Override
public void logMetric(String name, String status, String nameValuePairs) {
}
}
package com.ctrip.apollo.cat;
import com.dianping.cat.message.io.MessageSender;
import com.dianping.cat.message.io.TransportManager;
import com.dianping.cat.message.spi.MessageTree;
public class NullTransportManager implements TransportManager {
private static final MessageSender nullMessageSender = new MessageSender() {
@Override
public void initialize() {
}
@Override
public void send(MessageTree tree) {
}
@Override
public void shutdown() {
}
};
@Override
public MessageSender getSender() {
return nullMessageSender;
}
}
<plexus>
<components>
<component>
<role>com.dianping.cat.configuration.ClientConfigManager</role>
<implementation>com.ctrip.apollo.cat.NullClientConfigManager
</implementation>
</component>
<component>
<role>com.dianping.cat.message.io.TransportManager</role>
<implementation>com.ctrip.apollo.cat.NullTransportManager
</implementation>
</component>
<component>
<role>com.dianping.cat.message.spi.MessageManager</role>
<implementation>com.ctrip.apollo.cat.NullMessageManager
</implementation>
</component>
<component>
<role>com.dianping.cat.message.MessageProducer</role>
<implementation>com.ctrip.apollo.cat.NullMessageProducer
</implementation>
<requirements>
<requirement>
<role>com.dianping.cat.message.spi.MessageManager</role>
</requirement>
<requirement>
<role>com.dianping.cat.message.internal.MessageIdFactory</role>
</requirement>
</requirements>
</component>
<component>
<role>org.codehaus.plexus.logging.LoggerManager</role>
<implementation>com.ctrip.apollo.cat.NullLoggerManager
</implementation>
</component>
</components>
</plexus>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment