Skip to content

Commit cd6ab04

Browse files
committed
Update test data to aas-core-meta 31d6afd
We update the development requirements to and re-record the test data for [aas-core-meta 31d6afd]. Notably, we update to the v3.0.1 of the specification. [aas-core-meta 31d6afd]: aas-core-works/aas-core-meta@31d6afd
1 parent e1d8c19 commit cd6ab04

File tree

40 files changed

+409
-566
lines changed

40 files changed

+409
-566
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"twine",
5353
"jsonschema==3.2.0",
5454
"xmlschema==3.3.1",
55-
"aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@6d5411b#egg=aas-core-meta",
55+
"aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@31d6afd#egg=aas-core-meta",
5656
"ssort==0.12.3",
5757
]
5858
},

test_data/cpp/test_main/aas_core_meta.v3/expected_output/enhancing.hpp

+9-29
Original file line numberDiff line numberDiff line change
@@ -7118,22 +7118,16 @@ class EnhancedEmbeddedDataSpecification
71187118
instance_->set_data_specification_content(value);
71197119
}
71207120

7121-
const common::optional<
7122-
std::shared_ptr<types::IReference>
7123-
>& data_specification() const override {
7121+
const std::shared_ptr<types::IReference>& data_specification() const override {
71247122
return instance_->data_specification();
71257123
}
71267124

7127-
common::optional<
7128-
std::shared_ptr<types::IReference>
7129-
>& mutable_data_specification() override {
7125+
std::shared_ptr<types::IReference>& mutable_data_specification() override {
71307126
return instance_->mutable_data_specification();
71317127
}
71327128

71337129
void set_data_specification(
7134-
common::optional<
7135-
std::shared_ptr<types::IReference>
7136-
> value
7130+
std::shared_ptr<types::IReference> value
71377131
) override {
71387132
instance_->set_data_specification(value);
71397133
}
@@ -13537,26 +13531,12 @@ std::shared_ptr<types::IEmbeddedDataSpecification> WrapEmbeddedDataSpecification
1353713531
)
1353813532
);
1353913533

13540-
if (that->data_specification().has_value()) {
13541-
const std::shared_ptr<types::IReference>& value(
13542-
that->data_specification().value()
13543-
);
13544-
13545-
std::shared_ptr<
13546-
types::IReference
13547-
> wrapped(
13548-
Wrap<E>(
13549-
value,
13550-
factory
13551-
)
13552-
);
13553-
13554-
that->set_data_specification(
13555-
common::make_optional(
13556-
std::move(wrapped)
13557-
)
13558-
);
13559-
}
13534+
that->set_data_specification(
13535+
Wrap<E>(
13536+
that->data_specification(),
13537+
factory
13538+
)
13539+
);
1356013540

1356113541
std::shared_ptr<E> enh(
1356213542
factory(that)

test_data/cpp/test_main/aas_core_meta.v3/expected_output/iteration.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -11313,15 +11313,10 @@ void IteratorOverEmbeddedDataSpecification::Execute() {
1131311313
}
1131411314

1131511315
case 1: {
11316-
if (!(casted_->data_specification().has_value())) {
11317-
state_ = 2;
11318-
continue;
11319-
}
11320-
1132111316
property_ = Property::kDataSpecification;
1132211317
item_ = std::move(
1132311318
std::static_pointer_cast<types::IClass>(
11324-
*(casted_->data_specification())
11319+
casted_->data_specification()
1132511320
)
1132611321
);
1132711322
++index_;

test_data/cpp/test_main/aas_core_meta.v3/expected_output/jsonization.cpp

+55-54
Original file line numberDiff line numberDiff line change
@@ -23597,6 +23597,18 @@ std::pair<
2359723597
);
2359823598
}
2359923599

23600+
if (!json.contains("dataSpecification")) {
23601+
return std::make_pair<
23602+
common::optional<std::shared_ptr<types::IEmbeddedDataSpecification> >,
23603+
common::optional<DeserializationError>
23604+
>(
23605+
common::nullopt,
23606+
common::make_optional<DeserializationError>(
23607+
L"The required property dataSpecification is missing"
23608+
)
23609+
);
23610+
}
23611+
2360023612
// endregion Check required properties
2360123613

2360223614
// region Initialization
@@ -23605,9 +23617,7 @@ std::pair<
2360523617

2360623618
common::optional<std::shared_ptr<types::IDataSpecificationContent> > the_data_specification_content;
2360723619

23608-
common::optional<
23609-
std::shared_ptr<types::IReference>
23610-
> the_data_specification;
23620+
common::optional<std::shared_ptr<types::IReference> > the_data_specification;
2361123621

2361223622
// endregion Initialization
2361323623

@@ -23641,30 +23651,28 @@ std::pair<
2364123651

2364223652
// region De-serialize dataSpecification
2364323653

