def __init__(self, oneof, java_package): entity_name = oneof.oneof_name self.untyped_class_name = \ casing_utils.get_untyped_resource_name_class_name(entity_name) self.parent_interface = \ casing_utils.get_parent_resource_name_class_name(oneof.oneof_name) self.untyped_package_name = java_package
def __init__(self, oneof, java_package): entity_name = oneof.oneof_name self.class_name = \ casing_utils.get_resource_name_factory_class_name(entity_name) self.package_name = java_package self.resource_class_name = \ casing_utils.get_parent_resource_name_class_name(entity_name) self.untyped_class_name = \ casing_utils.get_untyped_resource_name_class_name(entity_name) self.single_resource_types = [{ 'resourceTypeClassName': resource.className(), 'resourceTypeVarName': resource.varName(), 'resourcePackage': resource.package(), } for resource in (ResourceName(x, java_package, oneof) for x in oneof.resource_list)] self.fixed_resource_types = [{ 'resourceTypeClassName': resource.className(), 'resourceTypeVarName': resource.varName(), 'resourcePackage': resource.package(), } for resource in (ResourceNameFixed(x, java_package, oneof) for x in oneof.fixed_resource_list)] self.resource_types = (self.single_resource_types + self.fixed_resource_types)
def test_untyped_resource_name_generation(self, run_protoc, oneof): generated_untyped = \ casing_utils.get_untyped_resource_name_class_name(oneof) untyped_filename_fragment = \ casing_utils.get_untyped_resource_name_lower_underscore(oneof) check_output(generated_untyped, TEST_OUTPUT_DIR_V1, PROTOC_OUTPUT_DIR, TEST_DIR_GAPIC_V1, 'java_' + untyped_filename_fragment)
def __init__(self, oneof, java_package): super(UntypedResourceName, self).__init__( casing_utils.get_untyped_resource_name_class_name( oneof.oneof_name), java_package) self.parent_interface = \ casing_utils.get_parent_resource_name_class_name(oneof.oneof_name) self.extension_keyword = 'extends'
def __init__(self, oneof, java_package): super(ResourceNameFactory, self).__init__( casing_utils.get_resource_name_factory_class_name( oneof.oneof_name), java_package) self.resource_class_name = \ casing_utils.get_parent_resource_name_class_name(oneof.oneof_name) self.untyped_class_name = \ casing_utils.get_untyped_resource_name_class_name(oneof.oneof_name) self.single_resource_types = [{ 'resource_type_class_name': resource.class_name, 'resource_type_var_name': resource.var_name, 'resource_package': resource.package, } for resource in (ResourceName(x, java_package, oneof) for x in oneof.legacy_resource_list)] self.fixed_resource_types = [{ 'resource_type_class_name': resource.class_name, 'resource_type_var_name': resource.var_name, 'resource_package': resource.package, } for resource in (ResourceNameFixed(x, java_package, oneof) for x in oneof.legacy_fixed_resource_list)] self.resource_types = (self.single_resource_types + self.fixed_resource_types)