Add codegen tests for package visibility

This commit is contained in:
Natalia.Ukhorskaya
2013-02-06 13:55:06 +04:00
parent 2862d13cb1
commit 88e3b9e190
9 changed files with 144 additions and 0 deletions
@@ -0,0 +1,28 @@
/*
* Copyright 2010-2013 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 org.jetbrains.jet.codegen;
import org.jetbrains.annotations.NotNull;
public abstract class AbstractJavaVisibilityTest extends CodegenTestCase {
@NotNull
@Override
protected GeneratedClassLoader createClassLoader(@NotNull ClassFileFactory factory) {
initializedClassLoader = new GeneratedClassLoader(factory, CodegenTestCase.class.getClassLoader(), getClassPathURLs());
return initializedClassLoader;
}
}
@@ -0,0 +1,68 @@
/*
* Copyright 2010-2013 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 org.jetbrains.jet.codegen;
import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestSuite;
import java.io.File;
import org.jetbrains.jet.JetTestUtils;
import org.jetbrains.jet.test.InnerTestClasses;
import org.jetbrains.jet.test.TestMetadata;
import org.jetbrains.jet.codegen.AbstractJavaVisibilityTest;
/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("compiler/testData/codegen/visibility")
@InnerTestClasses({JavaVisibilityTestGenerated.Package.class})
public class JavaVisibilityTestGenerated extends AbstractJavaVisibilityTest {
public void testAllFilesPresentInVisibility() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/visibility"), "kt", true);
}
@TestMetadata("compiler/testData/codegen/visibility/package")
public static class Package extends AbstractJavaVisibilityTest {
public void testAllFilesPresentInPackage() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/visibility/package"), "kt", true);
}
@TestMetadata("packageClass.kt")
public void testPackageClass() throws Exception {
blackBoxFileWithJavaByFullPath("compiler/testData/codegen/visibility/package/packageClass.kt");
}
@TestMetadata("packageFun.kt")
public void testPackageFun() throws Exception {
blackBoxFileWithJavaByFullPath("compiler/testData/codegen/visibility/package/packageFun.kt");
}
@TestMetadata("packageProperty.kt")
public void testPackageProperty() throws Exception {
blackBoxFileWithJavaByFullPath("compiler/testData/codegen/visibility/package/packageProperty.kt");
}
}
public static Test suite() {
TestSuite suite = new TestSuite("JavaVisibilityTestGenerated");
suite.addTestSuite(JavaVisibilityTestGenerated.class);
suite.addTestSuite(Package.class);
return suite;
}
}