23644-
if (json.contains("dataSpecification")) {
23645-
std::tie(
23646-
the_data_specification,
23647-
error
23648-
) = DeserializeReference(
23649-
json["dataSpecification"],
23650-
additional_properties
23651-
);
23654+
std::tie(
23655+
the_data_specification,
23656+
error
23657+
) = DeserializeReference(
23658+
json["dataSpecification"],
23659+
additional_properties
23660+
);
2365223661

23653-
if (error.has_value()) {
23654-
error->path.segments.emplace_front(
23655-
common::make_unique<PropertySegment>(
23656-
L"dataSpecification"
23657-
)
23658-
);
23662+
if (error.has_value()) {
23663+
error->path.segments.emplace_front(
23664+
common::make_unique<PropertySegment>(
23665+
L"dataSpecification"
23666+
)
23667+
);
2365923668

23660-
return std::make_pair<
23661-
common::optional<std::shared_ptr<types::IEmbeddedDataSpecification> >,
23662-
common::optional<DeserializationError>
23663-
>(
23664-
common::nullopt,
23665-
std::move(error)
23666-
);
23667-
}
23669+
return std::make_pair<
23670+
common::optional<std::shared_ptr<types::IEmbeddedDataSpecification> >,
23671+
common::optional<DeserializationError>
23672+
>(
23673+
common::nullopt,
23674+
std::move(error)
23675+
);
2366823676
}
2366923677

2367023678
// endregion De-serialize dataSpecification
@@ -23678,7 +23686,7 @@ std::pair<
2367823686
// upcast.
2367923687
new types::EmbeddedDataSpecification(
2368023688
std::move(*the_data_specification_content),
23681-
std::move(the_data_specification)
23689+
std::move(*the_data_specification)
2368223690
)
2368323691
),
2368423692
common::nullopt
@@ -36939,40 +36947,33 @@ std::pair<
3693936947
*json_data_specification_content
3694036948
);
3694136949

