Skip to content

Commit 42fc87d

Browse files
authored
HBASE-29608 Add test to make sure we do not have copy paste errors in the TAG value (#7324)
Signed-off-by: Istvan Toth <[email protected]>
1 parent 04d48ee commit 42fc87d

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.hadoop.hbase;
19+
20+
import static org.junit.jupiter.api.Assertions.assertEquals;
21+
22+
import java.lang.reflect.Field;
23+
import java.util.concurrent.TimeUnit;
24+
import org.apache.hadoop.hbase.testclassification.ClientTests;
25+
import org.apache.hadoop.hbase.testclassification.MiscTests;
26+
import org.apache.hadoop.hbase.testclassification.SmallTests;
27+
import org.junit.jupiter.api.Tag;
28+
import org.junit.jupiter.api.Test;
29+
import org.junit.jupiter.api.Timeout;
30+
31+
/**
32+
* Verify that the values are all correct.
33+
*/
34+
@Tag(MiscTests.TAG)
35+
@Tag(SmallTests.TAG)
36+
// TODO: this is the timeout for each method, not the whole class
37+
@Timeout(value = 1, unit = TimeUnit.MINUTES)
38+
public class TestJUnit5TagConstants {
39+
40+
@Test
41+
public void testVerify() throws Exception {
42+
ClassFinder finder = new ClassFinder(getClass().getClassLoader());
43+
for (Class<?> annoClazz : finder.findClasses(ClientTests.class.getPackageName(), false)) {
44+
Field field = annoClazz.getField("TAG");
45+
assertEquals(annoClazz.getName(), field.get(null));
46+
}
47+
}
48+
}

0 commit comments

Comments
 (0)