|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DNSLabel | Line # 11 | 11 | 0% | 7 | 7 | 63.2% |
0.6315789
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (21) | |||
| Result | |||
|
0.5263158
|
javax.jmdns.test.DNSMessageTest.testCreateQuery
javax.jmdns.test.DNSMessageTest.testCreateQuery
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.JmDNSTest.testUnregisterService
javax.jmdns.test.JmDNSTest.testUnregisterService
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.TextUpdateTest.testSubtype
javax.jmdns.test.TextUpdateTest.testSubtype
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.TextUpdateTest.testListenForTextUpdateOnOtherRegistry
javax.jmdns.test.TextUpdateTest.testListenForTextUpdateOnOtherRegistry
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.JmDNSTest.testRegisterServiceTwice
javax.jmdns.test.JmDNSTest.testRegisterServiceTwice
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.TextUpdateTest.testRegisterCaseSensitiveField
javax.jmdns.test.TextUpdateTest.testRegisterCaseSensitiveField
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.JmDNSTest.testRegisterService
javax.jmdns.test.JmDNSTest.testRegisterService
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.JmDNSTest.testUnregisterAndReregisterService
javax.jmdns.test.JmDNSTest.testUnregisterAndReregisterService
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.JmDNSTest.testWaitAndQueryForServiceOnOtherRegistry
javax.jmdns.test.JmDNSTest.testWaitAndQueryForServiceOnOtherRegistry
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.JmDNSTest.testListMyServiceWithToLowerCase
javax.jmdns.test.JmDNSTest.testListMyServiceWithToLowerCase
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.JmDNSTest.testListMyService
javax.jmdns.test.JmDNSTest.testListMyService
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.JmDNSTest.testQueryMyService
javax.jmdns.test.JmDNSTest.testQueryMyService
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.TextUpdateTest.testRenewExpiringRequests
javax.jmdns.test.TextUpdateTest.testRenewExpiringRequests
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.TextUpdateTest.testRegisterEmptyTXTField
javax.jmdns.test.TextUpdateTest.testRegisterEmptyTXTField
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.JmDNSTest.testListMyServiceWithoutLowerCase
javax.jmdns.test.JmDNSTest.testListMyServiceWithoutLowerCase
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.JmDNSTest.testListenForMyServiceAndList
javax.jmdns.test.JmDNSTest.testListenForMyServiceAndList
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.JmDNSTest.testListMyServiceIPV6
javax.jmdns.test.JmDNSTest.testListMyServiceIPV6
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.JmDNSTest.testRegisterAndListServiceOnOtherRegistry
javax.jmdns.test.JmDNSTest.testRegisterAndListServiceOnOtherRegistry
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.DNSMessageTest.testCreateAnswer
javax.jmdns.test.DNSMessageTest.testCreateAnswer
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.JmDNSTest.testListenForMyService
javax.jmdns.test.JmDNSTest.testListenForMyService
|
1 PASS | |
|
0.47368422
|
javax.jmdns.test.JmDNSTest.testListenForServiceOnOtherRegistry
javax.jmdns.test.JmDNSTest.testListenForServiceOnOtherRegistry
|
1 PASS | |
| 1 | /** | |
| 2 | * | |
| 3 | */ | |
| 4 | package javax.jmdns.impl.constants; | |
| 5 | ||
| 6 | /** | |
| 7 | * DNS label. | |
| 8 | * | |
| 9 | * @author Arthur van Hoff, Jeff Sonstein, Werner Randelshofer, Pierre Frisch, Rick Blair | |
| 10 | */ | |
| 11 | public enum DNSLabel { | |
| 12 | /** | |
| 13 | * This is unallocated. | |
| 14 | */ | |
| 15 | Unknown("", 0x80), | |
| 16 | /** | |
| 17 | * Standard label [RFC 1035] | |
| 18 | */ | |
| 19 | Standard("standard label", 0x00), | |
| 20 | /** | |
| 21 | * Compressed label [RFC 1035] | |
| 22 | */ | |
| 23 | Compressed("compressed label", 0xC0), | |
| 24 | /** | |
| 25 | * Extended label [RFC 2671] | |
| 26 | */ | |
| 27 | Extended("extended label", 0x40); | |
| 28 | ||
| 29 | /** | |
| 30 | * DNS label types are encoded on the first 2 bits | |
| 31 | */ | |
| 32 | static final int LABEL_MASK = 0xC0; | |
| 33 | static final int LABEL_NOT_MASK = 0x3F; | |
| 34 | ||
| 35 | private final String _externalName; | |
| 36 | ||
| 37 | private final int _index; | |
| 38 | ||
| 39 | 4 |
DNSLabel(String name, int index) { |
| 40 | 4 | _externalName = name; |
| 41 | 4 | _index = index; |
| 42 | } | |
| 43 | ||
| 44 | /** | |
| 45 | * Return the string representation of this type | |
| 46 | * | |
| 47 | * @return String | |
| 48 | */ | |
| 49 | 0 |
public String externalName() { |
| 50 | 0 | return _externalName; |
| 51 | } | |
| 52 | ||
| 53 | /** | |
| 54 | * Return the numeric value of this type | |
| 55 | * | |
| 56 | * @return String | |
| 57 | */ | |
| 58 | 0 |
public int indexValue() { |
| 59 | 0 | return _index; |
| 60 | } | |
| 61 | ||
| 62 | /** | |
| 63 | * @param index | |
| 64 | * @return label | |
| 65 | */ | |
| 66 | 3616 |
public static DNSLabel labelForByte(int index) { |
| 67 | 3631 | int maskedIndex = index & LABEL_MASK; |
| 68 | 3630 | for (DNSLabel aLabel : DNSLabel.values()) { |
| 69 | 3642 | if (aLabel._index == maskedIndex) return aLabel; |
| 70 | } | |
| 71 | 0 | return Unknown; |
| 72 | } | |
| 73 | ||
| 74 | /** | |
| 75 | * @param index | |
| 76 | * @return masked value | |
| 77 | */ | |
| 78 | 1100 |
public static int labelValue(int index) { |
| 79 | 1104 | return index & LABEL_NOT_MASK; |
| 80 | } | |
| 81 | ||
| 82 | 0 |
@Override |
| 83 | public String toString() { | |
| 84 | 0 | return this.name() + " index " + this.indexValue(); |
| 85 | } | |
| 86 | ||
| 87 | } | |
|
||||||||||||