mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
order test output & junit control seqs (IDEA-62424)
This commit is contained in:
@@ -17,8 +17,10 @@ package com.intellij.execution.junit2.segments;
|
||||
|
||||
import com.intellij.execution.junit.SegmentedInputStreamReader;
|
||||
import com.intellij.execution.junit2.SegmentedInputStream;
|
||||
import com.intellij.execution.testframework.Printable;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.rt.execution.junit.segments.PacketProcessor;
|
||||
|
||||
import java.io.InputStream;
|
||||
@@ -31,6 +33,8 @@ import java.nio.charset.Charset;
|
||||
public class Extractor {
|
||||
private DeferredActionsQueue myFulfilledWorkGate = null;
|
||||
private final SegmentedInputStream myStream;
|
||||
private OutputPacketProcessor myEventsDispatcher;
|
||||
private static final Logger LOG = Logger.getInstance("#" + Extractor.class.getName());
|
||||
|
||||
public Extractor(final InputStream stream, final Charset charset) {
|
||||
myStream = new SegmentedInputStream(stream, charset);
|
||||
@@ -54,7 +58,7 @@ public class Extractor {
|
||||
queue.setDispactchListener(listener);
|
||||
}
|
||||
};
|
||||
myStream.setEventsDispatcher(new PacketProcessor() {
|
||||
myEventsDispatcher = new OutputPacketProcessor() {
|
||||
public void processPacket(final String packet) {
|
||||
myFulfilledWorkGate.addLast(new Runnable() {
|
||||
public void run() {
|
||||
@@ -62,7 +66,22 @@ public class Extractor {
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void processOutput(final Printable printable) {
|
||||
LOG.assertTrue(packetProcessor instanceof OutputPacketProcessor);
|
||||
myFulfilledWorkGate.addLast(new Runnable() {
|
||||
public void run() {
|
||||
((OutputPacketProcessor)packetProcessor).processOutput(printable);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
myStream.setEventsDispatcher(myEventsDispatcher);
|
||||
}
|
||||
|
||||
public OutputPacketProcessor getEventsDispatcher() {
|
||||
return myEventsDispatcher;
|
||||
}
|
||||
|
||||
public Reader createReader() {
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.execution.junit2.segments;
|
||||
|
||||
import com.intellij.execution.testframework.Printable;
|
||||
import com.intellij.rt.execution.junit.segments.PacketProcessor;
|
||||
|
||||
/**
|
||||
* User: anna
|
||||
* Date: 12/6/10
|
||||
*/
|
||||
public interface OutputPacketProcessor extends PacketProcessor{
|
||||
void processOutput(Printable printable);
|
||||
}
|
||||
Reference in New Issue
Block a user