Skip to content

Commit

Permalink
remove no longer needed reflections
Browse files Browse the repository at this point in the history
  • Loading branch information
cdietrich committed Oct 30, 2024
1 parent 5fdf15d commit 7a7e3be
Show file tree
Hide file tree
Showing 7 changed files with 189 additions and 549 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2014, 2022 itemis AG (http://www.itemis.eu) and others.
* Copyright (c) 2014, 2024 itemis AG (http://www.itemis.eu) and others.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
Expand Down Expand Up @@ -33,7 +33,6 @@ import org.junit.Test
import static org.eclipse.xtext.ui.testing.util.IResourcesSetupUtil.*
import static extension org.eclipse.xtext.util.Strings.*
import static org.junit.Assert.*
import org.osgi.framework.Version

/**
* @author Jan Koehnlein - Initial contribution and API
Expand Down Expand Up @@ -487,33 +486,18 @@ class BuildAffectionTest {
int foo;
}
''')
if (isCoreResourceGreaterOrEqual_3_17_0) {
assertBuildLogs('''
Building test.project
indexing platform:/resource/test.project/src/Foo.xtend
Built test.project in \d+ ms
Building test.project
Built test.project in \d+ ms
Building test.client
indexing platform:/resource/test.client/src/Client.xtend
Built test.client in \d+ ms
Building test.client
Built test.client in \d+ ms
''')
} else {
assertBuildLogs('''
Building test.project
indexing platform:/resource/test.project/src/Foo.xtend
Built test.project in \d+ ms
Building test.client
indexing platform:/resource/test.client/src/Client.xtend
Built test.client in \d+ ms
Building test.project
Built test.project in \d+ ms
Building test.client
Built test.client in \d+ ms
''')
}
assertBuildLogs('''
Building test.project
indexing platform:/resource/test.project/src/Foo.xtend
Built test.project in \d+ ms
Building test.project
Built test.project in \d+ ms
Building test.client
indexing platform:/resource/test.client/src/Client.xtend
Built test.client in \d+ ms
Building test.client
Built test.client in \d+ ms
''')
}

@Test
Expand All @@ -530,33 +514,17 @@ class BuildAffectionTest {
protected int foo;
}
''')
if (isCoreResourceGreaterOrEqual_3_17_0) {
assertBuildLogs('''
Building test.project
Built test.project in \d+ ms
Building test.project
Built test.project in \d+ ms
Building test.client
indexing platform:/resource/test.client/src/Client.xtend
Built test.client in \d+ ms
Building test.client
Built test.client in \d+ ms
''')
} else {
assertBuildLogs('''
Building test.project
Built test.project in \d+ ms
Building test.client
Built test.client in \d+ ms
Building test.project
Built test.project in \d+ ms
Building test.client
indexing platform:/resource/test.client/src/Client.xtend
Built test.client in \d+ ms
Building test.client
Built test.client in \d+ ms
''')
}
assertBuildLogs('''
Building test.project
Built test.project in \d+ ms
Building test.project
Built test.project in \d+ ms
Building test.client
indexing platform:/resource/test.client/src/Client.xtend
Built test.client in \d+ ms
Building test.client
Built test.client in \d+ ms
''')
}

@Test
Expand All @@ -577,33 +545,17 @@ class BuildAffectionTest {
protected int foo;
}
''')
if (isCoreResourceGreaterOrEqual_3_17_0) {
assertBuildLogs('''
Building test.project
Built test.project in \d+ ms
Building test.project
Built test.project in \d+ ms
Building test.client
indexing platform:/resource/test.client/src/Client.xtend
Built test.client in \d+ ms
Building test.client
Built test.client in \d+ ms
''')
} else {
assertBuildLogs('''
Building test.project
Built test.project in \d+ ms
Building test.client
Built test.client in \d+ ms
Building test.project
Built test.project in \d+ ms
Building test.client
indexing platform:/resource/test.client/src/Client.xtend
Built test.client in \d+ ms
Building test.client
Built test.client in \d+ ms
''')
}
assertBuildLogs('''
Building test.project
Built test.project in \d+ ms
Building test.project
Built test.project in \d+ ms
Building test.client
indexing platform:/resource/test.client/src/Client.xtend
Built test.client in \d+ ms
Building test.client
Built test.client in \d+ ms
''')
}

@Test
Expand Down Expand Up @@ -640,33 +592,18 @@ class BuildAffectionTest {
}
}
''')
if (isCoreResourceGreaterOrEqual_3_17_0) {
assertBuildLogs('''
Building test.project
indexing platform:/resource/test.project/src/Foo.xtend
Built test.project in \d+ ms
Building test.project
Built test.project in \d+ ms
Building test.client
indexing platform:/resource/test.client/src/Client.xtend
Built test.client in \d+ ms
Building test.client
Built test.client in \d+ ms
''')
} else {
assertBuildLogs('''
Building test.project
indexing platform:/resource/test.project/src/Foo.xtend
Built test.project in \d+ ms
Building test.client
indexing platform:/resource/test.client/src/Client.xtend
Built test.client in \d+ ms
Building test.project
Built test.project in \d+ ms
Building test.client
Built test.client in \d+ ms
''')
}
assertBuildLogs('''
Building test.project
indexing platform:/resource/test.project/src/Foo.xtend
Built test.project in \d+ ms
Building test.project
Built test.project in \d+ ms
Building test.client
indexing platform:/resource/test.client/src/Client.xtend
Built test.client in \d+ ms
Building test.client
Built test.client in \d+ ms
''')
}

@Test
Expand Down Expand Up @@ -700,35 +637,19 @@ class BuildAffectionTest {
}
}
''')
if (isCoreResourceGreaterOrEqual_3_17_0) {
assertBuildLogs('''
Building test.project
indexing platform:/resource/test.project/src/Bar.xtend
indexing platform:/resource/test.project/src/Foo.xtend
Built test.project in \d+ ms
Building test.project
Built test.project in \d+ ms
Building test.client
indexing platform:/resource/test.client/src/Client.xtend
Built test.client in \d+ ms
Building test.client
Built test.client in \d+ ms
''')
} else {
assertBuildLogs('''
Building test.project
indexing platform:/resource/test.project/src/Bar.xtend
indexing platform:/resource/test.project/src/Foo.xtend
Built test.project in \d+ ms
Building test.client
indexing platform:/resource/test.client/src/Client.xtend
Built test.client in \d+ ms
Building test.project
Built test.project in \d+ ms
Building test.client
Built test.client in \d+ ms
''')
}
assertBuildLogs('''
Building test.project
indexing platform:/resource/test.project/src/Bar.xtend
indexing platform:/resource/test.project/src/Foo.xtend
Built test.project in \d+ ms
Building test.project
Built test.project in \d+ ms
Building test.client
indexing platform:/resource/test.client/src/Client.xtend
Built test.client in \d+ ms
Building test.client
Built test.client in \d+ ms
''')
}

private def assertBuildLogs(CharSequence expected) {
Expand All @@ -754,10 +675,4 @@ class BuildAffectionTest {
createFile(new Path('test.client/src/' + name + '.xtend'), content.toString)
}

def private static boolean isCoreResourceGreaterOrEqual_3_17_0() {
var version_3_17_0 = new Version(3,17,0)
var installed = ResourcesPlugin.getPlugin().getBundle().getVersion()
return installed >= version_3_17_0
}

}
Loading

0 comments on commit 7a7e3be

Please sign in to comment.