Skip to content

Commit

Permalink
Updates to 2018.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Henry committed Apr 25, 2018
1 parent 3c4ae5d commit 09aa3a0
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 38 deletions.
5 changes: 1 addition & 4 deletions .idea/runConfigurations/MockGeneratorTest.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APPCODE_BUILD=173.3727
APPCODE_BUILD=181.4445

.PHONY: bootstrap downloadcommunity updateandroid updateandroidtools buildcommunity ant

Expand Down
2 changes: 1 addition & 1 deletion MockGenerator/MockGenerator.iml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/testData" type="java-test-resource" />
</content>
<orderEntry type="jdk" jdkName="OC-173.4674" jdkType="IDEA JDK" />
<orderEntry type="jdk" jdkName="OC-181.4668" jdkType="IDEA JDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="MockGeneratorUseCases" />
<orderEntry type="library" scope="TEST" name="junit:junit:4.12" level="project" />
Expand Down
7 changes: 3 additions & 4 deletions MockGenerator/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<idea-plugin>
<id>codes.seanhenry.mockgenerator</id>
<name>Swift Mock Generator for AppCode</name>
<version>11</version>
<version>12</version>
<vendor email="hello@seanhenry.codes" url="https://github.com/seanhenry/MockGenerator">Sean Henry</vendor>

<description><![CDATA[
Expand Down Expand Up @@ -66,14 +66,13 @@ class MockDataStore: DataStore {

<change-notes><![CDATA[
<ul>
<li>Supports capturing of generic method parameters.</li>
<li>Supports capturing of generic method return values.</li>
<li>Fixes missing method error in AppCode 2018.1.2.</li>
</ul>
]]>
</change-notes>

<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
<idea-version since-build="173.2463"/>
<idea-version since-build="181.4668"/>

<actions>
</actions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ private List<SwiftTypeDeclaration> getResolvedTypes(SwiftTypeDeclaration typeDec
if (inheritanceClause == null) {
return Collections.emptyList();
}
List<SwiftTypeDeclaration> results = inheritanceClause.getReferenceTypeElementList()
List<SwiftTypeDeclaration> results = inheritanceClause.getTypeElementList()
.stream()
.filter((e) -> e instanceof SwiftReferenceTypeElement)
.map((e) -> (SwiftReferenceTypeElement) e)
.map(this::getResolvedType)
.filter(Objects::nonNull)
.collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,51 +1,52 @@
package codes.seanhenry.testhelpers;

import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.idea.IdeaTestApplication;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess;
import com.intellij.openapi.vfs.newvfs.persistent.PersistentFS;
import com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl;
import com.intellij.psi.PsiFile;
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
import com.intellij.testFramework.PlatformTestCase;
import com.intellij.testFramework.UsefulTestCase;
import com.intellij.testFramework.fixtures.CodeInsightTestFixture;

import java.io.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.stream.Collectors;

public abstract class ImportProjectTestCase extends PlatformTestCase {
public abstract class ImportProjectTestCase extends UsefulTestCase {

private Path testResultPath;
private CodeInsightTestFixture fixture;

@Override
protected void tearDown() throws Exception {
try {
fixture.tearDown();
} catch (Throwable e) {
e.printStackTrace();
} finally {
fixture = null;
try {
super.tearDown();
} catch (Throwable e) {
e.printStackTrace();
}
}
super.tearDown();
}

@Override
protected void setUp() throws Exception {
allowAccessToXcodeDirectory();
testResultPath = Files.createTempDirectory("codes.seanhenry.mockgenerator");
try {
super.setUp();
} catch (Throwable e) {
e.printStackTrace();
}
super.setUp();
this.initApplication();
fixture = ImportProjectTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(getDataPath(), getProjectFileName());
fixture.setUp();
}

private void initApplication() throws Exception {
IdeaTestApplication.getInstance(null);
((PersistentFSImpl)PersistentFS.getInstance()).cleanPersistedContents();
}

private void allowAccessToXcodeDirectory() throws IOException {
Expand All @@ -60,13 +61,6 @@ private String findXcodePath() throws IOException {
return input.lines().collect(Collectors.joining());
}

@Override
protected void setUpProject() throws Exception {
super.setUpProject();
fixture = ImportProjectTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(getDataPath(), getProjectFileName());
fixture.setUp();
}

protected abstract String getDataPath();
protected abstract String getProjectFileName();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package codes.seanhenry.testhelpers;

import com.intellij.ide.impl.ProjectUtil;
import com.intellij.idea.IdeaTestApplication;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ex.ProjectManagerEx;
import com.intellij.testFramework.LightPlatformTestCase;
import com.intellij.testFramework.fixtures.IdeaProjectTestFixture;
import com.intellij.testFramework.fixtures.TempDirTestFixture;

Expand Down

0 comments on commit 09aa3a0

Please sign in to comment.