36942-
const common::optional<
36943-
std::shared_ptr<types::IReference>
36944-
>& maybe_data_specification(
36945-
that.data_specification()
36950+
common::optional<nlohmann::json> json_data_specification;
36951+
std::tie(
36952+
json_data_specification,
36953+
error
36954+
) = SerializeIClass(
36955+
*that.data_specification()
3694636956
);
36947-
if (maybe_data_specification.has_value()) {
36948-
common::optional<nlohmann::json> json_data_specification;
36949-
std::tie(
36950-
json_data_specification,
36951-
error
36952-
) = SerializeIClass(
36953-
**maybe_data_specification
36957+
if (error.has_value()) {
36958+
error->path.segments.emplace_front(
36959+
common::make_unique<iteration::PropertySegment>(
36960+
iteration::Property::kDataSpecification
36961+
)
3695436962
);
36955-
if (error.has_value()) {
36956-
error->path.segments.emplace_front(
36957-
common::make_unique<iteration::PropertySegment>(
36958-
iteration::Property::kDataSpecification
36959-
)
36960-
);
36961-
36962-
return std::make_pair<
36963-
common::optional<nlohmann::json>,
36964-
common::optional<SerializationError>
36965-
>(
36966-
common::nullopt,
36967-
std::move(error)
36968-
);
36969-
}
3697036963

36971-
result["dataSpecification"] = std::move(
36972-
*json_data_specification
36964+
return std::make_pair<
36965+
common::optional<nlohmann::json>,
36966+
common::optional<SerializationError>
36967+
>(
36968+
common::nullopt,
36969+
std::move(error)
3697336970
);
3697436971
}
3697536972

36973+
result["dataSpecification"] = std::move(
36974+
*json_data_specification
36975+
);
36976+
3697636977
return std::make_pair<
3697736978
common::optional<nlohmann::json>,
3697836979
common::optional<SerializationError>

test_data/cpp/test_main/aas_core_meta.v3/expected_output/types.cpp

+4-12
Original file line numberDiff line numberDiff line change
@@ -6912,9 +6912,7 @@ void Environment::set_concept_descriptions(
69126912

69136913
EmbeddedDataSpecification::EmbeddedDataSpecification(
69146914
std::shared_ptr<IDataSpecificationContent> data_specification_content,
6915-
common::optional<
6916-
std::shared_ptr<IReference>
6917-
> data_specification
6915+
std::shared_ptr<IReference> data_specification
69186916
) {
69196917
data_specification_content_ = std::move(data_specification_content);
69206918

@@ -6939,22 +6937,16 @@ void EmbeddedDataSpecification::set_data_specification_content(
69396937
data_specification_content_ = value;
69406938
}
69416939

6942-
const common::optional<
6943-
std::shared_ptr<IReference>
6944-
>& EmbeddedDataSpecification::data_specification() const {
6940+
const std::shared_ptr<IReference>& EmbeddedDataSpecification::data_specification() const {
69456941
return data_specification_;
69466942
}
69476943

6948-
common::optional<
6949-
std::shared_ptr<IReference>
6950-
>& EmbeddedDataSpecification::mutable_data_specification() {
6944+
std::shared_ptr<IReference>& EmbeddedDataSpecification::mutable_data_specification() {
69516945
return data_specification_;
69526946
}
69536947

69546948
void EmbeddedDataSpecification::set_data_specification(
6955-
common::optional<
6956-
std::shared_ptr<IReference>
6957-
> value
6949+
std::shared_ptr<IReference> value
69586950
) {
69596951
data_specification_ = value;
69606952
}

test_data/cpp/test_main/aas_core_meta.v3/expected_output/types.hpp

+9-25
Original file line numberDiff line numberDiff line change
@@ -2942,18 +2942,12 @@ class IEmbeddedDataSpecification
29422942
///@{
29432943
/// \brief Reference to the data specification
29442944

2945-
virtual const common::optional<
2946-
std::shared_ptr<IReference>
2947-
>& data_specification() const = 0;
2945+
virtual const std::shared_ptr<IReference>& data_specification() const = 0;
29482946

2949-
virtual common::optional<
2950-
std::shared_ptr<IReference>
2951-
>& mutable_data_specification() = 0;
2947+
virtual std::shared_ptr<IReference>& mutable_data_specification() = 0;
29522948

29532949
virtual void set_data_specification(
2954-
common::optional<
2955-
std::shared_ptr<IReference>
2956-
> value
2950+
std::shared_ptr<IReference> value
29572951
) = 0;
29582952

29592953
///@}
@@ -10275,11 +10269,9 @@ class Environment
1027510269
class EmbeddedDataSpecification
1027610270
: public IEmbeddedDataSpecification {
1027710271
public:
10278-
explicit EmbeddedDataSpecification(
10272+
EmbeddedDataSpecification(
1027910273
std::shared_ptr<IDataSpecificationContent> data_specification_content,
10280-
common::optional<
10281-
std::shared_ptr<IReference>
10282-
> data_specification = common::nullopt
10274+
std::shared_ptr<IReference> data_specification
1028310275
);
1028410276

1028510277
ModelType model_type() const override;
@@ -10298,18 +10290,12 @@ class EmbeddedDataSpecification
1029810290

1029910291
// region Get and set data_specification_
1030010292

10301-
const common::optional<
10302-
std::shared_ptr<IReference>
10303-
>& data_specification() const override;
10293+
const std::shared_ptr<IReference>& data_specification() const override;
1030410294

10305-
common::optional<
10306-
std::shared_ptr<IReference>
10307-
>& mutable_data_specification() override;
10295+
std::shared_ptr<IReference>& mutable_data_specification() override;
1030810296

1030910297
void set_data_specification(
10310-
common::optional<
10311-
std::shared_ptr<IReference>
10312-
> value
10298+
std::shared_ptr<IReference> value
1031310299
) override;
1031410300

1031510301
// endregion
@@ -10319,9 +10305,7 @@ class EmbeddedDataSpecification
1031910305
private:
1032010306
std::shared_ptr<IDataSpecificationContent> data_specification_content_;
1032110307

10322-
common::optional<
10323-
std::shared_ptr<IReference>
10324-
> data_specification_;
10308+
std::shared_ptr<IReference> data_specification_;
1032510309
};
1032610310

1032710311
class LevelType

test_data/cpp/test_main/aas_core_meta.v3/expected_output/verification.cpp

+2-23
Original file line numberDiff line numberDiff line change
@@ -5421,33 +5421,12 @@ void OfPathType::Execute() {
54215421
}
54225422

54235423
case 3: {
5424-
if (
5425-
MatchesRfc8089Path(
5426-
(*value_)
5427-
)
5428-
) {
5429-
state_ = 4;
5430-
continue;
5431-
}
5432-
5433-
error_ = common::make_unique<Error>(
5434-
L"The value must represent a valid file URI scheme according "
5435-
L"to RFC 8089."
5436-
);
5437-
// No path is prepended as the error refers to the value itself.
5438-
++index_;
5439-
5440-
state_ = 4;
5441-
return;
5442-
}
5443-
5444-
case 4: {
54455424
done_ = true;
54465425
error_ = nullptr;
54475426
index_ = -1;
54485427

54495428
// We invalidate the state since we reached the end of the routine.
5450-
state_ = 5;
5429+
state_ = 4;
54515430
return;
54525431
}
54535432

@@ -24262,7 +24241,7 @@ void OfDataSpecificationIec61360::Execute() {
2426224241
}
2426324242

2426424243
error_ = common::make_unique<Error>(
24265-
L"Constraint AASc-002: preferred name shall be provided at "
24244+
L"Constraint AASc-3a-002: preferred name shall be provided at "
2426624245
L"least in English."
2426724246
);
2426824247
// No path is prepended as the error refers to the instance itself.

0 commit comments

Comments
 (0)