IDEA-203230 avoid showing 2 TabWrapper components if content was added right after...
[idea/community.git] / platform / testFramework / src / com / intellij / testFramework / fixtures / IdeaTestFixtureFactory.java
1 // 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.
2 package com.intellij.testFramework.fixtures;
3
4 import com.intellij.testFramework.LightProjectDescriptor;
5 import com.intellij.testFramework.builders.ModuleFixtureBuilder;
6 import com.intellij.testFramework.fixtures.impl.IdeaTestFixtureFactoryImpl;
7 import org.jetbrains.annotations.NotNull;
8 import org.jetbrains.annotations.Nullable;
9
10 import java.nio.file.Path;
11
12 /**
13  * This is to be provided by the test framework and not by plugin authors.
14  */
15 public abstract class IdeaTestFixtureFactory {
16   private static final IdeaTestFixtureFactory ourInstance = new IdeaTestFixtureFactoryImpl();
17
18   @NotNull
19   public static IdeaTestFixtureFactory getFixtureFactory() {
20     return ourInstance;
21   }
22
23   /**
24    * @param aClass test fixture builder interface class
25    * @param implClass implementation class, should have a constructor which takes {@link TestFixtureBuilder} as an argument.
26    */
27   public abstract <T extends ModuleFixtureBuilder<?>> void registerFixtureBuilder(@NotNull Class<T> aClass, @NotNull Class<? extends T> implClass);
28
29   public abstract void registerFixtureBuilder(@NotNull Class<? extends ModuleFixtureBuilder<?>> aClass, @NotNull String implClassName);
30
31   @NotNull
32   public TestFixtureBuilder<IdeaProjectTestFixture> createFixtureBuilder(@NotNull String name) {
33     return createFixtureBuilder(name, false);
34   }
35
36   public abstract TestFixtureBuilder<IdeaProjectTestFixture> createFixtureBuilder(@NotNull String name, boolean isDirectoryBasedProject);
37
38   public abstract TestFixtureBuilder<IdeaProjectTestFixture> createFixtureBuilder(@NotNull String name, @Nullable Path projectPath, boolean isDirectoryBasedProject);
39
40   @NotNull
41   public abstract TestFixtureBuilder<IdeaProjectTestFixture> createLightFixtureBuilder();
42
43   @NotNull
44   public abstract TestFixtureBuilder<IdeaProjectTestFixture> createLightFixtureBuilder(@Nullable LightProjectDescriptor projectDescriptor);
45
46   @NotNull
47   public abstract CodeInsightTestFixture createCodeInsightFixture(@NotNull IdeaProjectTestFixture projectFixture);
48
49   @NotNull
50   public abstract CodeInsightTestFixture createCodeInsightFixture(@NotNull IdeaProjectTestFixture projectFixture, @NotNull TempDirTestFixture tempDirFixture);
51
52   @NotNull
53   public abstract TempDirTestFixture createTempDirTestFixture();
54
55   @NotNull
56   public abstract BareTestFixture createBareFixture();
57 }