forked from apache/skywalking
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
timeBucket
not taking effect in EqualsAndHashCode annotation. (a…
- Loading branch information
Showing
10 changed files
with
229 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...kywalking/oap/server/core/analysis/manual/relation/endpoint/EndpointCallRelationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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.apache.skywalking.oap.server.core.analysis.manual.relation.endpoint; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class EndpointCallRelationTest { | ||
@Test | ||
public void testEndpointRelationServerSideMetricsEquals() { | ||
EndpointRelationServerSideMetrics thisObject = new EndpointRelationServerSideMetrics(); | ||
thisObject.setEntityId( | ||
"VXNlcg==.0-VXNlcg==-em1iaXotcHJvbW90aW9uMi1hZG1pbkAxMjUyNw==.1-L0Bpbi9hcGkvaGVhbHRo"); | ||
thisObject.setTimeBucket(202101071505L); | ||
|
||
EndpointRelationServerSideMetrics otherObject = new EndpointRelationServerSideMetrics(); | ||
otherObject.setEntityId( | ||
"VXNlcg==.0-VXNlcg==-em1iaXotcHJvbW90aW9uMi1hZG1pbkAxMjUyNw==.1-L0Bpbi9hcGkvaGVhbHRo"); | ||
otherObject.setTimeBucket(202101071505L); | ||
|
||
Assert.assertTrue(thisObject.equals(otherObject)); | ||
} | ||
|
||
@Test | ||
public void testEndpointRelationServerSideMetricsNotEquals() { | ||
EndpointRelationServerSideMetrics thisObject = new EndpointRelationServerSideMetrics(); | ||
thisObject.setEntityId( | ||
"VXNlcg==.0-VXNlcg==-em1iaXotcHJvbW90aW9uMi1hZG1pbkAxMjUyNw==.1-L0Bpbi9hcGkvaGVhbHRo"); | ||
thisObject.setTimeBucket(202101071505L); | ||
|
||
EndpointRelationServerSideMetrics otherObject = new EndpointRelationServerSideMetrics(); | ||
otherObject.setEntityId( | ||
"VXNlcg==.0-VXNlcg==-em1iaXotcHJvbW90aW9uMi1hZG1pbkAxMjUyNw==.1-L0Bpbi9hcGkvaGVhbHRo"); | ||
otherObject.setTimeBucket(202101071506L); | ||
|
||
Assert.assertFalse(thisObject.equals(otherObject)); | ||
} | ||
} |
84 changes: 84 additions & 0 deletions
84
...alking/oap/server/core/analysis/manual/relation/instance/ServiceInstanceRelationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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.apache.skywalking.oap.server.core.analysis.manual.relation.instance; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class ServiceInstanceRelationTest { | ||
@Test | ||
public void testServiceInstanceRelationClientSideMetricsEquals() { | ||
ServiceInstanceRelationClientSideMetrics thisObject = new ServiceInstanceRelationClientSideMetrics(); | ||
thisObject.setEntityId( | ||
"em1jLWJlYWNvbi1taWRkbGV3YXJlQDExMTIz.1_MTAuMTExLjIzMi4yMDc=-MTkyLjE2OC40Ni4xNDM6NDY2MDY=.0_MTkyLjE2OC40Ni4xNDM6NDY2MDY="); | ||
thisObject.setTimeBucket(202101071505L); | ||
|
||
ServiceInstanceRelationClientSideMetrics otherObject = new ServiceInstanceRelationClientSideMetrics(); | ||
otherObject.setEntityId( | ||
"em1jLWJlYWNvbi1taWRkbGV3YXJlQDExMTIz.1_MTAuMTExLjIzMi4yMDc=-MTkyLjE2OC40Ni4xNDM6NDY2MDY=.0_MTkyLjE2OC40Ni4xNDM6NDY2MDY="); | ||
otherObject.setTimeBucket(202101071505L); | ||
|
||
Assert.assertTrue(thisObject.equals(otherObject)); | ||
} | ||
|
||
@Test | ||
public void testServiceInstanceRelationClientSideMetricsNotEquals() { | ||
ServiceInstanceRelationClientSideMetrics thisObject = new ServiceInstanceRelationClientSideMetrics(); | ||
thisObject.setEntityId( | ||
"em1jLWJlYWNvbi1taWRkbGV3YXJlQDExMTIz.1_MTAuMTExLjIzMi4yMDc=-MTkyLjE2OC40Ni4xNDM6NDY2MDY=.0_MTkyLjE2OC40Ni4xNDM6NDY2MDY="); | ||
thisObject.setTimeBucket(202101071505L); | ||
|
||
ServiceInstanceRelationClientSideMetrics otherObject = new ServiceInstanceRelationClientSideMetrics(); | ||
otherObject.setEntityId( | ||
"em1jLWJlYWNvbi1taWRkbGV3YXJlQDExMTIz.1_MTAuMTExLjIzMi4yMDc=-MTkyLjE2OC40Ni4xNDM6NDY2MDY=.0_MTkyLjE2OC40Ni4xNDM6NDY2MDY="); | ||
otherObject.setTimeBucket(202101071506L); | ||
|
||
Assert.assertFalse(thisObject.equals(otherObject)); | ||
} | ||
|
||
@Test | ||
public void testServiceInstanceRelationServerSideMetricsEquals() { | ||
ServiceInstanceRelationServerSideMetrics thisObject = new ServiceInstanceRelationServerSideMetrics(); | ||
thisObject.setEntityId( | ||
"em1jLWJlYWNvbi1taWRkbGV3YXJlQDExMTIz.1_MTAuMTExLjIzMi4yMDc=-MTkyLjE2OC40Ni4xNDM6NDY2MDY=.0_MTkyLjE2OC40Ni4xNDM6NDY2MDY="); | ||
thisObject.setTimeBucket(202101071505L); | ||
|
||
ServiceInstanceRelationServerSideMetrics otherObject = new ServiceInstanceRelationServerSideMetrics(); | ||
otherObject.setEntityId( | ||
"em1jLWJlYWNvbi1taWRkbGV3YXJlQDExMTIz.1_MTAuMTExLjIzMi4yMDc=-MTkyLjE2OC40Ni4xNDM6NDY2MDY=.0_MTkyLjE2OC40Ni4xNDM6NDY2MDY="); | ||
otherObject.setTimeBucket(202101071505L); | ||
|
||
Assert.assertTrue(thisObject.equals(otherObject)); | ||
} | ||
|
||
@Test | ||
public void testServiceInstanceRelationServerSideMetricsNotEquals() { | ||
ServiceInstanceRelationServerSideMetrics thisObject = new ServiceInstanceRelationServerSideMetrics(); | ||
thisObject.setEntityId( | ||
"em1jLWJlYWNvbi1taWRkbGV3YXJlQDExMTIz.1_MTAuMTExLjIzMi4yMDc=-MTkyLjE2OC40Ni4xNDM6NDY2MDY=.0_MTkyLjE2OC40Ni4xNDM6NDY2MDY="); | ||
thisObject.setTimeBucket(202101071505L); | ||
|
||
ServiceInstanceRelationServerSideMetrics otherObject = new ServiceInstanceRelationServerSideMetrics(); | ||
otherObject.setEntityId( | ||
"em1jLWJlYWNvbi1taWRkbGV3YXJlQDExMTIz.1_MTAuMTExLjIzMi4yMDc=-MTkyLjE2OC40Ni4xNDM6NDY2MDY=.0_MTkyLjE2OC40Ni4xNDM6NDY2MDY="); | ||
otherObject.setTimeBucket(202101071506L); | ||
|
||
Assert.assertFalse(thisObject.equals(otherObject)); | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
...ache/skywalking/oap/server/core/analysis/manual/relation/service/ServiceRelationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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.apache.skywalking.oap.server.core.analysis.manual.relation.service; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class ServiceRelationTest { | ||
@Test | ||
public void testServiceRelationClientSideMetricsEquals() { | ||
ServiceRelationClientSideMetrics thisObject = new ServiceRelationClientSideMetrics(); | ||
thisObject.setEntityId("VXNlcg==.0-em0tY2xpZW50LXNldHRpbmctd2ViYXBpQDEwNjQ4.1"); | ||
thisObject.setTimeBucket(202101071505L); | ||
|
||
ServiceRelationClientSideMetrics otherObject = new ServiceRelationClientSideMetrics(); | ||
otherObject.setEntityId("VXNlcg==.0-em0tY2xpZW50LXNldHRpbmctd2ViYXBpQDEwNjQ4.1"); | ||
otherObject.setTimeBucket(202101071505L); | ||
|
||
Assert.assertTrue(thisObject.equals(otherObject)); | ||
} | ||
|
||
@Test | ||
public void testServiceRelationClientSideMetricsNotEquals() { | ||
ServiceRelationClientSideMetrics thisObject = new ServiceRelationClientSideMetrics(); | ||
thisObject.setEntityId("VXNlcg==.0-em0tY2xpZW50LXNldHRpbmctd2ViYXBpQDEwNjQ4.1"); | ||
thisObject.setTimeBucket(202101071505L); | ||
|
||
ServiceRelationClientSideMetrics otherObject = new ServiceRelationClientSideMetrics(); | ||
otherObject.setEntityId("VXNlcg==.0-em0tY2xpZW50LXNldHRpbmctd2ViYXBpQDEwNjQ4.1"); | ||
otherObject.setTimeBucket(202101071506L); | ||
|
||
Assert.assertFalse(thisObject.equals(otherObject)); | ||
} | ||
|
||
@Test | ||
public void testServiceRelationServerSideMetricsEquals() { | ||
ServiceRelationServerSideMetrics thisObject = new ServiceRelationServerSideMetrics(); | ||
thisObject.setEntityId("VXNlcg==.0-em0tY2xpZW50LXNldHRpbmctd2ViYXBpQDEwNjQ4.1"); | ||
thisObject.setTimeBucket(202101071505L); | ||
|
||
ServiceRelationServerSideMetrics otherObject = new ServiceRelationServerSideMetrics(); | ||
otherObject.setEntityId("VXNlcg==.0-em0tY2xpZW50LXNldHRpbmctd2ViYXBpQDEwNjQ4.1"); | ||
otherObject.setTimeBucket(202101071505L); | ||
|
||
Assert.assertTrue(thisObject.equals(otherObject)); | ||
} | ||
|
||
@Test | ||
public void testServiceRelationServerSideMetricsNotEquals() { | ||
ServiceRelationServerSideMetrics thisObject = new ServiceRelationServerSideMetrics(); | ||
thisObject.setEntityId("VXNlcg==.0-em0tY2xpZW50LXNldHRpbmctd2ViYXBpQDEwNjQ4.1"); | ||
thisObject.setTimeBucket(202101071505L); | ||
|
||
ServiceRelationServerSideMetrics otherObject = new ServiceRelationServerSideMetrics(); | ||
otherObject.setEntityId("VXNlcg==.0-em0tY2xpZW50LXNldHRpbmctd2ViYXBpQDEwNjQ4.1"); | ||
otherObject.setTimeBucket(202101071506L); | ||
|
||
Assert.assertFalse(thisObject.equals(otherObject)); | ||
} | ||
} |