diff --git a/querydsl-core/src/test/java/com/querydsl/core/testutil/FilteringTestRunner.java b/querydsl-core/src/test/java/com/querydsl/core/testutil/FilteringTestRunner.java deleted file mode 100644 index 601e32d9c..000000000 --- a/querydsl-core/src/test/java/com/querydsl/core/testutil/FilteringTestRunner.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2011, Mysema Ltd - * - * 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.querydsl.core.testutil; - -import org.junit.runner.notification.RunNotifier; -import org.junit.runners.BlockJUnit4ClassRunner; -import org.junit.runners.model.InitializationError; - -public class FilteringTestRunner extends BlockJUnit4ClassRunner { - - private boolean run = true; - - public FilteringTestRunner(Class klass) throws InitializationError { - super(klass); - ResourceCheck rc = klass.getAnnotation(ResourceCheck.class); - if (rc != null) { - run = klass.getResourceAsStream(rc.value()) != null; - } - } - - @Override - public void run(RunNotifier notifier) { - if (run) { - super.run(notifier); - } - } - -} diff --git a/querydsl-core/src/test/java/com/querydsl/core/testutil/ResourceCheck.java b/querydsl-core/src/test/java/com/querydsl/core/testutil/ResourceCheck.java deleted file mode 100644 index 22e9368cd..000000000 --- a/querydsl-core/src/test/java/com/querydsl/core/testutil/ResourceCheck.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2011, Mysema Ltd - * - * 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.querydsl.core.testutil; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -@Inherited -public @interface ResourceCheck { - /** - * @return - */ - public String value(); -} diff --git a/querydsl-core/src/test/java/com/querydsl/core/testutil/ResourceCheckRule.java b/querydsl-core/src/test/java/com/querydsl/core/testutil/ResourceCheckRule.java deleted file mode 100644 index e85355ba9..000000000 --- a/querydsl-core/src/test/java/com/querydsl/core/testutil/ResourceCheckRule.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2011, Mysema Ltd - * - * 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.querydsl.core.testutil; - -import org.junit.rules.MethodRule; -import org.junit.runners.model.FrameworkMethod; -import org.junit.runners.model.Statement; - -public class ResourceCheckRule implements MethodRule{ - - @Override - public Statement apply(Statement base, FrameworkMethod method, Object target) { - Class testClass = target.getClass(); - ResourceCheck rc = testClass.getAnnotation(ResourceCheck.class); - boolean run = true; - if (rc != null) { - run = testClass.getResourceAsStream(rc.value()) != null; - } - return run ? base : EmptyStatement.DEFAULT; - } - -} diff --git a/querydsl-root/pom.xml b/querydsl-root/pom.xml index 5b236d623..108543c46 100644 --- a/querydsl-root/pom.xml +++ b/querydsl-root/pom.xml @@ -568,6 +568,7 @@ **/*$* **/DB2*SuiteTest.java + **/ExportMSSQLTest.java **/ExportOracleTest.java **/ExportTeradataTest.java **/Oracle*SuiteTest.java diff --git a/querydsl-sql-codegen/src/test/java/com/querydsl/sql/codegen/ExportBaseTest.java b/querydsl-sql-codegen/src/test/java/com/querydsl/sql/codegen/ExportBaseTest.java index 351ab851c..f4a9e2cd5 100644 --- a/querydsl-sql-codegen/src/test/java/com/querydsl/sql/codegen/ExportBaseTest.java +++ b/querydsl-sql-codegen/src/test/java/com/querydsl/sql/codegen/ExportBaseTest.java @@ -18,12 +18,9 @@ import java.sql.SQLException; import org.junit.AfterClass; import org.junit.Test; -import org.junit.runner.RunWith; import com.querydsl.sql.Connections; -import com.querydsl.core.testutil.FilteringTestRunner; -@RunWith(FilteringTestRunner.class) public abstract class ExportBaseTest { @Test diff --git a/querydsl-sql-codegen/src/test/java/com/querydsl/sql/codegen/ExportMSSQLTest.java b/querydsl-sql-codegen/src/test/java/com/querydsl/sql/codegen/ExportMSSQLTest.java index 23d73c27b..7692a6714 100644 --- a/querydsl-sql-codegen/src/test/java/com/querydsl/sql/codegen/ExportMSSQLTest.java +++ b/querydsl-sql-codegen/src/test/java/com/querydsl/sql/codegen/ExportMSSQLTest.java @@ -14,11 +14,12 @@ package com.querydsl.sql.codegen; import org.junit.BeforeClass; +import org.junit.experimental.categories.Category; -import com.querydsl.core.testutil.ResourceCheck; +import com.querydsl.core.testutil.ExternalDB; import com.querydsl.sql.Connections; -@ResourceCheck("/sqlserver.run") +@Category(ExternalDB.class) public class ExportMSSQLTest extends ExportBaseTest{ @BeforeClass diff --git a/querydsl-sql-codegen/src/test/java/com/querydsl/sql/codegen/ExportTeradataTest.java b/querydsl-sql-codegen/src/test/java/com/querydsl/sql/codegen/ExportTeradataTest.java index 618939494..f1a9c2670 100644 --- a/querydsl-sql-codegen/src/test/java/com/querydsl/sql/codegen/ExportTeradataTest.java +++ b/querydsl-sql-codegen/src/test/java/com/querydsl/sql/codegen/ExportTeradataTest.java @@ -6,7 +6,6 @@ import org.junit.experimental.categories.Category; import com.querydsl.core.testutil.ExternalDB; import com.querydsl.sql.Connections; -//@Ignore @Category(ExternalDB.class) public class ExportTeradataTest extends ExportBaseTest {