junit.rt: avoid split package between junit & idea rt modules

GitOrigin-RevId: 5aa3786b05f625f9ee51d0c22bcbe0f38d610468
This commit is contained in:
Anna Kozlova
2019-08-22 13:02:45 +03:00
committed by intellij-monorepo-bot
parent 310550fcb6
commit 6275a982fb
18 changed files with 36 additions and 145 deletions
@@ -44,7 +44,7 @@ import com.intellij.project.IntelliJProjectConfiguration;
import com.intellij.psi.*;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.rt.ant.execution.SegmentedOutputStream;
import com.intellij.rt.execution.junit.JUnitStarter;
import com.intellij.rt.junit.JUnitStarter;
import com.intellij.testFramework.CompilerTester;
import com.intellij.testFramework.MapDataContext;
import com.intellij.testFramework.PlatformTestUtil;
@@ -12,5 +12,6 @@
<orderEntry type="library" scope="PROVIDED" name="TestNG" level="project" />
<orderEntry type="library" name="intellij-coverage" level="project" />
<orderEntry type="library" name="intellij-test-discovery" level="project" />
<orderEntry type="module" module-name="intellij.java.rt" />
</component>
</module>
@@ -64,7 +64,7 @@ public class JUnitConfiguration extends JavaTestConfigurationWithDiscoverySuppor
@NonNls public static final String FORK_KLASS = "class";
@NonNls public static final String FORK_REPEAT = "repeat";
// See #26522
@NonNls public static final String JUNIT_START_CLASS = "com.intellij.rt.execution.junit.JUnitStarter";
@NonNls public static final String JUNIT_START_CLASS = "com.intellij.rt.junit.JUnitStarter";
@NonNls private static final String PATTERN_EL_NAME = "pattern";
@NonNls public static final String TEST_PATTERN = PATTERN_EL_NAME;
@NonNls private static final String TEST_CLASS_ATT_NAME = "testClass";
@@ -41,9 +41,9 @@ import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiUtilCore;
import com.intellij.refactoring.listeners.RefactoringElementListener;
import com.intellij.rt.execution.junit.IDEAJUnitListener;
import com.intellij.rt.execution.junit.JUnitStarter;
import com.intellij.rt.execution.junit.RepeatCount;
import com.intellij.rt.execution.testFrameworks.ForkedDebuggerHelper;
import com.intellij.rt.junit.JUnitStarter;
import com.intellij.spi.SPIFileType;
import com.intellij.spi.psi.SPIClassProviderReferenceElement;
import com.intellij.util.Function;
@@ -21,7 +21,7 @@ import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.search.PackageScope;
import com.intellij.psi.util.ClassUtil;
import com.intellij.refactoring.listeners.RefactoringElementListener;
import com.intellij.rt.execution.junit.JUnitStarter;
import com.intellij.rt.junit.JUnitStarter;
import com.intellij.util.Function;
import com.intellij.util.containers.JBTreeTraverser;
import org.jetbrains.annotations.NotNull;
@@ -17,7 +17,7 @@ import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.util.Pair;
import com.intellij.psi.PsiMethod;
import com.intellij.rt.execution.junit.JUnitStarter;
import com.intellij.rt.junit.JUnitStarter;
import org.jetbrains.annotations.NotNull;
import java.util.*;
@@ -17,7 +17,7 @@ package com.intellij.junit5;
import com.intellij.rt.execution.junit.IDEAJUnitListener;
import com.intellij.rt.execution.junit.IDEAJUnitListenerEx;
import com.intellij.rt.execution.junit.IdeaTestRunner;
import com.intellij.rt.junit.IdeaTestRunner;
import org.junit.platform.engine.TestExecutionResult;
import org.junit.platform.launcher.*;
import org.junit.platform.launcher.core.LauncherFactory;
@@ -16,6 +16,8 @@
package com.intellij.junit3;
import com.intellij.rt.execution.junit.*;
import com.intellij.rt.junit.DeafStream;
import com.intellij.rt.junit.IdeaTestRunner;
import junit.framework.*;
import junit.textui.ResultPrinter;
import junit.textui.TestRunner;
@@ -18,7 +18,7 @@ package com.intellij.junit4;
import com.intellij.rt.execution.junit.ComparisonFailureData;
import com.intellij.rt.execution.junit.IDEAJUnitListener;
import com.intellij.rt.execution.junit.IDEAJUnitListenerEx;
import com.intellij.rt.execution.junit.IdeaTestRunner;
import com.intellij.rt.junit.IdeaTestRunner;
import org.junit.internal.requests.ClassRequest;
import org.junit.internal.requests.FilterRequest;
import org.junit.runner.*;
@@ -1,28 +0,0 @@
/*
* Copyright 2000-2009 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.rt.execution.junit;
import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintStream;
public class DeafStream extends OutputStream {
public static final DeafStream CURRENT = new DeafStream();
public static final PrintStream DEAF_PRINT_STREAM = new PrintStream(CURRENT);
public void write(int b) throws IOException {
}
}
@@ -1,46 +0,0 @@
/*
* Copyright 2000-2009 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.rt.execution.junit;
import junit.framework.TestCase;
import junit.framework.TestResult;
import junit.framework.TestSuite;
import java.util.Hashtable;
public class RunOnce extends TestResult {
private final Hashtable myPeformedTests = new Hashtable();
private static final String NOT_ALLOWED_IN_ID = ":";
protected void run(TestCase test) {
if (test.getClass().getName().startsWith(TestSuite.class.getName())) {
super.run(test);
}
else {
String testKey = keyOf(test);
if (!myPeformedTests.containsKey(testKey)) {
super.run(test);
myPeformedTests.put(testKey, test);
}
}
}
private static String keyOf(TestCase test) {
return test.getClass().getName() + NOT_ALLOWED_IN_ID + test.getName() + NOT_ALLOWED_IN_ID + test.toString();
}
}
@@ -0,0 +1,14 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.rt.junit;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class DeafStream extends OutputStream {
public static final DeafStream CURRENT = new DeafStream();
public static final PrintStream DEAF_PRINT_STREAM = new PrintStream(CURRENT);
public void write(int b) throws IOException {
}
}
@@ -1,20 +1,6 @@
/*
* Copyright 2000-2011 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.
*/
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.rt.execution.junit;
package com.intellij.rt.junit;
import java.util.ArrayList;
import java.util.List;
@@ -1,19 +1,5 @@
/*
* Copyright 2000-2015 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.rt.execution.junit;
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.rt.junit;
import com.intellij.rt.execution.testFrameworks.ForkedSplitter;
@@ -1,19 +1,7 @@
/*
* Copyright 2000-2015 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.rt.execution.junit;
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.rt.junit;
import com.intellij.rt.execution.junit.RepeatCount;
import java.util.ArrayList;
import java.util.List;
@@ -1,19 +1,7 @@
/*
* Copyright 2000-2011 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.rt.execution.junit;
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.rt.junit;
import com.intellij.rt.execution.junit.RepeatCount;
import java.io.*;
import java.net.InetAddress;