Skip to content

Commit

Permalink
[J2KT] Rename j2ktobjcinterop integration test to j2ktiosinterop,…
Browse files Browse the repository at this point in the history
… as it covers both ObjC and Swift.

PiperOrigin-RevId: 689744853
  • Loading branch information
Googler authored and copybara-github committed Oct 25, 2024
1 parent e303a1d commit 6aaf674
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package(
)

integration_test(
name = "j2ktobjcinterop",
name = "j2ktiosinterop",
srcs = glob(["*.java"]),
deps = [
"//third_party:j2objc_annotations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
package j2ktobjcinterop;
package j2ktiosinterop;

import com.google.j2objc.annotations.ObjectiveCName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
package j2ktobjcinterop;
package j2ktiosinterop;

public final class DefaultNames {
public DefaultNames() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
package j2ktobjcinterop;
package j2ktiosinterop;

public enum EnumNames {
ONE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
package j2ktobjcinterop;
package j2ktiosinterop;

public class Main {
public static void main(String... args) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
#import <XCTest/XCTest.h>

#import "transpiler/javatests/com/google/j2cl/integration/java/j2ktobjcinterop/CustomNames.h"
#import "transpiler/javatests/com/google/j2cl/integration/java/j2ktobjcinterop/DefaultNames.h"
#import "transpiler/javatests/com/google/j2cl/integration/java/j2ktobjcinterop/EnumNames.h"
#import "transpiler/javatests/com/google/j2cl/integration/java/j2ktiosinterop/CustomNames.h"
#import "transpiler/javatests/com/google/j2cl/integration/java/j2ktiosinterop/DefaultNames.h"
#import "transpiler/javatests/com/google/j2cl/integration/java/j2ktiosinterop/EnumNames.h"

@interface ObjCInteropTest : XCTestCase
@end

@implementation ObjCInteropTest

- (void)testDefaultNames {
J2ktJ2ktobjcinteropDefaultNames *obj;
obj = [[J2ktJ2ktobjcinteropDefaultNames alloc] init];
obj = [[J2ktJ2ktobjcinteropDefaultNames alloc] initWithInt:1];
obj = [[J2ktJ2ktobjcinteropDefaultNames alloc] initWithInt:1 withNSString:@""];
J2ktJ2ktiosinteropDefaultNames *obj;
obj = [[J2ktJ2ktiosinteropDefaultNames alloc] init];
obj = [[J2ktJ2ktiosinteropDefaultNames alloc] initWithInt:1];
obj = [[J2ktJ2ktiosinteropDefaultNames alloc] initWithInt:1 withNSString:@""];

obj = create_J2ktobjcinteropDefaultNames_init();
obj = create_J2ktobjcinteropDefaultNames_initWithInt_(1);
obj = create_J2ktobjcinteropDefaultNames_initWithInt_withNSString_(1, @"");
obj = create_J2ktiosinteropDefaultNames_init();
obj = create_J2ktiosinteropDefaultNames_initWithInt_(1);
obj = create_J2ktiosinteropDefaultNames_initWithInt_withNSString_(1, @"");

obj = new_J2ktobjcinteropDefaultNames_init();
obj = new_J2ktobjcinteropDefaultNames_initWithInt_(1);
obj = new_J2ktobjcinteropDefaultNames_initWithInt_withNSString_(1, @"");
obj = new_J2ktiosinteropDefaultNames_init();
obj = new_J2ktiosinteropDefaultNames_initWithInt_(1);
obj = new_J2ktiosinteropDefaultNames_initWithInt_withNSString_(1, @"");

[obj method];
[obj methodWithBoolean:YES];
Expand All @@ -47,16 +47,16 @@ - (void)testDefaultNames {

obj.field_ = obj.field_;

J2ktJ2ktobjcinteropDefaultNamesCompanion.shared.staticField_ =
J2ktJ2ktobjcinteropDefaultNamesCompanion.shared.staticField_;
J2ktJ2ktiosinteropDefaultNamesCompanion.shared.staticField_ =
J2ktJ2ktiosinteropDefaultNamesCompanion.shared.staticField_;

[J2ktJ2ktobjcinteropDefaultNamesCompanion.shared staticMethod];
[J2ktJ2ktobjcinteropDefaultNamesCompanion.shared staticMethodWithInt:1];
[J2ktJ2ktobjcinteropDefaultNamesCompanion.shared staticMethodWithInt:1 withNSString:@""];
[J2ktJ2ktiosinteropDefaultNamesCompanion.shared staticMethod];
[J2ktJ2ktiosinteropDefaultNamesCompanion.shared staticMethodWithInt:1];
[J2ktJ2ktiosinteropDefaultNamesCompanion.shared staticMethodWithInt:1 withNSString:@""];

J2ktobjcinteropDefaultNames_staticMethod();
J2ktobjcinteropDefaultNames_staticMethodWithInt_(1);
J2ktobjcinteropDefaultNames_staticMethodWithInt_withNSString_(1, @"");
J2ktiosinteropDefaultNames_staticMethod();
J2ktiosinteropDefaultNames_staticMethodWithInt_(1);
J2ktiosinteropDefaultNames_staticMethodWithInt_withNSString_(1, @"");
}

- (void)testCustomNames {
Expand Down Expand Up @@ -105,16 +105,16 @@ - (void)testCustomNames {
}

- (void)testEnumNames {
J2ktJ2ktobjcinteropEnumNames *e;
e = J2ktJ2ktobjcinteropEnumNames.ONE;
e = J2ktJ2ktobjcinteropEnumNames.TWO;
J2ktJ2ktiosinteropEnumNames *e;
e = J2ktJ2ktiosinteropEnumNames.ONE;
e = J2ktJ2ktiosinteropEnumNames.TWO;

e = J2ktobjcinteropEnumNames_get_ONE();
e = J2ktobjcinteropEnumNames_get_TWO();
e = J2ktiosinteropEnumNames_get_ONE();
e = J2ktiosinteropEnumNames_get_TWO();

J2ktobjcinteropEnumNames_Enum e2;
e2 = J2ktobjcinteropEnumNames_Enum_ONE;
e2 = J2ktobjcinteropEnumNames_Enum_TWO;
J2ktiosinteropEnumNames_Enum e2;
e2 = J2ktiosinteropEnumNames_Enum_ONE;
e2 = J2ktiosinteropEnumNames_Enum_TWO;
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
* the License.
*/
import XCTest
import third_party_java_src_j2cl_transpiler_javatests_com_google_j2cl_integration_java_j2ktobjcinterop_SwiftInteropFramework
import third_party_java_src_j2cl_transpiler_javatests_com_google_j2cl_integration_java_j2ktiosinterop_SwiftInteropFramework

final class SwiftInteropTest: XCTestCase {
func testDefaultNames() {
var obj: J2ktJ2ktobjcinteropDefaultNames
var obj: J2ktJ2ktiosinteropDefaultNames

obj = J2ktJ2ktobjcinteropDefaultNames()
obj = J2ktJ2ktobjcinteropDefaultNames(Int: 1)
obj = J2ktJ2ktobjcinteropDefaultNames(Int: 1, withNSString: "")
obj = J2ktJ2ktiosinteropDefaultNames()
obj = J2ktJ2ktiosinteropDefaultNames(Int: 1)
obj = J2ktJ2ktiosinteropDefaultNames(Int: 1, withNSString: "")

obj.method()
obj.method(withBoolean: true)
Expand All @@ -47,12 +47,12 @@ final class SwiftInteropTest: XCTestCase {
obj.genericMethod(withNSString: nil)

obj.field_ = obj.field_
J2ktJ2ktobjcinteropDefaultNamesCompanion.shared.staticField_ =
J2ktJ2ktobjcinteropDefaultNamesCompanion.shared.staticField_
J2ktJ2ktiosinteropDefaultNamesCompanion.shared.staticField_ =
J2ktJ2ktiosinteropDefaultNamesCompanion.shared.staticField_

J2ktJ2ktobjcinteropDefaultNamesCompanion.shared.staticMethod()
J2ktJ2ktobjcinteropDefaultNamesCompanion.shared.staticMethod(withInt: 1)
J2ktJ2ktobjcinteropDefaultNamesCompanion.shared.staticMethod(withInt: 1, withNSString: "")
J2ktJ2ktiosinteropDefaultNamesCompanion.shared.staticMethod()
J2ktJ2ktiosinteropDefaultNamesCompanion.shared.staticMethod(withInt: 1)
J2ktJ2ktiosinteropDefaultNamesCompanion.shared.staticMethod(withInt: 1, withNSString: "")
}

func testCustomNames() {
Expand Down Expand Up @@ -81,8 +81,8 @@ final class SwiftInteropTest: XCTestCase {
}

func testEnumNames() {
var e: J2ktJ2ktobjcinteropEnumNames
e = J2ktJ2ktobjcinteropEnumNames.ONE
e = J2ktJ2ktobjcinteropEnumNames.TWO
var e: J2ktJ2ktiosinteropEnumNames
e = J2ktJ2ktiosinteropEnumNames.ONE
e = J2ktJ2ktiosinteropEnumNames.TWO
}
}

0 comments on commit 6aaf674

Please sign in to comment.